Apparently Ann Summers (link not really very safe for work) has declared July 31st to be national orgasm day.
So go... um... do what comes naturally.
Hmm... and today was the day a very attractive friend of mine decided to randomly take a day off work too...
I'm in the process of learning to do everything I do on the computer without touching my mouse.
Why?
Well, it's very simple. For the sake of argument, let's say you can move your hand to your mouse in one second, use the mouse in one second, and then return your hand to the keyboard in one second (I think these are pretty optimistic numbers, but let's work with them anyway). Now, let's say (very conservatively) that I can type at 60wpm. That's one word per second. One word is 8 characters. Let's assume that I'm going to be using godawful complex multicharacter keystroke combinations and they take about 8 characters worth of time to punch in. That means that I finish my command in the time it would have taken me to seek my hand to the mouse.
Now, this time savings is neat, but what's more significant is that it seems to keep my mind much more focused on what I'm doing. It keeps the mental flow of writing code from becoming interrupted. I get into writing code faster and stay focused longer.
There are (of course) many situations where a mouse is a vastly superior input device. Typically situations where you are interacting with data presented in a broad 2d or 3d manner (e.g. Photoshop, 3DSMax, and Quake3A) need a mouse as input, but in these situations you tend to see people with one hand that stays on the mouse and one hand that stays on the keyboard.
I suppose the code analogy here is to batch your processing. If you sort your data so that large groups of things process through the same chunks of code you get fewer cache misses and your processor doesn't mispredict the branches, thus leading to higher performance.
It's amazing how much difference picking the right name for a method makes. In this codebase there are a number of different objects that have an Init method. For about half of these objects Init is used as something that borders on a constructor[0] and for the other half Init is something which actually performs housekeeping to get the object ready to go. All the Init methods are virtual and none of them are used in a way that takes advantage of it. I keep thinking that if we'd chosen Construct and Start for method names that there wouldn't be this kind of confusion.
Particularly this would tend to lead to all methods having a common interface of having Start with no arguments so that final initializations would be a much more uniform process.
--
[0] We often pre-allocate an array of objects and then recycle the memory. This eliminates the issues of allocation time and memory fragmentation. We've got 32 megs of ram to play with including the code, fragmentation is a very serious issue.
In programming games very important aspect to decouple your media assets from your game code. Ideally you want to keep hard coded values in your code to an absolute minimum. Developing a mechanism to indirectly refer to assets (e.g. config files that point your hard coded values to the actual asset names) allows for changes in assets to occur without recompiling code[0]. This is a good thing, it allows for a shorter cycle between tweaks, and if sufficient control is placed in the config files then you can fob tasks off on the design staff[1]. Decoupling can also allow you to abstractly specify behavior so that you can use the unique features of each platform without wrapping everything in an #ifdef PLATFORM clause[2].
[0] Generating header files from assets is not decoupling, it is evil. it works really well right up until things start changing rapidly toward the end of a production cycle when you start to associate full builds with tearing your hair out.
[1] Nothing makes a designer prioritize features faster than a phrase like "Well, you just open mysound.cfg with your text editor and change the values to whatever you like." I'm willing to put in all kinds of work to support designers, but I don't want to have to spend 16 hours tweaking between 12 flavors of I-Don't-Really-Care when I've got code to write. Interestingly, the term for this behavior is "delegation" which I suppose makes me in charge of the designers in this very limited respect... hmm...
[2] Or at least that's what I'm telling myself this as I'm looking to redesign a few components in preparation for a port.
Well, so far the move seems to have gone off without any major hitches. I had to rearrange all my equipment so that it's in a state that I like (TVs aren't very well shielded and tend to cause monitors to shake if they're placed too close together).
The new office is beautiful, we have tons of room (hopefully we won't hire too many more people) and the traffic wasn't as bad as I had feared.
So, as smoothly as everything has gone this morning I'm now waiting for the building to catch fire. But then again, I'm an optimist.
I was perusing my codebase and I noticed a number of places where virtual methods from a parent class were being masked by virtual methods from the child class (e.g. ParentClass has a virtual method foo(int i=8). ChildClass is a ParentClass and has a virtual method foo(void)).
If you have:
Child myChild;
Parent *pParent = &myChild;
myChild.foo();
pParent->foo();
pParent->foo() is not calling the same routine as myChild.foo().
This can be detected by using the -Woverloaded-virtual flag when compiling files. Note that this doesn't warn if a nonvirtual method in child masks the parent method (presumably the nonvirtual method in ChildClass would indicate that things are supposed to work the way they do).
My nethack character is still alive and is getting set up to run his quest level.
The point of an alarm clock is to wake you up at a specific time. Unfortunately, I have a knack of turning off my alarm clock in my sleep if I place it too close to me. And given how late I slept this morning it looks like it's time to move my alarm clock again.
Of course, it could be worse, the lead programmer on my project puts his alarm clock in the bathroom so that he's not only forced to wake up in order to turn the alarm off, he's also less tempted to go back to sleep after he turns it off.
Hmm... actually that doesn't sound like such a bad idea.
I think recognizing the differences between versions of nethack just might be one of the top 10 signs of terminal geekdom.
The touchstones in v3.4.1 are a nice feature. And no, I still don't like the Gnome or QT front ends (sorry, a mumak is supposed to look like a 'q'). And my favorite technique for stealing from shops? Polymorph your pet into something nasty and have him eat the shopkeeper.
Now if you'll excuse me, I'm going to go to bed before my eyes start to bleed.
One of the aspects of the English language that seems to be slowly falling by the wayside is the collective noun. So to preserve that part of speech I give you:
I went to ComicCon this past weekend. Wandered around the show floor for a couple hours. Bought a Div (Zero To Drunk in 20 dollars) t-shirt from the Penny Arcade booth. Talked with Tycho for a bit (wearing a company t-shirt rocks... now if only I was working on an announced product...)
I saw Shirt Guy Dom and Seraphim at the Megatokyo booth and picked up a t-shirt and a poster from them.
I attended a polyfoam workshop where a guy showed how to make weird sea-creature looking things out of construction foam (the insulative foam that you spray around pipes when running them through walls). He cautioned against inhaling the fumes given off from the foam, although I think that maybe it was some other kind of fumes that might have been involved in his mental condition.
Later I attended the Keenspot panel (Keenspot: almost as good as porn) and met T Campbell and Tom the Fanboy while waiting for things to begin.
The panel was a lot of fun. Howard Taylor of Schlock Mercenary fame moderated, and at various points Scott Kurtz heckled from the back of the room. Incidentally, the character Gav from Schlock Mercenary does look just like Darren Bleuel who does Nukees. Howard mentioned that he'd like to see a Schlock Mercenary game, which I would also love to see.
Best quote from the panel was when Howard Taylor was obliquely talking about financial numbers and Darren Bleuel mentioned that Howard was being very conservative in the projections. "That's right folks, you saw it here first: The guy with blue hair just accused the guy in the necktie of being conservative."
Ended the night by watching the costume contest from the party area and then driving back home.
About a decade from now an art student is going to create a movie called Building Mozilla which uses the interminable build times of a software application as a metaphor for how our daily struggle for success is ultimately made meaningless by advances in technology. If an exceptionally talented art student makes the movie he will use a second metaphor to show how true forward progress seems to always be propagated through faster yet inferior solutions rather than truly superior technology (i.e. Worse Is Better).
I see this second metaphor taking the shape of a mutant ram who is born with straight horns which allow him to slay predators, but his deformity prevents him from participating in mating rituals without killing those around him. Later the predator-free environment is devastated by unchecked population growth on the part of the non-mutant rams. In the final scene the ram starves to death while left abandoned in the wasteland left by the out of control ram population.
Of course, the hypothetical art student a decade from know can build Mozilla in 18 seconds on his computer that's the result of all of us technical folks struggling daily for the next 10 years... pardon while I have a moment of hypothetical loathing for that hypothetical schmuck.
On the bright side, Linux is awfully good at that multitasking thing.
Programming tip for the day:
Alcohol and makefiles do not mix. You are not programming faster, you are noticing mistakes slower. Actually, if my former lead programmer is any indication alcohol and any programming language do not mix.
And no, Mozilla still hasn't finished building.
I have a plant in the kitchen of my apartment that has been doing fairly well after repotting, but has recently started to develop brown patches on some of the leaves. Last night I noticed small (1/8") dark grey insects flying around the plant and crawling out of the soil. Initial research indicates these are probably fungus gnats, which are supposed to do very bad things to the roots of your plants.
Additional research indicates that if they are fungus gnats, I can either use pesticides or nematodes[0]. I'm generally against the use of pesticides[1] because in the long run use of pesticides tends to create pesticide resistant pests[2] (same reason I'm against the over-prescription of antibiotics[3]).
According to a website I found
Entomopathogenic nematodes, or EPNs, are very small worm-like organisms that make their living killing insects. The nematodes do not act alone to kill insects, rather they merely serve as a delivery service for the actual organism that kills the insect, a bacteria!
Here's how the process works: The "infective juvenile" stage locates a host insect, usually an immature form (larva or pupa) in or on the soil, then it enters the insect through the mouth, anus, or breathing tube. Once inside the insect, the nematode releases the bacteria from its gut, and the bacteria starts growing, ultimately killing the insect. While this is going on, the nematode is feeding on the bacteria and what was once the insect.
Does that make executive managers a subspecies of nematode that feed on other things?
--
[0] Technically, I could also bake the soil at 180F for 3 hours, but I don't want to risk repotting the plant again, and 180F for 3 hours might do bad things to the plant.
[1] To clarify: I'm in favor of genetically modified plants and the use of friendly insect species because I think they do a better job with less environmental impact than pesticides. The only time I ever considered joining Greenpeace involved an extremely attractive girl with red hair.
[2] This goes double for a home setting with someone likely to do a very half-assed job of pesticide application.
[3] If there is a hell, I hope there's a nice corner of it where doctors who needlessly prescribed antibiotics are slowly eaten by antibiotic resistant staph.
For the record, we did a headcount at work and everyone's accounted for. Nice to know that the company president was concerned about us.
I went outside to get my cell phone out of my car and I noticed 8 or 9 helicopters hovering in a big circle over a location about a mile from where I park. That's never a good sign. Last time I saw helicopters hovering like that they were waiting for a leaking gas main to turn into a giant fireball.
Turns out some guy plowed through a farmer's market and hit about 40 people.
That's messed up.
I was all set to be melancholy about leaving my building.
Of course last night as I was leaving work I noticed a guy passed out drunk on the sidewalk. Then I listened to some guy screaming about something around the corner[0] as I walked to my car[1]. Then I spent most of today in an 85-90F office[2]. And I think back to how a couple of developers (the real estate kind, not the C++/Java kind) have tried to tear down the abandoned building next to us and build something in it's place, only to have every one of their efforts blocked by the local residents who apparently want to have a graffiti covered building full of broken glass[3].
I can't wait to move to Westwood.
--
[0] I don't know what he was screaming about (or at). Usually there aren't people screaming and breaking things, and since we hired a security guard there haven't been so many problems with people peeing on the walls of our building.
[1] Parking in Santa Monica is awful. Not NYC awful, but if I lived in NYC I could ride the subway.
[2] I'm in the one section of the building where the air conditioning doesn't work properly.
[3] There's probably a very good reason like "It might cause additional traffic that would make my commute an entire minute longer". Santa Monica is kind of like the Connecticut of Los Angeles. If someone reads this who blocked the development efforts, do me a favor, don't waste your time telling me why the development was a bad idea, just get off your butt and do something to clean up that area and make it safe. Either that or go choke on something nasty, your choice.
I just got my pre-registration for ComicCon in the mail.
Happy Day!
Did I mention I love being on the west coast?
Every once in a while it's really useful to find out exactly what the compiler's doing to your code.
gcc -g3 -fverbose-asm -Wa,-alh main.cpp > main.lst
The -fverbose-asm lists out all the compiler flags that are turned on and dumps out some additional information about how gcc was compiled (which can be useful in tracking down those "It works on system A but not on system B" bugs).
-g3 requests that additional debugging information be generated.
-Wa,<options> passes an argument to the assembler, thus -Wa,-alh asks the assembler to create a listing file with assembly and high level source.
> main.lst pipes stdout into main.lst
main.lst now contains an annotated assembler dump of your file that can help you figure out exactly what's going on with your code.
I don't spend all day reading assembler output (even if I were so inclined, I have these deadline things that prevent me from doing so), I usually use this when I'm concerned about the performance of certain calls that might wind up in high traffic inner loops (VarArgs based functions come to mind here) or when I want to track down the behavior of a bit of code that doesn't seem to be working in a rational fashion.
And here I thought that Jesus Saves meant something entirely different.
Thanks to Kasia for the link.
It's strange. When I joined this company two and a half years ago there was talk of moving to a new location. Now we're finally we're going to move. There's a big stack of boxes in the hall a little way down from my office.
Seems surreal somehow.
I think I'll make an effort to walk on the beach at least once a day while we're still here.
Oh, the interesting things you run across while researching the perfect gift bottle of alcohol:
On March 7th, 1997, the law against Poteen production was dropped. Legitimate brands became available. For many people, although the commercial brands are legal, they are still tempted to the illicit spirit. Although we don't recommend you try any, guidelines are available from the web which tell you how a drinkable but illicit Poteen is spotted. "Simply set fire to the spirit. If the flame is purple, it may be safe to drink" (although the word "may" should be taken lightly in this context). "If the flame is red, dispose of the liquid". Another old tale regarding Poteen was to put a mixture of half Poteen and half milk into a tablespoon to see if the milk curdled - if it did, the Poteen should be thrown away.(from irish-poteen.com)
I think I hold off on illicit Poteen until I've had all the children I'm going to have and have had that vasectomy.
There's an interesting distinction between a game having 3d art assets and a game having 3d game play. A game like Pikman could be done with an abstracted 2d top-down map (I'm not saying we should do it, but rather that the gameplay is not intrinsically dependent on the world being 3d). Nethack oddly enough has a 3 dimensional world where you can tunnel through the floors, levitate, etc. Not that this is a criticism of Pikman (which I enjoyed immensely), it's more of a conceptual benchmark.
It seems like people (or at least myself and some of my coworkers) can process spatial data faster in a 2d format. This means that as the gameplay becomes more 2d it's possible to have a player cope with more complex situations in less time. It becomes a tradeoff, depth for speed. Neither one is "right", but it is something to bear in mind while creating a game.
My car is mocking me.
No, really.
A little over a week ago I hit a bump on the highway which caused something to go strange and produce a sound like two pieces of metal rubbing together at high speed (the pitch of the noise tended to change when I used the brake). I'm not an expert at auto maintenance, but this struck me as a BadThing(tm), so I stopped driving it until there was a happy coincidence between when I had enough time to go to the garage and the garage was actually open (the 4th of July weekend caused problems with that). Monday was the first time this happy coincidence occurred, so I got up early(ish) and went down to drive my car to the mechanic's.
No rubbing noise.
Tuesday morning: no rubbing noise.
Tuesday evening: it's determined that I have to come in very early to perform a core library upgrade on our project, so I won't have time to go to the mechanic's this morning. So naturally the moment I get in my car the noise returns.
It's mocking me. I can tell.
I know at some level that it's probably changes in air temperature and humidity that are causing parts to slightly realign and behave improperly, but then again when I worked in the computer lab at UIUC I did have a reputation for having intimidated all the equipment into working properly. So, I guess that for better or worse, animism does make up some of my core belief structure.
Now, if you'll excuse me I need to go swear at my computer for taking so much time to add these library files to source safe.
A little while ago (after reading Kasia's entry on browsers) I decided to give MozillaFirebird a try. So far it seems to be lighter weight and faster than Mozilla. The only annoying thing has been finding out which applications have their own copy of the command to launch Mozilla and changing them over to launch MozillaFirebird.
One of the best things about tools that are written to function as small components in a chain (as opposed to monolithic tools) is that if the behavior of one tool in the chain changes you can do something to compensate for it.
I've been cleaning up our toolchain and discovered a slight difference in the way two versions of gcc deal with concatenation (##) directives in the preprocessor phase[0]. The previous version allowed you to do things like:
#define FOO_V w
#define FOO_ADDR 72
#define LQ_VAR(var, reg, ptr ) LQ.##var##_V reg, var##_ADDR(ptr)
NOP LQ_VAR( FOO, VF03, VI00 )
which would preprocess into:
NOP LQ.w VF03, 72(VI00)
However, the compilers from the cleaned up toolchain kindly decided to pad output with whitespace producing something like:
NOP LQ. w VF03 , 72 (VI00)
which was fine, except that the assembler got confused by the whitespace between the LQ. and the w. After a couple hours of research and experimenting with compiler flags[1] I was unable to find a setting that produced the original behavior.
Fortunately, gcc is good about outputing to stdout, so all I had to was change the makefile from
$(AS) $(ASFLAGS) $< -o $(OBJDIR)/$<.foo
to
$(AS) $(ASFLAGS) $< | $(SED) 's/\. \([xyzw]\)/.\1/g' > $(OBJDIR)/$<.foo
$(AS) is gcc, $(SED) is sed[2], all the tools are set up as variables in Make and all pathnames are fully qualified in order to prevent versioning problems. It's actually less of a hassle to keep all your tools under source control than to get everyone on the team to maintain identical toolchains on their own.
[0] Note: I don't code like this.
[1] I believe the technical term for this is 'Futzing'.
[2] For those that don't know, sed is one of a number of older languages that have syntax that make you really appreciate how clear most perl code really is in the grand scheme of things.
Well, we haven't migrated to perforce yet, we are re-negotiating contracts with the publisher. Can't wait to see how this one pans out