Skip to content

{ Author Archives }

STL lower_bound on lists four times slower than naive algorithm

Here is a comparison between the naive lower bound and STL’s version. Execution time reported in seconds was measured using the Windows high resolution timer. An STL list of integers 1-N was created by populating a vector, shuffling it, pushing the elements onto a list, and sorting the list. This was done so the list […]

Visual Studio 6.0 list::sort erases some elements when more than 32767 are present

Update: This is a known bug. In the process of gathering my data for the next post in the stl lower_bound() series, I ran into some weird timings. Basically I was seeing a linear increase until there were 32000 elements in my list, and then at 33000 the timing suddenly dropped by a factor of […]

Analyzing STL lower_bound: why does it iterate the whole list twice?

I criticized an STL algorithm in a previous entry, calling it “unintuitive but correct.”. That’s pretty arrogant of me, considering the STL has been published for fifteen or so years. You’d think that if an STL algorithm were incorrect, someone would have noticed by now. Or taken differently, STL doesn’t need an obscure blogger’s approval. […]

Tagged

Unintuitive (but correct) STL lower_bound algorithm

When I was looking for a C lower-bound algorithm — after I wound up writing it myself — I realized that there was an implementation in STL. A Detour into STL STL, in case your programming life is lived under a rock labeled “C#”, is an awesome set of template routines for C++, for having […]

Starting up a software solo practice

When I started contracting, I had just dropped out of grad school and was doing everything on a shoestring. I think we took an advance on my in-laws credit card just to buy me a machine, and my wife (who was still a grad student at that time) bought Visual Studio 6.0 Professional Edition at […]

Using precompiled headers in Visual Studio 6

I only learned how to use precompiled headers recently — even though I remember reading this paper about how to do it back in the late 90’s. It seemed like too much effort, then, and my then-blazing fast Windows NT 4.0 machine didn’t seem to need the help. Somehow, ten years later with a dual-core […]

Tagged

Why I hate python

I recently wrote a small internal program in python to automate our client’s builds: run everything overnight, collect the output, and generate some rudimentary web pages It wound up being 250 loc for the program, split into about three files; and 500 loc for the tests. I spent about 2-5 days on it, part time. […]

Tagged

When backslashes attack (or: rsync sucks)

We use BackupPC for our backups, both on our site and at $CLIENT. It’s a great onsite backup tool, really brilliantly done, and I recommend it to anyone who has small office multi-PC backup needs. BackupPC can connect to clients in a variety of ways, the most useful being rsync and SMB (windows networking). All […]

Tagged , ,