Wednesday, August 02, 2006

Selenastrum capricornutum algae in our aquarium

SelenastrumWe started a ten gallon fish tank in our apartment four weeks ago.

For the first three weeks, our aquarium went through the standard series of nitrogen compound crises that a new tank experiences before it is "cycled", as the fish tank enthusiasts say. During those three weeks, our tank water was crystal clear.

About one week ago, our nitrite levels fell abruptly to zero, indicating that our "biological filter" was now colonized by all of the bacteria needed to complete the nitrogen cycle. As soon as the nitrite levels fell, algae began to grow. The water in our tank is quite green.

I placed a drop of our tank water on a microscope slide and viewed the contents at 150X with an inexpensive microscope I obtained in the 1970s. There I found green U-shaped algae with pointy ends. After a bit of google image searching, I conclude that the species of algae is Selenastrum capricornutum, or Selenastrum gracile.

It's fun to identify the organisms in your home. I recommend it.

Other species I have identified in my home:
  1. Homo sapiens notsosapiensis
  2. Danio rerio (zebra danios)
  3. Palaemonetes kadakensis (ghost shrimp)

Monday, April 03, 2006

Const correctness and duck typing

I am a big fan of "const correctness" when programming in C++. It permits me to be a lazier programmer, but this is a good thing. It permits me to be a lazier programmer in the same way that these other language features do:
  • Using local variables instead of global variables
  • Using formal loop constructs like "for", "while", and "do", instead of "GOTO"
  • Using iterators instead of looping with "for", "while", and "do"
  • Program to interfaces instead of implementations
It is possible to write robust computer programs using only global variables, while branching using only GOTO statements. It simply requires more discipline on the part of the programmer. I am grateful that modern languages have features that permit me to be less disciplined while still writing maintainable code. The application of "const correctness" is one such language feature that make programs easier to write and maintain. I am amazed that it does not appear in other languages that I use, such as Java and Ruby.

Sometimes Java and Ruby fanboys who do not understand what const-correctness is will assert that one can get the effect of the const keyword with "final" in Java or "freeze" in Ruby. That is utter nonsense.

On the other hand, it is possible to get some of the const effect in Java by creating separate "ConstInterfaces" for each class. Unfortunately, such interfaces do not already exist for the standard library, and I believe that it is not possible to retroactively declare existing classes to conform to a particular Interface, even if they (syntactically) already do conform. The only alternative is to create derived wrapper classes for each standard class, explicitly declaring ConstInterfaces. Even this Herculean approach will fail with the many "final" classes in the standard library. In keeping with the general ultra-wordiness of Java, the reams of additional source files and lines of code required to emulate const-correctness in Java make this approach essentially extinct in the wild.

Ruby fanboys make a big deal about "duck typing", which is a fancy way of describing a lack of static typing. Static typing means that something about the type of each variable can be determined in the local source code context. "Duck typing" is more flexible than static typing in the same way that GOTO statements are more flexible than formal loops. The one big advantage of lack-of-static-typing is that it permits languages like PERL and Ruby to have essentially zero compile time. I love the possibilities that zero-compile-time languages create. But please do not overextend this tradeoff and pretend that "we meant to do that" and that "duck typing" is somehow a desirable language feature. Put the kool aid down.

Monday, March 06, 2006

Eclipse IDE not updating to the latest version?

I just discovered that my Eclipse programming environment has not been updating itself to the latest version. I have been stuck at Eclipse version 3.1.0 for the past year. This is apparently due to a URL bug in the 3.1.0 release of Eclipse. See Ed Burnette's site for details.

Ed Burnette's view from the asylum: Eclipse updates still lag behind

(In short, add the site to your list of update sites under Help->Software Updates->Manage Configuration->Scan for Updates->Search for new features to install->New Remote Site...)

I discovered this problem when trying to create two editor windows for one source file. In Eclipse 3.1.0 editing two parts of the same file at the same time is not possible. In 3.1.2, select "New Editor" from the Window menu to create a second Editor pane with the same file you are currently editing. I am amazed that Eclipse lasted this long without such a feature designed into the original implementation.

Wednesday, March 01, 2006

Unconventional telemarketing tactics : latest telephone harrassment

Last night I got a strange phone call. At about 7:45 pm PST Tuesday Feb 28, 2006 I was having supper with my wife when the phone rang. I suspect the caller was a telemarketer. You be the judge:

Me: *picks up phone* Hello? *start counting seconds until response*

Troubled gentleman: *five second pause* *click* Hello?

Me: Why did you take so long to answer?

Troubled gentleman: Why did it take YOU so long to answer? It must have taken five or six rings for you to pick up the phone! Like I have time for this shit!

Me: Who is this?

Troubled gentleman: You are being childish, sir. *click*

It is difficult to figure out what his goal was from this short conversation. It is especially interesting that his final word was "sir". I guess some of his training must have sunk in...

It is hard for me not to feel agitated after an attack like this. Even though its importance is so small. I understand that there is no point in seething after such a random encounter, but I cannot help but obsess a little over it. But don't worry about me. I have moved on now.

Friday, February 24, 2006

SBC still owes me ten dollars

But that is not the worst of it. Not by a long shot. Agents of SBC are continuing their mission to make my life miserable.

Today, February 24, 2006, at 8:55 am, a well labeled SBC truck with license number California 5Y78601 illegally went straight from the right turn lane at Arastradero and Miranda streets in Los Altos, California, to get onto Foothill expressway. To his left was a bicyclist in the bike lane who also wanted to get onto Foothill. The retarded SBC guy made this very dangerous for the bicyclist. And also for those of us trying to legally enter Foothill from the correct lane.

I wouldn't bring this up were it not just one more episode of what must be a systematic effort by SBC to drive me insane with their obnoxious behavior. Remind me to post my essay on the horrible ordeal of trying to get DSL installed from SBC.

Friday, February 03, 2006

Getting a good "Leaf" staff in Diablo II

In the computer game Diablo II, a sorceress who specializes in the skill "enchant" is a useful support character. One of the best items for an enchant sorceress is a staff with the runeword "Leaf". You can get one by shopping at the Act II normal vendor Drognan. "Leaf" uses the runes "Tir Ral", so you need a 2 socket staff. And you want bonuses to the skill Enchant to be present on the staff.

What follows are the details of how I shop for such a staff.

You will not have to read (much) during your repeated trips to the shop. Most of the visual scanning required consists of "is it a staff?", "is it red?", and "does it have 2 circles on it?". This relieves some of the tedium of repeated shopping.
  1. Create or join a normal difficulty game, using a character that has reached Act 2, but which is no higher than level 17.
  2. Make sure that no other players are in the Act 2 town area. Otherwise you will be unable to reset the shop contents.
  3. Make sure that Drognan's shop is next to a gate to the rocky waste. This will make shopping much faster.
  4. Having faster run/walk is helpful here. Make sure you are always running (use the "R" key to toggle).
  5. Open Drognan's shop window.
  6. In each of the two "weapons" tabs, mouse over each staff that has a red background. Because Enchant is a level 18 skill, and your shopper is level 17 or lower, every staff that has the Enchant skill must be red, indicating that it is above your current level.
  7. As you mouse over each red staff, look for ones that have exactly two sockets. A staff must have exactly two sockets to hold the Leaf rune word.
  8. If no staves are both red and have two sockets, skip ahead to the "close shop window" step. None of the staves in the shop are the one you are looking for.
  9. Ignore staves with a blue name (magic). The name must be grey for the staff to hold a rune word.
  10. If the staff has "+3 Enchant" (and grey name and two sockets), this is exactly the staff you are looking for! Buy it and rejoice. Your shopping task is done.
  11. In the meantime, you may want to buy 2-socket staves with only +1 or +2 to enchant, in case you get too bored with the repeated shopping.
  12. Close the shop window.
  13. Run a short distance into the Rocky Waste, and then run back to Drognan. The shop contents will have magically reset.
  14. Go back to step 5 (open shop window), and repeat the process until you have a 2-socketed +3 enchant grey-named staff.
I have gotten about 5 leaf staves this way. You can usually get one in less than an hour if you don't waste time.

You won't be able to use the enchant skill on the staff until your character is level 18. You won't be able to use the Leaf rune word until you are level 19. So wait until you are level 19 before adding the runes. This way you will be able to use the +3 to the enchant skill while your character is level 18.

It is not possible to get a white or grey-named staff with both Enchant and Fire Mastery skills on it from a town vendor. Such a staff can only be found in normal gameplay and is extremely valuable. Keep your eyes open for a staff with these characteristics:
  1. Enchant plus Fire Mastery bonuses combined are +4 or more. (e.g. +2 Enchant, +2 Fire Mastery)
  2. Staff has exactly zero, two, or four sockets. (for Leaf or Memory rune words)
  3. Staff name is white or grey (i.e. non-magical)

Thursday, February 02, 2006

Gmail is a terrible pop server

I have put my trust in Google and forwarded most of my mail accounts to my gmail account. As part of this I wanted to use gmail as my focus of mail reading.

But I want to be able to read and compose email offline on my laptop, so I want to use a rich email client. And I want to use multiple clients on multiple computers. Gmail's feeble support for the POP protocol makes this difficult.

Here are the problems:

Gmail wants you to never delete your old mail. This is part of their "new way" of handling e-mail, and I can understand the justification. Unfortunately many POP email clients are usually configured to delete old messages from the POP server after they are downloaded. Perhaps reasonably, Gmail has decided to ignore this aspect of the POP protocol, so your messages on the Gmail server are not deleted by your POP email client. So far this is all justifiable. Somehow this has led Gmail to ignore other POP functionality in annoyingly useless ways.

I like to read my email from multiple computers, each with a current and complete archive of my mails. Using decent and reasonable POP servers such as that provided by Comcast or other large ISPs, each client is able to sychronize with the POP server, downloading only those emails which that particular client has not yet seen before. This makes me happy.

When I tried to get this same behavior from Gmail's POP server I could not. My choices seem to be as follows:

1) Each client can download every mail I have ever received at gmail at one time, including duplicates of any messages I got on that client before. This results in multiple copies of every email. This is so far beyond unacceptable that I will not discuss this further.

2) Each client can download only those messages newer than those last downloaded by ANY email client of mine. This process puts distinct subsets of my email on each client, depending upon when I connect with each one. This too sucks very very very badly.


Use a real POP server. I created another special purpose email account at Comcast. The purpose of this account is to provide a decent POP interface to Gmail. I never use this special account to send, nor to directly receive any mails. A copy of every mail that comes to my gmail account is forwarded to this special comcast mail account. My email clients now sync with the special comcast email account and all is joy and happiness.