llemarie’s weblog

Programming, tinkering – Lionel Lemarié

Breakpoint ’08 Seminar: Multicore Mayhem

Posted by llemarie on February 27, 2008

The seminar page for Breakpoint ’08 is up!

I’ll be giving a talk at Breakpoint in Bingen on multicore programming on Windows. A lot of lessons can be learnt from console programming and applied to the PC now that CPUs have 2, 4 or 8 cores… I’ll be discussing design and pitfalls (with solutions) and I’ll give away an in-game profiler for free!

Stay tuned (to the RSS feed) for more details about the entry in the next few weeks.

Posted in Blogroll, Breakpoint, Programming, Teenage Mutant Ninja Puppets | 5 Comments »

Project: Head-tracking on PS3

Posted by llemarie on February 9, 2008

IR LED glassesThomas Miller IV from SCEA game studios posted a cool video about his Desktop VR port to the PS3 (embedded below). This is a very interesting concept and well worth watching.

It uses the Playstation Eye webcam to track IR LEDs that you wear on your head on the side of a pair of glasses. As you move your head, it moves the 3D view on the screen accordingly, giving you a great impression of depth. When you look at the face of a cube and lean left to look at its side, you actually see its side.

I built the glasses out of junk remote controls lying around. Took the IR LEDs, the remote battery compartment, even the on/off switch. Glued the lot together on my friend’s sunglasses and added a couple of wires. Job done. No resistors needed that I could tell, the IR LEDs use 1.6V, so they should be fine wired straight to a couple of 1.5V batteries in series. Post in the comments to tell me otherwise before they blow up and I’ll owe you one. I could have used button batteries to make it swish and subtle, but then it would have blown my budget of £0, so I went for the fat ones from the remote controls.

We taped developed film on the Playstation Eye as an IR filter (see photos), as recommended in the video. It works pretty well. To improve the image quality it’s recommended to open the webcam, and remove the IR filter (it’s a pale green film on the lens), but it’s not strictly necessary to do it. (Note that the IR filter inside the webcam prevents IR light from passing through, whereas our developed film tends to only let the IR light through, not sure what the proper vocabulary is there, they probably have different names).

The PS3 demo written by tmiv is pretty simple, and neat in that way. It takes the image from the webcam and looks for the two dots of light from the IR LEDs (also supports one dot for controlling using a normal remote control). As the dots move on the X/Y plane, it moves the camera accordingly, giving you the impression that you are looking on the side of the object. The effect is pretty uncanny! By using the distance between the points, it knows when you’re getting closer or further from the webcam, and changes the depth too.

Video from Thomas:

Posted in Head Tracking, Projects | 11 Comments »

Programming: ezTunnel SSH – Port Forwarding Made Easy

Posted by llemarie on November 25, 2007

Update: Windows and Linux binaries, as well as open-source code under GPL are available here.

The freeware “ezTunnel SSH” is a GUI application for Windows and Linux that makes it easy to manage multiple SSH tunnels in the background. The interface is simple: creating a tunnel takes a few seconds, connecting to an existing tunnel is instant!

“Why would I want to do that?” you might ask… To make a secure connection to your home or to your office of course! If you wanted to control your home computer via Remote Desktop from work for example, you certainly don’t want to open port 3389 on your home firewall! Instead you set-up an SSH server at home (with a Linux box, or using cygwin under Windows, it’s easy either way) then you “tunnel” your connection via the port 22 (default for SSH) and you don’t have to open any other ports on your firewall. With one SSH server on your home network, you can access any computer on your network simply by creating a tunnel to it.

Now imagine you want to securely control your home PC from anywhere in the world, stream your home MP3s (using Jinzora, it’s brilliant), occasionally connect to a secure server at work, punch a hole through a local firewall administrated by somebody else, etc… That will take a few tunnels to set-up. No worries: with ezTunnel SSH it only take minutes and it all sits in one icon in the system tray.

Simply put, a tunnel works this way:

  • Tell it where the SSH server is (this is your home address, probably a static IP from your ISP or a dyndns address).
  • Tell it which computer you want to access on your home network (this is the internal IP, probably 192.168.0… ).
  • Specify the remote port (for remote desktop that’s 3389, for a web server it’s 80, etc…).
  • Choose a local port (that’s your choice, I tend to use ports in the 5000-6000 range).
  • Start the tunnel and connect to “localhost:5000” (if you chose 5000 as the local port).

That’s it, now you can access all your home computers from anywhere completely securely!

Get “ezTunnelSSH” for free here.

Posted in Blogroll, Programming | Tagged: | 8 Comments »

Programming: Updated Teenage Mutant Ninja Puppets

Posted by llemarie on November 11, 2007

I’ve received a few requests to post the full version of Teenage Mutant Ninja Puppets as shown in the YouTube video I posted a few months ago.

This version has the high resolution textures and character position editor enabled.

Update: Network support now works and the editor can save the current pose of the ghost (the pale guy) by pressing ‘R’ on the keyboard, then during the game you can use the pose by pressing ‘T’.

Download it free here (5MiB).

Screenshots on flickr.

Posted in Blogroll, Programming, Teenage Mutant Ninja Puppets | Tagged: , | 56 Comments »

Project: Musical Caps-Lock Key

Posted by llemarie on November 7, 2007

I posted my first Instructables after I received a comment on my Frankenphones post saying that I should have pusblished the instructions for the headphones.

For this project I took the idea from a Kipkay video and wired a greeting card musical module to the caps-lock key of a colleague’s keyboard, unbeknownst to him, and waited for him to press caps-lock by mistake. Music!

He googled for a virus that plays music on your keyboard, looked for accessibility settings, searched for the source of the Jingle Bells music: is it the PC? is it the monitor? no, it’s the keyboard! This prank is hilarious!

Read all about it on Instructables.

Photos on flickr.

Lire en français.

Posted in Blogroll, Musical CapsLock Key, Prank, Projects | Tagged: | Leave a Comment »

Tip: Use a higher resolution desktop than your monitor can support

Posted by llemarie on November 3, 2007

Note: This post has been superceded. Please see this update for a better way to do this. 

As a follow up from my previous post about scaling the screen for a remote session, here’s a new hack that allows you to scale the screen of your local session! Using this trick you can set the desktop to a resolution that is not supported by your monitor and it will be scaled down nicely to fit. There is of course a performance hit, but depending on your usage this could be very useful. For example I am writing this post in a comfortable Firefox window in 1600×1200 on a monitor that supports only 1280×1024.

There have been a number of hurdles to overcome: I needed to connect Remote Desktop to the machine I was currently using, and Windows does not make it easy for the user to do that. Windows XP does not allow multiple interactive users to log on at the same time normally, and Remote Desktop refuses to connect to localhost on port 3389. Now this simple tutorial will take you past those problems in no time.

Here’s how you do it:

1. How to allow multiple users to connect at once on Windows XP.

Get the Terminal Patch and install it. It’s really easy, just run the installer, there’s nothing to it. You need to reboot.

You can now login into your machine using multiple accounts at once, locally and using Remote Desktop.

2. Create a new user account and enable Fast User Switching

Add a new user whose sole purpose will be to Remote Desktop to localhost. Log-in as the new user for the remaining steps. No need to set the theme or anything.

To add a new user, open the Control Panel, open User Accounts, click “Create a new account”. Then enable Fast User Switching by clicking “Change the way users log on or off”.

3. Trick Remote Desktop into letting you connect to localhost

By default Remote Desktop will not let you connect to the local computer (even using another account) saying that you are already using it. That’s dumb because you can use Remote Desktop from another machine to connect to your computer fine.

Download a port forwarder and create a shortcut for it. Open the shortcut properties and change it like this:


"C:\Documents and Settings\Lionel\Desktop\portforward.exe"


"C:\Documents and Settings\Lionel\Desktop\portforward.exe" 5000 3389

Run it, this redirects all connections to port 5000 to port 3389 which is used normally by Remote Desktop. Now when you connect, use 5000 instead of the default port and you will get connected fine.

4. Create a saved RDP session with scaled settings

Follow the instructions from the previous post to create a .rdp file and add “smart sizing” to it.

Set the server to “localhost:5000” as we setup in the previous step.

Set the username as your normal username, not the new one.

That’s it! When you want high-res, simply log-in with your new account, start the port forwarder with the shortcut, start the connection by double-clicking on the .rdp and you’re connected as your usual user.

Posted in Blogroll, Remote Desktop, Tips | Tagged: , | 1 Comment »

Tip: Scaling your Remote Desktop session

Posted by llemarie on November 1, 2007

No matter whether you’re a Windows lover or hater, there’s no denying that Remote Desktop is one of the greatest features of the system. It beats VNC and many other remote control solutions by far for its sheer speed and picture quality (although of course VNC is genius for the fact that it works on Linux and Mac).

One gripe I have had with Remote Destop for years though is that I want to be able to connect to my desktop machine at its native high resolution from my laptop which has a lower resolution. Scaling isn’t that hard! Don’t give me those scrollbars, they are just useless. Both TightVNC and MaxiVista (and many others) support scaling the remote screen and it looks very good, so it’s been frustrating not to have the feature in RDP.

This morning I found that RDP does indeed support nice and efficient scaling, just not from the GUI settings. Here’s how:

  • Configure your remote connection from the GUI as usual.
  • In “Local Resources, make sure that “Apply Windows key combinations” is set to “On the remote computer”.
  • Save the connections settings to a file in a sensible directory. Call it for example “Remote.rdp”.
  • Open Notepad and edit that file “Remote.rdp”, it’s just a text file that looks like this (short version):
screen mode id:i:1
session bpp:i:16
  • Add a new line with this text: “smart sizing:i:1”
  • Change the desktop width and height to what you want (for example 1600 and 960 to keep the aspect ratio).
  • You’re done! Save and quit Notepad. Double click on Remote.rdp, you’re connected at high resolution!

Using this extremely simple tip (hacking with notepad! where have the hex editor days gone ?) you can crank up your resolution to 4096×2048, if you don’t mind not being able not to read anything. I find that a factor of roughly 1.25 is sensible.

Posted in Blogroll, Remote Desktop, Tips | Tagged: , , | 29 Comments »

Software: LeDimmer – Unclutter your screen

Posted by llemarie on November 1, 2007

LeDimmer is a small Windows application (<200KB) that sits in the system tray and simply dims the screen around the foreground window. The numerous advantages include being able to focus on the task at hand, finding the window in focus at first glance even on multi-monitors, and it even looks nice. General Windows usage is not changed at all: click or alt-tab into a dimmed window and it brightens into focus.

You can specify a bitmap as the dimming picture to get a nice glossy effect on your screen, embed your company logo, admire your dulcine, etc…

It couldn’t be simpler to use: start it, it sits in the system tray, quit it with the tray menu or the shortcut ctrl-shift-q. That’s it…

LeDimmer works on Windows 2000, XP and Vista. Grab it free from the home page.

Comments, feature requests and bug reports are appreciated.

Posted in Blogroll, LeDimmer, Programming, Projects | Tagged: , , , , , , | 1 Comment »

Projects: Fixed my boots

Posted by llemarie on October 14, 2007

Exciting! I fixed my boots.

I’ve been a walking fashion faux-pas for weeks now, since a metal plate broke at the back of my boots then fell off altogether. We couldn’t have that. New Rock was kind enough to send me a set of replacement plates and rivets with no instructions to take the broken plate off and put the new one in.

The solution: walk about with the broken plate hanging until a piece falls off a few months later and use brute force to pry the remaining bits off. Of course, I should have thought about it before: nothing beats brute force.

After that it took me weeks to finally get my act together and replace the thing. I had to learn how to use a rivet machine – I had to buy a rivet machine. Scary. The whole thing took 10 minutes.

Pixels on flickr.

Posted in NewRock Boots, Projects | 4 Comments »

Project: Frankenphones (update)

Posted by llemarie on October 14, 2007

Well, that didn’t take long. It took less than a week for the inevitable to happen. The duct tape stopped sticking and the right driver came loose, rattling about. That and the blue-tack holding the charging connector stopped tacking. I feel let down by the DIYer’s best friend. I used hotglue this time to hold the driver in place.

I got some comments in Portuguese saying that there weren’t enough pictures of the process anyway. It’s a bit late now for that, but while I repaired the rattling I took some more pictures: flickr.

In the pictures, we can see the irreparable damage I did to the first bluetooth module I had. Because of that I had to replace it ):

We can also see the neat little on/off button. I didn’t even have to drill for it, it simply uses the hole for the old wire. Convenient.

See my original post for details about the headphones.

Posted in Bluetooth headphones, Projects | 1 Comment »