jump to navigation

The Forever Stamp February 27, 2007

Posted by gordonwatts in life, politics.
3 comments

The idea of the Forever Stamp is great. Imagine not having to ever buy 2 or 3 cent stamps to make up the difference when rates go up? At the very least, you no longer have to worry.

But, I’m not totally happy with the idea. The problem is that every news report has discussed just having one particular stamp design. As a former stamp collector, that would suck! Stamps are beautiful. I seriously doubt that the US Post office would abandon their long tradition of stamp diversity — after all, we have many different versions of the current first class stamps. But I had to get my protest in early.

Speaking of which — has anyone tried this photo-stamp service? It lets you upload photos and then prints them as stamps for you to use as first class postage.

New Addition to the Household February 26, 2007

Posted by gordonwatts in computers.
add a comment

IMG_0479.JPG

No, that isn’t for Julia!

My wife just got a new Apple laptop. One of those cool black ones. Her comment, over IM: “you know what? Apple has better designers working on the styrofoam packing inserts than Dell has in their whole company.”

Ouch.

Looking forward to getting back and seeing those cool styrofoam inserts!

ROOT, Python, and .NET February 25, 2007

Posted by gordonwatts in computers.
15 comments

Nothing is ever fast enough, except when it takes too long to code…

I’ve long been a fan of the python language. As I’ve said previously, I think C++ is a dead language: there is very little research going on and proposed language improvements are quite limited. Languages like Python, C#, and Java (along with others) are all adding features at an impressive rate that, I think, make them much more productive languages.

I’ve used python for years. And I’ve used ROOT for years. Finally, Wim, down at LBNL, married the two. Previously, the only way to use ROOT was the C++ interpreter, called CINT, bundled with ROOT. With pyROOT, however, one could use python. It was fantastic. I wrote lots of analysis code in python. And I got it done so much faster.

Only one problem — it is slow! The interface between python and ROOT has a fair amount of work to do. Further, it is quite flexible and must make a number of decisions at runtime. The result is that each time you call into ROOT from python some extra processing must occur.

I’m also a big fan of C#. However, calling into real C++ code (i.e. ROOT) from C# is difficult. You have to leave the interpreted world (i.e. the CLR) and go into the C++ world. Other than writing managed C++ this is a big pain. I’ve often generated small stubs of code to enable some small project. It occurred to me just before going on vacation to Vancouver that this process could be automated: ROOT includes full class meta-data.

Add to this there is now an implementing of Python 2.4 on the CLR — IronPython. I could do a apples-to-apples comparison: normal python vs CLR python!

So, that is what I did on my short vacation trip to Vancouver, while Paula was asleep. I wrote some code that would automatically produce wrapper files for a small set of ROOT classes. Enough to create a file, fill a histogram, and close the file. And then I timed them with ROOT’s TStopwatch class. Here are the results:

Raw C++: 7.2 seconds

C#: 11.3 seconds

Raw Python: 143 seconds

IronPython: 64 seconds

Wow — IronPython is a x2 faster. Note this is a statement about how one moves from the python to the C++ world — not the overall speed of IronPython. But it is interesting. Here we are going from Python -> .NET CLR -> C++ and it is x2 faster than going from Python -> C++. Now, I’m willing to bet you good money the reason for this difference is the Python implementation of the ROOT interface is much more flexible than the .NET one I’ve created: the regular python interface has so-called late-binding. That is — it can handle any object you give to it, my .NET translation can only handle objects that were previously converted. If pyROOT implemented that method that I suspect it would be hugely faster than it is now. Hmmm — one can build .NET objects on the fly - I wonder what it would be like if one automated that translation? That is a kind-a cool idea, isn’t it? :-)

If you are curious about the IronPython source code, here it is:

import clr
clr.AddReferenceToFileAndPath(”G:\\users\\gwatts\\Documents\\Visual Studio 2005\\Projects\\ROOT Class Interface Maker\\Test - TH1F\\bin\\Release\\ROOTDotNet.dll”)

from ROOT import TFile, TH1F, TStopwatch

sw = TStopwatch ()

sw.Start(1)

f = TFile (”bogus.root”, “RECREATE”, “”, 1)

h = TH1F (”hi”, “there”, 10, 0.0, 10.0)

for i in xrange(100000000):
h.Fill(9)
f.Write(”0″, 0, 0)
f.Close(”")

sw.Stop()
sw.Print(”")

Those of you how know pyROOT will note that other than the first two lines the code is basically the same (note: I’ve not implemented default arguments, which is why every single argument is spelled out).

Now, the only thing left in this proof-of-principle is that I can open the file I wrote out, grab the TH1F object, and see if I can get the contents of bin #9. This is complex because TFile::Get returns an anonymous TObject and it has to be turned into a TH1F interface. This is tough in .NET because it doesn’t support multiple inheritance, something that ROOT takes full advantage of.

Snow! February 25, 2007

Posted by gordonwatts in life, travel.
add a comment

I was planning on going downtown to eat dinner with some friends tonight — downtown Chicago is about 45 minutes from Fermilab. Not going to happen.

The youtube video below is a click taking with my camera. I’m in the car, driving (very slowly) along the road just outside DZERO. That sound you hear is the snow hitting the side of the car — it was mostly snow and a bit of ice (actually, it looks like the youtube encoding algorithm removed a bunch of the high frequency noise). In about an hour over an inch of snow dropped.

Needless to say, I did not go downtown.

So Much For McCain February 24, 2007

Posted by gordonwatts in politics.
add a comment

I was really looking forward to a presidential contest that I would have to think about. Hillary vs McCain was my best first guess (along with just about everyone else). Barak would have been great too. But McCain seems to have stepped across several right-wing conservative lines now. For example, he recently talked at the Seattle Discovery Institute — the leading US group trying to get creationism into the schools. I’ve seen references to him being down on stem cell research (though in 2006 he seems to have voted for it – so there is hope). He also would overturn Roe v. Wade — the land-mark decision allowing for abortions uniformly with in the USA. These are all make-or-break issues for me.

What are we? More than a year and a half out? If McCain wins the Republican contest this will be a very boring campaign. The Democrat on the other side is going to really have to say some bogus things for me to reconsider a vote for someone like McCain. And if a 3rd party candidate comes along that might split the opposing vote for McCain — even if I like them better, I doubt I would vote for them - lest we have a repeat of the Al Gore vs GW Bush match up.

This sucks. I was really hoping for an interesting political campaign. At least on the Republican side it is shaping up to be the same-old same-old (I’m sure the same thing is going to end up happening on the Democratic side - they just haven’t said anything which has gotten me pissed off yet).

Rank Amateur February 24, 2007

Posted by gordonwatts in travel.
add a comment

So, I admit that I’ve not traveled in a while, but this is ridiculous. At Seattle security I left my portable sitting on top of the x-ray machine. I discovered it only by chance, after I was comfortably unpacked and seated on the airplane. The only reason I’m on this flight to Seattle at all is because the TSA was so well organized (my portable was already cataloged) and because the gate agent came out into the main terminal hallway to see if she could see me running towards the gate.

On the plane I managed to split a cup full of ginger ale and ice all over my self. Clean up is not possible; hopefully it will air dry. My wallet will be sticky for a little while…

And I’m only just half way to Chicago…

Other than the person in front of me holding up the hotel registration line for almost 15 minutes over a lost registration… I guess the rest wasn’t too bad… Snow tomorrow night too! I’ve not seen that in a long time!

Everybody Downloads February 21, 2007

Posted by gordonwatts in life.
add a comment

I went to The Whip for a few drinks here in Vancouver (great bar). My brother-in-law and I ended up talking to another woman sitting at the bar. Topic? Latest good TV shows. How did she watch them? Oh, obviously. By downloading them. What does she do for a living? Tend bar at some other bar.

Music? Not as much. Why? Not so much good. Mostly she gets it from friends who give her CD’s and she rips those. I guess that is a perk of the business she is in.

Does anybody not download!?

Kids Name’s that Never Made It… February 20, 2007

Posted by gordonwatts in life.
3 comments

Before Julia was born, my sister tried to persuade us to name her Rashzilla. “Gender neutral!” she said. And I wondered what New York City bar she’d come up with that in.

On our way back from Vancouver today we stopped at a former UW graduate student’s place. They have a 4 year old boy and expect a daughter in a few months. When the boy was asked what they should name his new sister the reply, apparently, was “Kersplat!”. Now, is that a name or what!?

TGIF!! February 16, 2007

Posted by gordonwatts in life, physics life, university.
add a comment

Finally! Friday! The past couple of weeks have been hell. I remember when I was on the interview circuit. It was exhausting. Each day I was at an institution was a rapid fire series of meetings. One after the other. Each one I had to start from scratch, telling the small group about myself, what my research plans were, and what I hopped to bring to the department. Add in one or two big talks and after two days I was barely able to drab myself back to the airport.

What I didn’t appreciate then was that the faculty doing the interview are just as tired. Especially ones on the search committee (as I am this week). For us it has been more than 4 weeks to interview 6 candidates. I’ve not done any real research in over a month now.

Now, it is certainly true that we have it easier: our future job is not on the line. On the other hand, we are interviewing to fill a position with my group — which means the group’s future is on the line. Plenty of stress.

Whatever. I’m glad most of the interviews are over now. It is a long weekend here in the US, and my wife and I are taking our kid on her first long drive up to Vancouver. I’ll see you when I get back!

Web 2.0 February 14, 2007

Posted by gordonwatts in science.
5 comments

As someone was pointing out to me at dinner the other night - I’m never one for getting information onto the blog quickly (or even first). So, in that spirit, I’ll now mention an article that came out on Physics Web a week or so ago. Heck, I’m even quoted in it, so it has to be good. It makes for an interesting review of various Web 2.0 techniques used in physics.

Tagging is one Web 2.0 social mechanism I’m fascinated by — if only because I use it so much to help catalog my pictures. Flickr is an example — the Seattle Sculpture Garden just opened. You can search the tags across all of the users to see everyone’s photographs. So, why not with physics papers? Turns out no one is doing this yet in physics — though they are in biology. The benefits might be that you could find out what other people had tagged a particular paper, and perhaps that would lead you to other papers you were unaware of on the same topic: experts tend to collect clouds of tags around their expert topics. Sadly, not yet in physics. I’ve already started tagging some of my download papers (the Vista OS lets you tag any file) to see if anything happens. But in isolation tagging isn’t nearly as powerful.