Wednesday, 19 December 2007

Luigi's Purple Coins - a map

I've been playing Super Mario Galaxy on the Wii for the last few weeks now, and enjoying it immensely. I now have just over three quarters of the stars and have hit a level called "Luigi's Purple Coins". It seems to be extremely difficult!

The idea is to collect 100 (purple) coins out of a possible 150. This level is all 2D, so it should be easy, right? Wrong. Apart from the big gaps you have to jump to avoid falling into space, and apart from the big sections of sticky goo which swallow you up and kill you, the rest of the platforms either disappear after you've stepped on them, or start rotating (about a horizontal axis).

Partly for my own benefit, I've created a map of this level, so that I can plan my route through it to get enough coins. Here is that map:-
Luigi's Purple Coins map

Luigi's Purple Coins Map

You start off on the brown square the bottom left corner. The white bits are empty space (as in fall to your death), the blue bits are sticky goo (you drown). Green are disappearing squares, and yellow are the rotating ones.
It may look familiar! It's designed to be similar to (but not the same as) Luigi's jumping sprite from the original Super Mario Brothers.

I've also submitted this map to GameFAQs, so it may end up appearing there, but I've never submitted anything before, so I haven't a clue if it will.

Here are some tips that I found by searching various forums:-
If you do collect 100 coins, the star will appear back where you first started, so make sure you have a path to get back there.
The main techniques here are the "long jump" (particularly to get over the gaps where coins are hanging in the air or over goo) and the "spin jump", where you can get a boost in height and change in direction at the end of a jump if you mess it up or need to get that bit further, etc.
Have a look on YouTube, etc., for videos of people playing this level. As unbelievable as it may sound, there are people out there who have grabbed all 150 coins, instead of just 100.

Good luck! I haven't beaten it yet ... will try again soon.

Monday, 5 November 2007

Browsing for multiple files in a file upload box

If you've used Flickr, you may well have seen their funky uploading tool that lets you pick multiple files to upload and then shows you the status of each as it uploads.

It's very cool, and you may want to copy it on your site. So, how would you do it?

Well, you can't. At least not with the standard tools of the web - HTML and JavaScript. It's a limitation of the input type="file" HTML control that it only allows you to pick a single file. JavaScript can't help because JavaScript code cannot have access to your file-system. So with any standard web-server language (Java, ASP, ASPX, PHP, etc), the user will always have to pick their files one at a time (even if you can spruce things up slightly by capturing all of the files in a single list once they've been chosen).

Well ... actually you can, but you have to rely on something happening at the user's end.

  • You can force the user to zip up all of the files and upload a single archive (which you can then manipulate and unzip using the standard library functionality of your chosen language).
  • You can use a Java Applet, since Java can access files on your machine if you allow it to. This means that the user will have to install the Java runtimes if they don't have them already. You may also need to look into security-signing your applet.
  • You can use an ActiveX control. This has the severe limitation that it will only work on Windows systems. Also, you'll probably need to security-sign it to stop dire warnings from appearing when users visit your site, and it probably won't work in Firefox.
  • You could use a client application. This gives you lots of control, but breaks the web paradigm slightly and you'll have to think about which platforms you want to code for and support.
  • Ah, so how do Flickr do it? They use Flash. It's very nifty, and you might not even notice that it's a Flash application. Uploading multiple files was added in Flash 8 and seems to work well.
Flash could be expensive, if you don't already have it. There's a third-party control available which uses Flash, but I'm not going to link to it just yet as we're still evaluating whether it's any good and how good the "Free" version is.

Update: 2nd April 2008. We started to look at how this is possible using Flex, and it looks doable using the free version of the tool (if a little painful).
Oh, and we looked at how YouTube does it - they use Java. Interesting.
Meanwhile, Microsoft are pushing Silverlight harder and harder. You can't view some of their webcasts without installing it, and every time you download something you are told you'll get a better experience with it. Perhaps it will reach the tipping point after all?

New College Logo

(Hurrah! Google is finally picking up my site. Right, time to add some content.)

I'm currently making a t-shirt related to my old college (New College, Oxford, England) and wanted to add the New College logo. Legalities aside, I couldn't find a decent copy anywhere. The best I found was a 100 x 120 pixel version on Wikipedia I (I've since found some more examples at a random Varsity shop, but nothing very clear).

So - I made my own! It took me a little while, but once I figured out how useful layers are in Paint.NET, I ended up with something that works quite well (with the help of a Tudor Rose from Wikipedia again!). Tada:

New College Oxford logo

Friday, 7 September 2007

Opera Ctrl-click behaviour

Here's something that people may find useful!

I'm normally a Firefox fan, but I thought I'd give Opera a try. My first hurdle was that Control+Click in Firefox means "Open Link in New Tab". Ctrl+click in Opera just seems to load pages in the current tab (or current page).

So, I figured there must be a way to customise the behaviour. Initial results said "no", but then I found a page about editing Opera Settings.

In order to set up my custom Control+Left Mouse Click behaviour in Opera, I needed to:-

  • Go to Tools -> Preferences
  • Click on the Advanced Tab
  • Select Shortcuts
  • Duplicate the Opera Standard Mouse setup (and rename my duplicate as Marv Setup)
  • Edit this Mouse setup
  • Under Browser Window, hit "New"
  • In the Input field, the command to enter is "Button1 ctrl" (without the quotes)
  • For the Action, enter "Open link in new page" (without the quotes) - for Opera, "page" is the equivalent of "tab" in Firefox.
  • Click OK a few times
  • Done!
Actually, strike all that - I could have sworn that it was working, but when I re-opened Opera, it wasn't. Ah well, back to the drawing board.

Edit: Although a few people have said that you can accomplish what I want to do using the keyboard options, I've tried many permutations on Opera 9.50 in Windows XP/2003, and have been unable to get it to work. However, if you check my latest post below, I've found a solution!
Opera Ctrl Click to open in new page / tab updated

Thursday, 6 September 2007

Suggestions...

Well, although I originally thought I would update this off my own back, I don't seem to have the time while searching for things to post about the results. And when I have time to write things in this blog, I've forgotten the things I've searched for.

Anyway, so if this site eventually does turn up in Google, and someone finds it and has a suggestion, please put it in the comments section!

Cheers,

Marv

JavaScript HTTP Status detection

I was using Selenium to do some SEO testing, and for political reasons the tests had to run in the Selenium IDE.
Some of the tests were for HTTP Status: certain pages should return a 301 redirect. So I was asked to find a way to extend the Selenium user-extensions.js file so that it could find the HTTP Status for a page.
I found that it's not possible to do this in JavaScript directly: there is a way to find the HTTP Status code, but unfortunately the 301 redirects are interpreted before JavaScript gets a chance to log them.
In the end, we had to implement a solution where we had our own web-service (written in C#) to read the HTTP Status for a URL, and then we just called that from the Selenium JavaScript. Because the language we were using had access to the HTTP headers from the start, it was able to pick up 301s fine (and we could also code special cases like 404s easily).

Update:
At Angelblade's request, I'm posting some of the code we used to find the HTTP status of a URL. I'm not sure how much use it will be in Java though, since a lot of the processing is handled for us in the .NET objects!
It's probably not the best code, and I'm a bit hesitant about posting it, but it could at least provide a starting point for anyone else who wants to accomplish something similar.


public Int32 GetStatus(String encodedUrl)
{

const Int32 Request_Timeout = 90000;
HttpWebRequest request = (HttpWebRequest) WebRequest.Create(encodedUrl);
request.Timeout = Request_Timeout;
request.AllowAutoRedirect = false;
try
{
HttpWebResponse response = (HttpWebResponse) request.GetResponse();
response.Close();
return (Int32) response.StatusCode;
}
catch (WebException webException)
{
if (webException.Status == WebExceptionStatus.ProtocolError &&
webException.Message == "The remote server returned an error: (410) Gone.")
{
return 410;
}
else
{
throw webException;
}
}

}

Can you search RSS feeds?

Official Google Reader Blog: "We found it!"

How do you search RSS feeds? Through Google Reader! Their team have just added Search to the list of tools at your disposal. You can search individual feeds, a group of feeds or all of your feeds.

At the same time, they've upped the maximum count of items from 100 to 1000 - so now I'm not just 100+ items behind ... I'm 1000+!.

If you haven't already signed up for Google Reader, I highly recommend it. It lets you manage your RSS feeds and keep track of which items you have read from whichever computer you access it from. You can also activate an offline mode to download posts for perusal when an internet connection isn't available.

Sunday, 29 April 2007

Is "Kenco Pure" "Fair trade" coffee?

I just watched an advert on television for a new range of coffee from Kenco - Kenco Pure. I was curious; there was an implication that the "Kenco Pure" brand is Fair Trade. There's even a little logo at the bottom of the screen that looks like it could be the Fair Trade logo (yes, alright, it doesn't look that much like it, but I'm the person who happily bought some "Fair Trade" chocolate in France, only to find that the symbol on the wrapper actually meant that it could be recycled). Well, Kenco Pure is not Fair Trade. I found a blog post here that has some more details:-
http://mtcodex.net/2007/california-coffee/

Monday, 9 April 2007

Tough to find

Hmm, a new blog; pregnant with possibilities. How shall I start it? There's quite a lot of pressure, because if I don't get it right, it'll be here forever. Ah, f*** it, I can always edit it later...

So , what's this blog about. Well, I consider myself to be a pretty good Google-searcher (not Googler, I don't want the Google Nazis coming after me and accusing me of using their trademark as a Verb (TM)). However, sometimes it takes a while to dig out the results I'm after. What I'm going to try to do with this blog is to be useful and re-post the results in a way that might bring the same results up more quickly for other people.
The results will be very varied, because I use Google for a shed-load of stuff.
The next step is to remember some of the times I've had this happen in the past, or to remember to put up a post when it happens again. We shall see how that goes...