Fibonacci series can be generated with LabVIEW using a For Loop, Shift Registers and an Addition Operator. In the example below, we provide a Front Panel Control with the number of Fibonacci series entries to generate. We initialize two shift registers, and pass the current Fibonacci sum as well as the previous Fibonacci entry to […]
Posts in the General Programming category:
Using MCP3008 ADC with Raspberry Pi
Raspberry Pi does not have a built-in ADC. Which means an external ADC has to be used to capture analog signals. In theory, it is possible to capture certain analog signals via the audio input jack, but there may be limitations on the signal amplitude and frequency ranges, among other issues. MCP3008 is an 8 […]
Continuously updating audio waveform display using Python
While matplotlib works well for displaying static graphs and charts, sometimes we may need to display a continuous (live) waveform on a graph. This requires repeatedly retrieving and displaying samples of incoming data (an audio stream, for example). An interesting way to display such a continuously varying waveform is to use the ‘Animation’ classes built […]
Creating an ASCII progress bar in C++
Sometimes it is useful to display a progress bar if your Command Line Interface (CLI) based application does processing in the background that takes a long time. This is relatively straightforward to do in a GUI framework based application but it’s also possible to create some kind of a “progress bar” in a CLI as […]
Creating games with C using ASCII characters
While it is possible to use full fledged graphics to create games, but learning how to use a game engine or a game development framework usually takes time. It is equally fun and probably easier to use only ASCII characters and no graphics libraries or game engines to make simple games. ASCII characters can be […]
Visual Studio 2015 won’t launch
I recently had a problem where my installed Visual Studio IDE just wouldn’t launch. Sometimes the startup screen would show up for an instant and then go away. Rebooting my PC didn’t help either. To solve it, I ran the Command prompt with Admin privileges and typed in the following. Running either one of these […]
How to get values in a dictionary as a list in C#
If you have a dictionary with scalar entities, its is fairly straightforward to get either all the Keys or the Values as a list: Let’s say we have: Dictionary<string, string> MyDictionary To get all the keys as a list: MyDictionary.Keys.ToList() To get all the values as a list: MyDictionary.Values.ToList() If you have a case where […]
Embedding images directly into HTML with C#
The usual approach is to reference an image using the image name. But it is also possible to embed the image directly into a webpage. This is especially useful for report generation where it is required to move the report files from one location to another. Embedding an image into the webpage ensures you don’t […]
Scrolling data into View in a WPF Datagrid
There may be cases where you’d want to programmatically select an item in a WPF datagrid or a list. Usually, if the collection is large and only a part of it is visible at a time, you would also want the items to scroll into view automatically. Otherwise there’s no point in “selecting” an item […]
Accessing DataGrid data in C# with WPF
If you need to access row and column data values in a WPF DataGrid you’ll realize it is bit of a pain. It’s definitely easier to do this in WinForms but that may not be what you’re using. So here’s how you can access WPF DataGrid in your code: Do note that I’ve used the […]