Useful tips for everyday
How do you sort even and odd elements of an array separately? Algorithm: Initialise two index variable , left=0 and right=arr.length-1. Increment left variable until…
How do you sort in Pascal? temp:integer; begin. (*bubble sort- ascending*) for i:= 1 to 6 do. begin. for j:= 1 to 5 do. begin.…
How to get the neighbour cells in 2D array or matrix? The output is a list of the cell values, the adjacent values, and the…
How do you get string on a StackTrace? The function printStackTrace() of the Exception class can take one parameter, either a PrintStream or a PrintWriter.…
How do you write a 2D vector? // declare 2D vector vector< vector > myVector; // make new row (arbitrary example) vector myRow(1,5); myVector. push_back(myRow);…
How do you create a custom string class in C++? Take a look at the following code please before reading further: class CString { private:…
How do you write a git hook? Implementing Git Hooks Navigate to the hooks directory $ cd /my-git-repo/.git/hooks. Notice the files inside, namely: applypatch-msg.sample. Install…
How can I extract data from a JSON file? To extract information from a JSON file or a JSON response, we have to parse the…
How do I import a CSV file into SQLite? You can import a CSV file directly into SQLite table from its table view: Open the…
How do I block a website using JavaScript? Vivaldi Click the padlock “site info” icon on the left side of the URL bar, then click…