Let’s play

Let's Play!

Need I say more? Now, how am I going to find time for that paper I have to write within the week…

UPDATE Absolute first impressions are:

  • It’s heavy, but good looking. Fingerprint prone.
  • Gorgeus interface and buttons.
  • Somewhat hard to navigate inside games – not self-evident how to exit a game, for example. Note that I have no previous Playstation or PSP experience.
  • Really good graphics, but the current TV is really crappy.
  • Using the controller for other things than racing is impossible :) It was hilarious trying to fight my friend Max’ robot in Gundam, nobody could control them and were just fumbling around.
  • The packaged games were not really heart-stopping, I hope I can get my hands on Resistance: Fall of Man soon! Although I don’t look forward to a first-person shooter with hand control :p .

Introducing Blogfront!

I have many unfinished hacks lying around on my web server(s), but this time it is time to release something finished. Blogfront is a simple script that fetches, crops, caches and displays random images from your Flickr account, as demonstrated by this blogs header image (try refreshing the page).

Download and installation

  • Version 0.7 (latest): blogfront.php (bugfixes, better default parameters, resizing)
  • Version 0.6: blogfront.php (first, corrected, release)

To install, copy the php file to your web server, preferably to its own directory. Make sure the script has write permissions (do this my doing chmod 777 or similar). It needs write permissions to be able to save cached photos, which is necessary for decent fetch times. Edit the script file to add your Flickr account ID and your API key (currently you need your own API key… it’s beta you know 😉 ).

Usage

The script will fetch a list of photos with a specific tag from your Flickr account. Among these photos, one will randomly be picked, downloaded, cropped and resized to fit desired size, cached locally and then displayed. All you have to do is to make an <img> tag with the src parameter pointing to the blogfront.php script file residing on your server. The script file takes some parameters for customization:

  • width – the width in pixels of the cropped image to be shown. Default is 640.
  • height – the height in pixels of the cropped image to be shown. Default is 200.
  • tag – the tag(s) to use when finding candidates among your Flickr photos. Default is “blogfront”, but you can change to anything. If you have several scripts running, you might want to have a different tag for each so you can have different sets of images. It is of course possible to define several tags, just write them comma separated.
  • border – Boolean saying if there should be a black border in the photo or not. Default is “true”.

Example: However, you can edit these parameters, and more, from within the script. Read it for more information.

What is even better is that you can control how to crop each photo. Go to your Flickr account and find the pictures you have tagged to show up. For each picture, do one of the following to create a custom crop (default crop is from top left corner):

  1. Make a note (press the Add note icon on Flickr), and position and scale it roughly to where you want the crop. The actual crop and resize will be fitted inside your note with the same center point. In the note write “blogfront” to identify it. Nothing else.
  2. Edit the “blogfront” (or equivalent) tag to add the locations of the crop. The format is “blogfrontx1y2w3h4”. Replace “1” and “2” with the x and y coordinate respectively of the start of the crop. Replace “3” and “4” with the width and height of the crop. A number can be left out if one so wish. Remember, a note will have precedence over a tag.

FAQ

  • It is ugly with a big note on my photo, what to do? In this version, there is no other way than to try to find out the location of the note you posted and transfer these numbers to a tag instead, as listed above. To find the coordinates of a note, view source for the photo page and search for the id photo_notes.
  • I get a black image! What is wrong? This probably means no photo could be found. Make sure your tag is correct.
  • Something is wrong with the image thats shows up! Try to delete the cache, i.e. delete all jpg-files from the script directory. Beware, this will increase load time considerably until all images have been cached again.
  • How can I debug the script? Unfortunately, at this time it is impossible, other than echoing manually from within the script.

Disclaimer

The script is released as Creative Commons Share-Alike. I bear NO responsibility for the results of using this script. It is in beta and expected to have bugs. (oh, when you find the bugs, please let me know!)

Apple, please save me

I have been yipping a whole lot about Mac before, more specifically about the MacBook Pro. Now, with barely three weeks left in Hong Kong, I have never been more close to buying one – which puts me into some trouble; will it be delivered in time and what should I do with my existing laptop?

A few weeks ago I had more or less decided not to buy one, at least not until the lifespan of my current laptop had passed. But my laptop (a Z60m) seem to have made up its mind for me. The last weeks it has been making trouble constantly, and this is on a system I re-installed in August. Programs crash more often than not, things are always slow (I kind of wonder what is being done with all those megahertz), processor load randomly go up to 100%, the battery time is useless even though I never really disconnect the power and I sit here wishing I had programs like iPhoto.

An important factor is that my room mate finally bought one a few weeks ago (after nagging me to buy one for more than a year!). It seems to run very smoothly, and while my laptop shuts down randomly when gaming, and delivering decent but not wonderful performance, he’s complaining he can’t set the graphics settings higher in the games. What makes these big differences between Windows and OS X baffles me, and I start to understand all those Mac evangelists.

I am ready to do the switch, but I am afraid it is more out of frustration with Windows and PCs in general rather than actual interest in OS X. Even though MacBooks are much cheaper here in HK than Europe, they are still expensive, more expensive than most PC laptops. It is not ecomonically sound to buy a new computer when I, according to all standards, already have a new computer (one that I thought would solve all my problems when I bought it a little more than a year ago). Put differently – I am wasting a lot of money into electronics that never seem to fully please me!

I guess I have to make my decision in the coming days. What should it be?

Redesigned

Yesterday I just wanted to update my blog to the latest version, but then something broke with the old theme (K2, good but not good enough) and now I changed to the aptly named Qwilm!2 theme by (Brazilian?) designer genius Oriol Sanchez. The new color scheme is mine and it is… well, good enough and at least more RipperDocish. The re-design is a work in progress, some parts of the blog are broken at the moment. Let me know if the new theme makes you throw up on your keyboard, which is not good, and sticky…