Tutorials

By Shamus Posted Tuesday Aug 8, 2006

Filed under: Rants 6 comments

A coding rant follows. It’s not for everyone. Or anyone. I’m just venting.

Last week:

I need a library to compress zip files. (By library I mean a .lib or .dll, I didn’t need a PROGRAM to zip files. I’m writing the program, and zipping files is a very small but very crucial aspect of what this program needs to do.) I need it quick. Money no object. (I’m not the one paying for it.) A quick Google search reveals that there are many, many out there. What hampers my search the most is that nearly all of them are documented by absolute stooges. To wit: When you write an example program demonstrating how to do such-and-such, you make that example as clean, uncluttered, as simple, and as short as possible. You do not make a production-grade program with dialog boxes and some convoluted MFC interface, a splash screen, an about box, or anything else that is not directly related to the task at hand.

I see this all the time and I can’t imagine what sort of imbecile would go to so much trouble to make something so useless. Several of the “example” programs I reviewed were many pages of C++ code, usually spread out over several modules and employing various elaborate class interfaces, and somewhere in what soup were the half-dozen lines of code that interested me and would show me what I needed to know.

Incompetence

Imagine if you had a tutorial for how to hammer a nail:

  1. Lengthy description of how to obtain the blueprint for a house
  2. Directions for how to select and prepare the building site.
  3. Long list of the tools needed. Somewhere in this list is buried the information about the hammer and how to use it.
  4. List of building materials. Somewhere in this list is a description of nails and how to hold them.
  5. Assemby instructions. Somewhere in here you might find instructions on how to arrange the two pieces of wood you’ll be nailing together.
  6. Instructions for adding a roof.

All of this comes in a hundred-page bound volume titled, “How to Drive Nails”.

This is one of the reasons I never bothered to learn DirectX. There was never a lesson on how to hook up with DirectX, start rendering, make ONE polygon, and then close DirectX. No, the tutorials were bloated, messy, and so confusingly written that I couldn’t tell which parts were DirectX calls and which were parts of the tutorial. Layers and layers of obfuscation were built up around function calls with confusingly similar (and painfully LONG) names.

Hmmmm. Am I supposed to call:
DirectXRenderTimeToDrawASinglePolygonPrettyPlease ()

or:
WowICouldReallyUseADirectXPolygonRightNow ()

No, both of those just turn around and call:
DxPolygonReadySetGoRender ()

Which in turn calls…
DxGimmieATriangle ()

But that’s just a container for… Um. Geeze. Forget this. I’m about ten levels deep and suffering from a personal stack overflow. I forget what I was even looking for when I started tracing through this mess.

(On the other hand, if you want to do a little rendering with OpenGL, NeHe is stellar. It starts with simple concepts (how to hammer a nail) and adds things one tutorial at a time, until you have everything you need to build a house. The tutorials are simple, as short as possible, and many are even cross-platform.)

So what happened with the zip library? I found one with a simple tutorial. The entire program would fit on one side of a single piece of paper. They also had the fastest, smallest external library out of all that I reviewed. I am of the opinion that all of these advantages are related. (The coders knew what they were doing.) As a bonus, the library as was also the cheapest. Amazing.

 


 

The Procedural World, Part 1

By Shamus Posted Monday Aug 7, 2006

Filed under: Programming 38 comments

Via Augury I found out about .kkrieger, a first-person shooter game which is only 97k in size. That means the entire game, sound effects, graphics, code, and everything, all within 97k. That is preposterously small, yet the game still looks quite good and at first glance it can pass for a cutting-edge shooter.

.kkrieger Screenshot

Continue reading ⟩⟩ “The Procedural World, Part 1”

 


 

McCulture

By Shamus Posted Monday Aug 7, 2006

Filed under: Random 5 comments

Saturday morning, McDonald’s. The same McDonald’s where I met my wife, in fact. I’m sitting with the family enjoying a very greasy and heart-impeding breakfast. The music this morning is a collection of expired pop music from the early 60’s. There’s some Beatles and maybe an Elvis in the mix. A doo-wop song floats by harmlessly. People have been hearing this stuff in grocery stores for years and have learned to tune it out. The music is only there to keep the place from being to dull and quiet. It’s just a low-level murmur of notes so that people can talk without their conversations overlapping with those going on at adjacent tables.

Then LA Woman by The Doors comes on. The music doesn’t really fit on a sunny August morning in western PA, but it does not cause a scandal. The old timers – men who were middle-aged when the song was still on the charts – take no notice. None of the mothers present clamp their hands over the ears of their children. Nobody is shocked. There is nothing surprising about hearing something like this piped into the restaurant. I mean, it’s just oldies. Right?

Drive Through
Drive on through to the other side! Drive on through to the other side!

It’s a very strange thing. LA Woman came out the year I was born – 1971. The Doors were considered to be very edgy and subversive at the time, or so I’m told. The song certainly wouldn’t have been played in a McDonald’s back then. It still doesn’t really fit in the red and yellow plastic clown world of MickeyDees, but nothing short of circus music would suit the atmosphere of that place. Although the lyrics haven’t changed and the tune is the same, it has been rendered somehow “family friendly” simply by aging.

I also realized: Thirty years from now I’ll be sitting in a McDonald’s somewhere and nobody will be surprised when Marlyin Manson comes on.

 


 

Useless Stats by Hour

By Shamus Posted Sunday Aug 6, 2006

Filed under: Projects 3 comments

I’m fiddling around with my WordPress plugin and I added a feature to show posts sorted by what hour of the day they were posted, just because I wanted to see what that would look like. Of course, I already had an idea of what it would look like before I wrote it, and I was quite confused when what I made didn’t match my expectations. Geeks are funny that way.

I most often post either during lunch, or when I knock off work between 5pm and 6pm. So, what I expected to see was a mostly flat grid, with a spike in the noon hour, and then another spike at 5pm. What I got was…

Posts by Hour

This shows how many of the blog’s posts are published by hour of the day. This can be useful to see what time of day sees the most posting activity.

Midnight: 7

(1%)

1:00: 2

(0%)

2:00: 1

(0%)

3:00: 1

(0%)

4:00: 0

(0%)

5:00: 3

(0%)

6:00: 5

(1%)

7:00: 9

(2%)

8:00: 13

(2%)

9:00: 5

(1%)

10:00: 20

(4%)

11:00: 55

(12%)

Noon: 50

(11%)

13:00: 19

(4%)

14:00: 19

(4%)

15:00: 13

(2%)

16:00: 53

(12%)

17:00: 43

(9%)

18:00: 30

(6%)

19:00: 29

(6%)

20:00: 21

(4%)

21:00: 12

(2%)

22:00: 19

(4%)

23:00: 10

(2%)

Have I been taking long lunches? Quitting early? Why are half of my lunch posts at 11am and the other half at noon? I could understand if they were all shifted forwards or backwards in time, depending on what time zone the server is in but…

<forehead slap>

Daylight savings time. Obviously the server is not taking part in the great American temporal hallucination that is DST.

I work from home, and my wife homeschools our children, so DST doesn’t really affect our lives except to annoy me twice a year.

 


 

Mel Gibson’s RAGE?

By Shamus Posted Saturday Aug 5, 2006

Filed under: Pictures 3 comments

Just spotted this ad on Fox News:

Mel Gibson Stoned

First: I realize this story has been beaten into the ground. Days after the story was over and normal people had moved on they were still trying to milk it: “What do our readers think about what Mel’s therapist said about the Jewish reaction to the Catholic Statement responding to the press release from Gibson’s publicist on the police report of Mel’s original drunken tirade?”

But just what is going on there? Look at that picture. Mel’s Rage? In that picture he looks thoroughly baked, man. His body language suggests he’s describing the size of the bag of Cheetos he wants to eat right now. If they describe this photo as a rage then I can’t imagine what they would think of one taken while he was wide awake. Are photographs of Mel Gibson so rare that this is the best they could find to go with the “rage” headline? They couldn’t even get their hands on one of him mildly peeved?

My caption would be: “Mel Gibson mellows out using herbal remedy and could totally go for a huge pizza right now.”

Guess that’s why I’m not a journalist.

 


 

Link to someone new

By Shamus Posted Saturday Aug 5, 2006

Filed under: Nerd Culture 1 comments

  • Despite the success portrayed in this instance, I still maintain that if you are going to attack someone you should not use your face to do so.

  • Here is a cool meme that got a bit out of hand: A Blog Tour of Homes. Like all the best memes, it might seem a bit obvious and pointless at first, but then turns out to be quite interesting. People run around their house and take pictures, post them on their blog with some (hopefully) brief descriptions, and then you get to have a look around the place. It’s fun to see these different homes and the different ways people live. I found it strangely compelling. Unless you’re some sort of salesman or peeping tom, you usually don’t geet to see inside of a lot of different houses, so this was interesting. My wife has our house in the list somewhere.

  • Scott Morris at SUSE Blog has made his book “The Easiest Linux Guide You'll Ever Read – an introduction to Linux for Windows users” available for download. It’s aimed at the total newbie. Brilliant. My wife used Linux for a while and it has a lot to offer the tired Windows user, but those first few steps are brutal. Any move in this direction is a good thing in my book. (Although I do hope the book is more pithy than the title!)
 


 

Site Pal

By Shamus Posted Saturday Aug 5, 2006

Filed under: Links 4 comments

I’m sure some of you have noticed this ad on Technorati:

It’s a very gimmicky talking ad. The problem is, it starts talking when the ad is loaded. I thought we learned this lesson back in the dot-com dark ages: Nothing will send visitors fleeing from your site faster than having ads yammering at them while they are trying to read. It’s infuriating. LATER: I reloaded the ad a few times since then and it now stays quiet until the user provokes it. Looks like it was either a fluke or they wised up and make the ad quiet by default.

Anyway…

I bring this up because I find voice synthesis facinating. Like flying cars, this was one of those technologies we were supposed to have by now. And yet, for almost twenty years the technology stalled. It wasn’t until the last couple of years that I’ve started to hear voices that were notably better than the ones from the late 70’s. Voice technology progressed to the point where you could understand the computer if you listened carefully, but didn’t get much better after that. I’m not sure what has got the technology moving again. Is it the availability of faster computers and more memory, or simply renewed interest in the subject?

Continue reading ⟩⟩ “Site Pal”