Install Qt 6 using MSYS2

pacman -Syu
pacman -S base-devel
pacman -S mingw-w64-x86_64-qt-creator
pacman -S mingw-w64-x86_64-qt6-base
pacman -S mingw-w64-x86_64-qt6
pacman -S mingw-w64-x86_64-clang
pacman -S mingw-w64-clang-x86_64-toolchain
pacman -S mingw-w64-x86_64-clang-tools-extra
pacman -S mingw-w64-x86_64-gdb

Optional Dependencies:

pacman -S mingw-w64-x86_64-cmake
pacman -S mingw-w64-x86_64-gdb
pacman -S mingw-w64-x86_64-ninja
pacman -S mingw-w64-x86_64-qbs
pacman -S mingw-w64-x86_64-qt6-doc
pacman -S mingw-w64-x86_64-qt6-quicktimeline
pacman -S mingw-w64-clang-x86_64-tidy


Restores Dependencies and Tools of a Project in .NET

Restore dependencies and tools for the project in the current directory:

dotnet restore

Restore dependencies and tools for the app1 project found in the given path:

dotnet restore ./projects/app1/app1.csproj

Restore the dependencies and tools for the project in the current directory using the file path provided as the source:

dotnet restore -s c:\packages\mypackages

Restore the dependencies and tools for the project in the current directory using the two file paths provided as sources:

dotnet restore -s c:\packages\mypackages -s c:\packages\myotherpackages

Restore dependencies and tools for the project in the current directory showing detailed output:

dotnet restore --verbosity detailed


GET and POST requests using Python

pip install requests

Making a Get request

# importing the requests library
import requests

# api-endpoint
URL = ""

# location given here
location = "delhi technological university"

# defining a params dict for the parameters to be sent to the API
PARAMS = {'address':location}

# sending get request and saving the response as response object
r = requests.get(url = URL, params = PARAMS)

# extracting data in json format
data = r.json()

# extracting latitude, longitude and formatted address
# of the first matching location
latitude = data['results'][0]['geometry']['location']['lat']
longitude = data['results'][0]['geometry']['location']['lng']
formatted_address = data['results'][0]['formatted_address']

# printing the output
print("Latitude:%s\nLongitude:%s\nFormatted Address:%s"
    %(latitude, longitude,formatted_address))

Making a POST request

# importing the requests library
import requests

# defining the api-endpoint

# your API key here

# your source code here
source_code = '''
print("Hello, world!")
a = 1
b = 2
print(a + b)

# data to be sent to api
data = {'api_dev_key':API_KEY,

# sending post request and saving response as response object
r = = API_ENDPOINT, data = data)

# extracting response text
pastebin_url = r.text
print("The pastebin URL is:%s"%pastebin_url)


Printing all DNS records using DNSPython in Python

import dns.resolver

def get_records(domain):
    Get all the records associated to domain parameter.
    :param domain: 
    ids = [
    for a in ids:
            answers = dns.resolver.query(domain, a)
            for rdata in answers:
                print(a, ':', rdata.to_text())
        except Exception as e:
            print(e)  # or pass

if __name__ == '__main__':


C# Generics

C# allows you to define generic classes, interfaces, abstract classes, fields, methods, static methods, properties, events, delegates, and operators using the type parameter and without the specific data type. A type parameter is a placeholder for a particular type specified when creating an instance of the generic type.

Generic Class

class DataStore<T>
    public T Data { get; set; }

You can also define multiple type parameters separated by a comma.

class KeyValuePair<TKey, TValue>
    public TKey Key { get; set; }
    public TValue Value { get; set; }

Instantiating Generic Class

DataStore<string> store = new DataStore<string>();
DataStore<string> store = new DataStore<string>();
store.Data = "Hello World!";
//store.Data = 123; //compile-time error

You can specify the different data types for different objects, as shown below.

DataStore<string> strStore = new DataStore<string>();
strStore.Data = "Hello World!";
//strStore.Data = 123; // compile-time error

DataStore<int> intStore = new DataStore<int>();
intStore.Data = 100;
//intStore.Data = "Hello World!"; // compile-time error

KeyValuePair<int, string> kvp1 = new KeyValuePair<int, string>();
kvp1.Key = 100;
kvp1.Value = "Hundred";

KeyValuePair<string, string> kvp2 = new KeyValuePair<string, string>();
kvp2.Key = "IT";
kvp2.Value = "Information Technology";

Generic Fields

class DataStore<T>
    public T data;
class DataStore<T>
    public T[] data = new T[10];

Generic Methods

class DataStore<T>
    private T[] _data = new T[10];
    public void AddOrUpdate(int index, T item)
        if(index >= 0 && index < 10)
            _data[index] = item;

    public T GetData(int index)
        if(index >= 0 && index < 10)
            return _data[index];
            return default(T);
DataStore<string> cities = new DataStore<string>();
cities.AddOrUpdate(0, "Mumbai");
cities.AddOrUpdate(1, "Chicago");
cities.AddOrUpdate(2, "London");

DataStore<int> empIds = new DataStore<int>();
empIds.AddOrUpdate(0, 50);
empIds.AddOrUpdate(1, 65);
empIds.AddOrUpdate(2, 89);
class Printer
    public void Print<T>(T data)

Printer printer = new Printer();
printer.Print(200); // type infer from the specified value
printer.Print("World!"); // type infer from the specified value



TRUNCATE [ TABLE ] [ ONLY ] name [ * ] [, ... ]

Remove all data from one table

TRUNCATE TABLE table_name;

Besides removing data, you may want to reset the values in the identity column by using the RESTART IDENTITY option like this:

TRUNCATE TABLE table_name 

Remove all data from a table that has foreign key references

TRUNCATE TABLE table_name