Spring term has started and I've now had all my various new classes. Comps (quals) ran at the beginning of the week, and Vincent and I just sat on the sidelines and watched as all the other first-years joined in. Vincent and I don't have to take comps because we're PSM. It's just kind of odd because this term I finally start my major deviation from the normal course of physics.
I now have a proper MBA business class, which is composed of about half PSMs and half MBAs. It was kind of funny because there was definitely a bit of culture shock going on there. I thought it was going to be a lecture class, but it's another one of these case study classes which I'm not completely sold on. Still, we're finally getting some business training, which is a good thing.
I'm also in a scientific computing class as a prep for computational physics next year. The odd thing is that my department programs in Java. I don't know why. I don't know Java, but it's loosely related to C++ so I'm getting by pretty well so far. Vincent only knows Fortran so he's having a rougher time. I think I did work with some Java back in my SOAR days, but that wasn't writing code, just kicking it around until it compiled.
In my crash course on Java I'm finding out all these little idiosyncrasies Java has that make me shake my head. It is like C++, but 50 times as uppity. The structure is much more restrictive (like 4x won't be intepreted as 4 * x) and it seems like everything takes twice as many lines as C++ to express (like how declaring an array takes two lines of code instead of one). I tried formatting some numbers, and the process was to use a good sized command to format the number, but it got returned as a string, so it had to be parsed back into a number using another good sized command. It practically took up a full line just to say I wanted less decimal places. And there's some really weird stuff about how it handles objects.
I also discovered one of Java's dirty little secrets - it can't even add properly! For some reason Java can't express the number 0.1 properly. Java's proponents blame it on binary numbers, but C++ certainly didn't seem to have any problems. They claim it doesn't matter unless you're doing taxes or something, but any way you cut it I don't like it when I add 0.2 to 6.0 and get 6.199999999999 back. Not appreciated.
I'm not a big fan of Java.
As for my engineering bug, I made a major find at Borders last weekend. I found the other book by J. E. Gordon, who wrote the slightly eccentric but very interesting book on structures I like. This one (The New Science of Strong Materials, or Why You Don't Fall Through the Floor) is more about material science, but it's still good. I love the way this guy writes, these books are good reads.
1 comment:
A couple things on Java:
the 6.19999999999 thing really is a limitation of how floating point numbers are stored -- across all languages (C# has a 'decimal' numeric type that's useful for currency and maintains complete accuracy to the right of the decimal, basically by just storing two ints, one for the part to the left of the decimal and one for the part to the right. But the computation is done in software so it's much slower than with floats). Floats can only exactly represent rational numbers where the denominator is a sufficiently small power of 2 (the exponent corresponding to the number of bits in the mantissa, which for a 32-bit float is like 23). So, numbers like 6.125 can stored exactly. It's like how base 10 decimal numbers can't exactly represent rational numbers with a denominator that factors into anything but 2s and 5s.
I don't think you can do '4x' in C++... perhaps you're thinking about Mathematica?
Anyway, I'm taking a computational physics course this semester and it's a lot of fun. Ours is taught in MATLAB, which I guarantee is 100 times as uppity as Java. I feel like I want to acquire an audience with the engineers (not computer scientists, obviously) who wrote it and lecture them on what's wrong with their product.
Oh, and I bought a Garmin 60CS. The -x models had just came out before I bought mine, but they were significantly more expensive. Mine ran about $360 on Amazon.com. The barometric altimeter isn't quite as useful as I had hoped (falls out of calibration too quickly, at which point you're pretty much stuck using a slightly averaged GPS altitude which is much less accurate), so the Cx model might be a good choice for a slightly higher price point.
Post a Comment