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.

Thursday, January 01, 2015

The Year is dead! Long live the Year!

Given that it sounds like a war zone outside, and it's not the Fourth of July, there are only two reasons I can see for this:

  1. anti-police factions are holding their position against the police or
  2. it's New Years Day and people are celebrating the start of 2015.

Frankly, given recent events, it very well could be the start of a revolution (which won't be televised; it will be Tweeted) but seeing how the calendar just flipped over, I do believe it's just the celebration of the New Year.

Here's to 2015!

Friday, January 02, 2015

The fultility of making resolutions

I resolved not to make any resolutions, which meant I lost the very second I made it.

Funny how that works.


Fireworks from a different perspective

In the late 90s, I found myself flying home on the night of July 4th. It was incredible seeing so many fireworks shows from high above—everywhere I looked, there were tiny multicolored explosions. It was an incredible experience to see over a hundred fireworks shows, live, on one night.

Even more impressive is this video (link via Instapundit) of a fireworks show, filmed alongside exploding fireworks! I'm very surprised that the drone survived such an ordeal.

Update at 12:36 AM on January 3rd, 2015

From my friend Jeff Koecher, that video was shot in West Palm Beach, Florida, about 30 miles north of Chez Boca.

Saturday, January 03, 2015

“Bow to my awesome power of zoning!”

Just what I need—a web-based version of Sim City (link via HackerMonthly). There go a few hours terrorizing simulated citizens with my dictatorial mayorial powers!

Muahahahahahahahahahahahahahaha!

But at least it wasn't a link to Cracked (WARNING: DO NOT CLICK ON THAT LINK IF YOU VALUE THE REST OF YOUR DAY!).

Sunday, January 04, 2015

'Tis easy to become an aluminum smith

[Not your standard bars of aluminum]

Who knew it was so easy to smelt aluminum at home?

Monday, January 05, 2015

Notes on an overheard conversation between two people assembling a table saw

“It says to use four screws, but there are seven holes in this rail.”

“So?”

So? There are more holes than screws.”

“Perhaps they use the rails for different table saws.”

“Okay, but they don't say which holes to use.”

“You use the holes that line up. See? That hole lines up, and that one, and that one, and that one.”

“But … but … how do you know this stuff? It's because you're an engineer, right?”

“Yup. College. It's a painful procedure where they physically implant engineering books into the head of engineering students.”

“Pbbbbbbbt.”

“You're welcome.”

“Okay, hand me that fence.”

“Here you go.”

“This is supposed to go between the table and the rail.”

“Really?”

“Yes.”

“There's no way it can fit. A piece of paper can't fit between the table and the rail. But place it like this and it still reaches across.”

“But the instructions say that bit is supposed to fit between the rail and the table.”

“Hmm … perhaps that bit sticking down was placed on backwards … ”

“No, I think it's correct.”

“Really? Let me see the instructions … ”

“See?”

“Oh. Oh!

“Oh?”

“Yes, oh. I put the rail on wrong.”

“Do tell … ”

Tuesday, January 06, 2015

… and this bug exists because of a work-around for that bug …

Sigh.

The last day at work in 2014 (Debtember 18th), I spent it running yet another IOT, which involves running tcpdump to capture the network traffic on our end to verify that we receive and send the data properly. After running a test, I would load the resulting capture into wireshark, filter for the SIP protocol only to find—

Nothing.

Project: Sippy-Cup” was getting the packets and responding correctly—well, as “correctly” as these things go, but I was not seeing any packets under wireshark, no matter what I did. But the whole test setup is so jury-rigged that it wouldn't surprise me at all if we were, in fact, doing NAT over avian carriers that it seemed rather pointless to spend the next few hours trouble shooting my inability to do network captures when the other participants were able to capture enough of the transaction to let us continue running the test.

Especially as I was one day from retirement a few hours away from a two-week Christmas vacation.

And then today, I learned that we were, in fact, capturing data.

Why was wireshark not showing the packets?

Because I was telling wireshark to filter on SIP, which defaults to port 5060. We were running our SIP component on port 5061, because of some odd-ball router on our network that oh-so-helpfully looks for SIP traffic and attempts to proxy it anywhere else than our SIP component.

And because we were running on a non-standard port, wireshark wasn't showing us the proper packets as it was looking only for packets on port 5060.

I swear, I think IP-over-avaian-carriers would be easier to deal with.


No, a reality TV show about computer hacking can be totally accurate and not boring at all. No, really.

[Well, isolate the node and dump them on the other side of the router.]

So apparently, this is happening:

SyFy just announced a new reality TV show called Hackers. It's about hacking, naturally, and the network promises it will be awesome and exciting. (Spoiler: Hacking is incredibly boring.)

The new, unscripted show does sound interesting. It's unclear if the new SyFy series has anything to do with the 90's classic film Hackers. SyFy will produce Hackers with Relativity Television (of Catfish fame) and promises to “take viewers deep inside the shadowy and dangerous world of high-tech hackers for the very first time.” While verbs like “shadowy” and “dangerous” certainly ring true of cyber security in the age of the Sony hack, that doesn't mean that filming hacker-types staring at dark screens makes for entertaining television for the general population. It almost definitely doesn't.

Via Reddit, The New Hackers Reality Show Would Be Great If Hacking Weren't So Boring

You really want to see what hacking is like? Watch the first episode of “The Scene.” While the story (and music) of “The Scene” is compelling (enough to carry me through the season), it's not compelling to watch (it was tiring having to pay so close attention and read everything on the screen to keep up with the “action”). That's a hacking movie.

This?

I'm curious enough to watch an episode or two—I mean, who doesn't love train wrecks? (Um, besides the ones involved in a train wreck?) But I can't see this being any good.

Or lasting that long.

But hey … you know … HACK THE PLANET!

Wednesday, January 07, 2015

Notes on an overheard conversation at The Ft. Lauderdale Office of The Corporation

“I have a problem.”

“And that problem is?”

“I have two remote meetings to attend, scehduled at the same time.”

“Any meeting that can start without you isn't worth attending.”

“They can't start without me.”

“Hmm … have you considered using both your cell phone and desk phone, at the same time?”

“Really?”

“Put one ear bud from one phone in one ear, one ear bud from the other phone in the other ear.”

“That could work.”

“Really?”

“I'm going to try that.”

“…”

Thursday, January 08, 2015

I think the problem is that without Steve Jobs, there's no one at Apple that can say “No, we aren't releasing this.”

A few months ago, I think back in late September or early October, I needed to reinstall Linux on my work laptop due to a hard drive failure. Over the following week or so, I came to the conclusion that Ubuntu had jumped the shark and that whatever they were trying to pass as a “Linux Laptop Distribution” (Ubuntu's Ulcerating Unicorn) was probably a secret plot by Microsoft to discredit Linux.

The upshot was that I got a new laptop a few weeks later—a shiny new Macbook Pro with all the bells and whistles. It took a few days to get the then-latest version of Mac OS-X, Mavericks, configured to my liking (and really, Apple? Near arbitrary names for versions? I could never remember if Jaguarundi was newer than Ocelot or was it Puma, Ocelot and then Jaguarundi).

There was only one problem—it couldn't log onto The Ft. Lauderdale Office of The Corporation's local wireless network. The wireless adaptor works (I was able to hook up to the local wireless network at Chez Boca) but for some reason, it just refuses to join The Ft. Lauderdale Office of the Corporations's local wireless network. In my opinion, it's not that big of a deal as I've always been able to use Ethernet. But it was an issue to my manager, S, so it came to pass that today was The Day to fix it by installing the latest version of Mac OS-X, Rabid Wombat Yosemite.

It's a testament to Apple that I spent more time trying to live with Ubuntu's Ulcerating Unicorn than I did with Apple's Rabid Wombat Yosemite. Not only did this not fix the wireless network issue, but part of the menu bar was constantly flashing for no apparent reason; I had to constantly reinstall DoubleCommand (I need DoubleCommand so I can use my preferred keyboard) but the final straw was maximizing a window. Previously, when you maximize the window, it takes up the whole screen, minus the menu bar at the top. But under Yosemite, the now flat, dull green button (I guess to harmonize with the new trendly look of Apple's iOS 8 for the iPhone/iPad) the window took up the entire screen, obscuring the menu bar!

At that point, I pulled all the cables out of the laptop and unceremoniously handed it to the IT person, demanding it be put back to Mavericks. I hate to say it, but I think Yosemite is worse than Windows. Apple Mac OS-X has not only jumped the shark, it has jumped the Discovery Channel's Shark Week.

Friday, January 09, 2015

The True Facility in the Middle of Nowhere

For some obscure reason, Bunny wanted us to go away on a weekend excursion. Last week she asked me if there was any place I wanted to visit. Not having any particular destination in mind, I decided to search for “weird places to visit in Florida,” threw a metaphorical dart and proudly announced “Solomon's Castle,” a museum-restaurant-bed-n-breakfast in the middle of nowhere.

[No matter where you go, there you are.]

The last sixteen miles are long unnamed county roads northwest of Arcadia, itself pretty much in the middle of nowhere, but it's a bit of civilization in the middle of nowhere. The last mile consists of driving down a dead end street, past the “END OF PAVEMENT” sign (which is a lie—it's paved all the way) to a large iron gate marking the entrance to Solomon's Castle. We parked, and headed on the yellow brick path (asphalt with yellow bricks stamped out in paint) towards the castle.

[It's befitting a moon castle if you think about it.]

It is impressive upon first sight and very hard to miss, seeing how it's clad in aluminum from top to bottom. We passed the two suits of armor and entered the castle.

[They couldn't be as different as day and knight.] [And if you think the previous pun was bad, it's worse inside.]

Our timing was a bit off as we arrived just as the place was closing. They were expecting us, as Bunny had already arranged for us to stay at this museum-restaurant-bed-n-breakfast, but Dean, our host, was over in the “Boat-in-the-Moat,” a 65' replica of a Spanish galleon moored in the moat (every castle has a moat, right?) which serves as a restaurant.

[Built, by hand, by a five-foot-nothing guy.]

We walked over to the gangplank and boarded the Boat-in-the-Moat. We met Dean while the restaurant was in the process of closing. Dean then lead us back down the gangplank and around the castle to the back, where the Blue Moon Room was located.

[Swish swish swish] [It did not!]

I suspect that the stairs (outside the building) leading to the Blue Moon Room might not quite meet OSHA standards as there was some heavy swaying as we climbed the stairs [It did not “sway.” —Bunny] [Oh yes it did. Swayed like RuPaul at a drag race. —Sean] [It did not, Mr. Hyperbole. —Bunny] [Did too! —Sean] [Did not! —Bunny] [ENOUGH! —Editor]. Dean then opened the double doors to our suite.

[Howard Solomon once joked he would only rent this room out once in a blue moon.]

The Blue Moon Room is the second best bedroom in the castle—the best belonging to Howard Solomon, owner and builder of (we learned later) the whole compound. Our room, the Blue Moon Room, is not only the second best, but the only other bedroom in the castle (as bed-n-breakfasts go, it's rather small in the “beds-to-rent” department).

The Blue Moon Room was really nice. Kitchen. Sitting area. Nice-sized bed.

[One half of the room] [Other half of the room]
Huge bathroom. And a definite “Blue Moon' theme going on, what with the color scheme and moon imagery going on (along with a sun motif—honestly, there were scores of suns and moons all about the room).
[Here a moon] [There a sun] [Everywhere a moon and sun] [All the time, moon and sun] [But here, I was only expecting a moon]
[Even the shower curtain] [Will it ever end?]

The one oddity of the room we instantly noticed was a slight incline in the floor. I wouldn't think a one degree incline would be so noticable but there it was, a definite list to the south.

Another oddify of the room slowly dawned on us. Back in the Boat-in-the-Moat, I had asked Dean about wifi access and Dean was a bit vague about it. He acted like he knew what the term “wifi” meant, and he even said it existed somewhere on the premises, but he didn't really say outright that we had wifi access. But no, we didn't. No signal at all. But another thing we had noticed—there was no cell signal either. It then hit me---the entire building was wrapped in aluminum.

Wrapped. In. Aluminum!

We were sitting in a large Faraday cage!

Talk about being in the Middle Of Nowhere.


Dodging bunrabs in the dark

After settling into the Blue Moon Room we rested for a bit before heading out to dinner. Given that the restaurant at Solomon's Castle closed at 4:00 PM, that meant we had to drive some twenty miles back to civilization—in our case, Arcadia. Dean had warned us that it would be dark and suggested we take along a flashlight, one being provided for us in the room.

“Dark” would be an understatement. I can't recall the last time I saw darkness that dark. Sure, it made for a spectacular view of the night sky (especially since the moon was still below the horizon) but we still had to navigate those swaying stairs [They didn't sway! —Bunny] [Did too! —Sean] [Snot! —Bunny] [Too! —Sean] [ENOUGH! —Editor]. Fortunately, our iPhones had a built-in flashlight app to augment the provided flashlight so we could safely navigate the stairs and flood the forest alongside them to assuage our fears of the noisy wildlife infesting the immediate area around the castle.

And driving along unnamed county roads unlit by modern technology was fun, although not as fun as driving along unnamed county roads unlit by modern technology in the mountains (which I have done, but that was a few years ago in North Carolina), but still, fun. It took me a few minutes to learn how the brights work in the car since that's not something I normally have to use here in Lower Sheol. Even better—we had to avoid opossums, rabbits (“bunrabs” as Bunny calls them), a fox (!) and one rather large and impressive looking deer (well, that last we didn't have to avoid—it was standing off to one side of the road, thankfully). That was more wildlife than I've seen driving on mountainous, unnamed county roads in North Carolina.


Educating the hoi polloi

There is one further observation I would like to make for today. Of the two restaurants where we ate, lunch at a diner in Okeechobee and dinner at a diner in Arcadia, both had paintings in the men's room.

Paintings. In the men's room!

Is that some sort of central Florida diner thing or something? Trying to civilize the hoi polloi in fine art through diner men's rooms?

I want to know.

Saturday, January 10, 2015

Phenomenal sized bathroom, itty bitty fixtures

I need to talk about the huge bathroom in the Blue Moon Room.

[Yeah, this bathroom right here.]

Huge. Easily twice the size of ours at Chez Boca. But the sink (not shown in the picture)? Tiny. That toilet? A midget would find it nice. That shower stall?

Nothing at all like the one at the Red House Inn in Brevard, which could easily fit two or more people. Nope. This one barely fit one and even then, it took careful manoeuvering to turn around.

Yeah, for the size of the actual room, you think they could have used slightly larger fixtures. Heck, moving the wall closer to the toilet by six inches, and putting the shower curtain across the room (across the rug that's there now) and making that entire portion of the bathroom the shower would have done wonders.

But no.

We get a bathroom fit for the extras from “The Wizard of Oz.”


Art, and a lot of it.

Bunny and I had our complementary continental breakfast (with hot chocolate!), and were putting our luggage in the car when we noticed just how hopping Solomon's Castle was by noon:

[Pretty popular place for being in the middle of nowhere]

We then caught the next tour of the castle, a museum containing mainly the art work of Howard Solomon, who has, shall we say, a rather punny sense of humor.

[Stained glass portait of a pirate, on a pirate ship.  Incredible!] [Waldo is hiding here somewhere …] [“Damn windmill, the lance wasn't strong enough.  I'll teach it who's boss!”] [Those are cameras along the bottom, so of course this is a picture window]
[A portait of the artist Howard Solomon] [A steampunkish Darth Vader] [The Queen of Hearts, done with scrap wood pieces] [The Dr. Kevorkian Dueling Pistols] [WMD:  Weapons of Mouse Destruction] [Picture yourself on a sailboat—yes, it's a selfie!] [A play on Norman Rockwell's “100 Years of Baseball” from scraps of wood] [Edvard Munch's “The Scream,” again made from scaps of wood] [This was described as just a plane wall.]

After the tour, we were exhausted and decided to just get on the road and head on back to Chez Boca. Contrary to some of my snarkier remarks about the place, both Bunny and I enjoyed our stay and were glad we went. The rate we paid to stay overnight wasn't that bad (I've paid more to stay at some bed-n-breakfast places over the years) but I would really recommend just coming for the museum and maybe the restaurant (what we had we liked, but it was a very light breakfast; we didn't have lunch there, but the reviews I have seen for the restaurant portion have been very favorable) if you happen to be in the area.

Sunday, January 11, 2015

There's just no explaining 2014

It was a year of mysteries. To list some of the more baffling ones:

A huge airliner simply vanished, and to this day nobody has any idea what happened to it, despite literally thousands of hours of intensive speculation on CNN.

Millions of Americans suddenly decided to make videos of themselves having ice water poured on their heads. Remember? There were rumors that this had something to do with charity, but for most of us, the connection was never clear. All we knew was that, for a while there, every time we turned on the TV, there was a local newscaster or Gwyneth Paltrow or Kermit the Frog or some random individual soaking wet and shivering. This mysterious phenomenon ended as suddenly as it started, but not before uncounted trillions of American brain cells died of frostbite.

An intruder jumped the White House fence and, inexplicably, managed to run into the White House through the unlocked front door. Most of us had assumed that anybody attempting this would instantly be converted to a bullet-ridden pile of smoking carbon by snipers, lasers, drones, ninjas, etc., but it turned out that, for some mysterious reason, the White House had effectively the same level of anti-penetration security as a Dunkin’ Donuts.

LeBron James deliberately moved to Cleveland.

Of course not everything that happened in 2014 was mysterious. Some developments—ISIS, Ebola, the song “Happy” were simply bad.

Via Instapundit, Dave Barry's Year in Review: There's just no explaining 2014 | The Washington Post

Dave Barry sums up 2014 better than anyone else can. So what if this is a bit late (my posting it here, not when Dave Barry wrote it)? I'm still trying to get a hang of 2015, which might not happen until 2016 comes rolling around …

Monday, January 12, 2015

Some might view this as a window into doom

Acrophobia is the fear of heights. We certainly hope you don’t have it. If so, a trip to the Zhangjiajie and Tianmen mountains in China’s Tianmen Mountain National Park may not be advised. However, if scenic routes that will get your heart racing and truly exhilarating views are what you are after, then this may be for you. The appropriately named Walk of Faith is a glass walkway that is exactly what it says on the tin. Save for the hand rails and metal and concrete supports, the 61 ft. walkway up the side of the mountain is entirely glass, allowing walkers to view the staggering height they are at, right beneath their feet, which is some 4,700 ft. above sea level.

Via MyGoogleFaceSpacePlusBook, Transparent Torture, The Walk of Faith and Seriously Scary! - Industry Tap

Cool idea, but in a word: OH XXXX NO!

Tuesday, January 13, 2015

Zombie outbreak? Head towards the zoo

Zombies are scary. We humans are evolutionarily pre-programmed to abhor the dead bodies of our own species. It's a natural reaction, helping healthy individuals avoid fatal pathogens.

The thought of being eaten alive is a natural fear, and when it's your own species doing the eating, it's even more terrifying.

Relax. Next time you're lying in bed, unable to fall asleep thanks to the vague anxiety of half-rotten corpses munching on you in the dark, remember this: if there was ever a zombie uprising, wildlife would kick its ass.

Zombies vs. animals? The living dead wouldn't stand a chance - Boing Boing

This is an article for my friend Hoade. It appears that the safest place to be in the zombocalypse is a zoo!

Who'd a thunk it?

Wednesday, January 14, 2015

Well this is a nice thing to come home to

I get home, and the monitor on my Linux system is wigging out. This is not good, as this is the third monitor on the system since 2009.

Also, the computer is quite loud, louder than normal, which means, it's hotter than normal, which isn't good. I never did find out what was constantly running, but I did isolate the issue with the monitor—it's not the monitor. That's the good news. It's the video card.

Lovely! I cooked the video card to death!

Sigh.

And in the process of troubleshooting all this, the shelf the computer was sitting on (attached to the computer desk) broke. Or rather, the caster beneath the shelf wrenched itself free, causing the shelf to collapse under the weight of the computer.

Double sigh.

At least the computer itself is fine. The shelf is in the process of being repaired (should be done by tomorrow) but the replacement video card won't get here for another week or so.

Thursday, January 15, 2015

A quick DIY computer desk shelf repair

Bunny's brother is visiting this week from Seattle. He took one look at the broken computer desk shelf, measured the broken caster (it ripped out from the bottom of the shelf) and the length of the shelf. He then went to the garage, where Bunny has all the wood working equipment. He selected a scrap piece of wood, ripped it to 2½″, then cut it to length (it helps to have a table saw for this). He then scribed a curve on each end and with the bandsaw, cut the corners off. A quick pass with the belt sander to round off the edges of the board. A bit of wood glue, some clamps, scraping off the the excess glue with a paint scraper and all that was left was to wait for the glue to dry.

And yes, it happened pretty much that fast. Well, except for the waiting for the glue to dry.

[No, the mouse cord is not under the shelf support.]

Oh, I almost forgot to mention the strip of felt along the bottom. The shelf now has better support and it can still slide out of the way in case I need access to the cables.

Now I'm just waiting for the new video card to arrive.

Friday, January 16, 2015

Never trust input, and you can still leak stuff with garbage collection

We're still IOT testing (yes, five months, but we're doing IOT testing with The Monopolistic “We Don't Have To Care, We're The” Phone Company where things move slower than molasses in Antarctica) and I'm finding it interesting (in the Chinese sense of the term) to see “actual real world data” rather than the “pristine theoretically correct data” we've been using for testing (because in theory, there is no difference between theory and practice, but in practice …).

For instance, I've been reeiving reports that “Project: Sippy Cup” (which implements a subsection of SIP) was only processing less than 5% of the OPTIONS requests (which informs the other side if we're ready for processing, but also informs the other side what other type of requests we support). Odd, as our internal testing was handling every OPTIONS request we sent.

So I added some addtional logging:

  1. Log everytime we receive a packet.
  2. Log everytime we get an OPTIONS request.
  3. Log the results of sending a reply to an OPTIONS request.

and I get back:

Sippy-Cup9900: received from ip6:[fc00:0:60:8a1::8]:5060
Sippy-Cup9900: received from ip6:[fc00:0:60:8a1::9]:5060
Sippy-Cup9900: received from ip6:[fc00:0:60:8a1::8]:5060
Sippy-Cup9900: received from ip6:[fc00:0:60:8a1::9]:5060
Sippy-Cup9900: received from ip6:[fc00:0:60:8a1::8]:5060
Sippy-Cup9900: received from ip6:[fc00:0:60:8a1::9]:5060
Sippy-Cup9900: received from ip6:[fc00:0:60:8a1::8]:5060
Sippy-Cup9900: received from ip6:[fc00:0:60:8a1::9]:5060
Sippy-Cup9900: received from ip6:[fc00:0:60:8a1::8]:5060
Sippy-Cup9900: received from ip6:[fc00:0:60:8a1::9]:5060
Sippy-Cup9900: received from ip6:[fc00:0:60:8a1::8]:5060
Sippy-Cup9900: received from ip6:[fc00:0:60:8a1::9]:5060
Sippy-Cup9900: received from ip6:[fc00:0:60:8a1::8]:5060
Sippy-Cup9900: received from ip6:[fc00:0:60:8a1::9]:5060
Sippy-Cup9900: received from ip6:[fc00:0:60:8a1::8]:5060
Sippy-Cup9900: received from ip6:[fc00:0:60:8a1::9]:5060
Sippy-Cup9900: received from ip6:[fc00:0:60:8a1::8]:5060
Sippy-Cup9900: received from ip6:[fc00:0:60:8a1::9]:5060
Sippy-Cup9901: OPTIONS from ip6:[fc00:0:60:8a1::9]:5060
Sippy-Cup9902: send OPTIONS response to ip6:[fc00:0:60:8a1::9]:5060 datasize=581 sentbytes=581 err=Success
Sippy-Cup9900: received from ip6:[fc00:0:60:8a1::8]:5060
Sippy-Cup9901: OPTIONS from ip6:[fc00:0:60:8a1::8]:5060
Sippy-Cup9902: send OPTIONS response to ip6:[fc00:0:60:8a1::8]:5060 datasize=581 sentbytes=581 err=Success
Sippy-Cup9900: received from ip6:[fc00:0:60:8a1::9]:5060
Sippy-Cup9900: received from ip6:[fc00:0:60:8a1::8]:5060
Sippy-Cup9900: received from ip6:[fc00:0:60:8a1::9]:5060
Sippy-Cup9900: received from ip6:[fc00:0:60:8a1::8]:5060
Sippy-Cup9900: received from ip6:[fc00:0:60:8a1::9]:5060
Sippy-Cup9900: received from ip6:[fc00:0:60:8a1::8]:5060
Sippy-Cup9900: received from ip6:[fc00:0:60:8a1::9]:5060
Sippy-Cup9900: received from ip6:[fc00:0:60:8a1::8]:5060
Sippy-Cup9900: received from ip6:[fc00:0:60:8a1::9]:5060
Sippy-Cup9900: received from ip6:[fc00:0:60:8a1::8]:5060
Sippy-Cup9900: received from ip6:[fc00:0:60:8a1::9]:5060
Sippy-Cup9900: received from ip6:[fc00:0:60:8a1::8]:5060
Sippy-Cup9900: received from ip6:[fc00:0:60:8a1::9]:5060
Sippy-Cup9900: received from ip6:[fc00:0:60:8a1::8]:5060
Sippy-Cup9900: received from ip6:[fc00:0:60:8a1::9]:5060
Sippy-Cup9900: received from ip6:[fc00:0:60:8a1::8]:5060
Sippy-Cup9900: received from ip6:[fc00:0:60:8a1::9]:5060
Sippy-Cup9900: received from ip6:[fc00:0:60:8a1::8]:5060
Sippy-Cup9900: received from ip6:[fc00:0:60:8a1::9]:5060
Sippy-Cup9901: OPTIONS from ip6:[fc00:0:60:8a1::9]:5060
Sippy-Cup9902: send OPTIONS response to ip6:[fc00:0:60:8a1::9]:5060 datasize=581 sentbytes=581 err=Success
Sippy-Cup9900: received from ip6:[fc00:0:60:8a1::8]:5060
Sippy-Cup9901: OPTIONS from ip6:[fc00:0:60:8a1::8]:5060
Sippy-Cup9902: send OPTIONS response to ip6:[fc00:0:60:8a1::8]:5060 datasize=581 sentbytes=581 err=Success

At first, I thought perhaps the output sent was filtered to just those three messages and some other messages, like, “Sippy-Cup0014: ip6:[fc00:0:60:8a1::9]:5060 sent garbage” or “Sippy-Cup0055: ip6:[fc00:0:60:8a1::9]:5060 sent an unknown call” were filtered out.

Nope. What I saw is what got logged.

Fortunately, the actual network packets had been captured so I could look at them. And I immediately saw the problem.

“Project: Sippy-Cup” is written in Lua, since it's easier to parse text in Lua than in C (it's easy to parse text with LPeg), and each request is handled in a Lua coroutine—it makes following the code a lot easier since it can be written in a straight-forward procedural way rather than with callbacks or complex state machines and what not. The only trick here is that for any operation that might block, the code has to manually insert a call to coroutine.yield() to let another coroutine run (if there are any to run).

In SIP, all the messages pertaining to a phone call each have a unique identifier, and it's this identifier I use to know which coroutine to run when a message comes in (or spwan a new coroutine if this is a new call). The OPTIONS request isn't really part of a normal call, but I had assumed, like other SIP requests, that they too, would have a unique identifier.

It turns out that no, The Monopolistic “We Don't Have To Care, We're The” Phone Company is gladly using the same “unique” identifier for each OPTIONS request, mostly … occasionally they'll generate a new “unique” identifier just to keep us on our toes.

Or something like that.

Okay, that did reveal the actual bug though—I wasn't releasing the reference to the coroutine when processing an OPTIONS request. Had I done that, it wouldn't have mattered, since I wouldn't have a reference to a coroutine with that particular “unique” identifier, and a new coroutine would have been created to handle the OPTIONS request.

Which goes to show you that not only is input weirder than expected, but even in a language with garbage collection, you can still leak resources.


Japanese wood porn

[No glue, no nails, no visible joints.  The Japanese are insane.]

There's a Japanese style of woodwork called sashimono where no nail or glue is used when making joints. Just intricate cuts using scores of custom saws and planes (no power tools here) to make blind joints (joints that do not show).

It's insane.

And it's incredibly beautiful.

I asked both Bunny and her brother (who's currently visiting) if they would take up sashimono, and in unison, both said “Oh XXXX no!” They're perfectly happy to use power tools and typical jointery for their woodworking projects, not that I blame them.

Saturday, January 17, 2015

Blackhat

Bunny, her brother and I went to see “Blackhat.” Wonderful … another Hollywood hacker film.

The gold standard for hacker films is “WarGames. “Sneakers” is good (it's a lovely character piece) but as far as hacking goes, it's a bit questionable. I loveHackers” but not because it's good, but becuase it's so cheesily bad! (“HACK THE PLANET!)

Other hacker films? “The Lawnmower Man” was just bad. And the only thing I remember about “The Net” was that it starred Sandra Bullock (and yes, I saw this is the theater). The rest? I haven't found them all that memorable (oh, I remember seeing “Swordfish, but the fact that I had to be reminded about it says something about the film—or me, but I digress).

So yeah, another Hollywood hacker film.

I went into the film with low expectations, which was a good thing, as this was better than I expected. Visually, the film is beautiful, and it's very atmospheric (read: ssssslllllllooooooooooooooooowwwwwwwwwwwwwwww) but I didn't really mind it that much (although Bunny did lean over and asked if I felt this was a slow movie). The hacking scenes were probably the best in a long time (not since “WarGames” has hacking been protrayed this well). Realistic command line action (for the most part—some bits of HollywoodOS peeked through, but not enough to be terribly distracting), and some other aspects of hacking that don't get much screen time, such as social engineering and physically being on-site (one scene required the heros to obtain data by physically extracting a hard drive from a computer).

Some of the gun fights were a bit over the top (as Bunny's brother mentioned on the way home—if those guns could shoot through cargo containers, there's no way the heros could have survived) but hey, it's Hollywood. Over the top gunplay is de rigueur these days.

The one big glaringly bad thing about the film is the villian. He's given very little screen time (fifteen minutes top?), his motivation is nothing more than simple greed (no, really. It's not even stated outright what his motivation is, other than he steals $73,000,000 to fund another hack to steal even more (the potential amount is never given) in an odd scheme that doesn't make real sense when you think about it for long). The villian is so inconsequential I can't even find out who played the villian. Nor could I find the name of the villian (the flunky? Yeah, he has a name, but Mr. Big? Nope). But perhaps that's the point? That it's some nameless hacker that can cause physical destruction on a mass scale?

I don't know, but it bothers me.

But is this the best cyber movie ever? For me—no. The best is still “WarGames” (to my knowledge, the only hacker film to inspire an actual hacking technique), followed by “Sneakers” (I just love the character interactions in that film). Heck, given a choice between this and the cheesefest that is “Hackers,” I'll take the cheesefest every time. But aside from those three? Yeah, it's a lot better than Hollywood has tended to make.

Sunday, January 18, 2015

“… the street finds its own uses for things.”

The Nintendo Power Glove may have failed as a game controller, but animator Dillon Markey has given it a new lease on life. With a few modifications and design tweaks, he’s revived the Glove and put it to use as an ingenious stop-motion animation tool.

Via Zed Shaw, Animator uses Nintendo Power Glove for stop-motion animation | Digital Trends

Back in college, my friend Ken thought that the Nintendo Power Glove would be great for virtual reality applications, and I think he even went so far as to obtain one, but I don't recall it ever being that great for his intended purposes.

It also appears that even for its intended purposes, it failed.

But it's great to see someone finding a unique use for it.


A little football rivalry

Bunnny and her brother are die hard Seahawks fans. Our neightbor across the street is a die hard Packers fan. After today's game, odddly enough, our neighbor wanted to talk about anything other than the game.

Monday, January 19, 2015

Cellphone guts for the curious, Part II

Two years ago I published an email I received about the internal workings of a cellphone, and today, I received yet another email, from a fellow cow-orker about that previous email:

From
BXXXX XXXXX <XXXXXXXXXXXXXXXXXX>
To
<sean@conman.org>
Subject
Re: Cellphone guts for the curious …
Date
Mon, 19 Jan 2015 12:08:13 -0500

Sean,

In reference to: http://boston.conman.org/2013/01/22.2

I passed this link along to a friend who is as technically talented as XXXX, but who is also as politically astute as he is technically astute. Here is his response:

Last time I checked, they are separate because the FCC says they have to be separate.

There was huge debate between focus and the phone manufacturers. The phone manufacturers wanted a single processor for both the air processor and the phone/app gui. The FCC said no because of the possibility of changing the radio firmware.

Disclaimer: I am not offering this for contradiction; just FYI and for discussion (if you wish). Both he and XXXX are way beyond me in this area, so I offer no opinions or views of my own. In other words, I am all ears.

While the FCC has jurisdiction over radio transmission, I think the separation of general purpose CPU and baseband processor has more do to with recertification than a legal mandate to be separated.

But I don't work for a cellphone manufacturer, so I might be mistaken.


'Tis easy to make an aluminum foundry

A few days ago I posted a video about smelting aluminum, and now:

[It's also a decorative planter when not in use]

… how to make the foundry to smelt the aluminum.

Tuesday, January 20, 2015

The upper bound on the number of test cases in the new regression test is 2,359,296, but it'll probably, hopefully, be less than that.

We're coming up with a new regression test at work that kind of, maybe, combines both the original “Project: Wolowizard” and the new “Project: Sippy Cup” and my manager, S, came up with 11 variables to test; A with values A1, A2 ‥ A8; B with values B1, B2, B3, B4; C with values etc. And multiplying out all the possible values of all the variables, I end up with a potential 2,359,296 possible test cases.

Now, some of the cases aren't possible. For instance, values D1, D2, D4and D6 can only be tested with value H1 (or rather, with those values of D, H1 is the only value H can have), while D3, D5, D7 and D8 can only be tested with values H2, H3 and H4. So, just looking at D and H, it's … um … let's see … there are two parties involved, both with D and H values, and does it make sense for P1D5 to call P2D5? Um … well, in this case, H doesn't really apply to P1 so out of a possible 32 combinations, only … um … 24 really apply.

I think.

Yeah, it's going to be real fun trying to puzzle out all the cases.


The new video card: the good, the bad and the ugly

The good news: The new video card arrived.

The bad: it's the wrong XXXXXXX card! I ordered a Dell nVidia GeForce 7300 LE. I received an ATI Technologies Inc RV370. Grrrrr.

The ugly: it does work, but it doesn't work at the resolution I require (or I don't have the proper drivers).

Back it goes, and we enter round two.

Wednesday, January 21, 2015

More alternatives to stream punk computers

[This is a computer.  Honest!]

I had thought I posted Jeffrey Stephenson's custom computer cases, but no, I had linked to Love Hultèn, who also does beautiful computer cases.

Thursday, January 22, 2015

It's over 9,000!

At work, we've been working to reduce the number of test cases and it looks like we have just a bit over 9,000 (it's an Internet meme-thing). It's over the 5,000 our manager was expecting, but it's far less than the 2,359,296 theoretical maximum number of test cases we could have had.

Now, it's off to document all 9,120 cases …

Friday, January 23, 2015

Generating regression test cases

We miscounted—there are, in fact, 9,697 test cases so far.

My manager, S, has been responsible for generating the test case descriptions, stuff like:

Section 1

Originating device is XXXXXXXXXX XX XXXXX and is calling a terminator with our client on the device test cases.

It's my job to generate the data required to run all these test cases, which means I need to run through the various variables and all their values, generating the data required to run the test and there's no better way of doing this than to brute force it. I could have written the code as:

-- variable names changed to protect the innocent.

for _,A in ipairs { false, true } do
  for _,B in ipairs { 'tel' , 'sip' } do
    for _,C in ipairs { 'tel' , 'sip' } do 
      for _,D in ipairs { false , true } do
        for _,E in ipairs { false , true } do
          for _, F in pairs { 'opt1' , 'opt2' , 'opt3' } do
            ...
              test_case(A,B,C,E,E,F, ... )
            end
          end
        end
      end
    end
  end
end

and while that does the trick, it's verbose and it uses a convention (using '_' to designate a result one doesn't care about, and in this case, I don't care about the first return result from ipairs()) that the other programmers here might not immediately pick up on (as far as I know, I'm the only one using Lua at the Corporation).

No, I feel it's better to show my intent. I want the code to look like:

for A in bool() do
  for B in list { 'tel' , 'sip' } do
    for C in list { 'tel' , 'sip' } do
      for D in bool() do
        for E in bool() do
          for F in list { 'opt1' , 'opt2' , 'opt3' } do
            ...
              test_case(A,B,C,D,E,F, ... )
            end
          end
        end
      end
    end
  end
end

And that's exactly what I did. The generic for loop in Lua is defined as:

for variable in function, state-variable, initial-value

where function is repeatedly invoked as function(state-variable,initial-value) until the it returns nil; when the result isn't nil, it's assigned to the main loop variable. In the first example, ipairs() (a standard Lua function):

function ipairs(list)
  local function next_value(state,var)
    var = var + 1
    if var > #state then
      return nil
    else
      return var,state[var]
    end
  end
  
  return next_value,list,0
end

ipairs() returns a function that takes a state variable (in this case, the variable list which should be an array) and an initial value (0) and this is repeatedly called until that function returns nil (here, when the index exceeds the number of items in the array).

For what I wanted, the function list() is easy:

function list(L)
  local function next_item(state)
    state.n = state.n + 1
    return L[state.n]
  end
  
  return next_item,{ n = 0 }
end

The function next_item() only cares about the state, which holds an index into the list (it's stored in a table because this is the only way we can modify it) which we increment and return that item from the passed in list L. We only return two values, the function and the state. The missing third value will be nil, which we don't care about. The one for cycling through booleans, bool() looks a bit more complicated:

function bool()
  return function(_,value)
    if value == nil then
      return false
    elseif value == false then
      return true
    else
      return nil
    end
  end
end

Here we just return a function; the other two values for is expecting will then become nil. And since I don't care about any state (the next value is readily apparent from the previous value we've returned), that parameter in the returned function is named _ (the conventional name for ignored parameters). Since we initially gave for a nil value, that's what we get on the first call, so we return false. On the next call, value is false so we return true. On the third call, we call through, returning nil which ends the for loop.

And those two functions make the test case generation code look much better. The intent is clearer, and you can easily match the code against the English description.

Saturday, January 24, 2015

Then again, Darth Vader was a whine baby growing up

How did the Galactic Empire ever cement its hold on the Star Wars Universe? The war machine built by Emperor Palpatine and run by Darth Vader is a spectacularly bad fighting force, as evidenced by all of the pieces of Death Star littering space. But of all the Empire's failures, none is a more spectacular military fiasco than the Battle of Hoth at the beginning of The Empire Strikes Back.

From a military perspective, Hoth should have been a total debacle for the Rebel Alliance. Overconfident that they can evade Imperial surveillance, they hole up on unforgiving frigid terrain at the far end of the cosmos. Huddled into the lone Echo Base are all their major players: politically crucial Princess Leia; ace pilot Han Solo; and their game- changer, Luke Skywalker, who isn't even a Jedi yet.

The defenses the Alliance constructed on Hoth could not be more favorable to Vader if the villain constructed them himself. The single Rebel base (!) is defended by a few artillery pieces on its north slope, protecting its main power generator. An ion cannon is its main anti- aircraft/spacecraft defense. Its outermost perimeter defense is an energy shield that can deflect Imperial laser bombardment. But the shield has two huge flaws: It can't stop an Imperial landing force from entering the atmosphere, and it can only open in a discrete place for a limited time so the Rebels' Ion Cannon can protect an evacuation. In essence, the Rebels built a shield that can't keep an invader out and complicates their own escape.

When Vader enters the Hoth System with the Imperial Fleet, he's holding a winning hand. What follows next is a reminder of two military truths that apply in our own time and in our own galaxy: Don't place unaccountable religious fanatics in wartime command, and never underestimate a hegemonic power's ability to miscalculate against an insurgency.

Via Jason Kottke, Inside the Battle of Hoth: The Empire Strikes Out | WIRED

Let's see … in “Star Wars,” a major design flaw in the Death Star lead to its destruction at the hands of a rooky fighter pilot in his first battle, and in “Return of the Jedi,” their second Death Star was destroyed by a rebel fleet after their only source of defense was taken out by ex-smuggler and a group of walking teddy bears.

And now this, the movie that supposedly shows the Empire at it's best.

Yeah, the Empire doesn't seem all that competent now.

Sunday, January 25, 2015

The Meow of HTTP status codes

If you were ever curious about the various status codes of HTTP, or if you like cats (or both!) then you might want to check out HTTP Status Cats (link via BoingBoing).

Monday, January 26, 2015

On napping

Ah, after work naps. How do I love thee? Let me count the ways …

  1. Zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz

Tuesday, January 27, 2015

A fine line indeed

In C (and Lua, PHP, Python and just about any other language you'll find on Unix), you use the function strftime() to format a timestamp based on a format string. I always have to look up the format when I want to use it, but hey, it's not like I do it all the time (otherwise, I wouldn't have to look this up).

Anyway, it seems that Go is … different (of course! Rob Pike & Co. know better and feel that replacing the entire development chain is the way to go, what with mandating a coding style in the language design and a static-only linking technology straight from the 70s and its own runtime and standard library … but I digress), and I'm still trying to decide if the approach is stupid or clever—to specify the format with an example! (link to this via Hacker News).

const (
        ANSIC       = "Mon Jan _2 15:04:05 2006"
        UnixDate    = "Mon Jan _2 15:04:05 MST 2006"
        RubyDate    = "Mon Jan 02 15:04:05 -0700 2006"
        RFC822      = "02 Jan 06 15:04 MST"
        RFC822Z     = "02 Jan 06 15:04 -0700" // RFC822 with numeric zone
        RFC850      = "Monday, 02-Jan-06 15:04:05 MST"
        RFC1123     = "Mon, 02 Jan 2006 15:04:05 MST"
        RFC1123Z    = "Mon, 02 Jan 2006 15:04:05 -0700" // RFC1123 with numeric zone
        RFC3339     = "2006-01-02T15:04:05Z07:00"
        RFC3339Nano = "2006-01-02T15:04:05.999999999Z07:00"
        Kitchen     = "3:04PM"
        // Handy time stamps.
        Stamp      = "Jan _2 15:04:05"
        StampMilli = "Jan _2 15:04:05.000"
        StampMicro = "Jan _2 15:04:05.000000"
        StampNano  = "Jan _2 15:04:05.000000000"
)

Yes, you specify how you want the date formated by writing out January 2nd, 2006, at 3:05 PM in Mountain Standard Time (of course!) however you want it. Never mind that the 1-2-3 sequence is the American “month-then-day” format (Europe? Isn't that near New England somewhere? Across some pond or something).

Now, it's not the first language to specify output using an example. Some versions of Microsoft Basic had that feature to specify numeric output, but I've never seen anything quite like this.

And the justification for it?

I think the litmus test is that if a function's usage is so hard to remember that someone is motivated enough to create a domain and web site whose only purpose is to make it easier to remember where to find the documentation, then that function is broken. (http://strftime.org/)

Time.Format doesn't need to be the kitchen sink. If you need more control, there is always fmt.Sprintf. Unlike C's struct tm, Go's time.Time does not require the addition of magic constants to turn struct fields into printable values.

Time formatting - Google Groups

I'm still unsure how I feel about this.

Wednesday, January 28, 2015

Those Compiler Warning Blues

It's always instructive to crank the warning level up on compilers. It also helps to use different compilers since they tend to warn about different things. With GCC, I use -Wall (which sadly, isn't all possible warnings) but today I learned that clang (the default compiler on Mac OS-X these days) has a -Weverything option, so hey, why not try it?

Wow!

It's not kidding—it warns about everything! Missing prototypes, gratuitous use of packed structures, added padding to structures, signed conversions (not only unsigned to signed, which I can see possibly losing information, but signed to unsigned, which doesn't), loss of interger precision, relying on auto-conversion of function calls (in my case, assigning the result of a function that returns a double to an unsigned long long variable), alignment changes in unions, even “default label in switch which covers all enumeration values.”

It's a lot of output to pour through. And this is for code that passes cleanly through GCC.

But in the ton of “legal, even if a bit questionable C” it still managed to find a real bug in my code:

In file included from common/XXXXlib.c:11:
third_party/uuid/src/uuid.h:34:17: warning: 'SHORT_MAX' is not defined, evaluates to 0 [-Wundef]
#if RAND_MAX == SHORT_MAX
                ^

It's a typo—it should be SHRT_MAX (apparently, there was a severe shortage of vowels in 70s computing, which is why C got stuck with a bunch of vowel-impaired identifiers—sheesh!) but at the same time, it's perfectly legal C, which is why I never noticed this until now.


The new video card, round two.

Last week, I initiated a return of the video card with Amazon. I stated my reason for returning it:

I received an ATI Technologies Inc RV370 [Radeon X300SE], which works, but is not what I ordered.

and I was informed that I should hear back from the third party company I ordered the video card from in less than 48 hours.

Nearly a week later, and I had yet to hear back.

I logged into Amazon to lodge another complaint when I stumbled across the message the third-party company sent to me (the following day, on the 21st), along with the error that prevented the email from being delivered:

Final-Recipient: rfc822; Sean Conner <sean@conman.org>
Action: failed
Diagnostic-Code: smtp; 554 4.4.7 Message expired: unable to deliver in 840 minutes.<450 <sean@conman.org>: Recipient address rejected: Service temporarily unavailable>
Status: 4.4.7

XXXXXX! Amazon ran afoul of my greylisting daemon (Amazon is acting as a proxy between me and the third-party company—neither one of us has the other's true email address).

Checking the logs confirmed what I suspected happened: every attempt by Amazon to deliver the email came from a different IP address, which caused the greylist daemon to treat each attempt as a separate email and thus, block each attempt.

Sigh.

Once that was cleared up, I got the story as to what happened. The third-party company had run out of the video card I requested, and since the card they sent contained the same connectors and amount of memory, they felt it would be acceptable. Had I the right drivers, it might have been acceptable. But I didn't, so it won't.

The third-party company apologized for sending the wrong card. They also said they just received a new shipment of the video card I did order and they're sending one to me. All I need to do now is return the original card they sent back once I get the right card.

So … round three!

We shall see how this goes …


Loving County, Texas

… his phone rang with an old-fashioned warning: “You don't know it, but you're in trouble.” A group was planning a takeover of the county, said the caller, a woman in Arizona who promised to send him some information by e- mail. The material described the plans of a Libertarian faction in its own words “to win most of the elected offices in the county administration” and “restore to freedom” Loving County.

The goal, said an e-mail message attributed to a group member, was to move in enough Libertarians “to control the local government and remove oppressive regulations (such as planning and zoning, and building code requirements) and stop enforcement of laws prohibiting victimless acts among consenting adults such as dueling, gambling, incest, price-gouging, cannibalism and drug handling.”

Now pictures of the three decorate a poster on the sheriff's door at the Loving County Courthouse under the timeworn Wild West legend: “Wanted by the Texas Rangers.”

1 Cafe, 1 Gas Station and 2 Roads: America's Emptiest County

Oh real life! You are so much better than satire these days.

Thursday, January 29, 2015

A Software Archeological Approach to the First Video Game

At the Higham Institute sessions some months back, he and his friends had discussed the criteria for the ultimate display hack. Since they had been fans of trashy science fiction, particularly the space opera novels of E. E. “Doc” Smith, they somehow decided that the PDP-1 would be a perfect machine to make a combination grade-B movie and $120,000 [about $950,000 today —Editor] toy. A game in which two people could face each other in an outer-space showdown. …

Peter Samson, for instance, loved the idea of Spacewar, but could not abide the randomly generated dots that passed themselves off as the sky. Real space had stars in specific places. “We'll have the real thing,” Samson vowed. He obtained a thick atlas of the universe, and set about entering data into a routine he wrote that would generate the actual constellations visible to someone standing on the equator on a clear night. All stars down to the fifth magnitude were represented; Samson duplicated their relative brightness by controlling how often the computer lit the dot on the screen which represented the star. He also rigged the program so that, as the game progressed, the sky would majestically scroll at any one time the screen exposed 45 percent of the sky. Besides adding verisimilitude, this “Expensive Planetarium” program also gave rocket fighters a mappable background from which to gauge position. The game could truly be called, as Samson said, Shootout-at-El-Cassiopeia.

Another programmer named Dan Edwards was dissatisfied with the unanchored movement of the two dueling ships. It made the game merely a test of motor skills. He figured that adding a gravity factor would give the game a strategic component. So he programmed a central star a sun in the middle of the screen; you could use the sun's gravitational pull to give you speed as you circled it, but if you weren't careful and got too close, you'd be drawn into the sun. Which was certain death.

Before all the strategic implications of this variation could be employed, Shag Garetz, one of the Higham Institute trio, contributed a wild-card type of feature. He had read in Doc Smith's novels how space hot-rodders could suck themselves out of one galaxy and into another by virtue of a “hyper-spatial tube,” which would throw you into “that highly enigmatic Nth space.” So he added a “hyperspace” capability to the game, allowing a player to avoid a dire situation by pushing a panic button that would zip him to this hyperspace. You were allowed to go into hyperspace three times in the course of a game; the drawback was that you never knew where you might come out. Sometimes you'd reappear right next to the sun, just in time to see your ship hopelessly pulled to an untimely demise on the sun's surface. In tribute to Marvin Minsky's original hack, Garetz programmed the hyperspace feature so that a ship entering hyperspace would leave a “warp-induced photonic stress emission signature” a leftover smear of light in a shape that often formed in the aftermath of a Minskytron display.

The variations were endless. By switching a few parameters you could turn the game into “hydraulic Spacewar,” in which torpedoes flow out in ejaculatory streams instead of one by one. Or, as the night grew later and people became locked into interstellar mode, someone might shout, “Let's turn on the Winds of Space!” and someone would hack up a warping factor which would force players to make adjustments every time they moved. Though any improvement a hacker wished to make would be welcome, it was extremely bad form to make some weird change in the game unannounced. The effective social pressures which enforced the Hacker Ethic which urged hands-on for improvement, not damage prevented any instance of that kind of mischief. Anyway, the hackers were already engaged in a mind-boggling tweak of the system they were using an expensive computer to play the world's most glorified game!

Hackers: Heroes of the Computer Revolution

Whenever I read Hackers, I was always wanted to play the version of Spacewar described and see the code. Sure, I had played the arcade version multiple times, and I even had a version of Spacewar for the IBM PC that I ran through a disassembler, printed the results and spent a summer going over the code (okay, this was back when I had the time to do such things, in high school) to see how it worked, but neither version sounded quite like the description in Hackers.

Now, thirty years later, computers are now fast enough that an emulator of the original Spacewar can be written in a scripting language and run on a web browser! Even better (well, for various values of “better”) is the extensive writeup about how Spacewar works, along with the actual source code (along with explanations of how one programs the PDP-1, a 5MHz 18-bit 1's complement machine with 4,096 18-bit words of memory.

My, how far we've come in 50 years.

Friday, January 30, 2015

Your surreal moment of the day

An abominable sight of monks (no, really!) chanting “Losing My Religion” (no, really!).

That is all.

Saturday, January 31, 2015

Some commentary about comments and commit messages

Whoever wrote line 4 of the following code snippet decided to access the clientLeft property of a DOM node for some reason, but do nothing with the result. It’s pretty mysterious. Can you tell why they did it, or is it safe to change or remove that call in the future?

If someone pasted you this code, like I did here, you probably won’t be able to tell who wrote this line, what was their reasoning, and is it necessary to keep it. However, most of the time when working on a project you’ll have access to its history via version control systems.

Via Hacker News, Every line of code is always documented

At work, a former developer would always include a huge comment at the top of each file, describing the history of bug fixes to the code. It looked something like this:

//---------------------------------------------------------------------------
//
// HISTORY OF CHANGE  
//
// -----+--------+------------------------------------------+------+---------
// VERS | DATE   | DESCRIPTION OF CHANGE                    | INIT | PR#
// =====+========+==========================================+======+=========
//  001 |06/09/05| File creation.                           | ABC  | B1017 
// -----+--------+------------------------------------------+------+---------
//  002 |06/24/07| Optimize the fob.                        | XYZ  | B1130
// -----+--------+------------------------------------------+------+---------
//  003 |01/08/08| Make the fob more flexible.              | XYZ  | B0019
// -----+--------+------------------------------------------+------+---------
//  004 |04/15/09| The fob wasn't frobbing the widget.      | XYZ  | B0021
// -----+--------+------------------------------------------+------+---------
//  005 |02/02/10| Reduce the size of the gadget handler.   | XYZ  | B0005
// -----+--------+------------------------------------------+------+---------
//  006 |04/05/10| Work around Whatzat Protocol bug.        | XYZ  | B0024
//      |04/14/10| Generalize the widget protocol.          |      | B0007
// -----+--------+------------------------------------------+------+---------
//  007 |01/20/10| Performance enhancement.                 | XYZ  | B1019
// -----+--------+------------------------------------------+------+---------
//  008 |03/09/11| Race condition between hare and turtle.  | XYZ  | B1019
//      |03/15/11| Beef up authentication.                  |      | B1021
// -----+--------+------------------------------------------+------+---------

Seeing how we already use a version control system, which already contains this information and thus, there is no real need to put this in the source code itself, I asked him about it.

“Because not everyone has access to the version control server,” he said.

“What? Who can see the source code but does not have access to the version control server?” I asked.

“Customers we license the code to,” he said.

“But we don't license the code to anyone,” I said.

He then stormed off, saying I didn't understand how software was developed, but I think I see where he was coming from. He has a side-company where he licenses the source code to his products and didn't want his customers to have access to his version control server. Adding this information to the files themselves let his customers know what has been fixed. But he kept the practice up at The Corporation because that's the way he's always done it. It made sense for his company, but not for The Corporation. We aren't going to license this code to anyone, and anyone that is working on it has access to the version control server and can see the entire history of any of the files in the project.

But that's not to say that all commentary about the code should go exclusively in version control. The history of bug fixes, yes, that can go into version control as there's no need to clutter up the source code files with that information. But comments that describe why the code is doing something odd should go in the file itself, above the odd bit of code.

For example, in my own blogging engine, I have this commit:

commit eab6ecb7149f8b70614657cd20fe09337cf5e977
Author: Sean Conner <spc@conman.org>
Date:   Tue Jan 15 23:43:19 2013 -0500

    Bug fix---tumbler problems, but not necessarily with the parsing
    
    The intent was if the start date was later than the end date, swap the
    two dates and set the reverse flag.  Unfortunately, the logic to
    determine the swap was wrong.  Wong wrong wrong wrong wrong.  I moved
    the check down, and rewrote the check logic.  It should be fine now, but
    get back to me in another decade.

But the code that handles this is a bit odd (it was even worse before I fixed it) so I added a comment to the modified code:

    /*------------------------------------------------------------------------
    ; swap tumblers if required.  If the parts are the default values, swap
    ; them, as they probably weren't specified and need swapping as well.
    ;
    ; Example:
    ;
    ;     2000/02/04    - 01/26
    ;  -> 2000/02/04.1  - 2000/01/26.23
    ;  -> 2000/01/26.23 - 2000/02/04.1
    ;  -> 2000/01/26.1  - 2000/02/04.23
    ;
    ;-----------------------------------------------------------------------*/

    if (btm_cmp(&start,&end) > 0)
    {
      struct btm tmp;

      gd.f.reverse = true;
      tmp   = start;
      start = end;
      end   = tmp;

      if ((start.part == 23) && (end.part == 1))
      {
        start.part = 1;
        end.part = 23;
      }
    }
  }

The comment describes what the code is doing (and shows an example; I'll admit, the comment could be a bit better). But notice how the commit describes why I made the change—it's a comment on the comment as it were.

Obligatory Picture

[The future's so bright, I gotta wear shades]

Obligatory Contact Info

Obligatory Feeds

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: https://boston.conman.org/, then add the date you are interested in, say 2000/08/01, so that would make the final URL:

https://boston.conman.org/2000/08/01

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-2024 by Sean Conner. All Rights Reserved.