The common question: How do i make a selection from an arraylist in a simple way. Answer: use the streams api that has been around since forever. Assume the very simple data class B And let’s put some very simple data in it: Selecting with an arraylist as target Or, using a generic List<> to […]
Month: January 2020
Recursion revisited: Let’s call it self-calling-code
In the days of Z80 and 6502 programming in low memory systems self modifying code was quite common. Not only was it extremely efficient space and speed wise, it often was the only real way to get things done in systems with nothing but a few kb of memory. Explaining the concept of self modifying […]
Testing the Ajax Control Toolkit Tab control with WatiN
The Ajax Control Toolkit offers a large amount op ASP.NET Ajax control, and can be found on codeplex. WatiN is a popular test framework for UI testing ASP.NET web applications. Both can be obtained from the linked site, or can easily be added in Visual Studio with nuget. The objective of this writeup is to […]
Establishing display and game window size
Sample XNA code to establish a fixed size windowed view public Game1() { graphics = new GraphicsDeviceManager(this); // Determine the resolution of the screen int maxwidth = GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Width; int maxheight = GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Height; // Set the game window to 90% of the avaiable resolution _windowWidth = (int) (0.9*maxwidth); _windowHeight = (int) (0.9*maxheight); graphics.PreferredBackBufferWidth = _windowWidth; graphics.PreferredBackBufferHeight […]
Backup and restore a MySQL Database from the command line
Creating a backup from the command line on the source server mysqldump -h localhost -u username -p database_name > backup_db.sql Restoring this backup to an existing, empty database on the target server mysql -u username -p database_name < backup_db.sql When scheduling your backup with a batchfile you can use a simple trick to include a […]
Change network type for VPN Connections (Windows)
So you just created a brand new VPN connection to let’s say work, and Windows decided that it is a completely untrusted network connection, setting it to a public network. Here is how you can quickly and immediately change the network type using powershell. Start an elevated powershell prompt Use the following command to list […]
Get the version number of the current running release
lsb_release -a No LSB modules are available. Distributor ID: Debian Description: Debian GNU/Linux 8.9 (jessie) Release: 8.9 Codename: jessie</pre>
Upgrade debian jessie to stretch
Check if you are using obsolete packages aptitude search ‘~o’If this gives you output you will have to take into account that these packages are no longer in a standard repo since they were removed. Perform a full backup – does that realy need stating ? warningUpgrading debian from 8 to 9 will replace mysql […]
Writing a context menu outlook addin
There is a sizable amount of documentation around about writing outlook addins, but few complete samples that cover the basics, and only the basic. Documentation snippets are great to get started, full blown applications are good if you dig around in addins daily. This snippet covers the middle ground: It is (the) complete framework you […]
Configuring VPN Access with Server 2012
This document demonstrates how to configure PPTP remote VPN Access on server 2012 using the routing and remote access component. If you have a router or other hardware supplying firewall services and the server that will provide the VPN access is not directly attached to the internet (a good thing) – you will need to […]