Demystifying Windows UI Technology

Introduction As a Windows developer you’ve considered creating a graphical user interface (GUI). The inevitable question that comes up is: which Windows GUI technology should I use? I tried to answer that question myself, and thought surely everyone is still using Windows API (ye olde Win32 API) with GDI/GDI+! Right? No? Oh, let’s see what there is now… WinUI, WPF, WinForms, UWP, .NET MAUI, oh my, the list goes on. Why did these all come about?...

January 4, 2024

Search Directory Names

Quick tip today. I wanted to find all directories with a certain name specifically .vs because I wanted to delete them. Is the .vs directory safe to delete? Yes, becuase its all generated files by VS that can be deleted. There is also db files in there that intellisense keeps, which can clutter your system after a while. To find all files: gci -recurse -Force -filter ".vs" gci alias for GetChild-Item -recurse to search all sub-directories -Force to search hidden and system files (this is useful for ....

August 7, 2023

Read and Edit XML in Powershell

Create XML in Powershell Before we start if we don’t have a XML file, we can create one: Set-Content .\test.xml '<?xml version="1.0" encoding="utf-8"?><root/>' Set-Content is a powershell cmd-let to write to a file. The first element is the prolog element 1: <?xml version="1.0" encoding="utf-8"?>. The W3C Recommendation describes the prolog as version number, encoding declaration. If we want to load it and write to it, it must have at least a root element, in this example it is <root> but it can be anything such as <catalog>, <company>, <store>, or even <zoo>....

August 5, 2023

Quake Mode

Cool trick with the Windows Terminal is Quake mode. The name comes from the Quake games’ console. The Quake console was used to send commands to the game such as /god for God mode or /give all to get all game items. The Quake in-game console was shown by pressing tilde ~ key. A similar behavior can be accomplished with Windows Terminal called Quake mode. In Windows Terminal quake mode the terminal is snapped to the top of the screen....

July 27, 2023

Windows Terminal Starting Directory

I often need to jump into a command-line interface (CLI) in Windows from an Explorer window. Previous, I used to type cmd . into Explorer’s current directory (press F4 to hightlight) to open the current directory. However, I have been using Windows Terminal (wt) more than the classic Command Prompt (cmd) for some of the quality of life features (e.g., tabs). To call Windows Terminal from Explorer type wt into the current directory – but this does not open the current directory....

July 20, 2023

Create Text File

Command Prompt to Powershell To create a new text file using PowerShell, use New-Item. Classically, done by echo "some text" > into-a-file.txt, but PowerShell New-Item provides more robustness. The equvalent of the echo redirect > to a new file is PowerShell cmdlet New-Item. In this example, output hello into a new text file in the current directory called myFile.txt. echo hello > myFile.txt New-Item ".\myFile.txt" -Value "hello" -Force Note that New-Item does not replace the file if it already exists by default, we can use -Force to emulate the behavior of the echo redirect....

June 1, 2023

C++ Version History

Origin C++ was created by Bjarne Stroustrup. Dr. Stroustrup created C++ as a direct descendant of C language (specifically, descendant of Classic C and C89). C++ is not a descendant of C99 (therefore they are siblings). 1 C++ supports data abstraction, object-oriented programming (OOP), and generic programming. C++ can be considered a better language than C because C++ supports more programming styles, while being a superset of C. Some programmers write in C++ but only use C functionality (e....

May 30, 2023

Clean C++ Build

Clean the Visual Studio 2019 x64 Release or Debug build directory using Clean-Build.bat batch script. Place in the x64 directory and run the bat. Great if you need to archive your project before sending and don’t want to send a bunch of extra files. Tested with Visual Studio 2019 and 2022. The script can be expanded to remove other kinds of files. Files Removed File type Usage *.ipdb Incremental Link-Time Code Generation - Program database (PDB) file *....

May 29, 2023

Algorithm Complexity

Strategy Talk about time and space complexity through out the program look at the input parameters to the function Terminology $O(nlogn + n^2)$ asymptotically is $O(n^2)$. If you write $O(n^2)$ explain its the asymptotic time complexity. Applications Common time complexity patterns: $O(2^N)$, $O(3^N)$: Permutation (e.g., NP hard problems) $O(N^2)$, $O(N^3)$: Recursion / generate subsets, nested loops $O(NlogN)$: Sorting / heap $O(N)$: Iteration, pointers/sliding window, common array operations $O(logN)$: Binary search / exponentially sized steps search $O(1)$: Hashmap or index of array Time Complexity Names $O(2^N)$, exponential time $O(N^2)$, quadratic time $O(NlogN)$, linearithmic time $O(N)$, linear time $O(logN)$, logarithmic time $O(1)$, constant time Space Complexity Space = Input + Auxilary + Output...

May 24, 2023

Convert String to Int

Previously discussed Convert Char to Int in C++, in which we converted a single character to an integer. In this article we will build upon that idea by converting multiple characters to an integer. C++ Standard Library If want to use the built-in functions, the C++ standard has a couple built-in functions for converting strings to an integer. Namely there is atoi and std::stoi. atoi atoi is part of “C Standard General Utilities Library in the header <cstdlib>....

May 23, 2023