Category: Writing Software

  • Integrate flyspray with CVSWeb

    Currently I’m using flyspray for bug tracking.
    I use cvsweb to view the cvs tree online.

    One thing that I really wanted was to be able to click one bug numbers in the cvs log reports and see the bug tracking entry that matches it.
    It turns out this is amazingly simple. I added the following code to the cvsweb.cgi file inside the htmlify function, just below the bit that does the urls. (new section in bold)

    # get URL's as link
    s{
    ((https?|ftp)://.+?)([s']|&(quot|[lg]t);)
    }{
    &link($1, htmlunquote($1)) . $3
    }egx;


    # replace FS with correct bug track link in flyspray
    s{
    FS#([0-9]+)
    }{
    &link("[$1]","/flyspray/index.php?do=details&id=$1")
    }egx;


    # get e-mails as link

    And now my cvs logs display a link whenever I use FS#100 or a similar bug number. Next I suppose is to integrate it the other way and have the cvs system automatically close resolved issues in flyspray. There is actually already some code for subversion so it wouldn’t be very hard to implement probably (but there are better things to do with my time).

    [edit]
    subversion code is at http://flyspray.rocks.cc/bts/index.php?do=details&id=310&area=attachments#tabs

  • 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.

  • 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?

  • Online Store

    I’ve been working recently on integrating a registration system into SQLEditor (sorry).

    Unfortunately I kind of need to make some money out of my software and so people have to pay for it. I really wish this wasn’t the case but sadly it is.

    So I now have an online store powered by swreg. If you visit the SQLEditor page you will now see a couple of purchasing options in the right column and further options are an a subsequent screen. It looks fairly close to the rest of the site and swreg offers better fraud prevention than paypal, particularly for credit cards.

    The complexities of integrating everything together are quite great, which suprised me a bit. I was hoping for something easy, but it required a lot of steps to get everything pretty much working.

    • Sign up to online store
    • Add products
    • Create templates for shopping basket
    • Create serial number system
    • integrate serial number system into application and online store

    Although I won’t need to do this for any future software that I develop. Most of it was a one-off cost.

    One oddity is that the serial number code is written in ANSI C. This is a bit odd, because most of the code that I have been writing recently has been either Objective C, Java or PHP. But ANSI C proved to be the best way of using the same codebase for both the server and client side components.

    Hopefully lots of people will love and therefore buy the licenses.

  • Serial Number Systems

    I’ve recently been trying to write a serial number system for SQLEditor. I’m also looking for a new name for it. It was pointed out that the current name is generic and difficulty to pronounce, plus there is already at least one other “SQLEditor” out there already. Suggestions are welcome!

    But back to the serial number thing. If I could remember more of the maths that I learnt at university I would be happier, but as I tend to do I had forgotten most of the stuff that I don’t use, retaining only the bits I do use (Vectors primarily, plus some other stuff).

    Obviously serial number values end up in base 36 (0-9, A-Z), but other than that the problem occurred on how exactly to represent them. I need to have a link between the username and the serial number because that’s one of the methods implemented to discourage copying. If you see someone else’s name on the thing.

    I’m currently looking at a graphic convertor like delay (it will wait 20 or 30 seconds at startup after the trial period is ended) rather than a complete lockout. Because I think (a) it’s nicer to do it that way and (b) it offers people a chance to experience the feature set even after 30 days have expired.

    One thing I have noticed is that there are very few descriptions of how serial number systems actually work, probably to prevent people reverse engineering them and creating generators.

    Of course the most secure system is one that receives a license key directly from a server, but I think that could be too intrusive. I guess we’ll see how well the first version works out.

    New features for Beta 7 include “crows-feet” style referential cardinality indication and a new way of exporting foreign keys; following a suggestion they will be placed after the tables as soon as I write the code anyway, the parser is already capable, but the exporter is not.

    Finally Beta 7 will also offer selectable colors on the fields, more transparency and prettier connector drawing. Possibly also table type for mysql as well as a new export system for creating databases via scripts on remote servers. More later.

  • NSLog

    I just realised that NSLog allows parameters. I’d previously been using

    NSLog([NSString stringWithFormat:@"%d",randomVar]) ...

    But now I realise that the I don’t really need to do this. A simple call to NSLog will work as well.

    NSLog(@"%d",randomVar);

    It still isn’t as easy as php or even java, but it’s shorter and tidier and so better.

  • Shareware and Serial Numbers

    Not much posting recently. But I’ve been working getting SQLEditor ready for release. The big things recently have been bug fixes and developing a serial number system.

    It’s extremely annoying to have to spend any time at all working on the serial number system, because really the time would be better spent actually improving the software. But given that I actually want people to buy copies of the thing it is sadly necessary.

    I have a simple test program working already and as soon as I develop some kind of key generator system I’ll be able to add it (probably to beta 6).

    Beta 5 is complete, so it should be released tomorrow.

  • Cross Platform Applications

    With the announcement of Dashboard in Mac OS X 10.4 Apple, like many other companies, seems to have gone for a standards based approach. Dashboard is said to be based on HTML, CSS and javascript. A webpage in all but location. Microsoft tried something similar of course back with windows 98. You could display bits of webpages or activeX controls or java applets on the desktop. It didn’t prove all that popular then, but those pagelets were slow and clumsy. I very much imagine that dashboard is neither slow nor clumsy.

    More importantly though, dashboard objects have two interesting features. The first is that they use interpreted, not compiled, languages. The second is that they are essentially cross platform. I know that there doesn’t seem to be any particular other platform that can they can actually be moved to at the moment, but I feel fairly confident that before next year’s release of Mac OS X 10.4 someone will develop a suitable runtime for linux and quite likely windows as well.

    The dashboard concept seems to fall very much into the current fashion for application development. You write the interface in html, xml or something like it; then write the code in javascript or some kind of interpreted language. Then you provide libraries written in C or Java that provide the core functionality to the system. Mozilla’s XUL and Microsoft Avalon (windows xp next generation user interface) both use this approach. The Apple iTunes store also uses xml to describe the interface.

    It’s easy to see why this approach is popular. Building user interfaces from xml makes it much quicker to produce interesting results than having to change C++ code and rebuild. Multiple tools can be written to access the format and the result can be modified without rebuilding the main application. (Given modern build times always an advantage).

    One possibility is that dashboard may be something more than just a widget system. I have no inside knowledge whatsoever, but what if in future you could write whole applications using the dashboard system. What if you could create windows that were written in html/css/javascript and then tied to cocoa applications, much as we currently tie interface builder nib files to cocoa applications?

    Alternatively there is this mysterious business with Mozilla, Apple and Opera. The three have decided to work together to improve plugins, but what if they are actually considering a future application development and deployment system to compete against Microsoft’s .net? Combine the open .net implementations with something like dashboard and you have a cross platform development system that might offer developers a good incentive to develop for.

    I have no knowledge of the future though, so I guess I’ll have to wait and see

  • Definitions in spellchecker?

    There have been lots of articles today in newspapers because the Oxford English Dictionary publishers have claimed that people are confused and choosing words incorrectly. For example “pouring” instead of “poring”. The problem being that people are basing the word choice on the sound and thus homonyms (or homophones if you prefer) are confused. There are quite a lot of words that sound the same but different meaning, for example caret (a typographical mark and the blinking insertion point in a text editor) and carrot (vegetable).

    However I offer a simple solution: Have a brief definition of the word in the spell checker. Visual Studio already does this for programming languages so adding it to word processors is hardly difficult. The only issue really is likely to be disk space. If this is really a concern maybe some kind of online system? But I really don’t think it’s much of an issue given the current size of word processor installations anyway.

    It would allow writers to check whether the word that they selected had the correct meaning. Multiple meanings could also be listed, either in a list or with some kind of rotating display.

    Possibly it might even improve the quality of written english online? Of course it may be that there is a word processor that already does this. In which case the idea isn’t as original as I thought… but I would definitely like this feature in my word processor and even more so in system wide spell checking. 🙂

    [Edited: Because I suggested that Caret and Carrot were spelt the same.]

  • New day, new thoughts

    Well, I feel much better today. I’ve thought about it a bit more and I realise how very lucky I was that I found about the bug before the thing got a public release. I’m already working on some ideas on how to fix it. More on that as I think it up.

    This really shows the importance of testing stuff. So thank you to everyone who has tried SQLEditor in its various versions.