Nixon Meets Robocop

Nixon meets Robocop

I mentioned this picture once before, but I thought it deserved another outing. The reasons are clear:

  • It contains Robocop
  • It contain Richard Nixon
  • It contains Richard Nixon meeting Robocop
  • Richard Nixon looks amazingly happy
  • Robocop looks a little perturbed
  • The logo behind them is for The Boy Scouts of AmericaBoys Clubs of America

While you are enjoying the image, I hope you realize that somebody back in 1988 ruined their health smoking the amount of crack required to dream up and organize a meeting between disgraced former president and the star of an R rated film at a children’s event.

The Boost C++ Libraries Intermission – Getting Boost Used

A former colleage of mine (Hi Nigel!) frequently wore the greatest geek tee-shirt I have ever seen to work. Ineptly reproduced here, it summarizes the realities of software development – when deciding what to implement technical considerations are often overruled by more prosaic influences.
9-layer-osi

Take this comment by another old colleage. It is a example of how a lot of companies fail to exploit the huge amount of well-tested code available for reuse. There are lots of reasons why a company might ban boost, in my opinion none of them are that compelling.

The main reason cited is the fear of legal retribution (before continuing, I should point out that I am not a lawyer and the following is not legal advice.)

More than one company has been stung by employees including code they do not own into a commercial product, even accidental violations can attract huge penalties with big companies being particularly at risk. This has resulted in a climate where a company will pass every decision on third-party libraries through their lawyers. Lawyers by nature are cautious, they live in a world of contracts, indemnities and assigned liabilities. The default answer is almost always going to be “no” unless there is a contract to sign and someone to blame if it goes pear-shaped.
Continue reading

The Minimum Wage vs. The Edict of Maximum Prices

I see today that the minimum wage is going to rise from $12 to $12.50 this year. This is something I support, not only to keep up with inflation but also because it puts more money into the lowest section of the economy – always a good move in a recession.

coinThe minimum youth wage is going away, also something I support if only to stop the half-baked student protests that used to break out occasionally. Instead there is now a “new entrant wage”, which is almost the same thing but will mostly apply only to students in part-time work. 16 and 17 year-olds in full-time work will quickly step up to the full minimum wage. I can’t imagine this will stop young workers getting exploited, but it is a step in the right direction.
Continue reading

The Boost C++ Libraries Part 4 – boost::date_time

Living on a spherical planet can sometimes be a real pain in the neck. It makes what should be a simple concept, Time, inordinately complex. Timezones, daylight savings, leap years (and worse: leap seconds) all conspire to destroy any simple abstraction. So boost provides a complex one.

First up is the gregorian::date class, which specifies a day in the gregorian calendar (sorry fans of the French Revolutionary Calendar, boost::date_time is not for you). Along with normal days, gregorian::date supports positive/negative infinite dates as well as a special not_a_date_time value that make certain algorithms very easy.

A closely related type is gregorian::days, which represents duration. Durations can be freely added or taken away from dates to create new dates. Special classes for longer units also exist: gregorian::weeks, gregorian::months, and gregorian::years come in very handy. gregorian::months and gregorian::years even have special handling to ensure that dates “snap” to the end of the month during calculations.

gregorian::date leapYearMonth( 2008, Feb, 29 );
gregorian::months oneMonth(1);
gregorian::date endOfMarch = leapYearMonth + oneMonth;
// endOfMarch == 31/3/2008, not 29/3/2008

gregorian::date_period represents a fixed period between two dates, and has the methods you would expect for determining if a date exists within a period or two periods overlap. Because the date class can represent abstract concepts like dates infinity days into the future or past, date_periods can represent segments of time without fixed ends.

gregorian::date_period untilFurtherNotice( gregorian::day_clock::local_day(),
                                           gregorian::pos_infin );

Date Iterators and Generators are both very cool concepts. Iterators produce a series of dates that are all some duration (ie: 1 month) apart. Generators provide even more complex factories for producing non-uniform dates such a “the last monday in January” for a given year.

Times are just dates with an offset into the specified day. In boost::date_time this is handled by the posix_time::ptime class. Like date, ptime can represent positive and negitive infinity as well as not_a_date_time giving great flexibility. Also like gregorian::date there are time_duration, time_period, and time_iterator classes which serve the same purpose.

I haven’t even mentioned the most useful part of boost::date_time yet – a full set of streaming operators and conversions to and from standard string formats. If for some reason the standard input/output formats aren’t enough it is possible to imbue a stream with a custom date/time facet for that fancy touch of class.

Aside from strings, dates and times are probably the most common data-types that must be represented in programs dealing with human affairs. It is a pleasure to finally have a library that is up to the task.

A Better Handwriting Font with YourFonts.com

A while ago I created a font of my handwriting using a for-pay font-making website. For various reasons I was never terribly happy with the results, although I thought the small amount of money I was changed was a fair price. I kept using the font, waiting for something better.

That something better is YourFonts, a new font-making website that is free. An added bonus is that it does a much better job of creating a font than the other service did, with a much fuller range of characters and proper spline-based outlines.

If you are using a browser that supports @font-face (Safari or Firefox betas) then you are looking at the result – I think it is an improvement, if not a great leap forward for typography.

If you are planning to use YourFonts, or a similar service I have some hints.
Continue reading