Extend Your Language January 31, 2008
Posted by gordonwatts in computers.add a comment
A few days ago I had a post about extending objects – the desire to add little utility methods to objects that others had defined (and control). A few of the comments triggered something way back in the back of my head.
We (particle physics) have solved this sort of problem already. Anyone remember FLECS or RATFOR (holy cow, look at the original authors of RATFOR)? (there are others). I personally used FLECS when I was on the AMY experiment. We wanted some C-like structures in our FORTRAN so we used FLECS to add them — curly brackets, etc. The FLECS preprocessor was an extra step in the compilation process – it produced F77 code that was fed to the real compiler.
I’ve seen almost nothing like that for C++. Certainly, it is a much more complex language, so it is much harder to extend in this way, but it must be possible. Are there such languages? Any extension methods there?
P. Canal, a ROOT developer, pointed out to me that CINT supports extension methods in much the same way that python does – you can just add methods to your objects. Of course, in the case of CINT, this requires you to have the class loaded into CINT and you have to call it through CINT.
Going for the Hook January 30, 2008
Posted by gordonwatts in physics.3 comments
I’m not sure how this article showed up in my web browser — I must have clicked on some link without being aware of it. But check out the lead paragraph:
Thousands of particle physicists are spending billions to try to spot the elusive Higgs boson, which is key to explaining the origins of mass. But evidence of the Higgs boson–or at least a Higgs boson–may already be lying unnoticed in data from previous experiments, new calculations suggest.
Wow! I’d better read this! And then…
However, this lightweight Higgs is not exactly the Higgs everyone is looking for, says Marcela Carena, a theorist at Fermilab. “The Higgs they are talking about is not the one responsible for giving mass to the W and Z,” she says. It can’t be because it hardly interacts with those particles, Carena says. Indeed, in Yuan’s model, the role of mass-giver falls to one of the heavier Higgses, which is still heavier than the LEP limit, she notes.
Oh. Right. Back to work.
State of the Union January 29, 2008
Posted by gordonwatts in politics, science.5 comments
“The United States is committed to strengthening our energy security and confronting global climate change. And the best way to meet these goals is for America to continue leading the way toward the development of cleaner and more energy-efficient technology.
To keep America competitive into the future, we must trust in the skill of our scientists and engineers and empower them to pursue the breakthroughs of tomorrow. Last year Congress passed legislation supporting the American Competitiveness Initiative, but never followed through with the funding. This funding is essential to keeping our scientific edge. So I ask Congress to double federal support for critical basic research in the physical sciences and ensure America remains the most dynamic nation on earth.”
From last night’s State of the Union text. I have no idea what these things mean — especially given Bush is a lame duck now. But he did mention the dropped funding. Some of us have been hoping that something might be connected to the stimulus package – but I also agree with the point that funding science is not the right way to make a short term cash infusion into the economy – but it is good for the long term health of the economy (as he mentions).
The word science occurred one other time in the speech, and its context must aggravate most medical researchers:
On matters of life and science, we must trust in the innovative spirit of medical researchers and empower them to discover new treatments while respecting moral boundaries. In November we witnessed a landmark achievement when scientists discovered a way to reprogram adult skin cells to act like embryonic stem cells. This breakthrough has the potential to move us beyond the divisive debates of the past by extending the frontiers of medicine without the destruction of human life.
It is hard to disagree with the statement “respecting moral boundaries”, at least in the abstract. Unfortunately, it is a codeword for all the stem cell research battles.
To put this in some context I looked back at his last three addresses. The American Presidency Project, among other things, keeps many past state of the union addresses in its archive. I looked back at 2007 – science is mentioned once, in the context of the no child left behind law. In 2006 it is mentioned in the context of education and also the proposal of the American Competitive Initiative – which includes doubling the science budget (which got killed). Code words also appear in the context of medical science. In 2005 the word science didn’t appear once. So 2006 was a banner year…
Get It All At Once January 26, 2008
Posted by gordonwatts in physics life.add a comment
The Aspen 2008 winter conference finished last week. I’ve only been once – a long time ago – and it was one of my favorite conferences – talks are 30 minutes long. And every talk is a plenary talk. Unfortunately, the various experiments no long seem to treat it as a “must hit” conference – so they prep their results for the Moriond series of conferences. This makes Aspen a bit less interesting as far as new collider results – but the organizers are much more focused on the theory half than some of the other winter conferences. The conference is small and there is a great deal of interaction (or at least there was when I went):
The conference will cover the latest developments in High Energy Physics, concentrating on the theoretical and experimental exploration of the Higgs sector and alternative models of electroweak symmetry breaking. The schedule and the mixture of foreseen talks are designed to encourage interactions between theorists and experimenters, exposing experimenters to the latest theoretical ideas, while providing a dose of reality to the theorists.
Hmmm… A “dose of reality to the theorists”?
I have to say, the theorists I’ve worked with recently have gotten it pretty well. I wonder who authored that line?
At any rate, I missed this conference again, as usual. But now they are using the CERN agenda server for the conference web page. And the beauty of that system is the little “compressed file” icon at the top of the page. Click it and a giant ZIP file comes down of everything. Now I can take it with my on my flight back to France and read up on everything!
[Update: Well... I've never tried this on such a big conference -- after 12 hours and over a half gig of downloaded material my internet connection finally broke! Why is it feeding me data at only 12 KB/sec!? No longer as enamored of this feature.
]
Extend Your Objects January 25, 2008
Posted by gordonwatts in computers.9 comments
Sometimes, when coding up a particle selection, you end up with code that looks like the following:
if (abs(jet.Eta()) < 2.0 && jet.Pt() > 10.0 && jet.EMF()<0.90) {
good_jets.push_back(jet);
}
That is pseudo code, of course. The jet object is some collaboration defined object — not something you can really alter. But that selection can get pretty messy and long (especially for things like electrons) and you want to share it with others, so you write a small subroutine so you can write
if (ismykindofjet(jet)) {
good_jets.push_back(jet);
}
Promotes reuse, factorization — all sorts of good things. I would like to see C++ add a bit of extra syntactic sugar (which is so _not_ C++ like):
if (jet.ismykindofjet()) {
good_jets.push_back(jet);
}
It just looks so much cleaner. In other languages these are called extension methods. They don’t give you access to the private variables of the class – but they do make the code look cleaner. At least, they would make my code look a lot cleaner!
I suppose it is too late to get something like this into the next round of C++.
At least 50% of the reason I became a Physicist January 24, 2008
Posted by gordonwatts in Food, physics life.add a comment
They say that it is usually the high school teacher – if you have a good high school teacher it is likely that you will be open to studying that field when you get to university.
For me it was my Dad. He is also a particle physicist. He used to take me to work when I was a kid – at 10 years old I got to play with a PDP-10 computer. But a good part of the reason I liked going into Rutgers was the food we’d pick up on the way in.
Tastee Sub Shop. I don’t know what it is about their subs that they get so right. The tomato and the oil and vinegar are somehow so much better than anyone else’s. And these things are nothing fancy – just the standard ingredient. Puts the Subway sandwich’s I eat when I’m at Fermilab to shame – even with their fancy breads.
What a difference a modern CPU makes! January 23, 2008
Posted by gordonwatts in computers.3 comments
My new Lenovo X61t is doing great. One thing that is so much better than my old m200 is the CPU. My Skype calls actually work now. I can do video. And I can video conference at full bandwidth – and still use my computer for other things. My previous portable barely had the CPU to keep up. And you know what is even better? When on battery and power saver mode, it still has muscle left over – my old portable would just roll over and didn’t even have the spare cycles to laugh at me.
One thing I did this time, btw, was choose a slow processor — the 1.6 GHz dual core CPU (my m200 was a 1.96 GHz Pentium M). This plus modern electronics means my battery will last for almost 4 hours under full usage. That is great for the size and weight and power of this portable. Two years from now I’ll probably buy a new one – wonder what the battery life will be then? And how many cores? And what OS will I be running?
It isn’t without its problems, however.
Science Funding Irony January 22, 2008
Posted by gordonwatts in politics, science.add a comment
My Dad’s latest issue of Scientific American (Feb) just arrived. The cover carries the title: Special Report: The Future of Physics, with the short underneath it:
Hidden natural laws? Unseen dimensions? Two new particle colliders will search for answers at unimaginable energies
“Two!?” was my first thought. The first is, indeed, the LHC. The second is the ILC — the one for which all the funding was just cut. Ops. Reading the editorial I see no mention of the funding cuts, so I assume this went to press before that was known. Still, to be excited about something that has its funding slashed shows how out of touch science and politics are. For what it is worth, the authors of the articles make me think they will be good reading – I’ve not read it yet, but I’d suggest picking it up!
As a side note, I was listening to a pod-cast of Science Friday the other day and they had an interesting bit on the MESSENGER satellite’s return to Mercury. James Head, a professor from Brown University, was the guest. Early on in the interview he made the comment “science funding in the USA is at its lowest point in my lifetime.”
Adobe!?!? January 22, 2008
Posted by gordonwatts in computers.4 comments
Climbing on my soap box…
My mother has used computers for 30 years – or something close to that. Windows almost exclusively. At work she used it mostly for word processing and writing books – she was an English professor at Rutgers. She can’t spell either – the difference between her and me? She made sure she learned how to spell.
At any rate — she is comfortable with computers, but not a power user. Now that she has retired she has taken up birding and photography in a big way. There are amazing pictures all around our house – she enters contests as well. My sister and I and Dad are all working on her to get a flickr (or similar) account. You’ll be impressed (if they are ever posted online).
She just got the new D300 last week. She takes pictures in RAW format and the program she uses – Adobe’s Photoshop Elements — needed an update in order to read new new D300 RAW format. Adobe already has this update available. Cool!
Except… First thing she did was download the file. She then looked at the web site for installation instructions and saw the link to a PDF file. Only, when she clicked on it it brought up the warning “Are you sure you want to run acrobat reader? This program has known incompatibilities with Vista!” I have no idea what program installed that old version of Acrobat reader on her brand spanking new Dell Vista portable, but Mom decided that no, she didn’t want to run something that might break things. So, she proceeded without installation instructions. As it turns out, the installation instructions are both in the PDF file and also down at the bottom of the HTML page (why do this?? Why have a special PDF link when HTML will work??).
The downloaded ZIP file contained only a “Cammera Raw.8bi” file. No readme file. Why not include the readme file in that!?? So my mother tried double click it. Guess what — it opens the photo shop elements picture editor! And in doing so it doesn’t install the new Camera Raw file! What is the point of that other than to really confuse people!? Why not include a double-click to install file? That is 15 lines of open source XML code to do that!
Finally, she tried copying it into the Photoshop Elements directory (she didn’t realize how close she was!). Of course, that didn’t work. At that point she called me. We eventually got the file into the Plug-ins\File Formats directory. I really don’t know why Adobe made her do it – it was definitely not something she was comfortable doing, and Adobe’s Photoshop Elements product is aimed at the casual computer user, not the power user. Adobe is a big company – they produce some excellent products. They can do better when it comes to things like this.
Ok, getting off my soapbox.


