Time to Move

I’ve been hosting this blog with an inexpensive hosting provider with the idea that I would use the same account to develop some ideas for web sites. Unfortunately, I have not had the time to work on some of those ideas so I’ve decided to move this blog to a free hosting service. If you subscribed through feedburner, I have already switched the feed to the new URL so you shouldn’t see this post anyway! Otherwise, you can reach the blog at: http://tlzprgmr.wordpress.com

Update: If subscribed to this on Google Reader, there are now two blogs named “The Lazy Programmer”. You need to subscribe to the other one and unsubscribe from this one. Sorry for the confusion.

OpenDiff/SVN command line shortcut

For cross-platform projects, I switched from using XCode to TextMate and CMake. I found this to be a more productive environment for me but I miss the OpenDiff integration that’s built into XCode. Most of the time svn diff is all I need, but for more complex changes the visualization provided by OpenDiff makes life so much easier. Read more »

Dynamic C++ Update

I’ve been tinkering with my Dynamic C++ project on occasion in order to get it to build successfully under OSX without much luck. Most of it built just fine, but there were a bunch of places where the boost::variant::apply_visitor() function was giving me all sorts of grief.
The original problem was that I was passing an instance of a locally defined struct as the functor argument to apply_visitor(), such as:

unsigned int var::count() const {
    struct count_visitor : public boost::static_visitor<unsigned int> {
        unsigned int operator () (null_t) const { throw exception("invalid .count() operation on $"); }
        unsigned int operator () (int_t) const { throw exception("invalid .count() operation on int"); }
        unsigned int operator () (double_t) const { throw exception("invalid .count() operation on double"); }
        unsigned int operator () (string_t s) const { return s.ps->length(); }
        unsigned int operator () (list_ptr l) const { return l->size(); }
        unsigned int operator () (array_ptr a) const { return a->size(); }
        unsigned int operator () (set_ptr s) const { return s->size(); }
        unsigned int operator () (dict_ptr d) const { return d->size(); }
    };

    return boost::apply_visitor(count_visitor(), _var);
}

Read more »

Dynamic C++

A while back, I started building a PDF parser in C++. I had been using the Adobe PDF IFilter to extract text from PDF files in order to index the content, but I wanted to be able to be able to also extract formatting information so I dug into the PDF format. The PDF format itself is fairly easy to parse, but the contents can be quite complex.

The PDF format consists of a series of objects, expressed in a simple syntax based on PostScript. There are primitives such as strings and numbers, and there are collections (arrays and dictionaries) which can contain both primitives and containers. You can see how things quickly become complicated when you have dictionaries containing arrays containing other complex objects.

Read more »

<XAML fest>

I just finished XAML fest, a two day introduction to SilverLight, XAML and Expression Blend.  The event was held at Microsoft’s New England R&D  Center in Cambridge,  Massachusetts. The class centered around building a small web app using SilverLight. A lot of time was spent learning how to use Blend to build user interfaces.

Having spent a good portion of my career building Windows apps, I’ve had the opportunity to create UIs using the Win32 API, OWL, MFC, WTL and wxWidgets. I’ve dabbled in WPF but never did much with it since I’ve been spending most of my free time tinkering with Cocoa and Cocoa-Touch. What I really like about using XAML is that you can lay out an entire interface, including a lot of behavior without writing a single line of code.

Read more »

Next Page »