Archive for February, 2006

Games teaching the wrong things - Follow-up

My main beef with massive online games these days, is around how badly paying customers are treated and willing to be treated. I mentioned David Sirlin’s essay on his own beef with MMOs. Though his is not exactly the same as mine, I do share some of his opinions.

David got lots of feedback to this article, positive and negative. You can find them here.

Comments

Build status lights

Seen on the Extreme Programming mailing list:

I thought I’d share our new build status lights with the group:

This is a real, four foot high British traffic light, which is hooked up to our build machine. It was a scoop at only £40 from ebay, but I didn’t envy my colleague who had to bring it into work on a crowded London train.

The build machine also plays sounds when the build status changes:

Red: compilation failure; plays a submarine style siren sound
Amber: test failure; plays a ‘wrong answer’ sound from a game show
Green: build success; plays a ‘Hallelujah!’ sound

We also have a secret Friday night mode that plays disco music and alternates combinations of lights to the beat, but we haven’t shown that to the Customer yet :-)

So, do we have the coolest build status lights?

Chris

Fantastic stuff! I suspect those sounds will get old pretty quickly though.

Comments

LAMP without the L (WAMP?)

Get ready for some Linux-Apache-MySQL-PHP (LAMP), though I’ll skip the L part for now.

1 - Apache

Get Apache from here. More specifically for Windows, get this file (Apache HTTP Server 2.0.55).

Save the .msi file and when that’s done, double-click the file. The installation is straightforward.

Remember to select “localhost” for your Network Domain and the Server Name, in the Server Information page.

I run Apache as a service, but you don’t have to. It seems more convenient though.

2 - MySQL

I got MySQL 5.0 from here. Since I’m on Windows, I got this particular file (MySQL 5.0.18).

Unzip the file and run “setup.exe”. Pick “Custom” from the Setup Type page. Then you can skip the MYSQL.com Sign-Up page.

When asked if you want to configure MySQL, say yes (check the option) and in the next screen or so, select “Standard Configuration”.

Install as a Windows service, probably easier.

Pick a root password and write it somewhere, just in case.

After MySQL is installed, try and run MySQL Command Line Client from the Windows menus. If you see a console with the the mysql> prompt, you’re all good.

3 - PHP

Download the latest PHP build, 5.1.2, from here. For Windows, get the installer from here.

Unzip the file and run the installer. Everything should be fairly self-explanatory. In the Server Type dialog page, remember to select “Apache” as the HTTP server for PHP to run against.

Keep going until the very end. You will get an Apache Configuration error. It’s okay, just press “OK” and you should get the “Installation complete” dialog. Press “OK” again and you’re…almost done (got to fix that error you just got)

Stop Apache then go to the directory where you installed Apache and open the conf. Edit http.conf and add the following lines to the bottom of the file:


ScriptAlias /php/ "c:/where/you/installed/php/"
AddType application/x-httpd-php .php
Action application/x-httpd-php "/php/php-cgi.exe"

Restart Apache and go to http://localhost:8080/ (change the port number if you had selected to run Apache from a different port)

You should see the Apache welcome page. If so, you’re really almost there.

Add a new file called phpinfo.php (for example) and add this one line to it:
<?PHP phpinfo(); ?>

Save the file and load it from http://localhost:8080/phpinfo.php (again, fix the port number if necessary).

You should see a information page about your PHP setup. Congratulations, you’re PHP enabled!!

I still need to write something up on how to use MySQL from a PHP application, but for now, go here, and start doing PHP stuff.

Comments (1)

Fast connection

And I thought I had a fast connection at home. This is the connection I need:

Comments

Eclipse Business Intelligence and Reporting Tools (BIRT)

BIRT is a very cool set of Eclipse plug-ins for designing and deploying tabular reports to the web. I’ve been following BIRT since even before there was anything to download from the Eclipse site, when BIRT was just a proposal, and it has come a long way.

If you need to generate and deploy reports of data from a database or even from XML, you ought to try BIRT. Downloading and install from the Eclipse site can be a pain, especially if you’re new to Eclipse and its many dependencies on other more or less obscure projects.

Actuate has a nice one-button download and install link option on their site. If you’re not interested in source code, and really, just want to try BIRT and not deal with Eclipse stuff, I’d recommend you try it from the free downloads section. Sure, they still want to know a few things about you, but nothing major. You don’t even need to give them your real email address if you don’t want to.

Rather than put together yet another tutorial on how to get started with BIRT (and because I’m lazy like that), I’m going to link to the tutorials on the Eclipse site. They’re well done and easy to follow. See here.

Comments

Google Page Creator

Here’s a page I just created using the new Google’s Page Creator. I would say more about it, but there’s not much to say, it’s just easy.

Not sure why Blogspot doesn’t use Page Creator yet, I imagine it’s just a question of time.

Comments

VeryLightSchemeUnit

A very light SchemeUnit indeed

The “engine”, some code and some tests:

(define (assert-equals expected actual)
  (if (= expected actual)
      (display ".")
      (display ".F")))

(define (add x y)
  (+ x y))

(define (test-add-ok)
  (assert-equals 5 (add 2 3)))

(define (test-add-ko)
  (assert-equals 4 (add 2 3)))

(define (test-suite)
   (test-add-ok)
   (test-add-ko)
)

Run the suite

> (test-suite)
..F
>

Other features badly needed

- Display the name of the failing test
- Print a message when a test fails, something like “expected foo but got goo”
- Test count

Comments

60″ laptop on the way

This is what I’m talking about

More crazy and not so crazy laptop ideas here.

Comments

Mad gamer

It can be frustrating when you’re waiting for a game to start. Don’t mess with gamers, especially if you’re a keyboard.

me wanna play!!!

Nuts or Oscar material?

Comments

Flying over Odeceixe

Having fun with Google Earth

Odeceixe (pronounced odd-say-sh) is a small village in Algarve, southern Portugal. With my parents we used to go there every summer, even when were still in Africa. Eventually my parents bought a house and retired there (later on they moved some place else though).

This place is really two villages. The main one 1.5 mile from the shore, and then its beach version built on top of a small cliff. The combination of ocean and river makes this a very pretty beach. For the longest time it was a type of “best kept secret” but I think less and less secret. This is my contribution to revealing the secret.

If you have Google Earth installed, you can fly there. If not, just enjoy these pictures.

Comments

It’s the drivers stupid

I spent a good 2 hours on the phone, with Dell tech support. All my other computers were connecting to the internet just fine, but the new and still shiny M170 was not. Instead of getting the typical 4 Mbps, I was getting an embarrassing 250 kbps. It was 1998 all over again, and how am I supposed to read email at that speed?

The Dell dude was very nice and patient. At least he took me seriously (and maybe he shouldn’t have) and didn’t give me the canned answers “Sir, make sure you reboot 3 times…and oh, your monitor needs to be clean!”. Instead we jumped right to uninstalling drivers, connecting to other peoples’ networks, planning a trip to Startbucks to see how the connection was there (just in case it was my router) and all that good stuff.

In the end nothing worked. Then I decided to stop being lazy and search the Intel site for new drivers. I found some new and recent stuff (always nice), installed it and now it’s more like it:

I like this speed test because it has prettier graphics, and the numbers it gives me are better than all the other speed tools out there. I’m vain like that.

Comments

How to write a MultiPage Editor Eclipse plug-in

Eclipse comes with a small set of example plug-ins that need to be downloaded separately. For example, for the latest release (Eclipse 3.2 M5) get the example plug-ins from here.

If you have done this and looked at the source code for org.eclipse.ui.examples.multipageeditor, you see that it’s rather simple to add a multi-page editor to your plug-in.

Here are the steps though (this assumes you already know the basics for writing Eclipse plug-ins):

1- Add a new extension to org.eclipse.ui.editors
2- For the class, make sure you have it extend MultiPageEditorPart
3- Associate this plug-in extension with mpe files (or any other file extension you like)
4- Add the editor pages in createPages. For example:


    protected void createPages() {
        createPage0();
        createPage1();
    }

5 - Each createPageX() basically creates a Composite then adds it to the editor by calling addPage(composite). This method returns the page index in the editor. Get the index and call setPageText(index, "page name") to give the page tab a name.

That’s basically it, nice an easy. Run the plug-in, add an “mpe” file (if that’s the file extension you associated with the plug-in) and you should see something like this:

Multi-page editor, with 3 pages for viewing .mpe files.

Comments

Massive online games as Day Care

David Sirlin talks about all that’s wrong with World of Warcraft, and how it teaches the wrong things.

The article certainly strikes a chord. Over the years, Massive Online Games starting with Ultima Online and a certain expansion, have been pushing the envelope on how much abuse the players can take. I’m convinced it has something to do with the Stanford Prison Experiment. It’s sad though if that’s becoming the norm.

Comments

CVS in Eclipse nightmare seems to be over…

I have 3 Eclipse clients talking to the same CVS server. So far it has been a nightmare type of situation, where it’s really easy to make it so the files don’t sync up anymore. Not only that, Eclipse (3.2M5) fails but doesn’t tell me where and why it failed, only that it failed.

I was considering replacing CVS with Subversion or Perforce, but those come with their own sets of problems. SourceSafe maybe? (just kidding!)

I finally came up with what seems like a decent workaround: when an Eclipse project refuses to sync up for some mysterious reason, disconnect it from CVS (right-click -> Team -> Disconnect…) while also deleting the meta information (this option is “off” by default). Then connect is back (right-click -> Team -> Share project…).

Seems to be working well enough. Now if I could find a way to purge CVS of those deleted files and directories.

Comments

Myths of Open Source

Over pizza and beer the other day, Kevin, Jeff and I were discussing how good or evil Open Source Software (OSS) is.

As it happens often when we discuss stuff, there were 3 different opinions. We had the full spectrum, from OSS is evil and it’s going to kill our profession, to OSS raises the bar for everyone the users will benefit from it (my opinion).

There was no clear conclusion as some of us needed more time to come up with a rebuttal. We’ll finish the conversation next time we go over to Kapp’s or something.

Meanwhile, there was an article on CIO today that sort of reinforces my opinion (hey, this is my blog, I get to quote some articles and ignore others).

The article, as the name implies, talks about the myths of open source, 5 myths to be exact. The first myth is the one we were discussing:

Myth 1 - The attraction is the price tag

Fact: No so:

“It’s about doing our jobs effectively—and we’re willing to pay quite a bit for that. We want stable software that does what it says it will do.”

Or in other words, come up with a better solution than the free one, and people will pay for it. That’s what I mean when I say “raising the bar”.

Comments

Cubicles cause brain damage

Since I started working in cubicles, when I moved to the Silicon Valley a few years back, I had the impression I was also becoming dumber. Until now I have been blaming it on “age”. As it turns out, it’s those damn cubes that are doing it!!

Apparently playing is also good for neurogenesis (you know, new, fresh neurons). Since I don’t imagine I’m going to start working on a non-dull environment any time soon, I better keep on playing those computer games. Or maybe learn a new programming language or two.

More on the subject: Offices that work (pdf)

From Creating Passionate Users.

Comments (1)

How to synchronize your Firefox bookmarks

Like many folks, I have several machines I work on a regular basis, and it’s a mess having to sync up those bookmarks by hand. Sure I could use things like del.icio.us or spurl.net, but I actually like to have my bookmarks local.

My solution assumes that you already care about your data, and have some sort of source control system going on. I have a CVS server running at home, and all my machines can check-in and check-out from there. Until now I would only save the obvious stuff, such as code, pdfs, todo lists, etc, but not bookmarks.

Not sure why I didn’t have a solution for the bookmarks yet, because it’s not that difficult (again, assuming you already use CVS or some other source control system).

To make it easier to backup, I try to have all the data I care about, under “C:/Documents and Settings/Me/My Documents/~Save” so my only issue was to tell Firefox to store the bookmarks somewhere in there.

Typically Firefox stores your bookmarks right here (on Windows):

C:/Documents and Settings/Me/
Application Data/Mozilla/Firefox/Profiles/
some-profile-name/bookmarks.html

Luckily it’s really to change this default location.

1- Exit Firefox
2- In the same directory above, where Firefox expects the bookmarks to be - but not for long, right? - add the following line to “user.js” (create a user.js if you don’t have one already)

user_pref(”browser.bookmarks.file”,
“C:\Documents and Settings\(directory where you want to save your bookmarks)\bookmarks.html”);

3- Copy your bookmarks file to this new location
4- Start Firefox

That’s all there is to it. Now whenever you sync up your CVS data, this will be committed as well and not only accessible to your other systems, but also always in sync!

Comments

Patching online games

Why can’t all online games be like Guild Wars when it comes to patching? I’m not even going to talk about how good GW is as a game per se (it’s excellent), or the fact that there are no monthly fees (fits my style — “distracted”). I just wish that all these other games would learn something from GW. When it came out a year or so ago, it was obvious to me that the other games would take a page out of Guild Wars and come up with something a little bit less, what’s the term again…last century?

Instead games such as Star Wars Galaxies, Everquest II, Asheron’s Call (which died recently), and of course the game to rule them all, World of Warcraft, are all a major pain in the butt when it comes to upgrades.

It’s not uncommon to having to wait 5+ hours between the time you start patching the game and the time you can actually play. I don’t know, but especially on a game where you actually pay a monthly fee, that seems broken to me. Well, was broken enough that I’m no longer playing any of those games. So there you go Blizzard, that will teach you, now you’re stuck with only 3,999,999 players…hahaha.

So these folks started their own company after leaving Blizzard. At least some of the developers were in the World of Warcraft team, and one of them was the team lead for that project. They know a thing or two about game development. In fact, it seems to me that all the developers who knew anything about network programming, left Blizzard to go work on Guild Wars. It’s obvious from looking at how good Guild Wars is and how bad World of Warcraft is (at least from a network/patching viewpoint)

I’m migrating my games from my old system to the new laptop (yay) and I couldn’t find the Guild Wars CD. Then I remembered “wait a minute, isn’t their installer really light? like 100k or something?”. Sure enough, I went to their web site, downloaded a 100k installer, launched it and there it is, installing away.

So, how is that much different from other games? The difference is that in other games, no matter how small the installer is, these games think I need to have the entire game installed (2-4 gig) before I can actually start playing it. Never mind that I won’t see even half the game in my first 3 months playing it, but just in case, let’s have the entire game, before you can get started.

Instead of that nonsense, Guild Wars installs just what you need, which often is not much. If I logged out in Some Town and the game now needs a patch, why do I need to wait for it to patch Some-Other City as well? Why can’t it just patch Some Town and when, and if, I ever go to Some-Other City, then patch it then? If the game is smart enough, it can even patch Some-Other City in the background, when I’m away or whatever. That way I won’t even take the (lag) hit when I go there.

Seems obvious right? Just install what I need, not the whole frikin game for chrissake.

That’s one obvious feature those other games should consider. The other one is the whole server/shard issue. Especially in games where there is no housing, why can’t I move around between servers? If I start a character on Laggy Server, why can’t I just pull down a menu with all the active servers, select Cool Server, and have my character ported there? Why is that such a big deal?

With World of Warcraft this is such a big deal, I can’t even create new characters on European servers, where I could play with my buddies there. So forget about jumping from server to server with your character.

Sure, I can imagine abuses, where you’re trying to pk someone and then flee to a different server or whatever. There are plenty of in-game solutions for this type of abuse, that should not be the reason why things such as these aren’t implemented.

I think the reasons other games don’t do this are quite simple:

1- Do what Ultima Online did. Worked for them, it will probably work for us as well.

2- The people who actually know how to do this, left and started their own game company…the bastards! (well, at least for Blizzard, that’s got to be the excuse, for the other companies, I have no idea why not)

3- If people really want to move to a different server, make them pay. — this is like having Microsoft charge you every time you want to move a file from SomeDirectory to AnotherDirectory.

Anyway, this is not unique to games. Software in general should learn from the Guild Wars folks.

Alright, need to wrap this up, as I started installing Guild Wars at the same time as I was writing this, and the game is ready. Go them!

Comments (1)

What’s the next line? - Solutions in Lisp and Java

These are the Java and Lisp solutions for the “What’s the next line?” puzzle from yesterday. If you don’t want me to spoil it for you, don’t read any further.

The good thing about the real solution is that it can be more easily automated.

Here’s the solution in Java. Of course it can be improved, but I wasn’t that interested in making it real tight. I was more excited about writing it in Lisp, given that I don’t know much Lisp and all.

public class LookAndSay {
    public LookAndSay(int root, int depth) {
        System.out.println(""+root);
        look(new int[]{root}, depth);
    }

    private void look(int[] line, int depth) {
        if(depth == 0) {
            return;
        }
        ArrayList array = new ArrayList();
        for (int i = 0; i < line.length; ) {
            int previous = line[i];
            int count=0;
            while(i < line.length &&
                     line[i] == previous) {
                count++;
                i++;
            }

            array.add(new Integer(count));
            array.add(new Integer(previous));
        }
        int[] newline = new int[array.size()];
        for (int i = 0; i < array.size(); i++) {
            newline[i] =
               ((Integer)array.get(i)).intValue();
            System.out.print("" + newline[i] + ' ');
        }
        System.out.println();

        look(newline, depth-1);
    }
}

Let’s just say that the Lisp solution took me more than 7 minutes to come up with. I don’t know much about Lisp, but I do know enough to realize that I’m trying to write Java/C in Lisp. If you know how I can improve it, I’d appreciate if you could leave a comment. Thanks.

(define initial-count 1)

(define (elements items newitems count)
    (if (null? items)
        items)
    (if (null? (cdr items))
        (append newitems (list count (car items)))
        (if (= (car items) (cadr items))
            (elements (cdr items) newitems (+ count 1))
            (elements (cdr items)
                      (append newitems (list count (car items)))
                      initial-count)
        )
    )
)

(define (nextline items depth)
  (if (= depth 0)
      (display "done.")
  (let ((line (elements items '() initial-count)))
    (display line)
    (newline)
    (nextline line (- depth 1))
   ))
)

(define (list-all root depth)
  (display (list root))
  (newline)
  (nextline (list root) depth)
)

> (list-all 1 10)
(1)
(1 1)
(2 1)
(1 2 1 1)
(1 1 1 2 2 1)
(3 1 2 2 1 1)
(1 3 1 1 2 2 2 1)
(1 1 1 3 2 1 3 2 1 1)
(3 1 1 3 1 2 1 1 1 3 1 2 2 1)
(1 3 2 1 1 3 1 1 1 2 3 1 1 3 1 1 2 2 1 1)
(1 1 1 3 1 2 2 1 1 3 3 1 1 2 1 3 2 1 1 3 2 1 2 2 2 1)
done.
>

Comments

What’s the next line?

I was playing with some easy brain teasers (nothing that requires advanced math or anything) and came across this one:

     1
    1 1
    2 1
  1 2 1 1
1 1 1 2 2 1

what’s the next line?

After twisting this series in all sorts of directions, even imagining that this was some sort of base-3 prime number series I came up with what seemed like a decent solution:

(hightlight the box to see what solution I came up with)

After a while I noticed that this looked like a Fibonacci series, where every line after the first 2, is the sum of the previous two, if you add each inidivual number on each line. So:

Line 1: 1 (1)
Line 2: 1 1 (1+1 = 2)
Line 3: 2 1 (2+1 = 3)
Line 4: 1 2 1 1 (1+2+1+1=5)
Line 5: 1 1 1 2 2 1 (1+1+1+2+2+1=8)

So at least the sum on the next line was going to be 13 (8+5). Now it was a question of finding the right ones and twos. I came up with a series of 1’s and 2’s that made sense from a pattern point of view, and the sum was 13, so I thought I had cracked it. Boy was I wrong.

Then this morning I’m reading the Mathworld website (it’s a fantastic site) and lo and behold, I came across the same sequence of numbers, but with a different solution:

(hightlight the box to see it)

The actual solution (yes, actual, mine only seemed fine to my small brain) is much simpler. It’s based on the “look and say” technique. To figure out the next line, just say the current one. So for example

Line 1: 1 (start here)
Line 2: 1 1 (one 1 on the previous line)
Line 3: 2 1 (two 1’s on the previous line)
Line 4: 1 2 1 1 (one 1 and one 2 one the previous line)
Line 5: 1 1 1 2 2 1 (one 1, one two and two 1’s on the previous line)

and therefore

Line 6: 3 1 2 2 1 1 (three 1’s, two 2’s and one 1 on the previous line)

What’s sad with my solution, is that after line 5, there’s no more Fibonacci. Bummer, it would have been neat to have some sort of Fibonacci-Look & Say correlation.

Comments

« Previous entries