Thursday, May 08, 2008

"I must use this power only to annoy"

I clicked on an Amazon link to a product the other day and it lead me to its product page. Everything there is fine, except instead of a price, there was a link that read "Click here to see the price". There was also another link that read (Why don't we show the price?) which contained the following text:


Why Don't We Show the Price?

Manufacturers sometimes ask that retailers not display a price if it drops below a certain amount. The "click here to see price" message indicates that the price of the item is so low that the manufacturer requested that it not be advertised (that is, displayed). In a brick-and-mortar store, you would probably have to ask a salesperson what the price of the product is. At Amazon, by clicking on "click here to see price" you are essentially asking to see the price, at which point we show it to you.


Ummm... WTF? If I didn't see a price in a brick-and-mortar store, I wouldn't buy the item! You forcing me to click just to replicate that have-to-ask experience is forcing me to replicate my wouldn't-buy-the-item reaction. I hope you're happy about your lost sale.

Tuesday, April 29, 2008

Hi-tech alumni

What appeared to be a joke article at first glance (Cravath sounds like the french word for a tie) turned out to be a very insightful post by Alex on the topic of quitting and more generally about the habits of a certain class of software developers. I couldn't agree more! In fact, I have found myself proud to announce to my peers that I have worked at Microsoft and Macadamian; that I'm an alumnus or a graduate of sorts from their respective schools [of thought], that I embody some/most of their best practices and serve as a kind of unofficial ambassador.

I can relate to the "bus factor" concept and can even suggest a tangible metric: fantastic developers (who are thus likely to quit) are usually top contributors to corporate wikis, since they are constantly externalizing their knowledge for future colleagues/replacements. This, ironically, increases their value since they can spend more of their [precious] time solving new problems instead of being constantly disturbed for knowledge and acting as a "walking wiki" (which Alex calls "unskilled people"). It's not hard to see how true synergy is achieved by having all documentation at everybody's fingertips. This is what Bill Gates called a Digital Nervous System.

The next logical step to documenting is automating. So even if you feel your "bus factor" is low because everything is documented and your team spends a lot/most of their time solving new problems (which is, by itself, an excellent start) documented AND automated processes are the true mark of excellent talent.

So, in the spirit of the topic, I will quit my job (and there's nothing wrong with that), but I just haven't decided when. And if I start a company, I will include a link to this article in the corporate wiki.

P.S.: I'm posting this to my blog from Google Docs. I had this idea that it would be great to be able to do so and, lo and behold, there it was, under Share/Publish as web page...

Update: Ok, it posted, but without a title and the HTML was definitely not clean, but it's a start. I probably just need to tweak a few styles.

Friday, February 29, 2008

PalmPilot Jr

Having received my XO's developer key, I immediately upgraded the operating system to build number "Joyride 1638", using one of those "USB-based memory sticks". The large PDA/small laptop now appears to switch to some form of low-power mode whenever the lid is closed, when in "Reader mode" and in the middle of yum-based downloads. A tad too aggressive, if you ask me, but that's life when installing unstable software. It may have had something to do with having the Reader activity opened at the same time, but in any case, I don't think suspending is necessary when the laptop is plugged in. Maybe it would be OK after a much longer timeout, say 10 minutes.

Other than that, the new power management features (coming from build 653 -- which I think had absolutely none, except maybe for the "blank screen" screensaver -- these features are totally new) are really spiffy, and allowed me to go from a full charge this morning and still be going after a ride on the bus, followed by a full day of work (where it spent most of that time closed up). Hmmm... Maybe I didn't explain that correctly, so I'll switch to rough pseudo-code:


laptop.powerMode = PowerMode.OnBattery;
laptop.radio = RadioMode.Off;
me.use ( laptop, 30 /* minutes */ );
laptop.powerMode = PowerMode.Suspend;
Thread.sleep ( 1000 * 60 * 60 * 8 /* 8 hours in milliseconds */ );
laptop.powerMode = PowerMode.OnBattery;
me.use ( laptop, 30 /* minutes */ );
// because I didn't have to shutdown and boot up the laptop again
me.mood = Mood.Happy;


...there. I swear those "I write code" t-shirts were invented for me.


Anyway, there are still a few quirks, but the software is definitely getting there, which brings me to the whole point of this post: the XO should [eventually] be sold around the world. I'm thinking it could be ready and in all the stores where laptops and/or educational toys are normally sold (such as Walmart, Toys 'R' Us, ThinkGeek, Amazon.com, Future Shop, Best Buy, Fry's Electronics, Radio Shack, etc.) by next Christmas.

This form of distribution could expand their user base in a way that's not too dissimilar to the G1G1 program, minus the logistics nightmares associated with selling and shipping 80 000 units individually. This way, they ship say, 250 000 units in chunks of 10 or 20 thousand to a few retailers with established distribution channels and the foundation can then focus their efforts on what they do best (designing and building the laptop, marketing to governments of poor countries, etc.), instead of trying to also be a mass-distributor.

Of course, this assumes that the sale of XOs at retail would bring enough revenue to not only make this affordable to the foundation, but also to make money. I don't think they could pitch it for $400 (as in the G1G1 campaign) with a straight face (some Acer laptops are available now for $600), but they could probably do it for less than $200. At that price, they are starting to compete with other educational toys, as well as traditional PDAs that also come with a keyboard, word processing software, a web browser and an extended battery life.

I'm totally serious about this: it could be the source of volume they have been after to bring the price of the units down, not to mention the associated network effects. Think of it this way: as a parent, would you rather get your child an expensive, fragile computer made for adults or an inexpensive, rugged computer made for kids? ("hand-me-down clunkers" and sources of free tech support notwithstanding) How many people missed out due to the G1G1 campaign's short lifespan or high barrier of entry (i.e. you must create a PayPal account - even though the error message only said your credit card was not valid - and then have it authorized for large amounts - which means having it linked to a bank account - on top of the amateur-looking website and the uncertainty of shipping dates, etc.)?

Let's hope they read my blog and credit me after the associated success boom from implementing my master plan. You're welcome. :)

Tuesday, January 29, 2008

Blogging resumes (and other news)

After far too long of not blogging, I have arranged the circumstances to make it more likely I would blog through the use of an innovative concept I like to call "Blogging on the bus". Such a thing is now possible since the arrival of my late Christmas/early birthday present: an XO laptop (and about an hour of travel by bus to/from work every weekday).

I participated in the G1G1 (give one, get one) campaign and received the small laptop/large PDA device shortly two months after ordering it. Apart from being too small to allow me to touchtype, I really like it. It should be at least faster to write with than with my crusty old Palm III and also easier to read RSS feeds, etc. than same. I'm not sure I have figured out how to have it sleep and wake up (suspend/resume) really fast like my Palm did (thus never having to boot up/shutdown), but the OLPC wiki is nice and should have the answer.

UPDATE: The software that shipped with my unit does not support this yet:
How do I put an XO laptop to sleep?

The sleep feature is not enabled in software provided on XOs shipped starting December 2007 in the Give1Get1 program. A software upgrade early in 2008 will support suspend/resume sleep features, for much improved battery life.




Also worthy of noting is the successful completion of the courses part of my master's program at Carleton University. I now have to pick a decent topic and a supervisor to get started on this "other half". I'm hoping to add neat features to T.O.D.D. (a.k.a. testoriented), such as automatic testing, thus effectively putting me out of a day job. (ha ha)


Lastly, I would like to thank everybody who left words of thanks for my posting about Hacking the Microsoft Natural keyboard 4000, redux, as well as whoever drove all that traffic to my blog. I think we now have enough evidence to say that Microsoft definitely shipped the wrong mapping for that slider. I wonder if I should also start selling a little "Scroll" sticker (or, really, just a piece of electrical tape - such as this patch kit) alongside a floppy disk containing an automated and friendly version of the software I had posted, calling it an "upgrade kit" of some sort.

Tuesday, May 08, 2007

Your code is suboptimal!

I'm a sucker for t-shirts. Since I'm a geek with too much time on my hands, I'm part of an exclusive club. Then, because I read Eric Sink's Weblog, that makes me part of an even exclusiver club. Lastly, when I saw that Eric was offering to send some of his excellent t-shirts to people who were willing to mimic the character in a public photo plugging SourceGear's upcoming Fortress software, I couldn't resist the opportunity to sign up. 6-8 4-6 weeks later, here it is!

The t-shirt with the "Evil Mastermind" saying "YOUR CODE IS SUBOPTIMAL!" is part of an excellent marketing campaign.

Sunday, April 01, 2007

Please turn to page F%

I was reading the "Tech Weekly" section of a newspaper when I noticed that the staff are still typing page numbers by hand. How else could you explain page F5 (with page F3 folded up under it), as illustrated in this scan of a printout of a picture of a wooden table?


UPDATE: My submission to the Worse Than Failure website has finally appeared.

Saturday, March 31, 2007

They're more like guidelines...

Finally! An equivalent to SciTE's edge.* settings in Visual Studio! Trouble is, it's not called "edge" or "margin" (Eclipse), but "guidelines". No wonder I couldn't find anything on the topic when I was searching online!

Thanks go out to Sara Ford who blogged about this wonderful feature. If only I had known about this, oh, three years ago! :)

Here you go. Just copy/paste the following into a .reg file and import it. You can change the colour (currently a very pale green) and at which column you want it to show (currently at 80). You can even add more columns apparently, but that's getting a little silly.

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\8.0\Text Editor]
"Guides"="RGB(192,220,192) 80"

Monday, February 26, 2007

My name

It looks like Eber Irigoyen might be on to a new meme. I must propagate it by joining them in lamenting the mis-pronunciations of my names:
  • aw li vee eh
  • aw liver
  • dah gue naiz
  • dah gue nah
  • day je naiz
  • day je neh

As a result, I try to go by Oli, but this has proven to be equally as elusive as many people will write down Ali or even Holly! (WTF?)

Tuesday, February 20, 2007

Thanks for ruining it for the rest of us, guys!

Behold the power of stupidity on the internet, as I tried to e-mail a university computer science assignment to my professor:


 

https://mail.google.com

OlivierDagenais-Assignment1.zip contains an executable file. For security reasons, Gmail does not allow you to send this type of file.

I can sort of see how something like this could have come about: logs show users e-mailing executable files of various degrees of maliciousness.  Google reacts by deciding one malicious executable file is one too many and refuses to accept executable files as Gmail attachments.

Some clever user then thinks "My nefarious H@xx0Rz.EXE must be e-mailed to my clueless buddies... I know: I'll just zip it!".  Google notices again and here we are.  Encrypting my ZIP file would probably do nothing as you can list the names of the files without the key and so Google's clever little ZipSecurityPeeker.py only needs to check for the presence of files ending with .exe.

I ended up submitting the assignment using another e-mail account. I bet I could have CCed my GMail account and received the "insecure" attachment no problem.

UPDATE: Whoa! I didn't even have a .exe file in my ZIP archive! I have some .bat, some .cmd and some .pl, as well as one or two shell scripts without an extension. Most of those files, incidentally, shipped as part of Apache Ant, which I included in my assignment's ZIP archive so the professor wouldn't have to go hunt it down, install it, etc.

UPDATE 2: Nope, I can't receive it either because I apparently broke the law:


Your message cannot be delivered to the following recipients:

(...)
Reason: SMTP transmission failure has occurred
Diagnostic code: smtp;552 5.7.0 Illegal Attachment c5si5493294qbc
(...)

Saturday, February 10, 2007

Unit tests can be fun!

Here's a snippet of testing code from a university assignment I did last term where we had to create a model of an alarm clock using finite state machines and then test using the FSM testing techniques we learned in class. This is Java 5 code with some JUnit goodness.

/**
* It's 21:30 and I'm going to bed. I set the alarm time for 06:00 and then
* sleep until the damn thing wakes me up, but I don't want to get up just
* yet and I think 4 more minutes will change my mood today from
* "didn't get enough sleep" to "downright chipper" and so I slam my hand in
* the general direction of the drowse button (it has an 80%, no 70% chance
* of hitting it the first time) and then wake up a new man 4.2 minutes
* later, turning off the alarm functionality until I need it again the
* following night.
*/
@Test
public void SetTickRingDrowseTickRingStop ( ) {
// set clock time from 01:00 to 21:30
super.SwitchTimeSet();
// that is to say add 20 hours
for (int c = 0; c < 20; c++) {
super.HourButtonClick();
}
// and 30 minutes
for (int c = 0; c < 30; c++) {
super.MinuteButtonClick();
}
areEqual(21, 30, super.clockTime);

// set switch to Run
super.SwitchRun();

// set alarm time from 13:00 to 06:00
super.SwitchAlarmSet();
// which is to add 11 + 6 hours
for (int c = 0; c < 11 + 6; c++) {
super.HourButtonClick();
}
areEqual(06, 00, super.alarmTime);

// set switch to Run
super.SwitchRun();
assertTrue(super.IsAlarmOn());

// go to sleep for 8.5 hours
for (int c= 0; c < 8.5 * 60; c++) {
super.TickMinute();
}
areEqual(06, 00, super.clockTime);

// whoa, it's ringing!
assertTrue(super.IsTriggered());
assertTrue(super.IsRinging());
assertFalse(super.IsDrowsing());

// leave me alone for 240 more seconds!
super.DrowseButtonClick();
for ( int c = 0; c < 4; c++ ) {
assertTrue(super.IsTriggered());
assertFalse(super.IsRinging());
assertTrue(super.IsDrowsing());
super.TickMinute();
}
areEqual(06, 04, super.clockTime);

// whoa, it's ringing again!
assertTrue(super.IsTriggered());
assertTrue(super.IsRinging());
assertFalse(super.IsDrowsing());

// that's it, I'm getting up and turning this thing off
super.SwitchAlarmOff();
assertFalse(super.IsAlarmOn());
}

The test depends on some @Before method which resets the model (i.e. makes it just like the alarm clock just had batteries put in for the first time) and thus the the initial clock time is 01:00 and the initial alarm time is 13:00.  The model was created from observing the behaviour of an old Westclox travel alarm clock.

Wednesday, February 07, 2007

Backups of Subversion repositories

Here's the scenario: you are running a Subversion server and like all serious geeks, you want it backed up. This here post will show you how I do it for Windows and *nix _simultaneously_. I'm making the following assumptions:

Path typeWindows*nix
the subversion repositories are locatedd:\svnrepo/home/svn
the backup root folderd:\backups/home/backups
the subversion CLI(in the path)(in the path)


The first script performs not only a hotcopy backup of a repository (provided as the first parameter), but also first erases whatever backup might have been there (with a special provision for the very first time around) and creates a "dump" of the repository's contents, along with a final clean-up to save space. The reason we are keeping a dump over the contents of the db folder is that you can then "restore" your backup with a different version of Subversion. (trust me, I've lived through a catastrophic failure of a Subversion server and the dump format stays the same across versions while whatever's in the db folder doesn't necessarily)
Windows*nix
BackupAndDump.bat
@echo off
mkdir d:\backups\Subversion\%1\_backup
rmdir d:\backups\Subversion\%1 /s /q
svnadmin.exe hotcopy d:/SvnRepo/%1/ d:/backups/Subversion/%1/
svnadmin.exe dump d:/backups/Subversion/%1/ > d:/backups/Subversion/%1.svndump
rmdir d:\backups\Subversion\%1\db /s /q
backupanddump
#!/bin/sh
mkdir -p /home/backups/svn/$1/_backup
rm -rf /home/backups/svn/$1
svnadmin hotcopy /home/svn/$1/ /home/backups/svn/$1/
svnadmin dump /home/backups/svn/$1/ > /home/backups/svn/$1.svndump
rm -rf /home/backups/svn/$1/db



The second script iterates through all the repositories in a root folder and calls the first script (which, BTW, is located in the backup root folder) for each one.
Windows*nix
SubversionBackup.bat
@echo off
d:
cd \svnrepo
for /D %%d in (*) do d:\Backups\BackupAndDump %%d
svnbackup
#!/bin/sh
cd /home/svn
for d in *; do /home/backups/backupanddump $d; done


Well, that's enough for tonight. I'm sure all you Linux gurus out there are pointing and laughing at my noob-skills.

Tuesday, February 06, 2007

A new oxymoron: cybersurf reliability

Go head. Google it and, even there, you'll see enough of the following: (emphasis mine)

CIA.com : The Freedom of Choice
Cybersurf's premium Internet service utilizes the fibre backbones of Call-Net and Bell Canada for speed and stability, and the latest CISCO remote access equipment (modems) for state-of-the-art digital access and reliability.

...yet ONE link down, there's the sign-up page (emphasis mine):

Welcome to Cybersurf
Cybersurf, ITS PARTNERS, AFFILIATE PARTNERS AND CARRIERS MAKE NO REPRESENTATIONS ABOUT SUITABILITY, RELIABILITY, AVAILABILITY, TIMELINESS, AND ACCURACY OF THE SERVICES OR ANY UNDERLYING FACILITIES USED IN THE PROVISION OF THE SERVICES FOR ANY PURPOSE.

Err... aside from the "yes reliability, no reliability", they don't even acknowledge that future customers will be able to use the phone or internet to do anything? Legal and marketing need to have lunch together a little more often.


(Yes, yes, I know, standard "bait & switch"... I'm just pointing out it sucks, that's all...)

Saturday, January 13, 2007

That was easy!

So this [oldish] computer stopped booting properly about six months ago. It would start, but then mysteriously die during the sequence. I finally had a bit of time to check it out tonight, so I powered it up and noticed the POST would not only show a garbled version of "Maxtor" (and the model number), but also identify this 40 GB disk as about 8 GB. At this point, it would refuse to even boot and instead barf up with INVALID SYSTEM DISK, INSERT BOOT DISK AND HIT ENTER TO RETRY (or something just like it).

Anyway, I figured the hard disk wasn't that old and so I powered down and unplugged it. I noticed the ribbon cable wasn't quite straight (it was sort of folded onto itself, but not perpendicular to the wires), so being obsessive-compulsive as I usually am, I straightened it out, carefully plugged it back in and decided to give it a shot. Lo and behold, I'm blogging this from that computer.

Monday, January 08, 2007

Handy equivalents of Outlook Express keyboard shortcuts for Outlook 2007 users

Outlook 2007 is pretty neat but it's also a little awkward if you've been using Outlook Express a lot (or maybe even previous versions of Outlook). Since I'm a keyboard freak, here's my cheat-sheet of stuff that was really hard to find in the documentation (*cough* context sensitive help my ass! *cough*):


ActionOutlook ExpressOutlook 2007
Switch from plain text to HTML (while viewing a message and plain text is the default - which is what everybody should do)Alt+Shift+HCtrl+Shift+W, D
Focus on the folder tree (while in the main interface)TABCtrl+1
Insert default signature (while composing)Alt+I, SAlt+N, G, ENTER
Invoke smart tag (i.e. AutoCorrect Options)'s drop-down menunot applicableAlt+Shift+F10


Update: Until I put all the HTML code on one line, the spacing was way off, sorry. My "Preview" button doesn't really Preview. :p

Wednesday, December 20, 2006

Say what?

From Picasa's Terms of Service (emphasis mine):

Upon the termination of your use of Picasa Web Albums, including upon receipt of a certificate or other legal document confirming your death, Google will close your account and you will no longer be able to retrieve content contained in that account.


Errr... If I'm dead, do I care if I can't access content?

I'm afraid to ask if this rule is the result of a precedent.

Wednesday, December 13, 2006

What are my choices for "no"?


"Automatic Updates

Updating your computer is almost complete. You must restart your computer for the updates to take effect.

Do you want to restart your computer now?

[Restart Now]"

Whoa!  At least it's better than that "Your computer will restart in 5 minutes no matter what and I don't care if your name is Bill Gates and you're in the middle of a very important demonstration at the moment, so TOUGH LUCK."

For those of you who might be wondering how this could have happened, I run as a non-administrator on that computer and I "Remote Desktoped" back to my own machine as the administrator to install this Patch Tuesday's set of updates.  I wasn't quite ready to reboot, but Windows just needed to insist.

Thursday, November 30, 2006

Do what Technorati tells you to...

Oh, great. I think I just got suckered into another one of those linking schemes by accidentally creating a Technorati Profile so that I could post my picture somewhere or something.

Meh...

Do what the interweb tells you to

So I'm reading Larry O'Brien's blog and he tells me (well, not me personally, but you know what I mean) to not only click on a link, but also to link to it in my own blog. The destination page says the same, plus:


Ask your readers to do the same. Beg them. Relate sob stories about poor graduate students in desperate circumstances. Imply I'm one of them. (Do whatever you have to. If that fails, try whatever it takes.)


...who am I to resist orders from the internet and random blogs?

Wednesday, November 29, 2006

$how me the Shatner!

This show called Show Me The Money recently came out on ABC. It is hosted by William Shatner and feels like a cross between Who Wants to Be a Millionaire and Deal or No Deal.

Unsurprisingly - and appropriately enough but most likely on purpose - WFS feels like a cross between Regis Philbin and Howie Mandel.

Go....watch.....it! You know....you....want....to!

Hacking the Microsoft Natural Ergonomic Keyboard 4000, redux

Earlier I wrote about hacking IntelliType's commands.xml file to enable the use of the "Zoom slider" as a "Scroll slider". Having recently repaved my computer, I found myself installing the latest version of Microsoft IntelliType Pro (version 6.02, a.k.a. 6.02.303.0) and trying to apply the patch I posted earlier:


C:\Program Files\Microsoft IntelliType Pro>patch -p0 < command.patch
patching file `commands.xml'
Hunk #1 FAILED at 1606.
Hunk #2 FAILED at 1694.
Hunk #3 FAILED at 2122.
Hunk #4 FAILED at 2134.
Hunk #5 FAILED at 2152.
Hunk #6 FAILED at 2182.
patch unexpectedly ends in middle of line
Hunk #7 FAILED at 2224.
7 out of 7 hunks FAILED -- saving rejects to commands.xml.rej


B'oh! Err... I mean: D'oh! Ok, time for plan B: Zoom2Scroll.xsl


<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

<xsl:output method="xml" encoding="UTF-8" indent="yes" />

<!-- Pass-through (identity transform) template -->
<xsl:template match="* | @* | node()">
<xsl:copy>
<xsl:apply-templates select="* | @* | node()" />
</xsl:copy>
</xsl:template>

<xsl:template match="C319">
<C319 Type="6" Activator="ScrollUp" />
</xsl:template>

<xsl:template match="C320">
<C320 Type="6" Activator="ScrollDown" />
</xsl:template>

</xsl:stylesheet>


There. A quick trip to the command-line with my trusty xsl.exe:


C:\Program Files\Microsoft IntelliType Pro>xsl commands.old Zoom2Scroll.xsl commands.xml

C:\Program Files\Microsoft IntelliType Pro>


...and killing the IType.exe process, then re-launching that EXE again... it works! In your face, Larry Wall!

Oh, right. This post wouldn't be complete without the source code to xsl.exe. It's a JScript.NET program:


import System.Xml;
import System.Xml.Schema;

var src : String = System.Environment.GetCommandLineArgs()[1];

var transformer : System.Xml.Xsl.XslTransform = new System.Xml.Xsl.XslTransform ( );
var stylesheet : String = System.Environment.GetCommandLineArgs()[2];
transformer.Load ( stylesheet );

transformer.Transform ( src, System.Environment.GetCommandLineArgs()[3], null );


...which you can compile as follows:


C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322>jsc /nologo xsl.jsn


Thanks go out to the folks at Cute Overload for providing me with a [semi-]random web page to test the [new] scrolling capabilities of my "slider" in Internet Explorer.