WPF/C# Ribbon with commands, hotkeys, and unsaved document flag.

This post demonstrates the rudiments of an app with ribbon control. References: Introducing NET 4.5, Alex Mackey, William Tulloch, and Mahesh Krishnan. ribbon control WPF Programmer’s Reference, Rod Stephens. custom command hotkey for custom command hotkey for application command unsaved document flag Icons included with MS Visual Studio  or downloaded from the web (search for …

Add Resources (Images, etc.) to VS 2019 Project

Create Resource Folder Open the Solution Explorer tab in the Solution Explorer panel: RMB on the solution name (Ribbon_Demo, in this example). From the context menu, select Add → New Folder: Name the folder, in this example Resources. The folder should now appear in the solution tree: Move Resources to Folder In Windows Explorer, copy …

Rotate tetrahedron around coordinate axis

Very simple, but inefficient and unscalable rotation of tetrahedron about y-axis with no hidden line removal. References: plot and some concepts: “Python Graphics – A Reference for Creating 2D and 3D Images”, B.J. Korites. transform matrices: https://gist.github.com/jaseg/ef83d89b39ae69fad07a deleting lines from plot: from: https://sourceforge.net/p/matplotlib/mailman/message/9334388/ Tetrahedron is constructed with four points (vertices) and six lines (edges). The …

Delete line from matplotlib.pyplot

Two of many ways to do this: delete all lines delete one line using the line instance Delete all lines Import needed modules (numpy is only used to generate data): Generate dummy data and plot: Creates this plot: Get current instance of current axes: Loop through all lines and delete them: You may think that …

Implementation of discrete radon transform (parallel beam geometry)

The radon transformation was taken directly from https://gist.github.com/fubel/ad01878c5a08a57be9b8b80605ad1247, but with tweaks to allow variable steps in transform. The back-projection is a crude reverse of the forward transformation. This is an unfiltered back projection. skimage.transform.rotate instead of scipy.misc.imrotate (was removed from SciPy) reference for standard test image: https://scikit-image.org/docs/dev/auto_examples/transform/plot_radon_transform.html. This also has a scikit-image implementation of a …

Multiple Regression: Using PyTorch to Generate Regression Coefficients

This example generates parameters for a second order polynomial that fits synthetic data. The main source for this example comes from: https://donaldpinckney.com/books/pytorch/book/ch2-linreg/2018-03-21-multi-variable.html which has a good explanation of the underlying concepts, and a deeper explanation of the algorithm itself. Other sources for details on plotting and data generation are: https://www.kaggle.com/kanncaa1/pytorch-tutorial-for-deep-learning-lovers https://www.guru99.com/pytorch-tutorial.html The code Import modules: …

Classification in OpenCV Using Pre-built Caffe Model

Based upon: https://becominghuman.ai/face-detection-with-opencv-and-deep-learning-90b84735f421 With additional input from: 2. https://www.pyimagesearch.com/2017/08/21/deep-learning-with-opencv/ 3. https://nbviewer.jupyter.org/github/BVLC/caffe/blob/master/examples/00-classification.ipynb A) Download Caffe Models Need the following three files: .prototxt file containing model definition .caffemodel file containing layer weights a synset file containing category labels and an image file. Just steal one from the internet like everyone else does (or free from http://www.pexels.com). Before …

Extract tar.gz Files in Windows 10

Method taken directly from https://pureinfotech.com/extract-tar-gz-files-windows-10/ (I’ve added nothing new) Open Command Window (two of many ways): LMB on Win → Windows System → Command Prompt This will open the command window: 2. LMB on [Win] then type “cmd” Press [Enter] to start command window Extract file (two of many ways): Type: “cd <path>” change to …

Creating a simple MFC project in VS 2019 from scratch.

I wanted to learn how to create a stripped-down MFC project in Visual Studio 2019 (VS) that does not use the document/view architecture, but all of the tutorials on-line–at least the ones I found–were for earlier versions of VS and the menus have been restructured since that version. I’m often frustrated when software companies rearrange …

Design a site like this with WordPress.com
Get started