Archive for the ‘Science/Technology’ Category.

New web toy: Mobile dice!

“NO SOONER DO YOU DEFEAT THE TROLL THAN AN UMBER HULK APPEARS! ROLL INITIATIVE!” Photo courtesy Douglas S. Smith, found on wp

Surely it has happened to you: you’re out somewhere and need a random number, or a whole bunch of them. For me, this mostly happens at restaurants, when I would like to consult an Infallible Oracle as to which of N tasty possibilities is right for me on a given day. But maybe you’re playing Dungeons and Dragons in free-fall (this makes conventional dice less than useful). Perhaps you have found yourself diceless and kidnapped by a capricious yet mathematically sophisticated evil overlord, who will not free you until you have completed a Monte Carlo simulation by hand. I would like to help you, and if you’re that last guy I mentioned, buy you a drink.

Text “rolldice somestuff” to 41411, where somestuff is either a number or a D&D-style specification of how many dice to roll, and how many sides each die has. If you say just one number, you’ll get a reply with a random number between 1 and your number, inclusive, so sending “rolldice 6″ is like rolling a single, ordinary six-sided die; “rolldice 3″ will help you decide among the apple-glazed pork chop, the mahi-mahi on pan-fried noodles, and the five-spice steak. To use a D&D-style dice specification, put a “d” between the number of dice and the number of sides, so you would say “rolldice 3d10″ to get three random numbers between 1 and 10 (”three ten-sided dice”), or “rolldice 3d6″ to roll up your character’s stats old-school in that aforementioned free-fall role-playing scenario.

The way this was done is fairly cool, by the way: I used the free, ad-supported web service TextMarks to handle all the SMS-gateway logic, and then threw together a simple cgi script to handle the dice-rolling logic. Setting aside the time I spent figuring out that my newly-installed FTP client was set up wrong and mangling my script, the whole exercise took less than half an hour, which is nothing short of amazing – TextMarks 41411 is a marvel of simplicity.

Like arguing on the Internet

Adapted from this, and likewise made available under the GFDL

Toshiba, key player behind the HD-DVD format, announced this week that they’ve called in the priest for last rites. The conventional wisdom holds, then, that the competing Blu-Ray format “wins” the high-def format war. Honestly, I don’t buy it. It’s not clear to me that there’s anything to win. Downloaded or on-demand content is the next, and in some senses final, medium of choice for movie distribution; Blu-Ray gets to be King of Nothing for a day at best.

Consider: High-end computer monitors already offer resolutions of 1600 lines (2560×1600 glories in the entirely parody-proof name “WQXGA”) or more, compared to the 1080 lines addressed by today’s “high-def” content. Next year, there will be even more monitors with more than 1080 lines than there are this year, as an inevitable consequence of computer desktop creep. The year after that, there will be still more. At some point, it will become a selling point for high-end TVs that they are, as electronics salesthings are wont to say, “future-proof” in the same way as those computer monitors. Right around that time, some enterprising person, probably in the adult entertainment industry, will decide to sell content with 1600 or more lines of resolution, targeting the profligate. As a hard-coded standard, Blu-Ray is completely incapable of filling that many lines; it was written with VC-1 as its (arguably) highest-efficiency codec in terms of pixels/Mbit, and with Blu-Ray’s hard limit of 40Mbit/s video throughput, VC-1 can paint at most 1920×1080 at 24fps. On the other hand, a general-purpose computer, driving that same monitor, can add a new codec at any time. There is no pre-set limit on the throughput of its storage or network devices, and in fact we can expect that to remain a fast-moving target; thus, there is nearly no limit on the number of pixels per frame, or frames per second.

You will have your five-megapixel QSXGA smut, sure enough, but it is going to have to be delivered as “just data” rather than on a disc of the older, player-based kind. It may come on a BD-ROM, at least for a little while, but eventually will ship over the ever-accelerating Internet. Blu-Ray simply isn’t enough format, a problem compounded by the popularity and youth of the DVD format, and it seems likely that it’s destined for a northern winter’s day in the sun.

Sixteen more pictures of coffee

Documented here, the continuing saga of my attempt to master microfoam. Also, the awesomeness of ImageMagick. I was able to make that little montage with just a few keystrokes, by putting just the sixteen pictures I wanted in a directory by themselves, changing to that directory, and saying…
md small
for %i in (*.jpg) do convert %i -resize 100 -filter Lanczos small\%i
cd small
montage *.jpg -geometry +1+1 ..\montage.jpg
Note that “convert” and “montage” are two of the programs in the IM suite. I do have one small complaint about IM — why is it that I can’t take all the results of a batch transformation and “pipe” them into a multi-image operation like montage? The support for piping single images is incredibly handy, and it would be awesome if it could be generalized.

Tech update

Embarrassingly, I didn’t notice that the previous/next links at the bottom of each page weren’t working, as a consequence of my changes to support the moblog. What I needed to do was query_posts($query_string . "&cat=-16");, rather than just query_posts("cat-16");. What a silly thing to miss…

Fully operational

“As you can see, my young apprentice, your friends have failed. Now witness the firepower of this fully armed and operational battle station!”

Google Maps has just put up Street Level images for Pittsburgh, PA, and my friend Brian discovered evidence that the next-generation weather control laser, which the University of Pittsburgh has been developing for years, has now gone into production mode. Mounted to the 42-story Cathedral of Learning on the Pitt campus, it is the first weapon capable of dispersing Pittsburgh’s persistent (some would say “constant”) cloud cover. It is also capable of vaporizing a human target in orbit, which will be handy when Space Hitler inevitably returns. Critics have complained about the expense of the project, pointing out that there are plenty of other skyscraper-based death rays, but proponents emphasize that none match the Pitt device for energy density, total photon flux, or appetizing pierogie aroma.

Cleans to a shine, robot dancing

A kind of funny story: Punam and I were in Bangalore on New Year’s Day. We went to the Leela Palace for the brunch buffet, which, to my delight, offered pork and sauerkraut per the German tradition. I happened to notice that one of the bussers had a bottle of cleaning fluid which bore a most auspicious name…

And then, during an episode of the drama Parrivaar on ZeeTV, I couldn’t help but notice a familiar bottle in the hands of a servant. I wasn’t even watching it full-screen, just in a PiP window while I figured out which football game was likely to be most enjoyable.

It is astonishing how, given just a few pixels, smeared out by JPEG artifacts, I was able to pick out a weak brand identity to which I was exposed just once. In the screen grab on the left, the enhanced portion was created by applying edge detection, probably replicating what my retina had to work with (once you add the colors back in), and you can see it’s not the kind of data you’d want for an OCR project, yet my recognition was instantaneous and thoughtless.

The clear corollary to all this: everyone needs a recognizable, colorful brand to maximize their memorableness.

Like this, maybe. People are really sensitive to primary colors. That red, in a region of high contrast, is good for getting attention, right? It worked for the red lettering on a yellow background on the bottle of Colin cleaner.

And now, robot dancing! There are some excellent new pictures of Dante up, tagged with “week five”. You need to see them! Dante is bathed, his hair is temporarily tamed with the application of water, and he has an encounter with a robot (or maybe not — this, after all, is “コレジャナイロボ: IT IS NOT THIS!”, a sort of Engrish antinomy with the Pentateuchal “I am that I am.”).

Update: I was finally moved to do some research on this robot, a gift from some of our East Coast friends. I am a very, very poor and very, very slow reader of Japanese, so this was a painful process. It turns out that Zarigani Toy Works, in Japan, produced this highly generic and yet crappy toy robot to ensure that when an adult gives it to a child, that child will be disappointed that it isn’t the right robot, already a likely a priori outcome due to the large number of robots from which a Japanese adult would have to chose. The small child might, in fact, say, “kore ja nai!” — “This isn’t it!” (or more poetically, “IT IS NOT THIS!”). I’ve turned to Google’s machine translation engine for a doubly hilarious crib to share with the world

“As for wanting this – it is!!” The scream of sad it is given out from the child who opened the present. Christmas of pleasant expectation suddenly, in the shambles. Is there such experience? If possible, it is something which we would like to avoid. But life, many risks as for the how story which enters into the dying hand so there are no desired ones. In order to obtain desired ones also it is good to know that in a some opportunity also effort is necessary, probably will be.
As for “[korejiyanairobo]” the exquisite copy impression, with parenthesis trick, the it probably is to convey to the child with the effect of trauma class.
Please try by all means as a sentiment education toy.

Where the Moblog?

Just a bit uglier than this guy, they were… cc-by-nc photo by finstr.

I decided that moblog postings — those made from my phone and usually containing little to no text — will look better if they’re taken out of the usual run of the site’s layout and put on their own page. To that end, I’ve added a link to the moblog up above in the menu area, added a little widget to display my most recent few moblog posts over in the sidebar, and retained the ability to see those posts by clicking on the Category link or in the by-date archives.

One nice thing is that I can now come up with a new template just for moblog entries, if I decide that would be fun. So far, meh. Maybe later.

For now, I just hardcoded everything and inlined the code changes, but perhaps going forward I can package the changes into a plugin. Here’s what I had to do: Continue reading ‘Where the Moblog?’ »

Dante on the bench

Clean babies are agreeable, but how efficient are they?

Just a few new pictures are up on Flickr, available here.

Last night, Punam and I bathed Dante; it took about half an hour. I couldn’t help but think that my surface area must be an order of magnitude greater than his (I outweigh him about 25:1), and it only takes me about seven or eight minutes to shower. Data, clearly, needed to be collected!

I settled on a simplified model of the body that would be a fairly close estimate and would only require seven measurements: Consider the torso and each limb as a cylinder, with length measured in the obvious way and circumference measured around the middle part (above the knee, below the elbow, at the bottom of the ribcage), then fit a sphere around the head (circumference measured as if for a hat). Here’s what I got, for Dante and for myself, in cm:

GuyLeg lenLeg circArm lenArm circTorso lenTorso circHead circ
Dante16 11.5 1910.5 26 35 35
Colin 8443 77 298092 60

Multiplying each length by its corresponding circumference gives us the surface area of the cylindrical components. The head’s SA is just c2/π. Adding up the results, I estimate Dante’s surface at 6435cm2 and mine at 37719cm2 — just about six times greater. Dante (3.2kg) has a SA:mass ratio of 2011cm2/kg compared to 460 in my case, which underlines the commonplace that babies have to work a lot harder than adults to thermoregulate (roughly four times harder). But more importantly for our purposes, we learn that Dante’s totally factitious Bathing Efficiency Coefficient is 6435 cm2/30 min = 3.57cm2/sec against my 78.6cm2/sec, so we can conclude that bathing him is quite inefficient.

That said… we’re not going to skimp on it or anything. Clean babies are very nice to have around.

Edit: Forgot that each kind of limb comes in pairs. Doubled their contributions, updated numbers, point still intact.

Dynamic entry!

I’ve redesigned the site using a custom dynamic-width theme based on Srini G’s Fluid Blue theme. Now it will look less stupid on wide screens, I hope. If you’re using Internet Explorer, the header may be slightly broken*. I’m working on it, but in the meantime, have you considered switching to Firefox or Opera?

As for “Dynamic Entry”… well, it’s one of those Internets memes, don’t ya know. Here’s what I found:

*update 20 May 2007: I fixed this, but it’s ugly. Turns out that there are still a few box model issues even in Internet Explorer 7, which put most of them to bed. I had to do a sort of mini-browser-detection to see if a user is coming in with IE, and if so then reset the title’s padding in the style sheet. Yuck.

A koan

Koan

Huge!
The control which can be frobbed is not the true control. / Photo: Ian Easton

Earlier this evening, Punam and I used the self-checkout station at the grocery store. At first, everything proceeded normally – I entered my club card number, scanned the OJ and veggies, indicated that we were done, and chose to pay by card. The familiar prompt appeared on the touchscreen: “Please use the PIN pad to complete your transaction.” I looked down at the display of the PIN pad, which helpfully was telling me to “USE TOUCHSCREEN TO COMPLETE TRANSACTION.” The completion of the transaction did not inhere in the PIN pad or the touchscreen, but in the resignation of the possibility of completion.

At that moment, we achieved enlightenment.

Then the Clerk responsible for overseeing the self-checkouts plokta’d (pressed lots of keys to abort) the PIN pad to induce an error state in the system, from which it recovered normally and re-prompted me to choose a method of payment.

Colin’s Commentary

Truly, Clerk has the Buddha-nature. But does the PIN pad? The touchscreen? To answer is to demonstrate your own lack!

Neither rain nor rock becomes a canyon.
Neither PIN pad nor touchscreen
offers direction toward enlightenment.
The master unlocks any door with every key, all at once.

More koans here.