Rust Actix web panic when using custom regex1 min read

Using Actix-web v0.7.4 Error – thread ‘arbiter:6461f87e-20ed-4848-9feb-dbe68ab5ea7e:actor’ panicked at ‘index out of bounds: the len is 1 but the index is 1’, /checkout/src/libcore/slice/mod.rs:2079:10 How I corrected it The loop was accessing an index which didn’t exist. I don’t really know how actix web works or even how Rust works. pub fn match_with_params  in router.rs in actix-web src was the […]

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

Threads block while waiting for ownership of counter . So only one thread will have access to counter  at a time. Earlier we have created a […]