Programming: Ever wonder if...?

…it’s all just smoke and mirrors? Ultimately, any program running in 99% of the computers out there today is running the old fetch-execute cycle on a Von Neuman architecture: A processor fetches the next instruction, executes it, stores the result, and goes to the next instruction. Atop that, we’ve layered: Subroutines, Modules, Functional Programming, Structured Programming, Object-Orientation (Objects, Inheritance, Polymorphism, Composition/Aggregation), Closures, Atoms, Processes, Multithreading, Semaphores, etc. We’re desperately trying to make the digital computer be more than the sum of its parts, just as a living human brain is somehow more than a collection of neurons and synapses. We *desperately* want abstractions…need them, in fact. ...

2008-05-16 · 2 min · Harold Combs

Programming: Ever wonder if...? (Comments)

the word “lossy” in scrabble? Whitney - May 5, 2008 the word “lossy” in scrabble? No, it’s the antonym of a(nother) jarg… HarryC - May 5, 2008 LOL! No, it’s the antonym of a(nother) jargon word–lossless, which comes to us from the world of compression. “Lossless” compression (like the Huffman coding algorithm in WinZip/Gzip) remove reduntant sections to make data smaller, but they can decompress back to a bit-by-bit replica of the original. ...

2008-05-16 · 2 min · Harold Combs

Review: Kubuntu 8.04 (Hardy Heron)

It’s been a few years since I tried out a new version of my favorite Linux Distribution (ubuntu), so I downloaded the 64-bit ISO and put it on my 3GHz AMD64 Dell box here at work. The short version? It’s sick. Good sick. SIIIIICK, yo! In prior lives (back when I ran Redhat 6 on my 866Mhz PIII in college), I was a KDE fan, so I grabbed Kubuntu (KDE + Ubuntu, get it?) instead of the Gnome-based Ubuntu this time. It’s flashy and fast, and includes the new KDE 4 GUI. Nice *enough*, I suppose. Having programmed in Qt once upon a time, I have lots of respect for the GUI paradigm that Qt & KDE enforces. ...

2008-05-02 · 3 min · Harold Combs

Review: Kubuntu 8.04 (Hardy Heron) (Comments)

Nice review! I may just try KDE sometime, but unti… Ryan - May 5, 2008 Nice review! I may just try KDE sometime, but until then, GNOME’s just fine.

2008-05-02 · 1 min · Harold Combs

Anatomy of Software Applications

This is kinda “duh” stuff, but here goes: What does all professional software have in common? What attributes do all non-trivial programs share? When you’re in school and you write assignment programs, often, they’re command-line, single-execution processes. These toy programs exist as drivers for some concept you’re trying to grasp–string operations, numercal calculations, or Object-Oriented programming. An example might be: “Read a file that contains a maze and print out the steps to find the exit as coordinates.” ...

2008-04-15 · 4 min · Harold Combs

Synchronization, Windows style (overview)

Professor Djikstra–Mister Syncronization! So, I’ve been doing some heavy work with multithreading on windows lately, and I must say I’m impressed. Win32 went whole-hog for the multithreaded model, and has great Kernel support for some very useful primitives: If you want to work within your process exclusively, you have Critical Sections, which give are ways to ensure only one thread is executing in a code block at any one time. Nice, but nothing too exciting. ...

2008-04-09 · 2 min · Harold Combs

Meta: On version-control techniques

I’ve been thinking alot about version control lately, because we’re undertaking a big move from Clear Case and it’s Unified Change Management (UCM) process to Subversion, which is the source-control equivalent of the Wild Wild West–anything goes, wheee!! Meetings were held, proposals submitted, cost advantages debated, and finally the Big Muckety Muck cowboyed-up and made the call–we’re going to subversion and saving a gagillion dollars. As with many such decisions, this was communicated to the worldwide distributed sites with the utmost care, forethought, and consideration. That’s right–it was 13th out of 15 slides in a Powerpoint deck. Aforementioned plebians reacted with anything from curiosity to outright rebellion. ...

2008-02-07 · 4 min · Harold Combs

Thoughts: Approaches to encapsulation

One part of programming I enjoy is the creative process–taking a thing you’ve sketched out on a whiteboard, and making it come alive. Once you’re at this long enough though, you start to see common problems crop-up, no matter what problem you’re solving or what language you’re solving it in. I’d like to think through one of those today (or at least start to…) The problem is, I can’t really give a snazzy name to the problem itself. When you’re dealing with multithreaded programming, you can say “I have concurrency problems,” and someone in the ether will grok what you mean. When dealing with GUIs, you can talk Model-View-Controller (MVC) all day. As my friend Chuck would say, what I have here is a “meta” problem–a problem about a problem. ...

2008-01-28 · 5 min · Harold Combs

Scary thought for the day...

As a programmer, should it bother me that I’m beginning to think of Windows as a well-documented, flexible system? One that’s not-too-awful to program in? I beginning to understand why Rana found Java so jarring…documentation varies in quality and it’s all over the place. With Windows, MSDN is your friend :D (Note: I don’t find windows secure, consistent, or all that well-designed, but after reading Raymond Chen’s excellent “The Old New Thing” it’s easy to see why the sins of Windows 1.0 through 3.11 really affected the designs of Win32, leading to many gaping kludges and security holes.)

2008-01-24 · 1 min · Harold Combs

Rant: MFC is DLL Hell...

For my pal Jamie: GUI programming is hard. So, the big marquee part of Microsoft Visual C++ has been the “Visual” part, where you draw-out your lovely dialog boxes using a GUI creation tool, then the IDE generates the code & and resource files from that. Okay, so far so good, but I spent most of this morning trying to get this little MFC app I’m upgrading to run as a static EXE instead of a DLL-linked EXE. That would mean the EXE would be a little fatter, but we could ship it without the associated MSVCRT.dll and MFC42.DLL, reducing a point of failure if those files get lost or damaged. It’s a win-win, right? Everyone benefits! Bonuses galore! ...

2008-01-23 · 1 min · Harold Combs

Heresy...Firefox has jumped the shark?

I’ve been with Firefox ( originally Phoenix, then Firebird, forked to IceWeasel) for years now. Yes, it was the chip off the old block (Son of Mozilla, rise!), and it was build upon Good Code©, and it bore no hint of That evil corporation that won the browser war by not playing fair It was the best parts of mozilla, with none of the bloat of the suite (that email program that no one used) ...

2007-12-06 · 1 min · Harold Combs

The "Real" Software Development Lifecycle...

If you ask a student out of college or technical school how software is developed, he’ll say the software development lifecycle (SDLC) is something like: Gather requirements for a new system Design the new system’s inputs, outputs, screens, etc. Develop the system Test the system Deliver the system to the customer Maintain the system If you’re *really lucky* he’s read enough slashdot to know, it’s more of a spiral or iterative approach–less initial work, more testing, earlier customer involvement. ...

2007-11-27 · 2 min · Harold Combs

The "Real" Software Development Lifecycle... (Comments)

I think you’re right (and I live in the same world… DavidJarvis - Dec 3, 2007 I think you’re right (and I live in the same world). One question is, how are companies like Microsoft making this sort of thing work? (I guess that presumes you accept that they are, as I do.) How do you “ride the nerd” to success and avoid the bloated remnant product? (Sort of like a lot of TV shows’s second season …) ...

2007-11-27 · 1 min · Harold Combs

RegisterForPrintAsyncNotifications

I write this in hopes of saving you some time, if you’re looking at MSFT’s new RegisterForPrintAsyncNotifications API (new in Vista and Server 2008). At first glance (and second, and third) glance, this API doesn’t seem to work. It promises to provide asynchronous notifications of state changes to the print objects in the spooler, but how the $#@^ does it work? Let’s look at it more closely. (It’s defined int he file prnasnot.h, if you’ve got your sdk handy. ...

2007-10-16 · 3 min · Harold Combs

RegisterForPrintAsyncNotifications (Comments)

I am using the AsyncUI sample code provided with t… Sangeeta - Apr 4, 2008 I am using the AsyncUI sample code provided with the printer samples. The AsyncUIMessageBox displays correctly on the server when the printer is installed as the local printer on Vista. I cannot get the message box to appaer on the client PC though. The RegisterForPrintAsyncNotifications function on the client PC never returns when a remote printer name is passed to it. The documentation(http://msdn2.microsoft.com/en-us/library/aa506182.aspx) suggests that a local/remote printer or server name can be passed to this function. ...

2007-10-16 · 1 min · Harold Combs

Rumination on calling conventions

Back in the dark ages of 1998, I took my first programming class. As was the style of the time, the class was taught in Pascal, a language Nicklaus Wirth designed explicitly to teach structured programming concepts. Think of Pascal like an advanced jet trainer: They teach you all the cool stuff with it, before they turn you loose in the F-15’s to wax some MiGs. Anyway, Pascal had some neat concepts and quirks, one of which was the way it made a distinction between ‘functions’ (subroutines that returned data) and ‘procedures’ (subroutines that were passed data and operated on it). So, for example, you might have a function called ‘double’ that took an integer and returned that number times 2: ...

2007-08-22 · 3 min · Harold Combs

Neat little C++, templatized command line parser

I’m writing some toy apps that integrate with our libraries, and so I was looking for a good, Windows-compliant version of GNU Getopt. Cygwin has a version, but that ties me to the cygwin installation (I think…) Anyway, Getopt is straight POSIX C, and googling around I found this C++ .h called TCLAP it’s well documented and implemented as inlines in the tclap/CmdLine.h. Seems very similar to the ruby ‘optparse’ module in spirit and implementation.

2007-08-21 · 1 min · Harold Combs

Neat little C++, templatized command line parser (Comments)

hello my name is harold and i like to spend my tim… Whitney - Aug 2, 2007 hello my name is harold and i like to spend my time inventing my own language and pretending other ppl know what I’m talking about…. No! I don’t want to go on the cart! Bring out yer dead lollercart ...

2007-08-21 · 1 min · Harold Combs

Getting up-to-speed in the new reality...

Ah, so two weeks have elapsed of my new job, two weeks that skated between elation, boredom, fear, and frustration. It’s a whole different world over here. Some people like it, some people don’t. Me? I’m withholding judgment for now. I do like my team–they seem like quiet, competent, hardworking folks. They’ve been helpful to a total outsider in all senses of the word–an old unix + java wonk who’s now playing in the world of C/C++ and Windows. ...

2007-08-17 · 2 min · Harold Combs

Win32 in a nutshell

Link So, basically: Create a struct to hold your class. Create a Window struct. Enter your event loop and process events That’s kinda it…The rest is a bunch of nasty #define’s and macros Windows has built-up.

2007-08-13 · 1 min · Harold Combs