headerphoto

The next version of Windows has been in the works for a couple years, and now it’s available for you to try out. You can get your copy of the beta by going to http://microsoft.com/windows7. I’ve been running it here at work for months and I absolutely love it. Then again, I loved Vista too and still don’t know what all the hullabaloo was about. Anyway, Win7 doesn’t change the driver model like Vista did so you can expect everything that works with Vista to work with Win7. There are lots of new features, but the best one in my book is the speed. It is FAST. Faster that Vista. Faster than XP. You can run it on new hardware or old hardware. It works great!

Remember, it is a beta, but I wouldn’t be running it on my moneymakers here at work if I didn’t think it was safe to use.

Seattle has a lot of goofy environmental laws, but here’s one that actually saves me some money. Starting this month, Washington state is now offering free recycling for monitors, computers, laptops and TVs. Previously, this cost about $10 per item. I have about 4 or 5 computers sitting in the corner waiting to be recycled because I didn’t want to pay for it. I guess procrastination really does pay. You can find a list of places to drop them off by going to https://fortress.wa.gov/ecy/recycle/. More information about the program is available on their website. Thanks to NancyB for pointing this one out to me.

2008 was a leap year, but when was the first leap year? How did they know that they needed a leap year? I set out to find the answer, but it turns out to be fairly complicated.

A year was fairly easy to calculate by measuring the number of days between equinoxes. Historic societies had the technology to accomplish this (ie. a stick in the ground that cast a shadow.) When the concept of a leap year started is a bit more fuzzy.

There are two main calendars: Gregorian and Julian. The Julian calendar adds 1 day every four years. Since a year is actually 365.2422 days long, this average year of 365.25 days results in the calendar being off a full day every 128 years. The Julian calendar started back in 45 BC, but the first recorded person to add one day to the calendar every four years was Ptolemy III of Egypt in 238 BC.

The Gregorian calendar is a bit of an improvement. There are three rules for setting a leap year:

  1. If the year is divisible by 4 it is a leap year.
  2. If the year is divisible by 100 it is NOT a leap year.
  3. If the year is divisible by 400 it is a leap year.

That means that 2000 was actually an interesting leap year. It should not have been a leap year by rule 2 but was because rule 3. Since the Gregorian calendar was not widely adopted until 1752, this was the first time rule 3 was applied.

The Gregorian calendar still has a bit of drift though. These three rules combine for an average year of 365.2425 days and that means we’ll be off 1 day every 3236 years. There are some proposed rules to apply every 1000 years, but it’s not clear if they will be necessary. The speed of the rotation of the earth around the sun is constantly being affected by the moon, the sun, and the other planets. Even the quantity of liquid water on the earth can affect our speed through the universe.

Calendars end up being very complicated if you dive into them deeply. I wanted to write even more about them but quickly got lost. Here are a few other tidbits for you:

  • Great Britain switched from the Julian calendar to the Gregorian calendar in September 1752. They had to drop 11 days to do that. So if you were alive in September 1752, you would have gone straight from September 2 to September 14! No birthday for me!
  • There have been two February 30th’s in history. The first was in Sweden in 1712 when the first attempt at switching to the Gregorian calendar had to be reverted due to a calculation error. Oops. The second was in the Soviet Union when they tried to switch to a different calendar that abolished weekends. The calendar featured 12 30-day months with 5 day weeks. The remaining five or six days were holidays. Yikes!
  • 2008 featured an extra “leap second.” This is because we no longer track time based on the rotation of the earth, but rather on the regular signal emitted by electrons in an atomic clock. Since the earth’s rotation slowing down continually at an irregular rate, we have to add a second every 6 months to 7 years to keep the atomic clock in sync with the earth’s position in the universe. The last time this happened was December 31, 2005. This means that the world’s official clock actually recorded a time of 23:59:60 when the leap second was added. Leap seconds occur simultaneously around the world. We can’t predict the need for a leap second more than six months in advance due to the variable rate of change of the earth’s rotational speed.

I should have been keeping track of all my sources, but alas, I did not. If you want to read more about it, try this search for starters. It’s an amazingly complex problem.

The hole above the fireplace in the living room still bugs me. I guess you’re supposed to put your TV up there, but I think it creates a terrible viewing angle. The shelves that I built work nicely, but I’m not a huge fan of having stacks of DVDs as decoration.

I was watching a Trading Spaces rerun the other day and saw a fantastic idea. They built a facade over the front of the fireplace and put doors in front of the hole. They had a mantle over the fireplace and it came out looking very nice. It creates a lot of storage in that space too. It seems like a pretty simple project, but I’d want to do some design work to make sure it looked nice and not like boards stuck on a wall. Here are the before and after photos from the show. What do you think? Is this a good idea? Ugly? I think the trick is to make the doors look more like decorative panels than actual doors.

eWeek has released their top 10 application development products for 2008. The product I work on hit the list at number 9… one step ahead of the iPhone SDK. It’s pretty impressive considering that we have only released a pre-alpha build to a select few people in the community.

http://www.eweek.com/c/a/Application-Development/Top-10-Application-Development-Products-for-2008/

A recent program contest at work challenged us to find as many Pythagorean triples as we could that contained at minimum of one prime. We had about a month to work on it. The first question was whether to write up a quick brute force attempt or to take some time to come up with a more elegant solution but have less time to run it. I of course chose the latter because it’s more fun. Here’s what I ended up doing:

  1. First, find the first N primes
    1. To do this, I calculate the all the primes from 1 to 10,000,000. This is done with the sieve of Eratosthenes. Those primes are stored in a bitmap. Each prime is represented by a single bit that is either 0 or 1 indicating not prime or prime.
    2. That bitmap is saved and used throughout the whole prime finding process. I use those primes to calculate the next primes in batches of 10,000,000 (again using a modified sieve of Eratosthenes.)
    3. The problem is that using one bit for each prime ends up being inefficient because there are a lot of numbers that are not prime. For a n numbers, roughly ln(n) of those numbers are prime. To save space, I implemented a compression scheme. I store the distance from one prime to the next. (Actually I store distance/2 since the distance between primes is always even (except for 2 and 3.)) This algorithm still wastes a lot of space (more on that later), but it’s about twice as good as a bitmap for space usage. Unfortunately it takes a long time to find out if a number is prime.
    4. For a quicker answer to “is X prime?”, I store bookmarks into the compressed array of primes. So I know that the number at index Y by looking it up in the array of bookmarks.
    5. The compression array is a series of UInt16. This compression uses less than half the space of a bitmap but could theoretically still be improved. A UInt16 is wasteful for many of the lower numbers. I wanted to implement a dynamic compression scheme that would take a chunk of numbers and decide how many bits to devote to the distance from one prime to the next. The number of bits per distance would vary by compression page. I never got around to this though…
    6. I calculate as many primes as I could based on the amount of RAM on the machine. After calculating the primes, I wrote the compressed array and the page bookmarks out to disk so that I could quickly restart the program without having to recalculate all the primes!
  2. Secondly, find all the triples that have at least one prime.
    1. This was mostly brute force. There are two loops: M goes from 1 to sqrt of max prime and N goes from M to sqrt of max prime. For every value of M and N, a triple can be made with these formulas:
      1. A = 2*m*n
      2. B=m*m-n*n
      3. C=m*m+n*n
    2. 2 is always a factor of A so it is never prime. I just check B and C to see if they are prime. If so then I write the triple out to disk.
    3. This part took the longest but was easy to multithread. I used the new Parallel Extensions for .NET, and they were fantastically simple to use. The app automatically scales to the number of cores on the machine.

The only other thing to mention is that the command line arguments tell the app to either calculate primes or load them from the disk. The arguments also give a range of M for the app to examine for triples. This allowed it to be split over multiple machines easily. I wrote another small app that took all the output, cleaned it up, and combined it into a single file.

I ended up finding just under a billion triples that have at least one prime number. Since I was the only person who answered that question, I spent approximately 99.9% too much time on it.

You can download the app if you’re really curious to learn more and/or improve it.

Summit has been going back and forth with the Forest Service for years trying to get a plan approved for upgrades to the ski area. Since most of the Seattle ski areas are on National Forest land, it can take a lot of legal action to get changes put in place.

Note that just because these changes have been approved, it doesn’t mean that they’re going to be in place next year. It could take 10-15 years to complete the plan. I have heard that the new restaurant on top of Summit East could begin construction this summer though.

  • Alpental Changes
    • A new Interationale lift at Alpental. The lower terminal will be located approximately 1,000 feet southeast of the existing upper terminal of Sessel. The upper terminal would be sited approximately 1,500 feet north of the existing upper terminal of the Edelweiss chair at 4,960 feet.
    • The rope tow gets replaced with a magic carpet.
    • The top of St. Bernard gets moved about 250 feet east.
    • Sessel gets lengthened. The top will be about 450 up from where it is now. This will help to access more of the intermediate terrain.
    • No Alpental gondola or any gondola between Summit and Alpental.
    • Edelweiss upgrade. I’m not sure exactly what, but I’d guess a quad?
  • Summit Changes
    • New facilities will include a mountain-top restaurant at Summit East to be constructed adjacent to the upper terminal of the Mt. Hyak chairlift. The 5,000 suqare foot facility will provide 250 restaurant seats. At Summit Central the base lodge and rental shop/learning center will be removed and a new 60,000 square foot facility will be constructed. This facility will be constructed downslope of the existing day lodge and will include approximately 1,700 restaurant seats.
    • New lifts:
      • Mill Creek – The existing Backside chairlift will be replaced and realigned so that the new upper terminal will be located approximately 150 feet south from its current location and the new lower terminal will be located approximately 150 feet northwest from its current location.
      • Northside – This chairlift will provide round-trip access to expert terrain, north of the existing Pacific Crest chairlift. The proposed lower terminal will be accessed via the proposed Baby Double chairlift or by skiing down from the existing Pacific Crest chairlift. The upper terminal will be located approximately 500 feet north of the existing upper terminal of the Pacific Crest chairlift.
      • Rampart – This chairlift will be constructed to take advantage of existing terrain at Summit East. The lower terminal will be northwest of the Summit East base area facilities. The upper terminal will be 750 northwest of the existing upper terminal for the Mt. Hyak chairlift.
    • There are proposals to modify or upgrade many of the other lifts at Summit, but nothing major is there except some increased capacity.

If you want to double check my work, you can read the Summit-Snoqualmie Development Plan. Start with proposed Alternative 2, then add in Alternative 5, and finally modify that with the accepted plan in the Record of Decision. I think that’s less than 1000 pages. Maybe.

 

More Posts Next page »