Recent posts
The horrible implications of cheating at the Google Hurdles doodle
So Google has a hurdles doodle up where you play as an athlete competing in the 100m hurdles. You run by alternating between the left- and right arrow keys, and jump with space. Alternate left and right faster and you run faster. Obviously being a programmer this means I will run like the fastest bastard that ever lived: read full post
Protocol-relative URLs
Here’s a neat trick I’ve learned today: protocol-relative URLs. How do they work? Well, consider my current homepage, which has a link on it to this blog. My homepage can be viewed both over HTTP and HTTPS. Previously, the link to my blog looked like this: read full post
Writing a decimal number as a fraction
The decimal number 2.5 can also be written as the fraction 5 / 2. 19.2 becomes 96 / 5. 0.24 becomes 6 / 25. Etcetera. So how can you do this programmatically? Well, it turns out a naive solution can be obtained pretty quickly. read full post
Project Euler: Problem 15
The next Euler problem is here: read full post
Project Euler: Problem 14
Here’s problem 14 of Project Euler: read full post
Project Euler: Problem 13
It’s been over a month since I did any Euler problems, so I’ll be posting some of those the coming week. Here’s problem 13: read full post
Running with elevated privileges from C#
Sometimes, for some reason, you may require your C# program to run with elevated (Administrator) privileges, or you may need to run some other program with elevated privileges. So how do you do it? Well, there are multiple ways. Here, I will focus on elevating privileges from code. There is also the possibility of starting your app with elevated privileges by configuring the application manifest, but I won’t go into that now. read full post