peawee dot net

Archive for February, 2008

Ben Franklin was an internet junkie.

February 22, 2008 5:16 pm

Proof right here.

That is all.

iTunes headaches

February 19, 2008 2:34 pm

As you may guess, I run a mac. On the Macintosh, there really is only one music player in town: iTunes. Granted, there’s plenty others that will play music, but none that will manage it. I have enough music to make this a real issue. On Windows, there’s WMP, WinAmp, Foobar2000, and others I’m sure I’m missing. On Mac, there’s… iTunes.

iTunes follows the traditional 90/10 rule of most things Apple: do 90% of everything perfectly, and utterly fail at the last 10%. In this case, it fails at complex library management. Perhaps I’m setting the bar too high here, but Apple’s software is unable to intelligently re-build its library, based on changes to the library directory. For instance: Chip finds some music licensed under Creative Commons, and uploads it to me, directly into my music directory. On just about all the other players I’ve seen, I’m able to either re-index the music directory automagically, or even cooler, the player detects a delta between the current library index and what it sees in the directory, and rebuilds (Hello, Amarok!). As far as I can tell, iTunes does not do this. To add to the mess, on trying to import my library into iTunes fresh, it actually makes iTunes seize up about halfway through. This is rather unacceptable.

Also, it appears that it doesn’t include music that it can play but lacks metadata on. The very excellent band Everybody Else’s CD is one that I ripped to FLAC. Now, when I want to listen to them, I have to load up VLC. It’s not that I mind VLC so much, but it leaves something to be desired when working through my media collection.

My solution: once I’ve the time, hopefully I can whip up something resembling a media player for MacOS. I might, if persuaded, make it work cross-platform, but I don’t care too much about Windows, and the perfect media player already exists under Linux.

Beautiful Fortran

February 6, 2008 9:33 pm

One of my more favored software development blogs is Beautiful Code. The concept is that code that is properly elegant is going to be readable, functional, and most of all, working correctly. There’s a lot of focusing on unit testing, proper OO design techniques, and how to squeeze an elegant solution out of the nastiest conditions.

Well, I believe I have a Nasty Condition.

I hack on FORTRAN and Fortran at work, after getting out of the IT support gig. What’s the difference between the capitalizations? Easy. FORTRAN references the language pre-1990 (1950’s through to 1990), and Fortran is the more modern Fortran 90/95/2003 standards.

Fortran 90/95/2003 isn’t that bad to work on, actually. For its primary purpose (running numerical computations on hideously expensive computers), it works really well, and makes me a happy hacker.

FORTRAN helps to create ugly code. Complex looping and branching statements are much more difficult than in other languages, and many FORTRAN coders cut their teeth on it when the language was still implemented via punchcards, and “eloquent” coding meant as few cards (aka lines of code) as possible. Goto statements scare me. Gotos with literally 5-6 arguments terrify me. Did I mention that there’s limitations on line length imposed upon the language from punchcards?

The code in specific I’m working on is worse. Those working on it use no version control, so it’s full of commented-out things every which way, and it definitely dates from the punchcard era, as it lacks things like blank lines in between logical blocks of code statements. It has terrible, nonsensical indenting, and it relies heavily on subroutines acting in highly non-documented ways on literally hundreds of different, poorly named and undocumented, global variables.

Oh, and there’s a function that simply wraps ACOS(), the cosine function in FORTRAN. This is what it does:

FUNCTION ARCOS(X)
ARCOS = ACOS(X)
RETURN
END

Lovely, yes? Waste of a function to have to keep track of, yes? I’ve seen it in three different versions of the model, and it troubles me the same.

I also saw references to MS-FORTRAN 4.0 for MS-DOS in the comments. Joy of Joys. In addition, it will only compile with Intel Fortran. Portland Group’s compilers break a little bit on it, but gfortran, g95, g77, f2c, and sunf77 compilers all fail with pretty pyrotechnic displays with it.

Hopefully this stuff won’t drive me completely batty before I can understand what it does “under the hood” enough to re-write what I need out of it in something better.