Author: AngusThinks

  • Java FileWriter, XML and UTF-8

    Oddly enough the java.io.FileWriter class doesn’t use UTF-8 by default. I’m not exactly sure what the default encoding is (possibly ISO-8859-1 or US-ASCII?) but it doesn’t seem to be UTF-8, which is odd given that java strings are supposed to be unicode. This causes a problem if you want to have non-ascii characters and you don’t realise what’s happening. This was a bug in SQLEditor and somebody accidentally typed an umlaut into one of the fields and the file wouldn’t reload. (Which was annoying).

    The correct thing to do seems to be to use the following:

    OutputStreamWriter out = new OutputStreamWriter(new FileOutputStream(path),"UTF-8");

    Which ensures that you are using UTF-8.

    I suppose that the motivation for this is that it means that simple use of FileWriter is compatible with applications that are not unicode aware and don’t support UTF-8. It probably makes sense at some level, but it just goes to show that you can’t assume anything. 🙂

    Update: Bela’s comment (below) explains more about which character set you’ll actually get.

  • SQLEditor Cocoa B11a

    Unfortunately there was a crashing bug in SQLEditor beta 11 and I had to release b11a.

    It was one of these things were format strings caused the crash. I’d transposed two of the entries

    [NSString stringWithFormat:@” %@ %d”,aDecimal,aString]

    instead of

    [NSString stringWithFormat:@” %@ %d”, aString, aDecimal]

    and of course cocoa crashed, probably because it tried to send a message to the aDecimal variable.

    It’s unfortunate that this can’t be detected at compile time, because it’s really annoying and very easy to do.

    Possibly this could be caught in an exception handler of some kind though. I’ll have to do some more work on it.

  • HP unveils paper-thin flexible screen technology – ZDNet UK News

    HP unveils paper-thin flexible screen technology – ZDNet UK News

    This is a really amazing development. There are some images too. The most impressive one is probably the first image which has been unplugged for two years!

    They also demonstrate a color version which offers 125 colors at the moment.

    The advantages of this technology are obvious, although it isn’t (yet) fast enough for digital video. It can be used to create clever signage, smart display panels for places like airports and railway stations. Intelligent motorway signs and many other things. It will allow lower cost and better display quality.
    Think how much fun it could be in airports if a late passenger announcement also included a giant photo of the passenger holding up the flight. 🙂

    Maybe one day we might even have proper electronic paper. A unit as thin and light as real paper but with all of the qualities of a computer display.

  • SQLEditor Cocoa B11 Released

    Released SQLEditor Cocoa B11 today. Lots of new features included in this release.

    I almost missed the release today actually because I found an unfortunate bug just before I was about to upload. It turned out that an object wasn’t correctly removed from the notification center list, which caused a crash when the application tried to clean up by sending messages to various objects (including one that had actually been deleted already). But I fixed it and released just slightly late (it wasn’t really a serious bug)

  • UGC Cinema Pass & recent films

    Well I finally signed up for this. After about 5 minutes and an amazingly scarey form, I’ve now got a commitment to pay £120 and a pass good for 30 days. The actual pass will be delivered by post later.

    Saw Wimbledon. Along similar lines to many recent British romantic comedies, but pretty good none the less. The tennis scenes were suitable dramatic and it had a happy ending.

    Saw “Sky Captain and the World of Tomorrow” last week. Excellent film in the Indianna Jones style.

    Now I have my cinema pass I must see more films though.

    Still wanting to see

    Shark Tale

  • Mental Control of Computers

    Yahoo! News – Scientists gingerly tap into brain’s power

    This is a really great piece of news. If this technology can be extended then it will really improve the quality of people’s lives immensely.

    Plus they’re also promising non-invasive approaches too.

  • Cocoa#

    I’ve been playing around a bit recently with mono and cocoa#.

    There also seems to be an experimental build of Mono-develop.

    I begin to think that .net and mono are going to be excellent java competitors. I also think that the idea of supporting platform differences makes more sense than the java swing approach of lowest-common-denominator functionality.

    I started off SQLEditor in java swing and then switched to cocoa. I wonder if there will eventually be another rewrite to mono and .net?

  • UGC Cinema Pass?

    I’ve been wondering yet again about the UGC Cinema pass. It’s a 12 month minimum subscription pass that gives apparently unlimited cinema screenings. Pay £10 a month and see every film if you so desire.
    I’ve been wondering about this for a while now. As I see it there are advantages and disadvantages:
    Advantages

    • £10/month is less than twice the evening ticket price
    • I would see more films if there is no additional cost per film
    • The UGC is a good cinema with nice screens and plenty of showings
    • It would be really good if people I know also get one which some already have and several are talking about

    Disadvantages

    • I would have to see everything at the UGC unless I want to pay again
    • UGC showing times can be a bit odd sometimes
    • I have to get to the UGC which does cost money and take time. Fountainbridge is some distance from me
    • 12 month minimum term direct debit (or presumably £120 payment).

    At the moment I’m a bit undecided. I think I’ll probably go for it if enough of my friends also do, because that would make a lot of sense if we all had passes and went to the same cinema. I might also cancel VideoIsland (dvd rentals) because I think I’m not watching enough DVDs (I keep missing the post).

  • Sorry about lack of postings

    Not much happening here recently. I don’t think I’ve posted anything since September. This is mainly because I’ve been really busy with other stuff. SQLEditor has been making good progress and I’ve been working on some other projects too.

  • SQLEditor Beta 9 Released

    Lots of fun new features in SQLEditor Beta 9.

    I think SQLEditor is getting quite close to the final release version actually, which is good.

    I have set up a new bug reporting and tracking system.