Category: computers suck

  • diary of a geonumpty

    I have a GIS problem:

    There are two layers in the map above:

    • the green areas represent land lots, with owners Arnold, Beal, Carr, …
    • the red points represent wind turbines, or really anything that needs to be identified inside a lot.

    While I used to be quite decent with plain ol’ SQL, the spatial extensions (such as are in SpatiaLite) are nipping my heid. What I need to query:

    1. How many turbines does each land owner get?
    2. Are there any turbines that aren’t in a lot?

    Here’s the data, and I’ll show you a solution once I work it out.

    Update: dang, the SpatiaLite tutorial is useful. Here’s how to get the count for each owner:

    select Properties.owner, count(*) from Points, Properties where within(Points.geometry, Properties.geometry) group by Properties.owner;

    which gives:

    Owner count(*)
    Arnold 1
    Beal 2
    Dockrill 2

    Nifty, what!? Now to work out the other one, which I suspect will use a ‘not within()’.

    Update #2: Nope, the SpatiaLite mailing list came through:

    SELECT id,
           unitid
    FROM   points
    WHERE  id NOT IN (SELECT points.id
                      FROM   points,
                             properties
                      WHERE  Within(points.geometry,properties.geometry));
    

    I have to admit that I still don’t really think of nested SELECTs – my SQL formative years were spent on a DB that didn’t support them.

  • amiga emulator for iPhone – sorta whee

    Emulated Commodore Amiga Games sounds like a good idea, but each game has to be sold as a separate app so the dreaded FEATURES of the computer aren’t allowed out.

  • beacoup fish

    I just downloaded the first 1000 Fish Disks from Aminet. Back in the day, that would have cost me £3000, and would have involved serious floppy storage. As is, it took just a couple of hours.

    I used to write for short-lived PD Shopper magazine. There was one flaw in the business plan; trying to sell a magazine to people who were naturally inclined to be cheap. As soon as shovelware CD-ROMs became available, PD Shopper vanished.

  • empty threat

    This is the clickwrap login usage licence at work. The threat of ” is particularly chilling.

  • something went wrong

    Something went very wrong when my Thinkpad booted up:

    Pretty, though.

  • actually quite happy to see this

    Dammit, E-UAE is fiddly to set up. I finally got hard disk images working, by doing something like this:

    1. For an 160MB image, create the blank file: dd if=/dev/zero of=blank160.hdf bs=1M count=160
    2. Add the file specification to your .uaerc, something like: hardfile2=rw,DH2:$(FILE_PATH)/Amiga/blank160.hdf,32,1,2,512,-12,
      (Yeah, linux e-uae doesn’t allow you to add in HDF images. Annoying.)
    3. I found I had to put the amiga system executable FastFileSystem in with my ROM path. Your path may vary – look at the UAE log output for something like ‘RDB: fakefilesys, trying to load ...‘, and see where you want it to go.
    4. Pop into UAE, start a CLI or Shell, and issue this command: format DRIVE DH2: NAME hd160 FFS QUICK

    I’ve updated the drive images from yesterday, so you probably won’t need to format them.

  • amiga: blank hdf images

    I’m trying to get running an Amiga again, to see if I can remember what was rocking my computer world twenty years ago. I want to run that code, swim with the Fish disks, and generally muck about with what was my life back then.

    Emulation is interesting. Variants of UAE (which came with an Amiga Forever CD set I bought in 1997 or so) rule the roost. Quality is variable – on Windows, WinUAE is very comprehensive, even making grink-gronk noises as the floppy spins. On Mac, E-UAE is really not worth the bother kinda okay – it doesn’t want to emulate anything above a 68000, and falls over quite often but has decent sound. On Linux, it’s plain and stable, and I happen to have an old Thinkpad going spare I can dedicate to emulation.

    I would have expected all the old disk images to be readily available for download. It seems that the current owners of the Amiga name (this week, at least) still cling on to the old IP as if it has real value. The Amiga games market (which was the market) basically collapsed with Commodore in 1994. I really wonder who is buying the PowerPC based, vastly overpriced new hardware? For now, I’m relying on good old-fashioned torrent sites for my data.

    I want to emulate two machines; the A500 I had for all my cringe-worthy magazine writing running Workbench 1.3, and a fast thing maxed out with all the processors and RAM I never had, probably running 3.1. While I did have Amiga[D]os 2.04 (can’t remember if they’d dropped the D by then), it wasn’t the main focus of my interest by then.

    The biggest problem I have is getting hard disk image, even blank ones. UAE is picky. Here are a couple I formatted under WinUAE, both blank.

    I wonder if they’ll work under 1.3?

    Update: yes, they should. I formatted them FFS under AmigaDos 1.3.

  • well, they did ask

    BizRate had a survey regarding Ticketmaster‘s service. Here’s what I wrote:

    Just whose convenience is your 25% “convenience fee” for? You guys are a scandalous monopoly. I’ve had better customer service from the Mafia – at least they’re family-run.


  • another hypotrochoid

    Had another one lurking on my desktop:

    and here’s the gnuplot code to generate it:

    set terminal svg size 400,400
     set output "fig-spiro11.svg"
     set size ratio -1
     set nokey
     set noxtics
     set noytics
     set noborder
     set parametric
    #
     x(t)=(R-r)*cos(t) + p*cos((R-r)*t/r)
     y(t)=(R-r)*sin(t) - p*sin((R-r)*t/r)
    #
     R=100.0; r=-37.0; p=50.0
     set samples 8001
    #
     plot [t=0:320*pi] x(t),y(t)
    
  • some svg hypotrochoids

    Just by messing around with the simple gnuplot script in the article Plotting the spirograph equations with ‘gnuplot’, I made:

  • still the coolest thing ever

    Got E-UAE running properly from a hard disk image last night. Tried to get the configuration close to what I had on my old 3MB A500.

    This is what it sounds like.

  • something went wrong

    At the automatic podcast today, something went very wrong with the announcements. Hear what I mean.

    I was playing with flite‘s new voices, and I think the command line went up the chute.

  • TTC Trip Planner

    The TTC Trip Planner seems to be live, after some digging by the Spacing folks.

    It works with a bunch of small browsers I’ve thrown at it – w3m, mobile Safari, Blackberry – so I know I can use it from a handheld. Yay!

    Only minor annoyance is that for subway journeys, it only shows the direction of travel in the summary (“YONGE-UNIVERSITY-SPADINA TOWARDS DOWNSVIEW” – and yes, in all-caps) and you have to click through to the details to find out which station you need to get off at.

    It does seem to get deeply confused at Kennedy Station; I live just south of Kennedy, and it expects me to take the 43 Kennedy north to the junction to Eglinton, then walk south. Everyone here uses Transway Crescent …

    Update: how could I have missed the prettier and much less capslockier MyTTC?

    Update 2: The official TTC site appears to have moved here http://www3.ttc.ca/Trip_planner/index.jsp?useplanner=true. Let’s see if it still works with mobile devices.

  • old computer

    I got my Amiga A500 twenty years ago …

  • implicit markup: easy to read, hard to parse

    I don’t usually ponder about other people’s blog postings, but Jeff Atwood’s Responsible Open Source Code Parenting reminded me of some of the old wars that the used to be when I was a markup head. Jeff writes about his frustration that John Gruber’s Markdown text-to-html filter:

    1. hasn’t been updated for some time
    2. doesn’t quite do exactly what Jeff’s users at Stack Overflow want
    3. appears to have any changes in its behaviour from v1.0.1 strenuously vetoed by Gruber himself.

    Markdown is nice in that you can write screeds of text, and it does almost exactly what you’d expect. The markup doesn’t get in the way, usually. The difficulty arises when implicit markup (indented lines for quoted text, bulleted lists, highlights) has to give way to explicit (cross-references, code samples). Explicit markup is ugly, but sometimes, you’ve got to do it. Complex intent requires complex modes of communication, and sometimes plain text just hasn’t the bandwidth. [As an aside, there was a hilarious lengthy recurring episode on John Mark Ockerbloom‘s late bookpeople mailing list where a user (mercilessly skewered here)  insisted that they could write a general Gutenberg plain-text converter that would re-create typeset quality in an e-book reader with no explicit markup, and that XML was completely unnecessary and ill-conceived. The un-markup language, called zen markup language (said user had an aversion to the shift key) lives on only in a single website: the home of z.m.l. As for XML, its executive assistant had no comment on the matter.] Looking at Markdown, it looks like Gruber’s moved on from it. He made a 1.0.1 which did what he wanted. The code’s there to change if anyone needs it. I understand his frustration at people wanting to make changes and still call it Markdown; I’d be annoyed if I had text which I thought was in one format suddenly not be accepted, or do something unexpected. Seriously, that’s almost as bad as ‘deprecated‘. [At least Gruber didn’t go on a deletion rampage, like (admittedly smaller-time) erstwhile CHDK stalwart Barney Fife did when he was slighted in a forum. Looks like almost everything he contributed to CHDK has been removed, including some very useful control scripts and explanations.] Personally, when I need to make text to web conversions, I still use txt2html and a bunch of shell and Perl glue to feed to tidy. It’s on its third maintainer, doesn’t do much, but does it simply. And I’m pretty simple that way.

    Update: see also On my increasing exasperation with Markdown.

  • image rollover in wordpress, no plugins required

    I’m seeing quite a bit of traffic to this post. I suppose I should explain that this was a quick hack to see if I could get image rollover to work on a friend’s wordpress.com hosted blog (and no, I couldn’t). This little example doesn’t do preloading, either, and I really don’t have any intention to develop this further. Sorry …

    <img title="this" onmouseover="this.src='http://scruss.com/wordpress/wp-content/uploads/2010/01/that.png';" onmouseout="this.src='http://scruss.com/wordpress/wp-content/uploads/2010/01/this.png';" src="http://scruss.com/wordpress/wp-content/uploads/2010/01/this.png" alt="" width="192" height="116" />

    This does not work on wordpress.com hosted blogs; it gets stripped out.

    Update: You probably want to install the plugin Ultimate TinyMCE, which does the job rather well.

  • Recoverfab – for all your memory card recovery needs

    NB to readers: I am not the Recoverfab guy. I can’t help you recover images.

    A friend has baby pictures on an SD card, which said baby later found and used as an inappropriate teething aid. Yeah, yeah, I know …

    He asked me to try to get the pictures back. I couldn’t read the card. It even fried one of my card readers. I tried RescuePRO, PhotoRec and PhotoRescue: no dice. Downtown Camera returned it as unreadable (and declined to charge me anything).

    So I asked metafilter, and someone suggested Recoverfab in Germany. I sent the card off last week, and waited …

    Got an e-mail at 06:30 this morning that they’d received the card, with a latest completion date of a week. Before 09:00, received a second e-mail with a link to picture samples and payment options. Have paid (not cheap – €89, but they got results) and am awaiting the FTP link.

    Many thanks to Leopold Hiersche for his excellent results.

  • perhaps a slightly easier way to make SD cards bootable for CHDK under OS X

    Now that CHDK has a working beta in the source tree for my Canon PowerShot SD790is, I actually have to prepare SD cards for it. The Bootable SD card – OS X instructions seem a bit contrived, so I took a look at the linux instructions, and modified them accordingly. These instructions should work for FAT16-formatted SD cards of 2GB capacity and under. It will not work for SDHC cards, which are generally formatted to FAT32.

    This is all command-line only for here on in. It seems to work. Please note that you will be modifying raw file systems with root permissions here; there is no safety net. If you b0rk your main hard drive, don’t say I didn’t warn you.

    Firstly, you’re going to have to find out where the SD card in mounted. Do this with:
    df
    I got:

    Filesystem    512-blocks      Used Available Capacity  Mounted on
    /dev/disk0s2   487463200 318749896 168201304    66%    /
    devfs                222       222         0   100%    /dev
    map -hosts             0         0         0   100%    /net
    map auto_home          0         0         0   100%    /home
    /dev/disk2s1     3969280      3328   3965952     1%    /Volumes/CANON_DC

    There are three important concepts to note when looking at the mounted card:

    1. The mount point (or volume) – in this case /Volumes/CANON_DC. This is the location that you see in Finder when moving files around.
    2. The filesystem – here /dev/disk2s1. This is the partition on the disk, arranged according to a certain formatting scheme like MS-DOS FAT16.
    3. The disk device – which for me is /dev/disk2. This is the disk device itself, and it may contain several filesystems.

    Your locations for these three could well be different, so please substitute your values.

    You’ll need to unmount the device, as writing to a raw filesystem while the OS thinks it has control often results in hilariously unexpected results. I used the OS X-specific command

    diskutil unmount /Volumes/CANON_DC

    You should get a message like Volume CANON_DC on disk2s1 unmounted. Now you need to write the boot instruction:

    echo -n BOOTDISK | sudo dd bs=1 count=8 seek=64 of=/dev/disk2s1

    This will prompt you for your password.

    If you need to, you can remount the filesystems on the card with

    diskutil mountDisk /dev/disk2

    (Note that we used the disk name here, not the filesystem. If there were several partitions on the disk, this command would mount all of them that it could. It’s also kinda handy for remounting USB devices that you’ve accidentally ejected from Finder.)

    Update: Knowing a difficulty getting the firmware update method of getting CHDK to work on a Mac? Running a Leopard or newer machine? Then you need to learn all about Apple’s quarantine attribute and how to remove it with xattr: FAQ/Mac – Still having trouble?.

  • no ironic dying from dysentery, either

    Oregon Trail

    … and here’s me never played it before, too. You can play it too, at Virtual Apple ][.

  • this document has layers

    Never noticed this tiny icon in Adobe Acrobat Reader:

    layers

    Looks kinda weird when enlarged:

    layers