Compile (cl.exe) with /Zi /Od /Fd Link (link.exe) with /DEBUG /DEBUGTYPE:PDATA The produced executables will contain the full path in the Dynamically Linked Libraries (DLLs) and Executables. To debug in … Continue Reading Debugging in Visual Studio 2017 with a Command Line Compiled (cl.exe) and Linked (link.exe) Debug Executable Example
I see so many people confused about the use of “std::endl” versus “\n”, so here I explain when they should be used… std::endl The use of std::endl will insert an … Continue Reading In C++ when should I use std::endl versus “\n”?
In C++11 the regex library was added which allows you to do regex directly: #include <string> #include <regex> … std::string workingOn(“this text string\n”); std::regex expressionStart(“^th”); std::string removed = std::regex_replace(workingOn, expressionStart,””); … Continue Reading In C++ how do I use regex to replace a string match
To find lines which have “This” and “NotThat” it is as simple as: :g/This\&\(.*NotThat\)\@! Let’s dive into each piece of this in a little more detail… The :g is a … Continue Reading vim find a line that has this but not that
To see what programs are installed use: rpm -qa If you just installed a program and want to know where it went then grep for it: $ rpm -qa | … Continue Reading Using rpm to find an installed program (RedHat, CentOS, Fedora)
Normally when doing find and replaces in a file there are some key words that we want to key off, but not replace. This can be a pain because you … Continue Reading Vim finding and replacing without captures
I highlight my searches in VIM using the following in my .vimrc: While demoing or in a code review it is nice to highlight more than one item. You can … Continue Reading Vim Highlighting
We had a user account that we wanted to preserve as a back-up but we also wanted to make sure that if anyone gained access to the machine, that they … Continue Reading How can I lock and secure (prevent access) to a Windows 10 User Account without deleting it?
TL;DR Here is the alias: How do I use it? Here is how I use it: How does it work? find This search alias uses find as follows to … Continue Reading Searching large source trees in an efficient way on Linux
I was randomly getting errors (1 run in 50 would reproduce) like: $ ./myprogram *** glibc detected *** double free or corruption (out): 0x093014a4 *** Linux has a randomization of … Continue Reading Catching a double free or corruption error with memcheck (a Valgrind tool)
The ctags command allows you to index source – any source. The command generates a single file called a tags file (which [ironically] is the name of the file). Then … Continue Reading How to generate a ctags files and use it with vim
TL;DR The code is as simple as: Details… Hopefully you would rarely need to synchronize two threads. This is normally an indicator of a poor design – ideally each thread … Continue Reading How can I run something in one thread and wait for the result in a different thread using Java/JavaFX?
One of the fastest ways to search your previous commands is to use CTRL+R and start typing, once you’ve entered enough text you can use CTRL+R again and again to … Continue Reading How can I easily access my Linux command history? Is there a hot key?
SSH stands for Secure Shell and it is a protocol which enables secure network service connections over unsecured networks. For most users they think of SSH as a way to … Continue Reading How do you SSH without a password and what permissions are needed on the .ssh files?
I often need to run several commands which can take an hour or more and I won’t necessarily be present the entire time. It is nice to be able to … Continue Reading How do you chain commands in BASH or CSH?
I have seen zip files used as containers for hand off between programs. Java’s JAR files are just zip archives. Sometimes you just want to modify a file in a … Continue Reading How do I easily manipulate individual files in a zip archive?