Geek Boy's blog
Saturday, April 10, 2010
  Blog Migration
I'm moving the blog to posterous. This will eventually go away, and the blog.pclark.net URL will point there directly.
 
Friday, March 12, 2010
  No Fluff Just Stuff Mpls
I'm attending the No Fluff Just Stuff conference this weekend. Here are three things I learned on friday:


  1. You can do functional-style programming in java, using the collections framework. Ted Neward did some amazing, almost frightening stuff with anonymous inner classes and generics, that looked almost Standard ML-ish, but it was definitely not idiomatic java.
  2. Liquibase looks pretty cool. It's a lot like ActiveRecord migrations but for java (and groovy). Based on the 90-minute talk there are some design decisions I'm unsure about, but it's a lot better than ad-hoc schema management (or no schema management)
  3. Neal Ford gave a great talk on why agile development works. One of the great observations is that pairing can be a shortcut to getting into flow. He also shared a quote from Mary Poppendieck - "a late requirement is a competitive advantage".
I'm looking forward to tomorrow's sessions!

Labels:

 
Saturday, December 26, 2009
  Dear Hollywood
Doc Searls has a great post about the hassles and stupidity involved with Hollywood's region encoding. Worth reading. As a bi-lingual family, we have this problem in spades. Finding Region-1-coded movies with German soundtracks that are appropriate for 3rd graders and kindergardeners is a challenge.
 
Tuesday, December 15, 2009
  Fun little usability nightmare
Just noticed this fun little usability problem with the phorum system at the U of Mn computer science department.

Assume you really do want to cancel.

Do you hit "cancel", or "ok"?
 
Sunday, November 08, 2009
  Fun in programming languages
I'm taking a graduate-level programming languages class at the U of Mn. One of the problems in the current homework is to implement a binary tree (in C) that initially can hold ints, but can be genericized to hold anything. To show that it can hold anything, I'm implementing a data type for burritos.

The crown jewel of this assignment is getting to write this code:

typedef enum _burritomeat {veggie, chicken, barbacoa, carnitas, steak} BurritoMeat;

typedef enum _rice {brown, white} Rice;

burrito *makeMeABurrito(BurritoMeat m, Rice r, bool lettuce, bool cheese, bool sourCream);


Yay for burritos!

Labels:

 
Saturday, November 07, 2009
  Motorola Droid - WTF?
The new motorola droid handset has a picture of a red glowing eye on the front. For the love of God, don't Motorola already know that technology with red glowing eyes never ends well?


 
Monday, October 19, 2009
  People of Wal-mart
I'm a bad person because I find these amusing.
 
Thursday, October 15, 2009
  Fun with float
Anyone want to hazard a guess as to what this C program prints as output? I'm running it on Mac OS/X 10.6.1 on an Intel Core 2 Duo processor, but this should be IEEE-754-compliant math and return the same results on any processor you like that uses IEEE-754.


#include <stdio.h>

int main(int argc, char *argv[])
{
float basenum = 16777210.0;
float num = 0.0;
int counter = 0;

for(counter=0; counter < 16; counter++) {
num = basenum + counter;
printf("num is: %f\n", num);
}
}

Labels:

 
  Mac OS and Win7
Short post today.

I'm generally a mac user, but I need to use windows from time to time. When I have to do this, I use either Vista or WIn7. Using XP feels awkward, and the longer I spend away from it, the less I ever want to see it again.

So, I've been running Vista x64 on my main windows box, and recently attended a Microsoft event at which I received a copy of Win7 Ultimate. This was nice of them. However, it was Win7 Ultimate 32-bit, which I can't use. Aside from the fact that 32-bit windows of any flavor is the primary target for malware writers, my main windows box has 8gb of ram. However, one of the microsoft folk at the event put his email address up for comments and feedback on the launch event. I emailed him to say "Win7 looks great - can I get the x64 version?" He wrote back indicating that he'd look into it. Not long after that, I got an email indicating where to send the 32-bit installer disk to exchange it for a x64 version, with said Microsoft professional cc:ed on the email.

Thanks, Mike Benkovitch!

Labels:

 
Friday, August 21, 2009
  Songs in code?
void tomsawyer() {
try {
assertequals(you.say(his_company), you.say(society));
}
catch (mist) {}
catch (myth) {}
catch (mystery) {}
catch (drift) {}
finally
{
Runtime.exit(TomSawyer.WARRIOR);
}
}
 
Tuesday, July 21, 2009
  Clojure talk
Just got back from an Object Technology User's Group meeting, where Stuart Halloway spoke on Clojure. Whew - not sure I can get any more hyperlinks into that sentence!

Clojure is a lisp that runs on the JVM. It's full of parentheses, like a good lisp ought to be, and it can be difficult to read for developers who are more familiar with C-derived or Coffee-based languages. However, like a lisp, the information density in the code is really high, and the amount of idiomatic guarding against edge cases is really low. For instance, you generally don't need to write things like

if (myString != null && myString.length() > 0) {...}

in your code. This is quite refreshing!

However, what struck me as the most important point he made is the observation that good clojure code is about transforming a data structure from what you get into one that's closer to what you need to answer the question or solve the problem. It's about collection transformation, not about recursion. Thinking about 'how could I solve this problem with a recursive function' gets you into a nasty rabbithole and causes you to write the sort of spaghetti code that gives you a bad taste in your mouth from lisp. Thinking about collection transformations, echoing what you do with MapReduce-style coding, leads you to write code that is more readable and straightforward.

Another interesting point, that I might have issues with, was the observation that "we'll all be writing more functional code in general, and more lisp in particular, in the future." I think the lisp guys have been saying that for the last 30 years, of which the last 25 or so have been with a lot of bitterness. He might be right, but writing really good, clear, lisp-y code is harder than writing good-enough java. And good-enough java can be easier to sort out than not-quite-good-enough lisp.

Still, I'm more interested in clojure after his talk than I was before it.

And, as a bonus, I won a copy of the Programming Clojure book! Many thanks to The Pragmatic Press for donating several copies for OTUG to raffle off.

Labels:

 
Wednesday, June 03, 2009
  Hanging out at #javaone
I've been at JavaOne 2009 for the past few days. Lots and lots of great information, and learning a lot. Many of the talks I've been attending have been about alternate languages that run on the JVM - JRuby, Scala, Groovy, jython. Many of these languages solve problems that are difficult to solve given the constraints of the Java language, or at least are difficult to solve elegantly. Some of the problems along these lines are concurrency, simplicity, ease-of-development, and relaxing the type system. They all end up being about developer productivity. I find lots of analogies to the debates about java vs C++ in the late 1990s. This is probably healthy. The same thing appears to be happening in the .NET world - there are a lot of languages that run on the .NET CLR, and they don't all look like C#. In fact, F# looks pretty neat.

I also wanted to post a link to a great summary of a session about concurrency gotchas in java.

I've been posting updates on Twitter, if you're interested in following along.

Labels:

 
Monday, June 01, 2009
  javaone 2009!
I'm at JavaOne in San Francisco. I'll occasionally post updates to Twitter. Http://www.twitter.com/pclark

Labels:

 
Friday, May 15, 2009
  Confused about EIST/SpeedStep
Intel SpeedStep is a technology that allows the processor to be underclocked when it's not busy. AMD has a similar concept called cool'n'quiet. The idea is that if the processor is slowed, it'll run cooler and use less power. If it's emitting less heat, then the building needs less air conditioning, and everyone is happy.

We've got a bunch of Dell OptiPlex 745, 755, and 760 computers at work. These machines all have Core 2 Duo or Pentium D processors that support Intel SpeedStep, and we're mostly running Windows XP SP3, which has support for speedstep in the OS. We also have a lot of users who like to use Remote Desktop from home (over the VPN), and so they leave their computers on all the time. This isn't necessarily a good use of electricity, so I wanted to be as conservative with power usage as possible. SpeedStep seems to be exactly what you'd want in this sort of situation.

We've enabled speedstep in the BIOS, we've set the power settings to 'minimal power management' which is supposed to turn on speedstep support in the OS. I've been able to verify that speedstep is running by checking the reported clock speed in the properties panel for "My Computer". But is it really doing anything?

So - one of the best ways to measure actual power utilization is with a Kill a Watt power meter, which measures how much power the machine is drawing from the wall. If you let stuff run over time, it'll also measure kilowatt-hours.

I fired up a OptiPlex 755 with all the power management stuff turned on, and let it run over a weekend. The power utilization was around 55 watt-hours as measures over a 70-hour period. I then turned off speedstep in the bios by setting it to 'home/office desktop', which is supposed to not underclock when on AC power. I verified that the CPU was running at full speed in the "My Computer" properties display. I let the machine run for a couple days and measured power consumption of... wait for it... 55 watt-hours.

What's up? Is speedstep a joke? Alternatively, is something along the lines of speedstep running all the time? The machine was idle under both scenarios. If anyone has any insight into this, please comment!

Labels:

 
Wednesday, May 13, 2009
  From the mouths of babes...
A couple of days ago, Bea was annoyed that Laurel wasn't respecting her request for Laurel to keep her hands to herself. Bea complained to her mom "sometimes I think Laurel doesn't know what listening means".
 
Various ramblings from Peter Clark about life, coding, parenthood, Java, grad school, and enjoying my mac book air

Name: Peter Clark

Terror Alert Level

Thao and the Get Down Stay Down -- When We Swam

Archives
09/01/2003 - 10/01/2003 / 10/01/2003 - 11/01/2003 / 11/01/2003 - 12/01/2003 / 12/01/2003 - 01/01/2004 / 01/01/2004 - 02/01/2004 / 02/01/2004 - 03/01/2004 / 03/01/2004 - 04/01/2004 / 04/01/2004 - 05/01/2004 / 05/01/2004 - 06/01/2004 / 06/01/2004 - 07/01/2004 / 07/01/2004 - 08/01/2004 / 08/01/2004 - 09/01/2004 / 09/01/2004 - 10/01/2004 / 10/01/2004 - 11/01/2004 / 11/01/2004 - 12/01/2004 / 12/01/2004 - 01/01/2005 / 01/01/2005 - 02/01/2005 / 02/01/2005 - 03/01/2005 / 03/01/2005 - 04/01/2005 / 04/01/2005 - 05/01/2005 / 05/01/2005 - 06/01/2005 / 06/01/2005 - 07/01/2005 / 07/01/2005 - 08/01/2005 / 08/01/2005 - 09/01/2005 / 09/01/2005 - 10/01/2005 / 10/01/2005 - 11/01/2005 / 11/01/2005 - 12/01/2005 / 12/01/2005 - 01/01/2006 / 01/01/2006 - 02/01/2006 / 02/01/2006 - 03/01/2006 / 03/01/2006 - 04/01/2006 / 04/01/2006 - 05/01/2006 / 05/01/2006 - 06/01/2006 / 06/01/2006 - 07/01/2006 / 09/01/2006 - 10/01/2006 / 10/01/2006 - 11/01/2006 / 11/01/2006 - 12/01/2006 / 12/01/2006 - 01/01/2007 / 01/01/2007 - 02/01/2007 / 02/01/2007 - 03/01/2007 / 03/01/2007 - 04/01/2007 / 04/01/2007 - 05/01/2007 / 05/01/2007 - 06/01/2007 / 06/01/2007 - 07/01/2007 / 07/01/2007 - 08/01/2007 / 08/01/2007 - 09/01/2007 / 10/01/2007 - 11/01/2007 / 11/01/2007 - 12/01/2007 / 12/01/2007 - 01/01/2008 / 02/01/2008 - 03/01/2008 / 03/01/2008 - 04/01/2008 / 04/01/2008 - 05/01/2008 / 05/01/2008 - 06/01/2008 / 06/01/2008 - 07/01/2008 / 07/01/2008 - 08/01/2008 / 09/01/2008 - 10/01/2008 / 10/01/2008 - 11/01/2008 / 11/01/2008 - 12/01/2008 / 12/01/2008 - 01/01/2009 / 01/01/2009 - 02/01/2009 / 02/01/2009 - 03/01/2009 / 03/01/2009 - 04/01/2009 / 04/01/2009 - 05/01/2009 / 05/01/2009 - 06/01/2009 / 06/01/2009 - 07/01/2009 / 07/01/2009 - 08/01/2009 / 08/01/2009 - 09/01/2009 / 10/01/2009 - 11/01/2009 / 11/01/2009 - 12/01/2009 / 12/01/2009 - 01/01/2010 / 03/01/2010 - 04/01/2010 / 04/01/2010 - 05/01/2010 /


Powered by Blogger

Subscribe to
Posts [Atom]