Electron open file explorer with file selected43 sec read

After creating a file and writing it to the disk, its nice to show the user the location of the newly created file in the system file explorer. At the time of writing this there is no option in electron for opening the system file explorer with a file selected. So, like every programmer does […]

C CRITICAL_SECTION in windows2 min read

CRITICAL_SECTION (MSDN) in Windows can be used for thread synchronization. Essentially you can create a variable and limit it’s ownership to one thread at a time.  Something like this CRITICAL_SECTION cs; volatile long counter = 0; int main(){ InitializeCriticalSection(&cs); //Create threads and run thread_func //….. //….. } void thread_func (){ //Get ownership of counter EnterCriticalSection(&cs); […]

GST(Indian) check digit validation algorithm2 min read

GST number validation is done through 2 steps Check if there is a character in position of a character and a number in position of a number. Validate the check digit that is the last character in the GST no. with  Luhn mod N algorithm (https://en.wikipedia.org/wiki/Luhn_mod_N_algorithm) An implementation in javascript let GST = { /* Luhn […]