Archive for the 'Tech Geekery' Category

Let me fire up the DeLorean

Friday, July 3rd, 2009

Found and reported a couple of PHP 5.3 bugs yesterday. That isn’t such a surprise; it’s a new release, after all, and we’re currently in the midst of developing code for the first time against 5.3 here at work. One of them is a crasher, but an obscure one reliant on the new-in-5.3 INI_SCANNER_RAW mode in parse_ini_file and a rather odd configuration file, so as these things go, it’s pretty minor, and scottmac has jumped on it very promptly indeed (thanks!). The response from Jani was interesting, though:

Thanks for not reporting this before release..

Now, Jani does a tremendous amount of work triaging PHP bugs and I — and every other PHP developer (particularly those of us who does this for a living) — owe him a huge debt for that. But frankly, I resent the implication that I’ve somehow sat on a crasher since before 5.3.0 was released and only submitted it now as some sort of weird vendetta against the PHP internals team. Funnily enough, I only found it while I was reducing the other, more trivial bug down to a minimal test case.

I get far worse things implied in my direction when I’m out on a Saturday night in Northbridge, so really, I’m not that fussed. (I’m obviously a bit fussed, though, since I’m writing this.) I do wonder how somebody new to the PHP community would feel, though — my guess is that you could forget about future bug reports in some cases, and that just isn’t a win for anyone.

Tarnished, Old, Boring

Thursday, June 18th, 2009

As is all over the Web, our good friends at Microsoft Australia have decided to give away some money1 to try and shore up IE 8’s market share. They’ve done this by setting up a Web site that tells you to use IE 82, and when you do, you get a little box that includes the tweets they’re popping on the competition Twitter account.

That’s all well and good — it’s Microsoft’s money, after all, and they can spend it however they like. That said, there are a couple of things I find rather odd about the whole shebang. The first is technical: thus far, the landing page they have only uses some remarkably simple server-side User Agent sniffing to decide which image to show and whether to show the box of tweets. It would be nice if they actually used the competition to showcase some nifty technology that IE 8 actually brings to the Web that the other browsers don’t have, but presumably ActiveX and VML3 don’t count these days, and that pesky Silverlight team actually get things working on other browsers, damn them. (The fact that the competition page detects a default IE 8 install as IE 7 is particularly hilarious, but well documented elsewhere, so I won’t go into that.)

The bigger thing I find strange is the verbiage. There are at least seven versions of the welcome image that get served up depending on your browser: Tarnished Chrome, Old Firefox, Boring Safari, IE 6, IE 7, a generic message for other browsers, and the IE 8 version that talks about the competition a bit.

The first thing that leaps out at me is the rather negative language used — if IE 8’s so much better that people are going to love it just as soon as they give it a shot (encouraged by the chance to win $10,000), surely there’s no particular need to pluck out some negative adjectives before the names of the non-Microsoft browsers. (Presumably Microsoft’s marketing department isn’t too keen on talking down IE 6 and 7, so no adjectives and no ditching of the browsers in those cases. Feel free to suggest appropriate adjectives for IE 6 in particular in the comments.) Talk up your own product, Microsoft!

The So get rid of it, or get lost line is a bit odd, too. It seems to be an attempt to be cool, hip and edgy, but it’s dangerously close to actually telling your prospective customers to get bent, which is the sort of marketing tactic that doesn’t work out very often. Particularly for people on non-Windows platforms, surely it might have been better from a brand image point of view to say something nice (Sorry, but to take part in this competition, you have to be running the sheer awesomeness of Windows?) rather than that rather strange, out of place comment.

From my point of view, the idea of a marketing campaign for a new browser version seems reasonable — the last thing Microsoft wants from a brand and technological point of view is a world dominated by alternative browsers — but this seems like a remarkably wrong-headed, badly thought out way of going about it.

(Legalities: the marketing images and copy linked above are © Microsoft Australia and are reproduced unmodified apart from the addition of a background colour for legibility. Fair dealing is asserted under section 41 of the Copyright Act 1968 for the purposes of review and criticism.)

1 Link appropriately nofollowed. I did debate whether to post this at all, given it’s an obvious attempt at a viral marketing campaign and Microsoft would want people to talk about it, but I felt the need to vent a bit, so I feel nofollow links are an appropriate compromise.
2 For what it’s worth, I don’t mind IE 8 anywhere near as much as 6 or 7 as a developer. Sure, it’s still horribly slow at executing Javascript — sorry, JScript — and lacks support for a whole bunch of useful features everyone else has had for years, but it’s not actively broken any more, which is nice.
3 I don’t know whether to laugh or cry at the continued support for VML in lieu of SVG in IE. There has to be some sort of stubborn as a mule award on that front.

Tethering iPhone 3.0 to Ubuntu 9.04

Wednesday, June 17th, 2009

So, I found myself with a copy of iPhone OS 3.0 a little ahead of the general release and felt the urge to get tethering working properly. (People who jailbreak have previously had the option of a few third-party products, the best known and easiest to use being PdaNet, also known as that software that wrought havoc upon the LCA 2009 wireless.) It turns out to be pretty seamless on OS X (and apparently also on Windows), but of course, that doesn’t do an awful lot for me as an Ubuntu user.

iPhone Internet TetheringThe iPhone provides two options for tethering: USB and Bluetooth. The USB option looks promising, but is a bit beyond my knowledge of the USB subsystem: lsusb provides information on a configuration called PTP + Apple Mobile Device + Apple USB Ethernet with a couple of interfaces labelled Vendor Specific Class; someone with crazy USB hacking skills will probably get that turned into a network device in due course, I suspect.

That leaves Bluetooth. The iPhone uses Bluetooth Personal Area Networking The good news for lazy people like me is that NetworkManager support is in the works, but until then, it’s still not too painful, as people have been tethering to mobile devices using PAN for a while.

The tutorials I found generally covered other distributions or older versions of Ubuntu, so here’s the process for Jaunty. First the one-time configuration:

  1. Install the bluez-compat package.
  2. Edit /etc/default/bluetooth to add the following lines:
    PAND_ENABLED=1
    PAND_OPTIONS="--role=PANU"
    

  3. Restart the Bluetooth service: /etc/init.d/bluetooth restart
  4. Add the BNEP network adapter to the /etc/network/interfaces file by appending the following line: iface bnep0 inet dhcp
  5. Get the Bluetooth address of your phone by running hcitool scan and jotting down the address next to your phone’s name.

Now the bits and pieces that need to be done each time:

  1. Pair your computer with your iPhone. If you’re using GNOME, the standard Bluetooth applet can handle that; presumably that’s true of the other flavours of Ubuntu as well.
  2. To connect, run these commands in your favourite shell, replacing 00:aa:bb:cc:dd:ee with the Bluetooth address you jotted down earlier:
    sudo pand --connect 00:aa:bb:cc:dd:ee -n
    sudo ifup bnep0
    
  3. At that point, life should be good and you should be connected. To disconnect later:
    sudo ifdown bnep0
    sudo pand -K
    

This seems to work rather well. The speed test results were noticeably better than they had been previously using the various ad-hoc network + jailbreak based solutions that I tried with iPhone 2.x; here at the office in sunny Osborne Park, I got about 850 kilobits down and 350 kilobits up (and a ping around 250 ms) on the notoriously crummy Optus 3G network, which is enough to actually be genuinely useful.

Thanks to InfoSec812 and wilbur.harvey (no relation!) for writing rather good tutorial posts on the Ubuntu Forums, which this howto is based on.

Sure, Why Not?

Thursday, April 23rd, 2009

Seen on the Facebook home page….

I love that guy!

Ronnie and I have been friends for a long time, of course, but I’d just never been able to find him on Facebook. Thanks, anonymous PHP coders!

(Yeah, I know what they’re really getting at, but if you’re going to repurpose the people you might know field to handle fan pages and the like, it might be time to rethink the name.)

IPv5.999999

Tuesday, January 20th, 2009

I’ve just had to push out a DNS update (damn you, tunnel brokers), so it probably won’t work automagically for a little while, but my blog is available over IPv6, if people want some IPv6 action here at the conference (great work, network team!) and can’t be bothered looking for a site that’s actually useful.

It’s also available over IPv6 Gopher, should you feel the need. (Well, regular Gopher, too, but that’s boring.) Huzzah!

The (horrible, hacky) code that drives this has also been updated to a brand new version: 0.2! (It only took 18 months.) Grab a tarball (SHA-1 sum: 044b1c5bf1a6d5fa1bd2cad3f2029bc1b2549c38) and you too could join the IPv6-driven, Wordpress Gopher blog revolution!

Addendum: Google Reader is mangling the links for some reason. The direct URL for the blog on IPv6 is http://[2001:5c0:1103:3300::1]/ or gopher://[2001:5c0:1103:3300::1]/.

New Toy

Sunday, April 20th, 2008

I’ve been rather frustrated with my camera (an old Pentax point and shoot) for a while. It’s not that it’s a bad camera, but the lack of manual control over things has been irking me after spending a couple of years playing with increasingly nifty video cameras at uni. So I resolved that, once I had the money, I’d be upgrading to a digital SLR.

Well, I had the money yesterday, so I exchanged it for this:

Nikon D60

Specifically, a Nikon D60, which is one of their entry-level DSLRs, along with 18-55 and 55-200 mm lenses. Even after a brief play with it, I wish I’d done this a year or two ago.

Should be good for my upcoming trip to Latvia and parts beyond in July. More details on that soon. You know, whenever we figure out where the hell we’re actually going. Current candidates include Azerbaijan, Georgia, Turkmenistan and Uzbekistan. Should be fun.

PEAR DB 1.7.14RC1 Released

Wednesday, November 28th, 2007

I’ve pushed out a beta release of PEAR DB versioned 1.7.14RC1 with a few fixes for issues reported since 1.7.13. Nothing in there is hugely urgent or high-risk, but I’ve made it a beta rather than a stable release due to the fact that I’m still a few thousand kilometres from my testing setup, which means that I’ve only been able to test against the databases I have to hand on my laptop — MySQL, PostgreSQL and SQLite.

All being well, I’m looking to get 1.7.14 final out around Monday (along with an Informix fix that I can’t work on without my Informix testing VM). Please feel free to test this release and report any issues.

Gutsy + MacBook Pro

Sunday, November 18th, 2007

I’ve had to contend with a few little annoyances since installing Ubuntu 7.10 on my new MacBook Pro, so here’s a short list of things that might help if you find yourself with the same issues I’ve had.

Problem: The CapsLock and NumLock LEDs don’t light up. To make matters worse, the NumLock key occasionally locks on, particularly after sleep, and the keyboard becomes essentially useless.

Solution: Uninstall mouseemu. It seems to be the source of this evil.

Problem: Without mouseemu, there’s no way to use middle and right click from the keyboard.

As long as you don’t need the mouse outside of X and don’t really care whether NumLock actually results in numbers rather than mouse movements, you can solve this with xmodmap and mouse keys support. In short:

  1. Turn on mouse keys. Within Gnome, that’s under SystemPreferencesUniversal AccessKeyboard Accessibility; select Enable Keyboard Accessibility Features, then go to the Mouse Keys tab and Enable Mouse Keys.
  2. Create a file called .xmodmaprc in your home directory with the following contents:
    keycode 95 = Pointer_Button2
    keycode 96 = Pointer_Button3
    

    These keycodes correspond to F11 and F12 for me — you can change them to whatever you’d prefer for the middle and right click functions. xev will give you the keycodes for the keys you want.

  3. Ensure that the modmap is loaded when you log in. In Gnome, this can be done through the SystemPreferencesSessions dialog box. Click Add to add an additional startup program, then ensure that the command is xmodmap /home/USER/.xmodmaprc, replacing USER with your username. Give it any name and hit OK, then close the session preferences.
  4. Log out and log back in. The first time you log in, you should get a dialog box from xmodmap to confirm that you want to load the .xmodmaprc file — confirm that you do and that you don’t want to be asked each time, and from then on you should have the goodness of three mouse buttons again.

Problem: The keyboard backlight doesn’t work or I can’t change the display backlight brightness.

  1. There’s a kernel module that needs to be loaded for some of these features to work. The easiest way to do it is to edit /etc/modules and appending the line applesmc. This will ensure it’s loaded on subsequent boots.
  2. Load the applesmc module at the command line using sudo modprobe applesmc.
  3. Install pommed (available in the universe repository, so ensure that’s enabled). These things will start working. If you’d prefer to use the function key to change volume or brightness, you can do this by editing /etc/pommed.conf and changing fnmode to 2.

Most of this is pretty minor in the grand scheme of things — it was really the issue of NumLock freezing the keyboard (particularly on waking from sleep, although I’ve had it happen a couple of times in general use as well) that led me to start looking into this. I have a Rev. D MacBook Pro, so it may be that many of these things aren’t issues on the older hardware; I don’t recommend blindly doing any of this unless you know you have a problem.

public class Exam extends HttpServlet {

Monday, November 12th, 2007
        public void init() {
                findRoom();
                buyWater();
        }

        private void findRoom() {
                search(Buildings.ONE_WHICH_LOOKS_LIKE_WAGYL_THREW_UP_ON_IT);
                try {
                        regardArchitecture();
                }
                catch (VomitException e) {
                        shrug();
                }
        }

        private void buyWater() {
                try {
                        Machine.insert(0.20);
                }
                catch (MachineSwallowedCoinWithoutReasonAgainException e) {
                        System.err.println(Person.SWEAR);
                }
        }

        public void doGet(HttpServletRequest req, HttpServletResponse resp) {
                readExamPaper();
                winceAtPoorlyWrittenQuestions();
        }

        public void doPost(HttpServletRequest req, HttpServletResponse resp) {
                writeResponses();
                makeJoke(Lotus.NOTES);
                finish();
        }

        public void doDelete(HttpServletRequest req, HttpServletResponse resp) {
                leaveCampus();
                forgetEverything(java.lang);
                $var = ... oh, shit;
        }
}

I enjoyed the exam about as much as the rest of the unit (that is, not at all), but I’m pretty sure I did enough to pass. I must remember to read sample exams more closely, though — I was completely broadsided by the 15 mark question on Java GUI construction in a unit supposedly about building Java-powered Web sites. Obviously applets are back in vogue.

Now for the nervous wait for results in about six weeks.

iSight, youSight, weAllCamelCaseSight

Sunday, November 11th, 2007

My suspicion last night that ndiswrapper would cure my wireless ills appears to have been correct. It’s a bit of a step back, really, since it means (a) that I’m reliant on the Windows drivers and (b) that I had to switch to a 32-bit Ubuntu install since Apple don’t provide 64-bit drivers for the AR5418 wireless chipset on the Leopard DVD, but I’m not getting dropouts and stalls every couple of minutes now, so I guess I’ll have to grin and bear it.

Happily, everything else has worked out of the box in Ubuntu Gutsy. In fact, it’s probably all worked a bit too well — I had an afternoon of tinkering with things planned, but everything got configured much quicker than expected, which now means that I have no real excuse to avoid studying for tomorrow morning’s exam. Damn you, efficient FLOSS developers!

You heard me, uvcvideo developers. There may be blood on your hands. (In my case, the blood would be virtual, but people watching webcam missives from me may be in danger of bleeding from the eyes.)

Oh yes, the in-built webcam works, too. That promises to be… minutes of fun. Oh well, it’s still better than studying.