The Boston Diaries

The ongoing saga of a programmer who doesn't live in Boston, nor does he even like Boston, but yet named his weblog/journal “The Boston Diaries.”

Go figure.

Wednesday, September 02, 2015

I, for one, am still awaiting our self-aware robotic overlords

Roboticists at the Rensselaer Polytechnic Institute in New York have built a trio of robots that were put through the classic 'wise men puzzle' test of self-awareness - and one of them passed.

Via GoogleMyFacePlusSpaceBookTwitter, Uh-oh, a robot just passed the self-awareness test | TechRadar

I wouldn't worry too much—all this robot did was run some code to solve a logic problem, probably using code written in Prolog or something similar.

Nothing to see here … move along … the computer is your friend

Tuesday, September 01, 2015

“Wasting my time? Okay, I'll waste your time.”

This is a fantastic idea! (link via spin the cat) If telemarketers can robocall us, we can certainly use a computer to keep them busy on the phone.

Oh, I would love to set this up.

Monday, August 31, 2015

The days when assembly was required

From about the mid-80s to the mid-90s, I pretty much programmed exclusively in assembly langauge. Along the way, I learned the 6809, (my favorite of the 8-bit CPUs), x86, 68000 (my favorite of the 32-bit CPUs), VAX and MIPS assembly languages, and I can recognize (and could probably program in if I had to) the 6502, 8080, Z80 and SPARC. I don't program much (if any) in assembly anymore. The CPUs have gotten too complex, the optimization rules too arcane and numerous and porting programs just gets tedious in assembly (they're practically a rewrite). Besides, compilers are getting better and better over time, negating the use of assembly except for absolute performance (when C or Fortran won't cut it).

But I still like assembly language, and I find these assembly gems (link via Hacker News) fun to read, even if they aren't that useful these days.

Sunday, August 30, 2015

Kernighan, Ritchie and Lovecraft, oh my!

C functions may be used recursively; that is, a function may call itself either directly or indirectly. Uninquiring souls may take this as just another peculiarity of those C folk, of whose ways their neighbours speak little to outsiders but much among themselves.

Keener news-followers, however, wondered at the events of the winter of 1927-28, the abnormally large number of calls placed upon the stack, the swiftness with which that list was sorted, the disturbing lack of heap allocation throughout the proceedings, and the secrecy surrounding the affair.

People in the nearby towns had talked about C for nearly a century, and nothing new could be wilder or more hideous than what they had whispered and hinted years before. Many things had taught them secrecy, and there was now no need to exert pressure on them.

Via Reddit, The C Programming Language: 4.10

Speaking of eldritch code

Saturday, August 29, 2015

The Man From U.N.C.L.E.

Bunny's brother informed us that “The Man From U.N.C.L.E. was worth seeing and that was enough to convince her to go. Me? I've never seen the television show so I was going into this movie cold, having no idea what exactly to expect.

It was a very fun movie. I think the producers were smart in keeping it set to the 60s and not attempting to modernize the storyline at all. The cinematography was good, and the use of split-screen gave the film a unique look (and to me, gave it more of a “60” vibe). The use of flashbacks (in some cases, flashing back to a scene that happened less than a minute earlier) I felt was a bit excessive (like the audience can't figure out what might have happened) but overall, it was a solid, lighthearted action spy flick set in the 60s that didn't take itself too seriously, nor was it an outright parody like Austin Powers.

On the down side, about the only thing it had in common with the television series (according to Bunny—remember, I never saw it) were the names. In fact, the term U.N.C.L.E. doesn't even come up until the last line of the movie. But if there are sequels, I for one, wouldn't mind seeing them.

Friday, August 28, 2015

Reason #NaN I hate PHP

Quick, what does the following PHP code print out?

for ($i = 'a' ; $i <= 'z' ; $i++)
	echo "$i\n";

Non-PHP programmers might say “the letters from ‘a’ to ‘z’ of course!” But sadly, no. It does not just print the letters from ‘a’ to ‘z’. Nope. It prints way more than you expect (link via Hacker News).

I realize that picking on PHP is like shooting dead fish in a barrel with a double barrel shotgun but I find it never gets too old.

Thursday, August 27, 2015

As long as the trucks aren't named Christine, we should be fine, right?

This past Sunday, Bunny and I were talking to my friend Tom Lanahan (the friend that invited me for a little train ride) about self-driving vehicles when I mentioned the tests that are underway in Nevada involving self-driving trucks. Tom was skeptical it would ever come to that, if only due to liability and felt that we were still years away from it happening.

Yeah …

The first autonomous vehicles to hit US highways will not be Google or Apple cars, but self-driving trucks – and they will be riding roads in Florida by the end of the year.

The self-driving construction vehicles, fitted with special rear-end crash barriers and lights, have been successfully demonstrated, driving using GPS waypoints and following a lead car, mimicking its path, braking and speed.

The specialised crash trucks are fitted with large signs to warn road users of the presence of workers and are used to protect construction crews resurfacing roads, painting lines, inspecting bridges or installing traffic signals.

Via Bob Anstett on FaceGoogleMyTwitterPlusSpaceBook, Self-driving ‘crash’ trucks to hit Florida highways this year | Technology | The Guardian

… it's a thing.

At the computers of craziness

I throw together things until it works then I move on. The real programmers will say "yeah it works but you're leaking memory everywhere. Perhaps we should fix that." I'll just restart apache every 10 requests.

Rasmus Lerdorf

I am not a fan of PHP for a variety of reasons, and it doesn't help that the author of PHP says the scariest things a programmer can say and people still use his stuff.

True story: back in 1997 or 1998, Smirk came up to me with two thick printouts and asked me for my opinion. The printouts were manuals for two different HTML processors, one called MetaHTML and the other one PHP. Even back then, I had an uneasy feeling about PHP and said we should go with MetaHTML (the website no longer exists and good luck trying to search for “MetaHTML”).

But little did I realize the eldritch horrors lurking in the depths of R'lyeh PHP:

And if that's too simple, then just make the condition random:

class FooClass {
$foo = new FooClass();
$foo->bar = "qux";
$thing = "bar";
$qux = "th";
$grault = "ing";
$corge = "gnu";

echo $foo->${${$foo->bar}.${(rand(0, 9)<5)?grault:''}}, "\n";

Yeah this will print qux half the time, and crash the other half. Want to add equality tests? knock yourself out:


And that's where the second realization hits: you know how foo is just a string right? Then wouldn't foo() be "a string with parens"?

Well it happens that no:

function foo() { return "foo"; }

echo "foo"();

$ php test.php
Parse error: syntax error, unexpected '(', expecting ',' or ';' in test.php on line 4

Unless you put the string in a variable itself:

function foo() { return "foo"; }
$bar = "foo";
echo $bar();

this will print foo. That's actually what PHP's own create_function does. And yes, I can see the dread in your eyes already.

Your fears are real.

Via Hacker News, masklinn comments on Today I learned about PHP variable variables; "variable variable takes the value of a variable and treats that as the name of a variable". Also, variable.

Run now! Look not at this page! Spare your sanity! Aiiiee­eeeeeee­eeeeee­eeeeeee­eeeeee­eeee­eee—

Obligatory Picture

[Don't hate me for my sock monkey headphones.]

Obligatory Links

Obligatory Miscellaneous

You have my permission to link freely to any entry here. Go ahead, I won't bite. I promise.

The dates are the permanent links to that day's entries (or entry, if there is only one entry). The titles are the permanent links to that entry only. The format for the links are simple: Start with the base link for this site:, then add the date you are interested in, say 2000/08/01, so that would make the final URL:

You can also specify the entire month by leaving off the day portion. You can even select an arbitrary portion of time.

You may also note subtle shading of the links and that's intentional: the “closer” the link is (relative to the page) the “brighter” it appears. It's an experiment in using color shading to denote the distance a link is from here. If you don't notice it, don't worry; it's not all that important.

It is assumed that every brand name, slogan, corporate name, symbol, design element, et cetera mentioned in these pages is a protected and/or trademarked entity, the sole property of its owner(s), and acknowledgement of this status is implied.

Copyright © 1999-2015 by Sean Conner. All Rights Reserved.