10 December 2008

A lot of effort went into this

The first shareable version of mcgeometry, the general combinatorial geometry code for transport, is finished.

22 October 2008

Try out these word combinations

czar chasm
myrrh made
...

I need to think of more.

14 October 2008

Trilinos on the mac

My configuration script for Trilinos on Mac OS X 10.5.5, for building without MPI:

./configure \
--cache-file=config.cache \
--prefix=/usr/local/trilinos-8.0.8-serial \
CC=/usr/bin/gcc CXX=/usr/bin/g++ F77=/usr/local/bin/gfortran \
--with-libs="-framework vecLib" \
--with-ldflags="-Wl,-multiply_defined -Wl,suppress" \
--enable-amesos \
--enable-epetra \
--enable-anasazi \
--enable-aztecoo \
--enable-examples \
--enable-didasko \
--enable-teuchos \
--enable-triutils \
--enable-galeri

I believe that the only software needed to get this to work is the gfortran compiler available at the mac High Performance Computing site.

I found that the with-ldflags line was necessary because otherwise the "pow" check would die from "Undefined symbols: "___gxx_personality_v0", referenced from: __gxx_personality_v0$non_lazy_ptr in ccJ9fzb2.o".

To get a trilinos-base program to compile, run g++ with the Apple compiler with options "-framework vecLib -I/usr/local/trilinos-8.0.8-serial/include -L/usr/local/trilinos-8.0.8-serial/" with the libraries (e.g. "-lepetra").

08 October 2008

Word movement in terminal

This is a handy tip that I've wanted to do for months (since by default, on UNIX machines ctrl-left and ctrl-right move between words, but the mac terminal didn't).

Also, this inputrc modification (which makes the up arrow complete to the last occurrence of everything before the cursor) is even better than ctrl-r reverse search.

30 September 2008

Publication-quality plots in MATLAB

I've done something similar (but much more simple), but this article has some interesting points. Now if only MathWorks would fix that stupid bug that showed up with the latest Java update.

Here's what I do: it scales the fonts and figures (using hgexport) and markers so that they show up as not to small a size when included as 3-inch figures, changes the font to Times, makes the minimum line width 0.5 points, exports to EPS, and uses the epstopdf tool to convert it to a pdf (since Matlab's pdf export is buggy and always puts the image on an 8.5 x 11 page). The results look consistent and very clean.
exportNiceFig.m

UPDATE 11/30/2008: I fixed the behavior of some of the resizing when there are multiple axes on a single figure.

UPDATE 01/21/2009: For future updates, see the projects page

24 September 2008

Random number generators

I spent a good deal of time today -- way more than I should have -- looking at random number generators, specifically the ones in Boost (which are aliased by its std::tr1 deal). It turns out, based on my limited testing, that they're incredibly slow. The Mersenne Twister here is up to five times as fast. If I ever write a real Monte Carlo program, I definitely won't want to make my program five times slower if I don't have to.

I also spent about an hour trying to find where in my header files I'd somehow done "using namespace std", or if I'd accidentally included a instead of a , because somehow sqrt and rand were in the global namespace. It turns out that gcc's implementation automatically makes all the math functions global. Boo.

22 September 2008

What the functor?

Today I did the most advanced C++ programming that I've ever done. It's a recursively templated function that checks for soft equivalence of two doubles, or two vectors of doubles, or two vectors of vectors of doubles, or so on and so on.

This evening, I took that design and added functors to it, so that it can do any arbitrary comparison. I'd just read about them yesterday and gone, "Huh. What kind of weird application could those have?"

10 September 2008

Pseudo-random

My professor on pseudo-random numbers in the context of Monte Carlo:
They look like random numbers, they smell like random numbers, and by God, we're going to treat them like random numbers.

23 July 2008

Fsssssss

I discovered this morning one great thing about sleeping on an inflatable air mattress. All I have to do to get myself to stay up when I wake up is to pull open the valve.

Now if only there were an alarm clock to do this...

19 July 2008

Apricots

I picked one off of the tree in the yard here. It was tasty, but then an earwig fell out of it.

18 June 2008

Diffusion

Starting a month ago or so, I started writing up some notes on diffusion (specifically, its application in simplified form to the qualifying exam). The idea was that if I didn't pass, I would have a handy reference to help with re-learning diffusion. Anyway, I did pass, but I decided to finish it somewhat and make it available. It's meant for someone already familiar with reactor physics and diffusion, but it emphasizes some points that aren't that common, and it presents a good simplified summary of the one-speed homogeneous method. The content is all correct to the best of my knowledge, but caveat emptor.

28 April 2008

1E-9

For the past year and a half—maybe a bit more—my iPod Photo hadn't been quite working correctly. It would, on occasion, lock up in the middle of a song and restart with a frowny face icon. I discovered that when I put my ear up to it as this happened, I could hear a "click-peeew. click-peeew.click-peeew." sort of noise. And then I found that slapping it horizontally against my hand would cause it spin up properly and keep working.

During this time, it's been working for the most part, but freezing up more often (requiring sharper and even more frequent slaps in the past month or two). Finally, about a week ago, I slapped it and heard the terrible sound of the read/write head gouging the disk itself. And it didn't work again.

So I bought an iPod nano. Every time I look at it, I'm awed by how far miniaturization has come. Seven years ago, when the first iPod came out, I was amazed that they could fit 5 gigabytes of music into something the size of a deck of cards. And now I'm holding in my hand a device that's an tenth of the size, has a bigger video-playing screen, and lasts more than twice as long on a charge. It's just so tiny!

19 April 2008

Modern research technology

My class was assigned a sort of literature review project for our nuclear fuels class. I'd been to a presentation by Argonne on fast reactors, and one of the things they mentioned was how metallic fuels would probably be superior to metal oxide fuels in a sodium-cooled reactor.

So my partner and I chose metallic fuels for our topic. Well, basically, thanks to the amazing technology that's only shown up in recent years in available consumer technology, my life and ability to communicate information was fantastically simplified.

The first step was to use Google Scholar to find some good references. So I searched for "metallic fuel" fast reactor and found a few to start with. There's an option in the preferences to show a link to import the bibliography information into BibTeX format (like so). With Michigan's library subscriptions I was able to follow the link to ScienceDirect and other sites and actually download a digital copy of the article as a PDF. [Brief aside: I just realized that PDF format is one of those redundant acronyms.] So with the copied BibTeX information, I opened up BibDesk, created a new entry that now has all of the bibliography data, and dragged in the PDF. From this, I can automatically generate a bibliography in the report and citations and so forth (which, with LaTeX using BibTeX, is a piece of cake).

In short, I was able to easily find a lot of useful references, organize them, and use them. But one of the coolest things actually made itself useful during our presentation. Someone asked a question about iodine and technetium radiotoxicity, and how fast reactors transmuted those to less harmful elements. I couldn't recall anywhere in the papers offhand, but I opened up BibDesk, entered "iodine" in the search file content field, and double-clicked on the paper that showed up. It opened the publication in Preview, and inside that it had automatically highlighted eveywhere that "iodine" appeared in the document. Then I dragged the window over to the projector screen to show the relevent plot and text. So in about 10 seconds I was able to find exactly what information he needed. Pretty sweet! And to think that 25 years ago graduate students were lucky if they didn't have to use a typewrite to write their thesis.

13 April 2008

Typography issues

A pet peeve of mine is when a zero and the letter "O" are unintentionally interchanged in text (usually noticeable by the width and eccentricity of the glyph). The most common transgression is for people to write "H20," presumably because having a numeral nearby makes people's brains translate the "oh" sound ("O" for "Oxygen") into the number that is often read as "oh." Of course, I've seen in signs and other text where the converse has taken place.

I grant that I'm occasionally guilty of mistakenly hitting the wrong key (since "0" and "O" are adjacent on the keyboard), but I usually notice and correct it immediately...

09 April 2008

Not very nice

I got a letter in the mail from a company I had never heard of that began,
Dear Seth Johnson,

“Congratulations, this letter constitutes our formal offer to you for a position with our company, Proto-Power Corporation.”

Yes, this could be the opening line of your offer letter after you interview and are accepted for a position with Proto-Power Corporation.
So apparently using quotation marks gives a person the license to say whatever they want, as long as he states after the fact that it was a hypothetical situation.

"Go away and never talk to me again! Also, I killed your puppy."

Yes, that could be a blog post here if I hated you, and if I killed your puppy.

01 April 2008

Happy Aprilday

I definitely had fun with this combined with a Perl script that continually cycled it producing flashing error messages (ERROR: I am lonely, give me paper, and love) etc.

26 March 2008

MCNP

To save me the tedium of copying and pasting energy-dependent tally data in MCNP, I wrote up a couple of Perl scripts to do practically all of the work for me. Anyone who wants to visualize data like that from MCNP output should hopefully find these scripts useful.

17 January 2008

Evolution personified

It strikes me as ironic when people personify evolution as some sort of designer. I was reading an article in SIAM News describing the complexity and mathematical modeling of finger movements, when I stumbled across this:
But nature, for no obvious reason, took a different route. Opting to locate the muscles in the palm and forearm, at a distance from the fingers themselves, evolution tinkered its way to a quasi-two-dimensional system of interconnected tendons, more like fishing net than fishing line. This decidedly nonlinear and complex solution, anathema to "reasonable" engineering design, has paid off handsomely.

In the 19th century or even early 20th century, I could easily imagine a scientific article marveling about the incredible design of the human body in the context of a divine Creator. But to use that kind of language when talking about random processes and natural selection seems kind of silly.

14 January 2008

LaTeX ANS template

Well, for those of you who want to publish a summary for the American Nuclear Society transactions (or to write an abstract for the ANS student conference) but prefer LaTeX to Microsoft Word, today I completed a class and bibliography style that are (EDIT 6/2011) now completely compliant with the published ANS guidelines. Hopefully someone will find this useful. Example files and more details are here.

09 January 2008

Grammar joke!

"Knock knock."
"Who's there?"
"To."
"To who?"
"To whom!"
(source: the internet)

Transition to new blogger

After some tedious and some not-quite-as-tedious work, I've transitioned my blog back to Blogspot hosting with the new dynamic page serving. In order to make links to my old pages (and google links) work correctly, I added this to my .htaccess file to change any links on my old blog to pages on my new blog, except to the googlebot (so that hopefully it won't lose records of where my pages are):
RewriteCond %{REQUEST_URI} ^/blog/labels/
RewriteCond %{HTTP_USER_AGENT} !^.*Googlebot.* [NC]
RewriteRule ^blog/labels/(.*).html$ http://reference-man.blogspot.com/search/label/$1 [R,L]

RewriteCond %{REQUEST_URI} ^/blog
RewriteCond %{HTTP_USER_AGENT} !^.*Googlebot.* [NC]
RewriteRule ^blog/(.*)$ http://reference-man.blogspot.com/$1 [R,L]

02 January 2008

Setting up boot camp

Today I installed Windows on my Mac. (I'll need it to run MCNP this semester.) For my reference and for your enrichment, here's a few things I did to make my new system more homey.

For Mac-Windows interoperability:To make Windows less annoying and more secure:I have to say that being able to run Windows on here is nice. Apple's job with making it compatible with the Mac hardware is fantastic: all the necessary drivers are installed by simply inserting the 10.5 install DVD into the drive. It includes drivers for WiFi, Bluetooth, the iSight video camera, and even maps all the hardware buttons (sound volume, eject, etc.) to their proper functions.

With Cygwin, I don't have to mess around with the DOS shell, and I can also use its X11 server with MCNP's (admittedly primitive) visualization.

A year with my car

It's been a year since I bought my 2001 Honda Civic.  Aside from some problems with the tires and a little routine maintenance, it's done very well.  Today I crunched some numbers regarding the cost to own the car and the fuel mileage it's been getting. Yeah, I keep all sorts of data when I fill up the car, get repairs, etc. I know, I'm a super-nerd.


Gas mileage

So it's gotten an average of 35 mpg over the last year, which rocks. Also, including the purchase price of the car, inspections, insurance, gas, repairs, etc., it's cost me $0.80 per mile. That's not bad at all.