Author archive: ZERIN

Machine Learning
What is Mean Squared Error (MSE)?
October 17, 2024
0
Introduction When working with machine learning models, especially in regression tasks, it’s crucial to evaluate how well your model is performing. One of the most commonly used metrics for this purpose is Mean Squared Error (MSE). In this blog, we’ll break down what MSE is, why it’s important, and walk through a simple Python example […]
OOP Software Engineer Interview Question
OOP Interview Question
October 15, 2024
0
1) What is Object-Oriented Programming (OOP)? Answer:   OOP is a programming paradigm based on the concept of objects, which  can contain data in the form of fields (attributes or properties), and code in the form of procedures (methods or functions). 2) What are the four main principles of OOP? Answer:   Encapsulation, Inheritance, Polymorphism, and Abstraction. […]
Google Colab
How to Install & Run Python Flask in Google Colab with Ngrok | Step-by-Step Guide
October 13, 2024
0
, , ,
In this video, I’ll show you how to install and run a Python Flask web application in Google Colab and expose it to the internet using Ngrok. Learn how to set up Flask, handle Ngrok for public URLs, and test your Flask app live. This tutorial is perfect for Python developers who want to quickly […]
Uncategorized
Best way to Learn Anything
September 27, 2024
0
Best way to Learn Anything
These are the concepts that I follow to learn anything in a better way:   How to become expert at thing: 1. iteratively take on concrete projects and accomplish them depth wise, learning “on demand” (ie don’t learn bottom up breadth wise) 2. teach/summarize everything you learn in your own words 3. only compare yourself […]
Uncategorized
Entrepreneur Work Motivation
September 27, 2024
0
“Develop a habit of working on your own projects. Don’t let “work” mean something other people tell you to do. If you do manage to do great work one day, it will probably be on a project of your own. It may be within some bigger project, but you’ll be driving your part of it.” […]
CodeIgniter Framework
How do i install older version of CI4 using composer
October 10, 2023
0
Sometimes when you run git update & composer update, it updates codeigniter framework, then suddenly your app stops working unless you upgrade your codebase as per new framework requirement or downgrade to last version that you had. The below is the command to downgrade codeigniter to a version: # composer require codeigniter4/framework:4.1.5  
Coding php ThirdPartyAPI
hitpath API: Read Affiliates Record
May 15, 2023
0
, ,
<?php $offset = 0; $limit = 10; $url = "http://api.1318amethyst.com/api/v1.1/affiliates?all_details=1&offset=$offset&limit=$limit"; $ch = curl_init($url); curl_setopt($ch, CURLOPT_HTTPGET, TRUE); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($ch, CURLOPT_HTTPHEADER, array( "auth_token:6d4888962feba3c669176b81edacb185", "accept:application/json", )); $raw_response = curl_exec($ch); $response = json_decode($raw_response); $error = curl_error($ch); $tmp_file = 'h3.txt'; if ($error) { $response->error = curl_error($ch); } else { file_put_contents($tmp_file, $raw_response); //$this->file_transfer->send_file($tmp_file, $tmp_file); } curl_close($ch); echo $raw_response; ?>
Coding php ThirdPartyAPI
hitpath API: Read Campaigns Record
May 15, 2023
0
, ,
<?php $offset = 0; $limit = 10; $url = "http://api.1318amethyst.com/api/v1.1/campaigns?all_details=1&offset=$offset&limit=$limit"; $ch = curl_init($url); curl_setopt($ch, CURLOPT_HTTPGET, TRUE); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($ch, CURLOPT_HTTPHEADER, array( "auth_token:6d4888962feba3c669176b81edacb185", "accept:application/json", )); $raw_response = curl_exec($ch); $response = json_decode($raw_response); $error = curl_error($ch); $tmp_file = 'h2.txt'; if ($error) { $response->error = curl_error($ch); } else { file_put_contents($tmp_file, $raw_response); //$this->file_transfer->send_file($tmp_file, $tmp_file); } curl_close($ch); echo $raw_response; ?>
Coding ThirdPartyAPI
hitpath API: Read Advertisers Record
May 15, 2023
0
, ,
<?php $offset = 0; $limit = 10; $url = "http://api.1318amethyst.com/api/v1.1/advertisers?all_details=1&offset=$offset&limit=$limit"; $ch = curl_init($url); curl_setopt($ch, CURLOPT_HTTPGET, TRUE); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($ch, CURLOPT_HTTPHEADER, array( "auth_token:XXXXXXXXXXXXXXXX", "accept:application/json", )); $raw_response = curl_exec($ch); $response = json_decode($raw_response); $error = curl_error($ch); $tmp_file = 'h1.txt'; if ($error) { $response->error = curl_error($ch); } else { file_put_contents($tmp_file, $raw_response); //$this->file_transfer->send_file($tmp_file, $tmp_file); } curl_close($ch); echo $raw_response; ?>
php tcpdf
TCPDF ul li works actually
December 25, 2022
0
$pdf = new PdfLibrary('P', 'mm', 'A4', true, 'UTF-8', false); //$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); $pdf->SetTitle('My Title'); $pdf->SetHeaderMargin(30); $pdf->SetTopMargin(30); $pdf->setFooterMargin(30); $pdf->SetAutoPageBreak(true); $pdf->SetAuthor('Author'); $pdf->SetDisplayMode('real', 'default'); $pdf->AddPage(); $pdf->SetLineStyle( array( 'width' => 5, 'color' => array(0,0,0))); $pdf->Line(0,0,$pdf->getPageWidth(),0); $pdf->Line($pdf->getPageWidth(),0,$pdf->getPageWidth(),$pdf->getPageHeight()); $pdf->Line(0,$pdf->getPageHeight(),$pdf->getPageWidth(),$pdf->getPageHeight()); $pdf->Line(0,0,0,$pdf->getPageHeight()); //https://ourcodeworld.com/articles/read/275/how-to-encrypt-a-pdf-password-protection-against-copy-extraction-or-modifications-generated-with-tcpdf-in-php //$pdf->SetProtection(array('print', 'copy','modify'), "ourcodeworld", "ourcodeworld-master", 0, null); $pdf->SetMargins(10, 20, 10, true); //$pdf->Write(5, 'Some sample text'); […]