Posts

Showing posts from September, 2026

Inheritance And All Last Topic In C++ Date:- 06/09/2026

 // Online C++ compiler to run C++ program online #include <iostream> using namespace std; // class Parent{ //     public: //     // void display(){ //     //     cout<<"Hello their!!"<<endl; //     // } //     virtual void display(){ //         cout<<"Hello their!!"<<endl; //     } // }; // class A:public Parent{}; // class B:public Parent{}; // class A:public Parent{}; // class B:public A{}; // class A{ //     public: //     void dis(){ //         cout<<"Another display function"<<endl; //     } // }; // class B:public A,public Parent{}; // class B:public Parent{ //     public: //     // void display(){ //     //     cout<<"Another version of display!!"<<endl; //  ...

Deep and Shallow Constructor Date: 05/09/2026

// Online C++ compiler to run C++ program online #include <iostream> #include<string> using namespace std; class Student{     public:     int age;     Student(int a){         age=a;     }     Student(Student &ob){         age=ob.age;     } }; class Shallow{     public:     int *age;     Shallow(int a){         age=new int(a);     }      }; class Deep{     public:     int *age;     Deep(int a){         age=new int(a);     }     Deep(const Deep &o){         age=new int(*o.age);     } }; template<typename T> void display(T a){     cout<<"The value : "<<a<<endl; } template<> void display<string>(string a){     cout<<"The string is : "<...

API and JSON Date:- 03/09/2026

 # import requests # res=requests.get("https://example.com") # response = requests.get("https://api.example.com/user") # print(res.status_code) # print(res.text) # print(res) # print(res.headers) # print(response.json()) import requests url = "https://api.example.com/users" try:     response = requests.get(         url,         timeout=5     )     response.raise_for_status()     data = response.json()     print("Data received:")     print(data) except requests.exceptions.Timeout:     print("Request timed out") except requests.exceptions.RequestException as e:     print("Request failed:", e) except ValueError:     print("Invalid JSON response")

Regular Expression and Threading (Multi Threading) Date: 02/09/2026

 import re phone="My phone number is 9876543210 axx abx acx" # result=re.search(r"\d{10}",phone) # result=re.search(r"a.x",phone) # result=re.findall(r"a.x",phone) # result=re.findall(r"[abc]","apple banana cat") # result=re.findall(r"[a-z]","apple banana cat") # result=re.findall(r"[A-Z]\d{2}","Hello World H12 H34") # result=re.findall(r"[A-Z]\d{2}","Hello World H12 H34") # result=re.findall(r"\D","Hello World H12 H34") # result=re.findall(r"\w{4}","Hello World H12 H34") # result=re.findall(r"\s","Hello World H12 H34") # result=re.findall(r"\S","Hello World H12 H34") result=re.findall(r"[a-z|A-Z|0-9]*@[a-z|A-Z|0-9]*.[a-z|A-Z|0-9]{3}","Hello World H12 H34 gunjannayak2k20@gmail.com wsrgvesw@sfgde112.s#o") # print(result.group()) print(result) import threading import time...