If you want something to happen when you login, then there are several ways to do that, but that is not what this post is about. With a Raspberry PI … Continue Reading How to auto-run a script on boot with Linux / Raspberry PI
/* Sometimes we need to construct several classes and then pass them somewhere to do something, but we don’t have an abstract storage method. The unique_ptr can help */ // … Continue Reading Creating a Vector with Class Storage using C++11 smart_pointers
I often find myself just want to compare the contents of buffers in memory as I may use something like “:sort” or a find and replace and not necessarily want … Continue Reading How to compare vim’s in-memory buffers
To figure out where libraries are being loaded from, if you have your environment already setup in the same way for which you want to test, then you can run: … Continue Reading How can I see where libraries are being loaded from on Linux?
Debugging in Visual Studio 2017 with a Command Line Compiled (cl.exe) and Linked (link.exe) Debug Executable Example
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
How can I run something in one thread and wait for the result in a different thread using Java/JavaFX?
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?