Wednesday, October 26, 2011

Transition to New Site

This blog is now being retired in favor of the notes on my new site, which has an explanation of the transition. This blog will remain but will no longer be updated.

Wednesday, October 5, 2011

Steve Jobs, Rest in Peace

Today a great entrepreneur, one of the great American capitalists, Steve Jobs, passed away at the rather young age of 56. As others have said, we are all a bit poorer for it.

I didn't always agree with his style, I wasn't always a fan of his company's products, and I certainly didn't like the personality cult that surrounded him, but I have great respect for the man who believed in what he did, thought big, sought to empower people, and did it with style and aesthetics. He is an inspiration to us all.

Thursday, September 1, 2011

Project Euler Problem #102 Solution

A triangle in \( \mathbb{R}^2 \) contains the origin iff it has two edges such that

  1. one edge intercepts the \( y \)-axis at \( b_1 > 0 \), and
  2. the other edge intercepts the \( y \)-axis at \( b_2 < 0 \).
Therefore, for each triangle specified in the provided file, we can perform that test:

Monday, August 29, 2011

Finding Files with PowerShell, Part 2

This version (see Finding Files with PowerShell) gives the full path of the items:

Thursday, August 18, 2011

Project Euler Problem #92 Solution

A brute-force approach works well enough for this problem, too. The code below has the idea:

The LeadsTo extension method on Int32 is where the real work happens:

Tuesday, August 16, 2011

Project Euler Problem #52 Solution

Brute-force search is quite effective for this problem. Just go through the integers from \( 1 \) onward, and find the first one that satisfies the criteria. Nota bene: I used C out of nostalgia, just for kicks.

Finding Files with PowerShell

I miss the UNIX find command in Windows. I could get it with Cygwin or GNUWin32, but that requires littering my machine with extra stuff. So, PowerShell to the rescue: