Category: computers suck

  • first try with Inkscape

    I made a card for Catherine:

    The original has her contact details, which I’ve left out here. I’d never used Inkscape before; the tricky part was working out the layer alignment while allowing for the bleed. I exported it as a 600 dpi PNG, then sent it to Staples Copy & Print. Turned out pretty well, I thought.

  • Jetpack, you should know better …

    Jetpack, don’t you know that if you fool after noon, you’re the fool?

  • chroma key screen grabs

    Oddly-shaped windows are a pain to screen grab. Netpbm to the rescue!

    1. Make a blue (or green, or whatever isn’t used in your window) image larger than the window, like this:
      ppmmake blue 800 600 | pnmtopng > ~/Desktop/b.png
    2. Display the image, and arrange your program in front of it.
    3. Take a screenshot.
    4. Crop the image, and set the background transparent.
      pngtopnm Screen\ shot\ 2011-03-27\ at\ 10.12.52\ .png |\
       pnmcrop |\
       pnmtopng -transparent blue > ICP-2007.png

    Ta-dah!

    (and yeah, this is a Windows program running under Wine on OS X …)

  • pity the lobster requirement

    It appears that my musical choice has this effect on people, as this just happened on a collaborative jukebox I’m aware of:

  • (07:50) The Lobster Requirement has left
  • (07:49) Playing Freeing Song for Reindeer by The Music Tapes from Music Tapes for Clouds & Tornadoes
  • (07:49) Finished playing French Toast Man by Fred Lane & Ron ‘Pate’s Debonairs from From The One That Cut You & Car Radio Jerome
  • (07:48) The Lobster Requirement has joined

Oh well.

  • hats off to Canada Computers!

    Canada Computers are entirely awesome. In the last week, they:

    • without fuss (but a trivial restocking fee) took back RAM that wouldn’t work with a Toshiba laptop. bloody wrongly-specified devices, grar.
    • Had in stock a rather obscure ThinkPad battery in their charmingly cluttered Pacific Mall store.
  • on the trail of the elusive Power Cost Monitor signal

    Catherine probably thought I was acting no more strangely than usual last night, when I was holding the Power Cost display unit in one hand, frobbing the electric stove control with the other, all the while watching a digital clock and cackling gently to myself.

    All this makes me think I’m a bit further on with getting something from the Power Cost Monitor. Previous attempts using cheap wireless units (and cluelessness on my part — never forget that) got nothing, so I caved and bought the rather expensive but nice Parallax 433 MHz RF Transceiver from Solarbotics.

    The Parallax unit adds an analogue output that’s proportional to the instantaneous signal strength. I hooked up the output to the trusty sdfatlib analogue logger, set the logger to sample every 50ms (figuring that, every now and again, it’s going to see part of a transmission) and this is what I saw:

    Pretty noisy, I know. But look, there are regular peaks:

    Here I’ve highlighted all the peaks with signal strength ≥ 200 (in arbitrary units, where 1024 would be full scale). It’s pretty regular; the largest peaks come in a shade under every 32 seconds, or a multiple thereof. If you need additional decimal places to validate your worldview, I’m thinking the period’s around 31.86s.

    Observations made during last night’s frobbing and cackling episode seem to confirm that the display updates about every 32s. If you adjust the load mid-cycle, nothing changes until the update. If the display misses an update, it’ll refresh in 64 or 96 seconds.

    I don’t yet know what bitrate the data comes through at, or the protocol. I’ve logged some data recorded at various rates: 433mhz_powercost_data. The file names give a hint at the data rate; L1200V04 was recorded at 1200bps, for example. I’m guessing that there’s some kind of sync header, then the total value and the current temperature (which was around/below freezing at the time). I need to work on that.

    Update: I rewrote the logger to use the Arduino’s internal UART, since — lovely though NewSoftSerial may be — it causes millis() to report wildly inaccurate times at low bit rates. I recorded a bunch more data (powercost-arduino2.zip) in a slightly more useful text format. It has three columns:

    • the time, in milliseconds, at which the record was recorded
    • the time difference between this and the previous record, in milliseconds. Maybe not as useful as it could be. If adjacent records are about 31860ms apart, they’re transmissions from the meter.
    • 120 bytes of data recorded at the current bit rate (given in the file name) encoded in hex.

    I’ve also included the Arduino sketch, which could be better documented.

  • Life with Ardweeny

    I’m pretty new to Arduino, and electronics in general. Sure, I used to wire up sensors to a bunch of dataloggers, but there wasn’t much variation or application of theory. I made up a bunch of Ardweenies, mostly to practice soldering skills, but now I’ve made them, I might as well use them.

    ardweeny, breadboard, USB programmer and PSU

    The Ardweeny is a tiny broadboard-only Arduino-compatible microcontroller board. It needs both a power supply and a means of programming it. Solarbotics’ own Breadboard Voltage Regulator Kit provides the juice, while a SparkFun’s FTDI Basic Breakout handles the USB serial programming. The FTDI breakout board can supply power, so I turn the power off to the board at the regulator when programming it. You can’t use shields with the Ardweeny, but it’s small enough that you can have a simple project on a small breadboard. It communicates with the Arduino IDE as if it were a Duemilanove.

    The Ardweeny has pins clearly (if tinily) marked by function. To power it, you need to feed GND and +. The familiar A0-A5 and D0-D13 are present, if not quite where you’d expect them. There isn’t room to mark the digital pins capable of PWM.

    For no particular reason (perhaps that spring finally looks like it might be warming things up around here) I wanted to make a a temperature sensor that would sample the temperature at start up, then warn if the temperature got more than 2°C hotter or colder.

    I used an LM35 as the sensor. These are a bit noisy, so I added some smoothing (nicked, with little grace, from the Arduino – Smoothing tutorial). The temperature is indicated by three LEDs: red for ≥2°C over, amber for within ±2°C of the starting temperature, and green for ≥2°C under. I also wanted all the LEDs lit while the system was working out starting temperature. Here’s how it runs:

    starting up, showing all LEDs
    showing normal temperature
    warmed by a finger, showing ≥2°C over normal
    chilled by a frozen cayenne (!), showing ≥2°C below normal

    I put the LM35 on A0, and the red, amber and green LEDs on D5, D6 & D8. The only reason I didn’t use D7 was that I didn’t have the right length jumper wire. 680Ω resistors are used to limit current through the LEDs.

    Here’s the code:

    /*
     lm35_plusminus - read temperature at startup then light
     leds if over or under
     
     lm35 - analogue 0
     
     red led - digital 5
     amber led - digital 6
     green led - digital 8
     
     scruss - 2011-02-17
     */
    
    #define REDPIN 5
    #define AMBERPIN 6
    #define GREENPIN 8
    #define TEMPPIN 0 // analogue
    #define DELTA 2.0 // amount +/- from start to warn
    #define READINGS 15
    
    //declare variables
    float tempC, start_temp, array[READINGS], total;
    int val, i;
    
    void setup()
    {
      pinMode(REDPIN, OUTPUT);
      pinMode(AMBERPIN, OUTPUT);
      pinMode(GREENPIN, OUTPUT);
    
      // signal start of test by lighting all LEDs
      digitalWrite(REDPIN, HIGH);
      digitalWrite(AMBERPIN, HIGH);
      digitalWrite(GREENPIN, HIGH);
    
      // read initial values
      for (i=0; i< READINGS; i++) {
        delay(500/READINGS); // just so initialization is visible
        val = analogRead(TEMPPIN);
        array[i] =  (5.0 * (float) val * 100.0)/1024.0;
        total += array[i];
      }
      start_temp = total / READINGS;
    
      // test off, lights off
      digitalWrite(REDPIN, LOW);
      digitalWrite(AMBERPIN, LOW);
      digitalWrite(GREENPIN, LOW);
      i=0; // just to initialize  
    }
    
    void loop()
    {
      // some cheapo smoothing copied from the Smoothing example 
      //  in the playground
      total -= array[i];
      val = analogRead(TEMPPIN);
      tempC = (5.0 * (float) val * 100.0)/1024.0;
      array[i] = tempC;
      total += tempC;
      i++;
      if (i>=READINGS) {
        i=0;
      }
      tempC = total/READINGS;
      if (tempC - start_temp >= DELTA) {
        // we're hot !
        digitalWrite(REDPIN, HIGH);
        digitalWrite(AMBERPIN, LOW);
        digitalWrite(GREENPIN, LOW);
      }
      else if (tempC - start_temp <= -DELTA) {
        // we're cold !
        digitalWrite(REDPIN, LOW);
        digitalWrite(AMBERPIN, LOW);
        digitalWrite(GREENPIN, HIGH);
      }
      else {
        // we're just right !
        digitalWrite(REDPIN, LOW);
        digitalWrite(AMBERPIN, HIGH);
        digitalWrite(GREENPIN, LOW);
      }
    }
    

    Despite the smoothing, the LEDs flicker briefly as they turn on. I kind of like the effect, so I made no attempt to change it.

    What I like about Arduino is that — within the limits of my sensor knowledge — the programming language does what I expect. The above program worked first time; worked, that is, save for me putting one LED in the wrong way round, so it didn’t light. I know I could probably replicate the same function with a few linear devices and other components, but it would take much more time and effort. It may not be the most elegant, but it does work,  and gives me the satisfaction of the desired result quickly.

  • this week, I have been mostly solderin’ …

    … several Solarbotics Ardweenys. They are extremely tiny Arduino clones designed for the breadboard.

  • now *that’s* more like it …

    After bumping along at about 600Kbps for the last few weeks, Bell (through TekSavvy) finally kicked my connection over to 3 megabit. I don’t think we’ve ever managed this speed before, as I think I’ve been routed to a different exchange. Whee!

    Update: Yowza! Looks like I’ve been upped to as close to the 5M that I can get …

  • big trouble in little microSD

    It was a bit of a fight to get the SparkFun microSD Shield working. At first, I thought it was my choice of cards. Then, on reading the manual (ahem), I discovered the section “I downloaded a FAT library for Arduino on my own from the Web but it’s not working! Why not?“. It seems that the SparkFun shield uses non-standard pins for signalling, which they consider a feature, but some consider a bug.

    After fixing the code in the awesome sdfatlib library, I’ve now got it logging the temperature of a cooling container of hot water:

    You might just be able to make out the LM35 pressed up against the measuring cup.

    I remember making a right mess of this experiment in my school final Physics practical exam. I also used to do this in my first job when bored testing Campbell CR10 dataloggers, making a nice 1-d cooling curve with a thermocouple and a cup of hot water.

    I think the heating came on a couple of times, as there shouldn’t be bumps in the curve. Here’s the data.

  • four decades of xedit

    I realize that I first started using X11‘s xedit in 1989. I’ve moved on a bit from editing ANSYS source scripts, but that means I’ve used it in the 80s, 90s, 00s and 10s.

  • lolcobol

    The bloke standing behind the console looks like he’s working an iPhone – in 1959!

    (actually, it might just be a cigarette; see the open pack of Luckies by Grace Murray Hopper’s right elbow.)

    Image nicked from the NMAH | COBOL – COBOL online exhibit.

  • I didn’t see “worthwhile” in there

    I went to Photosynth, and saw this:

    Bullets are also small and fast, but I don’t plan to install any of those soon, either.

  • done with emusic – or trying to be

    I knew that nothing good would come of emusic’s plan changes. I mean, dumping all your favourite indie labels and replacing them with mainstream crud; how’s that working out for you, yeah?

    Just to show you how things have changed, here’s a list of the most recent artists I’d downloaded pre-plan changes. The ones in red are ones you can’t get any more:

    • Barry Louis Polisar
    • Belle and Sebastian
    • Boards Of Canada — only one album available
    • Dum Dum Girls
    • Eels
    • Elizabeth Cotten
    • Elsinore
    • Euros Childs
    • Forest City Lovers
    • Frontier Ruckus
    • Gonja Sufi
    • Gorky’s Zygotic Mynci
    • Hold Your Horses!
    • Macy Gray
    • Michael Hurley
    • Mount Eerie
    • Pocahaunted
    • Someone Still Loves You Boris Yeltsin
    • Sun Kil Moon
    • The Delgados
    • The Moldy Peaches
    • The Tallest Man On Earth
    • The Turtles
    • The Whitlams
    • Will Powers

    And here was me on a major Delgados kick, and they’re gone.

    So cancelled my plan on the weekend, and got this:

    Yep, if you’re on an annual plan, you’ve got to sit it out. They don’t offer refunds. So now I have to remember to go in every thirty days for the next nine months to find something – anything! – to download. It’s extremely shabby that emusic are holding over $100 of my balance to ransom. I guess they’re just trying to fit in with the mainstream music industry …

  • For St Andrew’s Day: Flower of Scotland

    Arduino and the Irn-Bru Can Choir present Roy Williamson’s epic anthem:

    Like O Canada and The Star Spangled Banner before it, it’s a random midi file (grabbed from Midi files of bagpipe tunes: mercifully, does not autoplay) converted to RTTTL and played through a glued-on piezo.

  • ring ring ring ring zx spectrum phone

    A ringtone which has its own special way of telling you to answer the phone:

    (and manages to be really annoying while doing so.)

  • the fabulous thunderbird

    I really like what Thunderbird does when you type a word like “attachment” or “attached” in a message:

  • Flattr doesn’t work for me

    So my six month experiment with Flattr has come to an end. In short, my revenue was a measly €0.42 for €2/month payment. Not worth it.

    Flattr was just too much hassle. I’d want it to be able to add pages from an RSS feed, but instead, every page had to be added manually. It wouldn’t even spider your sites to index content. You had to go to the site to find new things to read (I’ve never found a Flattr badge in the wild), and it is really difficult to filter by language and keywords. Worst of all, you have to remember to click on at least one thing a month, otherwise your payment would disappear down a black hole.

    Here’s my payment/revenue breakdown:

    Means -> Monthly Flattr amount
    2010-10-31
    €-1.70
    Flattr earnings -> revenue
    2010-10-10
    €0.09
    Means -> Monthly Flattr amount
    2010-09-30
    €-2.00
    Means -> Monthly Flattr amount
    2010-08-31
    €-2.00
    Means -> Monthly Flattr amount
    2010-07-31
    €-2.00
    Means -> Monthly Flattr amount
    2010-06-30
    €-2.00
    Flattr earnings -> revenue
    2010-06-10
    €0.33
    Means -> Monthly Flattr amount
    2010-05-31
    €-2.00
    Flattr earnings -> revenue
    2010-05-10
    Means -> Monthly Flattr amount
    2010-05-04
    €-0.44
    PayPal -> means
    2010-05-02
    €12.14

    And here’s what was actually clicked:

    Period Thing Clicks Revenue
    2010-05 We Saw a Chicken … 1 €0.20
    2010-05 Numpty’s Progress 1 €0.13
    2010-09 Numpty’s Progress 1 €0.09

    My blogs might be a bit, um, niche, but I’d expected to have at least broken even.

  • And this is why I hate the music industry

    Copyright Info: The Star Spangled Banner

    Your video, The Star Spangled Banner , may include content that is owned or administered by these entities:

    • Entity: Music Publishing Rights Collecting Society Content Type: Musical Composition

    What should I do?

    No action is required on your part. Your video is still available worldwide. In some cases ads may appear next to your video.

    What can I do about my video’s status?

    Please note that the video’s status can change, if the policies chosen by the content owners change. You may want to check back periodically to see if you have new options available to you.

    Under certain circumstances, you may dispute this copyright claim. These are:

    • if the content is mistakenly identified and is actually completely your original creation;
    • if you believe your use does not infringe copyright (e.g. it is fair use under US law);
    • if you are actually licensed by the owner to use this content.

    I need more information. I want to learn more about the dispute process.

    Please take a few minutes to visit our Help Center section on Policy and Copyright Guidelines, where you can learn more about copyright law and our Content Identification Service.

  • emusic canada changes its pricing

    What with the sad loss of Wild East Compact Sounds this summer, my sources of music are now limited. eMusic, bless ’em, have been my source of indie stuff since about 2003. They were cheap, had a fixed price per download, and carried a raft of indie stuff and no major label tat.

    Not much longer; got this in my inbox:

    So, yeah, the full announcement: major label content, minimum 49¢/track, and variable pricing. Exactly all the reasons I wouldn’t want to use them. Good call, eMusic, for a battered-about subscriber since 2003.

    I was initially confused by the pricing. I pay 36¢/track, so I couldn’t see how their promise that “your monthly payments will not change and you will still be able to download the same number of tracks available today, if not more, depending upon your current plan“. Then I see their new menu:

    So basically they’re crediting me with a fake $4.48 a month (oh wait; “30 days”, not a month; they so want you to forget to download stuff by making the cycle date change) so I can still get my 35 downloads. Since they hint that there will now be variable pricing, I’ll bet the new stuff will be >49¢, so I really won’t be able to download as many per month after all.

    They’re saying that the new pricing will allow them to do a bunch of fun stuff:

    We’re also committed to making eMusic a better member experience. We recently rolled out improvements to Browse and Search pages. And we’re hard at work on a host of new features and enhancements including a music locker, which should allow you to stream your music collection from any desktop or mobile device. In addition, improvements to eMusic’s social features, to better connect you with our editors, other members, artists, labels and your friends, are also in the works. We’ve sketched out an ambitious slate, and it will take a little while to get there. We hope you’ll continue on the journey with us.

    I don’t want all that social fluff. The MP3s work just fine on any mobile device, so streaming them just adds more crud. I want fixed price downloads, not some half-assed music locker. Where, oh where is Frank Hecker and swindleeeee when you need them?