Tuesday, November 24, 2009

Slow and Steady: Undervolting your CPU

The following only applies to Windows machines. There may be something similar for Mac and Linux, but I didn't look into it.

Why: It makes the CPU last longer, extends battery life, and makes the laptop quieter (the fan runs a lot less).

Risks: None - just the time it takes to do it.

Why it works: A standard voltage range is applied to all chips of a given type that a manufacturer makes. Each chip may have a different tolerance where it is stable, but by setting the voltage high, all of the chips in a given run will remain stable. Your chip may only be able to handle the max voltage, or it may be like mine - the min voltage for all clock speeds.

I followed this guide's advice for a while (drop the voltage by 0.025 & test for 45 minutes), then read down a ways the following comment:

I just keep the CPU stress test running and drop the voltage at the maximum multiplier at about 1 step every 15 seconds starting at 1.10V (for Intel Core / Core Duo). This very quickly finds the voltage which is definitely unstable and BSODs (keep a recod of the voltage as you drop it). I then put the voltage back up two steps and run an overnight stress test.

I ended up getting down to the minimum voltage in just a few minutes & ran a test for 45 minutes. It was stable, so I left it there. I'll run an overnight stress test this weekend.

The basics are to run three utilities together:
1) CPU Monitor to tell me the temperature of the cores.
2) A utility to make the CPU max out.
3) A utility to change the CPU voltage for each clock speed.

Keep dropping the voltage until you see the Blue Screen of Death, then kick it up two notches. You change only the max clock speed voltage as you go, then change the others once you have a setting for that (my chip has 6 steps). Once you're happy with it, you set the utility to kick off at startup (it runs once & goes away). You can always boot to safe mode & get factory defaults this way - safer than doing it at the BIOS level.

(Thanks to Uwe Hermann for the photo of a Celeron CPU)

Thursday, November 19, 2009

Detroit Tech: The 1DevDay Event

The 1DevDay event was organized by the Detroit Java User's Group, and held at ePrize in Pleasant Ridge, MI. The event was more like an expanded version of the monthly JUG meetings than something completely new. Since the monthly meetings are both valuable and interesting, this is not a criticism.

Here is a pared-down blow-by-blow of the events that I attended & what I took away from them, straight from what I hammered into OneNote at the time:

9:00 AM - Venkat Subramaniam's Keynote:

  • "Best practices" is often a fallacy.
  • 75% of the features in most systems is used only occasionally. 45% is never used at all. A good argument for Agile?
  • Interesting - Venkat is also making the point that we should pay attention to how we contribute to revenue. (Same as "Passionate Programmer" & other books.) Not sure that I agree that this should be an area of focus - worth some thought to articulate.
  • Don't create a new EJB standard:
    • Innovate first
    • Find real multiple use next
    • Standardize and market last
    • Rails & Spring are two examples.
  • Groovy & Ruby are as strongly typed as Java, they're just not statically typed. You'll get a runtime exception.
  • Check out: http://freerangekids.wordpress.com/2009/11/03/5-dangerous-things-you-should-let-your-kids-do/
  • Bogged down a bit at the end - talked about Unit testing & a lame story about exercise.

I wasn't interested in either of the sessions that followed, so I played around with RSpec while sitting in the Terracotta room.

10:45 AM – 11:45 AM – Agile Teams (Chet Hendrickson)

  • Chet likes burn-up charts over burn-down charts. I see his point.
  • Chet does not like certifications - certainly not for Agile or Scrum.
  • "Metaphor" is an XP practice meaning, "the common language developers and business people speak- the metaphor for the system".
  • 7 big categories (7 pillars of agile):
    • Business Value
    • Confidence - we can prove that the code works / plans are accurate
    • Product - dev should understand the business & product at least somewhat
    • Collaboration
    • Supportive Culture
    • Technical Excellence
    • Self Improvement
  • Check out: http://www.agileskillsproject.com/
  • Ditto on the google group: http://groups.google.com/group/agile-developer-skills
  • The Agile skills matrix, the 7 categories across the top, vertical axis contains:
    • Learner - I've heard of it
    • Journeyman - I can do it on my own & help others
    • Contributor - has changed our collective understanding of this topic

    Where are your skills in each category?

biz val



supt culture

tech ex

self imp






  • Developers should read a lot of good code. (Identifying what is "good" is a challenge, but a surmountable one.)
  • Pick up a copy of "Software for your head" by Jim McCarthy.
  • "Move to code as soon as possible."

12:45 PM – 2:45 PM - Ajax / DWR

  • The presenter of this one was a bit new at it and/or I was underprepared. It was difficult to follow along, though I did learn a few things about the capabilities of Dojo and DWR.

2:45 PM – 4:45 PM - OSGi (Dennis O'Flynn)

  • The Mainifest file is the key to this - it contains everything OSGi needs to determine how things fit together.
  • This session helped me form an opinion: It looks really cool, but I can't think of a problem that I would solve using OSGi. I will ignore it unless/until I actually need it.

4:45 PM– 6:45PM – TDD / Refactoring (Nayan Hajratwala)

  • This was without a doubt my favorite.
  • Characterization tests aren't all that tough - write one where parameters have an empty list, zero or null first, take a guess at the result, then change the test to match the result you actually got for the test & get a green one.
  • Nayan likes to run tests on all 3rd party components that you use. Note that these only apply to the methods/components that you're using - not the entire library. Not sure if I agree with this or not. I haven't been bitten by this problem yet, and I don't like to solve problems I don't have...
  • AssertThat sounds very useful. Ex: assertThat(<expected or actual>, is(0));
  • Hamcrest (an anagram for "matcher", I think) has a bunch of different matchers I can use in assertThat(). They're in org.hamcrest.CoreMatchers.

Tuesday, November 3, 2009

First Impressions of Windows 7

My first impression of the OS is overwhelmingly positive. I have been using it for a full day (just installed it last night), and I haven't seen a glitch or a slowdown yet. After using Vista for a couple of years, it's a welcome change.

I used the machine all day for software development at work. This was something of a pain, since I did a clean install and had to add a lot of my tools back in. The upshot to this is that I installed a pile of software and found that it all worked without a lot of tweaking required.

A few of the things that stood out as positives:
  • The redesigned taskbar. I like the fact that it consists of both running and "favorite" applications. The window management it drives simply rocks (see the link for a more detailed review & comparison to the Mac Dock).
  • Everything has been cleaned up in the interface. From the taskbar to the start button to control panel and all of the little utilities I have tried, everything is easy to grok and use.
  • The Aero UI components are reasonably fast. A very refreshing change from Vista.
  • The themes are visually appealing, and easy to change. The one you see in the screen shot above was downloaded by clicking "get more themes", but the built-in ones are really nice too.
  • Sleep means sleep. The machine didn't wake up in the middle of the night (and kill the battery) for no apparent reason. This is still something to watch, but since I haven't heard the fan running nonstop yet, I suspect that whatever the problem was is gone now. (Yes, I did look for processes running when they shouldn't. No, I never found one.)

The negatives are pretty minor, but here they are:

  • Some browser plugins (like Flash!) simply don't work in the native browser. This is a function of my installing the 64-bit version of Windows 7 - not all of the plugin vendors offer a 64-bit version of their software yet. I got around it by installing Flash inside of the 32-bit Google Chrome browser, but this will probably be annoying in the future.
  • Firefox doesn't have a 64-bit version. I'm using a one-off called "Minefield" right now. It appears to be misnamed, though - works just fine, and noticably faster than the 32-bit version. So far, all of my plugins (except Flash) work just fine.

Although there are no major negatives, so far. There are a few things I'm going to watch for, based on my experiences with Vista:

  • Search service and indexing performance: so far it hasn't been a noticable drag on performance. It sucked in Vista, even after installing Windows Search 4.
  • "Security Essentials". I decided to uninstall the copy of AVG I initially installed and try out Microsoft's free anti-virus and anti-spyware software. The word is, it isn't a drag on system resources and integrates nicely into the OS.

My overall impression is that this comes close to what OS X has been doing for the past few years. I am not a heavy user of Macs, but much of what attracts me to the OS (simplicity, ease-of-use, depth of functionality when you need it) seems to me to be present in Windows 7.

I had been thinking that "come hell or high water, I'm going to buy a MacBook Pro some time in the next year." Now I'm not so sure. A high-end PC laptop with this OS may give me everything I expect from a Mac. Well, I've got some time to compare the two (another member of the household has a Mac) and figure out if my first impression holds up.