Recent posts
Project Euler: Problem 17
Last year I’ve managed to complete 16 Euler problems. And even though I’ve been quite busy over the last 6 months, I’m still a bit disappointed in myself. Anyhow, let’s see how far we can get this year. Here’s the next problem: read full post
The mysterious PowerShell file expander
Let’s say you have a file around 1 GB in size containing just a little more than 10 million and 300 thousand lines of plain text data. Your goal is to extract the first 10 million lines and write those to another file. You figure an easy way this can be done is using PowerShell, so you enter the following command: read full post
Project Euler: Problem 16
It’s been a while since we last did any Project Euler problems, so why not have a go? read full post
Secure PowerShell remoting on bartwolff.com
If there’s one thing Windows Server sorely lacks, it’s a decent secure shell. There is no built-in SSH server, and any third-party solutions are either unmaintained or costly. I like neither. Fortunately, PowerShell itself actually has the ability of opening sessions on remote PCs, using WinRM. It just requires a bit of configuring first. In this post, I’ll discuss the steps I’ve had to take to enable PowerShell remoting on my server. For all steps, assume PowerShell is running with Administrator privileges. read full post
A word of caution when using HashSet
The HashSet is a “class [which] provides high-performance set operations. A set is a collection that contains no duplicate elements, and whose elements are in no particular order.” Common set operations such as additions, deletions, or containment checks can be done in O(1) time. It’s not difficult to come up with use cases where this may come in handy. read full post
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