Tue, 08 Aug 2006 15:54:00 GMT

Bizarre Build Errors

Have you ever had one problems with a build system that just seems to be inexplicable? I ran into one yesterday that nothing on Google seemed to be able to help with, so I thought I'd post it here in hopes that this might get someone out of a jam in the future. I was compiling some code for a DLL through a Microsoft compiler got these error statements:

This is editied to hide the paths and file names.

C:\somepath\dll.cpp(26) : error C2731: 'DllMain' : function cannot be overloaded
C:\somepath\dll.cpp(25) : see declaration of 'DllMain'
C:\somepath\dll.cpp(26) : error C2733: second C linkage of overloaded function 'DllMain' not allowed
C:\somepath\dll.cpp(25) : see declaration of 'DllMain'

When you look at the file:

24:
25: extern "C" BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
26: {
27:

So what should one make of this? The { is actually a redeclaration of the function? No, that would be ridiculous (and one might argue appropriately that the compiler should not give back such crazy statements). Perhaps the #defined terms BOOL, WINAPI, or maybe the typedefs were literally mistyped? No, those were triple checked. Is there a library which is being linked in before the compile phase of the file which already defines DllMain? Why didn't the compiler reference that lib then as the source of the definition?

Well it turns out that none of that is true. Instead, the term DllMain is somewhat akin to a keyword now and the compiler secretly gives you a DllMain function, which this declaration then clashes with. If you rename the function and declare the entry point of the DLL (since DllMain is suppose to be the entry) to the new name, everything works. So it goes to show that the compiler isn't acting inexplicably, just secretly (it's not telling you that it included the default function, or where it's from in the error message) and stupidly (it doesn't get rid of the default function, when clearly you want your own).


Thu, 03 Aug 2006 15:39:00 GMT

PADI Advanced Open Water

Well I'm officially a PADI Advanced Open Water Diver now. Scott and I passed the course this weekend. We did our dives at a place called ClearSprings in Terrell Texas, which is a SCUBA park. We had to do 5 types of dives, Peak Performance Buoyancy, Navigation, Night, Deep and Search and Recovery.

For the peak performance dive, I wore my full wetsuit and 12lbs of weights, along with the rest of my gear. I managed to be able to control my depth based only on the amount of air in my lungs, which is really where you want to be. However, at greater depths I was having a hard time getting just enough air in BCD to account for compression of the wetsuit.

For the Navigation dive, we had to swim shapes underwater, counting kicks or time or air usage. I've had a recurring problem with the big toe nail on my left foot (it's not ingrown, but it's pushing hard on the skin in the area, which becomes inflammed as a result) that is exacerbated by the way my fins strap on (they basically compress that toe from the front, which is really painful). I had to fix my fins a couple of times during the nav dive, which threw off my count, which threw off my shape. I also was having a problem with my ears that day. I couldn't seem to equalize them easily. It was always a struggle to get them to clear, like I had something compacted in front of the eustation tube. It's actually suprising I was able to function given that I was constantly readjusting fin or my ear during all these dives on Saturday.

The last dive on Saturday was the Night Dive, which was a lot of fun, and very surreal. I can't really describe the experience, except that it was reminiscent of being in a video game like Doom 3, where your only source of light is your flashlight and without it you have no source of reference for anything. Things tend to suddenly appear, like fish (not zombies) or rocks. It was also odd to see fish actually sleeping on the bottom. They just sort of float or sit right at the bottom, ususally on some plant, asleep, but their mouths still open and close to allow water to circulate over their gills. I'm definitely looking forward to doing some Night Dives in the ocean.

On Sunday, we started the day with the Deep Dive. ClearSprings has a special "can" at the bottom of the lake for doing the this aspect of the Advanced checkout which is just barely deep enough (given the low level of the lake and the drought here). The downside of diving in a lake is that it is freakin' cold. Scott and I both had to wear 2 wetsuits and hoods in order to be somewhat comfortable. I had a shortie 3mm under a 2/3mm full wetsuit and a 3mm hood and normal gloves. My hands were really the only uncomfortably cold part of me, owning to the thinness of the gloves. Visibility in a lake is normally awful and at ~60ft, it's basically a night dive with heavy sediment. Once we started ascending, it actually started to get a little uncomfortably warm in the upper waters. And of course, the temp above water was over a hundred.

The last dive we did was the Search and Recovery dive, which we aced. Our instructor left a weight with yellow and orange fluorescent bottles attached to it which we had to find out amoung the "hydrilla". Which permeate the bottom of the shallow areas of the lake, thus making it very hard to see anything which has sunk to the bottom (hence the fluorescent bottles). Scott and I did what we call a "comb" pattern, following the shore, and shooting out like comb teeth and comming back to the shore. We found the object, clipped on the weight bag and proceeded to overfill the bag. Well I overfilled the bag. While I was floating above it. And while I was holding on to it. So, it shot to the surface and I decided that since it was fairly shallow, it wasn't a problem to hold on to it. Once Scott met me on the surface, we resunk the bag and tried filling it correctly, but not to raise it, but just to get it neutrally buoyant and swim it back underwater, which we did.

After we finished checking out, we decided to check out the sunken plane fuselage on the north end of the lake. It would have been a better idea to get out an walk over then dive down because it was a bit of a swim, probably 200 yards, of which I think we swam between 70-100 yards under water. The plane was fairly well preserved, but covered in lake scum. Bazaarly, it (and the sunken boat in another location in the lake) was filled with tiny fish who seem to congregate in the cockpit.

Now we just need to plan a trip out to an ocean dive somewhere.


Tue, 20 Jun 2006 15:48:00 GMT

Closed on House, Open for Debt

Well it's done. I'm a home-owner/debtor/sucker now. The process was simpler than I thought and incurred less paperwork than rumoured. There was a interesting twist though, the second loan did turn into a 15yr ballon loan, which they professed is completely common. I plan to pay it off much sooner than 15 years so this isn't a problem in the long term. Neither loan had prepayment penalties, which is great since I plan on dumping a lot of extra cash into the principal during the life of the loan. I have to pick the keys up from the Title company tomorrow since the seller is won't do his signing until then because he is still moving his crap out of my house. Hmm, technically I suppose it's not mine until he surrenders title tomorrow at his signing, so I can get indignant then. I can't wait!

Thu, 01 Jun 2006 20:02:00 GMT

TES IV: Oblivion Update

I've beaten TES IV: Oblivion. 130 hours, level 30. I've pretty much exhausted all the quests except some of the Thieves Guild and the Dark Brotherhood.

Thu, 25 May 2006 18:53:00 GMT

House Buying

I'm in the process of buying a house in Plano, TX. During this whole process I've been slowly building up a large excel spreadsheet that I based off the Loan Analysis spreadsheet template that Microsoft provides. I wrapped that with some global variables and some amortization tables and the result is a nice little spreadsheet to help you understand the whole "I'm up my eye-balls in debt" thing. Try it out here. I've removed my own personal information, or at least the juicy tidbits.
Update: 06/05/2006 I've added a cool feature where you can see precisely how much money you save by paying your principal down early. Go to the bottom of the Amortization tables to see it. Enter some values in the "Add'l Principal" column to see the effects.

Fri, 05 May 2006 14:14:21 GMT

PADI Open Water Class

Scott and I are taking a PADI Open Water Certification class offered by the Texins Dive Club which is an activity club sponsered by the Texins Activity Center which is the gym that Texas Instruments, Inc. (my employeer) runs. The club is open to the public, so you don't have to be an employee to join club or to take the class. So far, I'm loving it. The sensation of sitting on the bottom of the pool is really neat (once you can get your ears to pressurize). We'll be doing our test out on Lake Murray sometime in the middle of May. We might even decide to go down to Cozumel to do some diving in July. Currently my plan is to finish Open Water then do Advanced Open Water, then Rescue, so that Scott and I can help each other incase something goes terribly wrong on a dive.

Thu, 20 Apr 2006 16:34:00 GMT

Flashback to the 1980's

I'm in a meeting where I'm using my business laptop. When I plunked it down on the table and cracked it open, it felt like I was opening one of those ancient laptops from the 80's where the keyboard sat about 3" off the table. This thing is thick, heavy and the keys feel oddly small. The screen is underwhelming and the contours of the casing are insipid. I had to remind my self that the touchpad even had a second button. I guess my macbookpro has really grown on me. ;)

Sat, 08 Apr 2006 00:02:00 GMT

Skiing in Colorado

Scott and I just got back from a ski trip with the North Texas Skiers Club in Winter Park Colorado. Overall, we had an awesome time, but that's not to say that there weren't problems.

On Wednesday we met the other club members in the parking lot of Six Flags in the afternoon. The bus was a sleeper bus, which I had never been on. All the seats are arranged around 10 tables and convert to "beds". I use a qualifier for that because it was obvioulsy not made for someone of my size. The waking hours of the trip were interesting in that we got to meet and get to know that other people at our table. However, you run out of things to talk about on a 15 hour trip. Once we had dinner at a TA center in Amarillo, we watched the Bourne Identity on the bus, while continuing our trek into the dark wastes of west Texas and New Mexico. Even though I've seen this movie before and I know how it goes, it bugged me that several people kept standing up in the middle of the flick , obscuring the TV, and obstructing my enjoyment of the movie, while they fetched cookies or drinks from the snack station, cleverly placed directly under the TV.

We "awoke" (some of us didn't get much sleep in the swaying midget-beds) to the sharp curves of the mountain pass near Winter Park. We made our seats back up (the construction of the sleeper portion of the bus is rather odd. Where 4 people sit at a table slightly uncomfortably, 4 people sleep very uncomforatably, even though there are 2 levels to the bed. Everyone changed into their ski stuff at the lodge, once we got there, and headed up the mountain. Incidently, our room wasn't ready, so we had to change in someone else's room.

The first day on the moutain was a bit icy. Most people don't like that sort of snow but since my style of skiing is more of a differential sliding approach, it wasn't that bad. As long as I had a somewhat constant coefficient of sliding friction, I did fine.

We didn't have a lot of luck on the lifts the first day. I accidenlty skied over an older guy's ski while waiting for the lift and apologized but I got the stink-eye in response. Later, Scott and I took a hard fall, while attempting to get on a smaller lift for the top of the mountain. One of us stepped on the other's ski and when the lift tried to pick us up, we both were flung bodily to the ground. the lift then proceeded to smack the back of my helmet and bang my head into the ground. I wasn't hurt (nor was Scott) but we were rather embarrased.

Later, James gave us a short lesson on the correct method to ski, which I had been ignorant of up to then. While it's hard to describe in text, it basically boils down to keeping your ski pole tips just barely skidding on the surface. This keeps your upperbody correctly centered over your feet and with your weight on the correct foot.

At the end of the day, Scott and I and most of the club retired to the hot tub. I think I stayed in too long because I later became very close to barfing at dinner. Only later in the trip did I notice the warning sign in the hot tub area which warned against this rather obvious behavior.

During my nausea stint, it started snowing again, and by morning, it had left about 6 inches on the ground.

The next day, Scott and I had a good run around the mountain in the fresh powder. Now, while I don't like powder (because of my skiing style), I did enjoying trying the stuff on the easier runs. Later, we tried Mary Jane, which is a fairly difficult blue run, with a short blue-black section. Scott wiped out on that harder area while I copped out and slide down in sideways.

At the end of the skiing day, we kipped off the local bar and had a round with the club and then retired to the hot tub again. After that, Ruben, Scott and I took off and had dinner at a local german restraunt. We overheard a conversation at another table, with 4 very old gentlemen who were talking about scientific issues with another table. One quipped "we're too old to have sex lives, so we have to talk about kelvins." When the other table asked why there were having a discussion on the topic.

On the third day, the snow had re-iced and been groomed into a very usable medium. We started late, and went straight to the NASTAR race. On the way there I managed to attain my longest continuous run of skiing that I can recall (that is skiing without stopping to rest). We lined up for the race and got our numbers. The first time I did the run I was just planning on doing the run in a technical way so that I was comformtable going fast on the second run. Well, my first run was ended up being 39 seconds but I managed to trim some time off the second run and pulled it down to 35 seconds. You had to get 28.5 to get a Bronze medal though.

Scott and I left the mountain early that day and headed back to the hot tub. I think we left just in time because the bottom of the mountain was almost all sludge. We went out again that night but the Italian place we went to was not as nice as the german place was on the previous night.

On Sunday we tooled around the downtown area of Winter Park, buying some t-shirts and stuff. We boarded the bus and set out for Dallas at about 1pm. There were some rather scenic vistas on the way back in Colorado and New Mexico but I'm not particularly good at photography from a moving bus. When we finally got back, and after Scott dropped me off at my place at 5 am or so, I just crashed until 12pm.

Since Scott took most of the photos for the trip, I'll just link to his photos.

Tue, 14 Mar 2006 16:57:00 GMT

Typo Problems on Dreamhost

Tired of seeing 500 errors in place of this blog? I know I am! I was considering updating to the lastest trunk version until I saw that the Dreamhost Install page at TypoSphere had been updated. It seems Alex Young found a way to get rid of this error by installing some custom signal processing in the Fast CGI rails code, which was originally suggested by Gary Lin. I installed these changes today and so far I've not seen any 500's. Here's hoping that it's a long term solution.

Fri, 10 Mar 2006 00:19:00 GMT

Cello Practice

I've started Cello practice, under the tutelage of a local, skilled instructor. My first lesson went well last week and I have many more planned. My first homework was to practice my hand positions. I tend to hold the neck of the Cello like a violin with my fingers at a non-right angles to the finger-board. This, I'm told, is bad form for a Cello player and will result in later problems when vibrato is practiced. I've had the week to practice this new form and I think I'm fairly comfortable with it now. I've also picked up speed with my pizzicato (plucking) and in some of my practices I've reverted to the bass guitar gate of index and middle finger when I'm trying to play too fast. This will also be bad form, I'm sure, since practically everything you pick up on your own ends up that way. I think this week we'll pickup the bow and start using it, which should be cool. I can't wait to be able to play Canon in D Minor.