Python code to extract the file name from path or URL is explained below. Find the delimiter “/” position before the file name using firstpos=path.rfind(“/”) Find the last position of the file name using lastpos=len(path) Extract the file name using path[firstpos+1:lastpos]. Add 1 to the first position to avoid extracting the delimeter “/”. Python code […]
Below is the python code that will print total elpased time or code execution time of an empty for loop of 1000. Python code to measure elapsed time
Problem: How to Measure the execution time of code or function speed in C++? Language: C++ [CPP] Solution: Use C++ clock() function to calculate elapsed time of code or function call How to use clock() function to measure elapsed time? Below example code is to calculate total elapsed time to execute an empty loop for […]
Excel function to combine multiple cells into one separated by comma. This is the quick way to combine cells separated by any specified delimiter. Use TEXTJOIN() function, which combines the text from multiple cells or ranges separated by the specified delimiter (comma, semi colon or any other). Syntax of TEXTJOIN function TEXTJOIN(delimiter, ignore_empty, text1, [text2], […]
Add a row as first row and add numbers in columns as 1,2,1,2 etc. Then highlight your entire range of data. Go to Data menu -> select Sort and Options… Change your Orientation to “Sort Left and Right”. Choose row 1 as sort by and Smallest to Largest. Excel will be changed with alternate column […]
Below article guides you on how to backup/restore theme/template on blogger blog with images. This is useful for new blogspot bloggers. Backup blogger blog theme Login to your blogger blog account Goto Theme On top-right, you will see Backup / Restore button. Click on it. 4. Click on Download Theme button. Your blogger template/theme will […]
Below article shows the simple way to add a related posts with thumbnails widget on blogspot blogger. It uses labels to display the related posts below post content. Things to do before blogger blog theme update: Backup blogger blog theme. If you get into any issue after update, you can restore/revert to the original theme. […]
This article provides C plus plus source code to print character using ASCII value. It gets the ASCII value input from user and prints the corresponding character. C++ Source code to print character from ASCII value #include <iostream> using namespace std; int main() { int asciiValue; //Input the ASCII value cout << “Enter ASCII value: […]
Below is the source code to print ASCII value of a character entered by the user. CPP source code to print a character’s ASCII value #include <iostream> using namespace std; int main() { char character; //Input the character cout << “Type a character and hit ENTER: “; // Read the character cin >> character; // […]
Below is the C plus plus source code to remove special characters other than alphabets (excluding upper and lower case letters). // C++ source code to remove special characters other than alphabets from a string #include <iostream> using namespace std; int main() { string str; cout << “Enter a string with special characters: “; // […]