Jul 30 2007

Explicit TVM Dev Process

Published by matt under Uncategorized

So, the first of our diaspora updates involves making our development process more explicit. While our group has, largely, worked this way already, it hasn’t been explicit. This had a lot to do with the fact that the entire team was housed in the same suite of offices at the University of Kent. Now, things have changed.

The first document I want to introduce you to is our development process. We’ve attempted to keep this as short and simple as possible. We want just enough process to keep us moving forward harmoniously, but not so much that developing on the Transterpreter is notfun. Given that we hope that students interested in concurrency, embedded systems, and other cool stuff like that will want to get involved, we also wanted the process to be heavy enough to provide some structure and be pedagogically valuable, but light enough so as not to get in the way of (say) an enjoyable final-year project.

So take a look, and join the development mailing list if you want to discuss it.

Comments Off

Jul 29 2007

All quiet on the western front

Published by matt under Uncategorized

Arguably, with respect to England, I’m now the Western Front. That is, last week, I moved from the UK back to my native land of the USA. Kinda sad, really; it’s hard to find cask-conditioned, top-fermented ales in the USA.

On Friday, July 20th, we went ahead and had a group meeting discussing many aspects of the project. Over the next few days, I’ll describe the various parts of that discussion to inform the development list as well as provide a partial record of what we came up with.

To me, the most important part of the discussion was our agreeing some working patterns that we can document and adhere to as a distributed group. As a result, this should make it much easier for new developers to get involved and feel “at home” in the project. This has been missing so far, largely because we were all in adjacent offices for the first few years of the project. That, now, has changed.

I’ll try and do one of these every morning. Admittedly, I’m on vacation right now, but I’m also jetlagged. Or, something… I’m still going to bed around 10PM and waking up around 6AM, which means that I have a few quiet hours in the morning to think and write things like this. We’ll see. Either way, keep an eye on this space, or watch the mailing lists, as I’ll announce the posts in this series to the list, as we (as a group) think they matter.

Comments Off

Feb 06 2007

Tools for collaborative writing

Published by matt under Uncategorized

My preferred writing mode is LaTeX under Subversion. But what do you do if you’re collaborating with others, and not everyone is LaTeX-keen? What kind of options are there for collaborative writing?

I have a few requirements I’d really like to meet.

Requirements

  1. Plain text

    I would prefer that the document is stored in plain text—this is one of the only formats that have survived for the last two decades. I can still read plain text files from the 1970s, but I have a hard opening anything else on my Mac. Hell, I have a hard time with the Frame5 documents I created in 1996.

  2. Version control

    I must have version control over the document. There is no sense writing collaboratively if you can’t safely edit over each-other’s text. This way, you can get into a working mode where each author feels free to work on any part of the document. If one makes changes the other genuinely doesn’t like, this doesn’t matter so much, because you can roll back a rev and recover the text. Hence, automatic versioning is critical.

  3. Backups

    When I check things into my Subversion repository, I know that they are not only versioned, but backed up several times a week. I must have the same security in any collaborative writing program I use.

  4. Offline

    The solution must work when I’m offline. This rules out most web-based collaborative writing tools (eg. Google Documents).

There is, however, one critical requirement put forward by my colleagues:

  1. No control codes

    My colleagues don’t want to write directly in LaTeX. They have little desire to be typing in control codes to format their text. I, personally, like having a Turing-complete word processing system…

What does this rule out?

  1. Word is ruled out by my requirement #1. Current versions of Word cannot reliably open even old versions of Word documents. Therefore, no writing solution I use will be based on Word. (Or anything else with a closed document format).
  2. Google Documents does not work offline, meaning I can’t write a paper while on a long train journey in the UK. This defeats the purpose of having a 13″ laptop, if I can’t work on collaborative documents while away from the Interweb. A whole host of other on-line writing solutions are not viable as a result of this requirement as well (eg. Writeboard).

What does this leave available?

  1. OpenOffice is possible. It does use the Open Document Format, which is encouraging—XML will, as we all know, save us from oblivion someday. It does have change tracking, but not quite versioning (so it would have to be checked into a Subversion repository). OO provides no particular help with backups.
  2. LyX is a WYSIWYM (what-you-see-is-what-you-mean) LaTeX processor. You edit text, highlight stuff, and say “Title”, or “Section”. It makes it bold, or centers it, and so on. Actually, it’s really quite nice (for five minutes of usage, anyway). I found an interesting thread at the Ubuntu Forums where users were discussing LyX for collaborative writing in academia. This was encouraging.

If I had to pick a tool right now (which I said I would pick one over the weekend), I would pick LyX. This is because I can, if I need to, export to LaTeX and do any really hard tweaking (or supporting of journal-specpfic styles) that way, or (for most cases), I don’t need to. Also, looking at the features of LyX 1.4 (current stable is 1.4.3), the change tracking, notes, and some other features look like they’re just what are needed for multiple people working on a document. Put another way, the native format of LyX is plain text (check!), it can easily be checked into a version control repository (check!), is therefore easy to backup (check!), is a WYSIWYG/WYSIWYM word processor (check!), and it supports WYSIWYG change tracking (with different colors, and change bars, and the whole deal).

So, I’d suggest LyX for collaborative writing in the sciences, unless someone suggests otherwise. I will probably still prefer LaTeX and a plain text editor, but I may change my mind someday.

lyx-editing

3 responses so far

Jan 08 2007

Creating a Subversion repository using TortoiseSVN

Published by matt under Uncategorized

This is only valid for TortoiseSVN 1.4.1. Anything else, and your milage may vary.

  1. Create a folder on the desktop (proj). This will be where your repository is stored. You may want to create some other, more permanent place for such things.

    create-svn-01

  2. Inside that directory, right-click, and select Create Repository Here from the TortoiseSVN drop-down menu.

    create-svn-02

  3. You’ll be given the option of creating a Native Filesystem (FSFS) or Berkeley database (DBD) repository. FSFS is the new default for Subversion, and is much preferred. To backup up your repository, you just have to back up the folder you created it in.

    create-svn-03

  4. That’s it! Now, let’s do an initial checkout of your new, empty repository. First, create a folder (checkout).

    create-svn-04

  5. In that folder, right-click, and do an SVN Checkout.

    create-svn-05

  6. The URL of your repository is the full path to wherever you created your repos. In this case, it is the proj folder on your Desktop.

    create-svn-06

  7. After you enter that information, you should be able to hit OK, and your repository will be checked out.

    create-svn-07

A Subversion repository does not always need to be stored on a remote server. You can have a repository right in your filesystem, and use it just like you would any other. Later, if you decide you want to put it on the WWW, you can, by any number of means.

Just remember, though, if you have a repository living in your filesystem, it is only as safe as your backup strategy. (Granted, that’s true of SVN repositories living on remote servers, too.)

7 responses so far

Aug 02 2006

Readership test: Presentations

Published by matt under Uncategorized

The question is, how many members of the Transterpreter team keep an eye on this weblog?

There are some tips on presentations over at Creating Passionate Users from Kathy Sierra that actually capture a superset of what I think I (subconsciously) strive for in my own presentations. While a keynote is different than a paper presentation at a conference, I think there’s no reason why a good presentation of a paper (or lecture, or …) shouldn’t be entertaining and memorable.

Why?

Because if it isn’t memorable… you won’t be remembered.

While I’m at it, I thought I’d mention S5; all of our presentations, from this point forward, should be S5 presentations. In particular, they are standards based, easy to maintain, easy to distribute (everyone has a web browser), and easy to incorporate into our website (they’re HTML/CSS). No Powerpoint/Keynote/OpenOffice/LaTeX problems, no PDF conversion woes, etc.

3 responses so far

Jun 20 2006

What can an Actor do?

Published by matt under Uncategorized

All the world’s a stage, and this quote, often abused.

M. Jadud

What can an Actor do? Not as pressing a question as What Would an Actor Do? (WWAD?), but certainly an important question never-the-less. I want to remind the gentle reader that I have many grand schemes about great, sweeping themes and stories about agent-based programming in Java using Greenfoot… but at the moment, I’m just wandering around. And in my wanderings, I’d like to make the mushrooms in my LumpWorld wander around, too.

Of course, I don’t know how to do that. I could try and use Google to find out how, or I could go back and read the tutorial. However, I want to try something a little different. I’ll read some documentation.

Now, I know some of you are saying “Matt! Reading documentation! That’s awfully extreme, isn’t it?” Well, my friends, it is. Very extreme. And, for the record, it is very, very exciting. And Greenfoot has plenty of documentation hidden inside it, if you know where to look.


greenfoot-actor-classes

Documentation be hidden in them thar classes…

Lets start with the Actor class. If I double-click on the Actor class, I get a whole mess of Java.


greenfoot-mess-o-java

Double-clicking the Actor class yields a mess-o-Java.

This mess-o-Java is not for the faint-of-heart. If you look at the top of the file, you’ll see that it is written by @author Poul Henriksen, which means that a crazy person wrote that code. And we all know what happens when crazy people write software. So be careful if you spend any serious time looking at this code. What is more interesting is in the upper-right-hand corner of this window: a little drop-down menu. It has two options: Implementation and Interface Go ahead and select Interface.


greenfoot-interface-documentation


Documentation regarding the Actor class.

This is more like it! The interface documentation tells us about all the things we can do with an Actor object. For example, in my last example, I used the setRotation method; we can see that it is documented here, and not just in the Wombats tutorial. Along with it is a method called setLocation. The method summary is really quite straight-forward:

void setLocation(int x, int y)
          Assign a new location for this object.

This method consumes two integers, and returns nothing. I’m guessing it is a magic teleport method, and probably should have been called magicTeleporter(int x, int y), because it will magically make your Actor jump to anyplace in the Greenfoot World. I’m going to take my existing act() method:

public void act()
    {
        lump_rotation = lump_rotation + 1;
        setRotation(lump_rotation);
    }

and I’m going to modify it just a bit. I’m going to make my mushrooms wander around while they’re rotating.

A first attempt

The neat thing about sitting down to a piece of software as rich as Greenfoot is that you can find things you don’t expect. Put another way, I can come to the table with all kinds of assumptions, pre-conceived notions, and expectations about how Greenfoot should or will work, and then be surprised when it doesn’t work that way. Since the point of this blog is to wander around Greenfoot “kicking the tires” (so to speak), I might as well talk about some of my failures along side some of my successes, no?

Here was my first attempt at making a Lump that would march across the screen:

public class Lump extends Actor
{
    private int lump_rotation;
    private int lump_X;
    public Lump()
    {
       lump_X = getX();
    }

    public void act()
    {
        lump_rotation = lump_rotation + 1;
        setRotation(lump_rotation);
        // Move the Lump around!
        lump_X = lump_X + 1;
        setLocation(lump_X, getY());
    }

}

My previous post explored making my Lumps rotate around their axes; this would have them spinning and marching around. However, this code has a significant problem that didn’t really make sense to me at first:

java.lang.IllegalStateException: The actor has not been inserted into a world
                                 so it has no location yet. You might want to look at the
                                 method addedToWorld on the Actor class.
	at greenfoot.Actor.failIfNotInWorld(Actor.java:537)
	at greenfoot.Actor.getX(Actor.java:103)
	at Lump.(Lump.java:23)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
	at greenfoot.core.WorldInvokeListener$2.run(WorldInvokeListener.java:150)

You see, I put the call getX() in the constructor for my Actor. (The constructor is a special Java class method that is called when a new object is created. It always has the same name as the class—in this case, it is called Lump().) When I right-click to create a new Lump() object, everything is fine… until I try and put it in the world. At this point, the object is created, but it doesn’t yet exist in the world. So, everything goes badly for my Lump, and this exception is thrown.

That’s cool. Since this post is about reading documentation, I then went back to the documentation I mentioned earlier and started reading. Sure enough, the docs tell me that I can’t do what I tried to do. Because I’m a slow monkey, it looks like the documentation might become even more explicit about this point—that would be cool. While reading more carefully, I discovered the addedToWorld() method. This fits in thusly:

  1. You right-click to create a new Actor object
  2. You drop your Actor on the World
  3. Your Actor’s constructor is called
  4. Your Actor’s addedToWorld() is called

Now, I’m sure other nifty things happen in there, but this is enough for us to be getting on with.

A second attempt

Now that I’ve learned to stop fearing Greenfoot, and learned to love the documentation, my life has been much, much better. My next attempt at making my Actor wander around was much better.

public class Lump extends Actor
{
    private int lump_rotation;
    private int lump_X;
    public Lump()
    {

    }

    public void addedToWorld(greenfoot.World world) {
       lump_X = getX();
    }

    public void act()
    {
        lump_rotation = lump_rotation + 1;
        setRotation(lump_rotation);
        // Move the Lump around!
        lump_X = lump_X + 1;
        setLocation(lump_X, getY());
    }

}

Now, my Lump correctly drops into the World! Woot! What happened next, however, was not expected; I’ve created a video to demonstrate what I encountered next.


greenfoot-exception-image

A video of my first Greenfoot exception! (6.9MB, right-click to download.)

An exception! In particular, this text popped up on my screen: