Alright, I'm writing this little trick I've found, because I bumped into that problem this weekend and couldn't find anyone one line who found out how to fix it. I hope it's useful to a few people! Winclone is a free piece of software for Mac that allows you to create a bit-for-bit image of a windows partition and save it to a file that you can use to restore your partition in case you have problems with it. It was discontinued a few months ago, but you can still find it and it does the job really well. Except that, if you make an image of a partition that has errors in it, it won't be able to restore it. When you try to do so, it will first run a filesystem check on the image, and the log will show errors, which looked like that in my case:
Cluster accounting failed at 73372 (0x11e9c): extra cluster in $Bitmap
Cluster accounting failed at 731267 (0xb2883): extra cluster in $Bitmap
Cluster accounting failed at 731268 (0xb2884): extra cluster in $Bitmap
Cluster accounting failed at 731269 (0xb2885): extra cluster in $Bitmap
It turned out that I did an image without running a filesystem check from Windows before, and that's not a good idea. That was the only image I had, so I just had to find a solution, and actually, it's not that complicated once you know it. It turns out that the winclone files are actually just a directory (or package) that bundles a compressed, standard dmg image of the partition, and the tools needed to restore it. In Finder, right click on the winclone image, and choose "Show package contents" in the contextual menu. It will open a new window showing the files contained in the winclone package, and you should see the dmg file there. Dmg images can be directly mounted by OSX and will appear as extra partitions in Finder. If you mount Winclone's dmg file, it will appear as a partition that contains all your Windows files. The good news is, you can use Disk Utility to check and repair errors in it. The bad news is, you can't, because it's a compressed image, and compressed images are read only.
Fortunately, Disk Utility allows to convert disk images, and one option is to convert it to a read/write version. So, right click on the dmg image, and choose "Open with" then "Disk Utility". Click on the dmg file in the right panel, and at the top of the window, click "Convert". Then in "Image formats", choose "read/write", and pick a location to save the new image. Now, be careful, it will create an uncompressed image, which will be as big as the original partition!! So make sure you have enough space where you save it. And go get yourself some coffee, it'll take a while (in my case, over an hour for a 150GB partition).
Once this is done, right click on the new image, open with Disk Utility, select it, and click "Repair disk". That's also going to take some time, and it should report that it found errors and, hopefully, fixed them. And that's it! At this point, you can either keep the fixed image as it is, or convert it back to a compressed image with Disk Utility. Again it'll take a while, but it's worth it if you want to store it as a backup. Either way, you now need to replace the original dmg file in the winclone package contents by the fixed one (make sure it has exactly the same name). I suggest keeping the original one somewhere until you're sure that the new one works. Then run winclone and restore the partition with the fixed file.
Et voila !
First bike ride in the snow this year, in the Schönbuch, close to Bebenhausen. A bit cold after 2 hours, but it was worth it.
This are pictures from my first origami (well, aside from planes and boats...). Took a few hours, but it was worth it. It's made of 30 folded pieces of paper (15x15cm), assembled without glue or staples or paperclips or anything, just paper :) The easy part is the folding. Assembling is nerve wrecking. The structure is surprisingly stable and looks pretty cool, apart from the holes in the middle of the flowers, which are probably not supposed to be there. It would also have been better to use nice coloured paper rather than my notebook. But it's a good first attempt overall :)
After my rant about iTunes and how to get rid of it under OSX, here is a second post about another problem I was having. Basically, I needed cgkit 2.0 to work under OSX, but it's only available as a binary package for OSX 10.4, and I couldn't find any help on the web as to how to compile it for OSX 10.6 (Snow Leopard). I found that the easiest way to get it to work is with the MacPorts version of Python 2.6, which has its advantages and drawbacks, but hey, now I can run my code. So here is how I got it to work. I may have have omitted some details, so please ask if that fails.
First, you're going to need to install a few packages from MacPorts, including of course Python (after you've installed MacPorts itself, but I'll skip that...). Open a terminal and type the following command:
sudo port install python26 scons boost +python26
The "+python26" ensures that the boost_python library will be compiled, which is crucial for the rest. Now, if you've just installed MacPorts, go watch a film, play outside, take your girlfriend to a nice restaurant, whatever will keep you busy for 2 or 3 hours. The good thing about MacPorts though, is that it will probably go smoothly.
You have to make sure that the python executable that you've just installed is the default one, and not the one that comes with OSX (you don't want to mess that one up, so better not use it at all). Type
It should return
If not, you need to make sure that /opt/local/bin
comes first in your PATH environment variable. To do that, edit .bash_profile
from your home directory, and modify the PATH definition (or add it if it's not there) so it looks like:
You should also have:
somewhere later in the file (the following line will do). Then save the file, close that terminal window and open a new one, and make sure that you know the correct default python version.
Now you need to get the cgkit source code from here
. Currently, the latest version is cgkit 2.0.0 alpha9, so I'm going to assume that it's what you'll be downloading. Get the cgkit-2.0.0alpha9.tar.gz file and decompress it somewhere. Now, in your terminal, move to cgkit's root directory.
Compiling the support library
First, we going to have to compile the support library, which is provided with the source code. So enter the supportlib directory. Before compiling it, you'll need to slightly modify one source file, else you'll get an error message. Open src/polyhedrongeom.cpp with your favourite text editor. Go to line 401, which should look like this:
typedef GLvoid (CALLBACK *TessCallback)(...);
Remove the ... between the brackets so it looks like that:
typedef GLvoid (CALLBACK *TessCallback)();
and save and close it.
Then, open the SConstruct file, and change line 36 from:
env.Append(CCFLAGS = ["-arch", "i386", "-arch", "ppc"])
env.Append(CCFLAGS = ["-arch", "x86_64"])
This ensures that the support library will be compiled in 64 bits, just like the MacPorts version of Python.
Now you can compile the support library by typing
This shouldn't take more than a couple of minutes.Compiling the main cgkit package
Now move up one directory (back to cgkit's root directory then). First we're going to tell python to link cgkit to boost, and tell it where the boost library is. By default, MacPorts should have installed it in /opt/local. Start by copying the template configuration file:
cp config_template.cfg config.cfg
Then open it and uncomment line 46, which should look like:
BOOST_LIB = "boost_python"
Then uncomment and edit lines 118 and 119 to make them look like:
INC_DIRS += ["/opt/local/include"]
LIB_DIRS += ["/opt/local/lib"]
Now we're ready for compiling. Enter the following command in the terminal window. Should take 10 minutes or so...
python setup.py build
Once it's done, install it with the command:
sudo python setup.py install
And that's it ! Now you should be able to import cgkit in your python scripts!
I recently bought my first Mac, a lovely MacBook Pro 13'', and have been using Window 7 on it pretty much ever since I've bought it. Sometimes I think it's really a shame though, because some features do work a lot better with OSX, notably the battery lasts significantly longer. A few things really annoy me in OSX though. Some of them are just habits, some are truly inherent to the available software, and one of those last ones is iTunes.
I really can't stand iTunes. It's slow slow slow and can't just play your files as is. I don't want to depend on iTunes, so I don't want to use its file management system. Of course you can tell it not to modify your music library, and that's what I tried first. I started by importing my mp3 collection. My files are nicely sorted in an directory imaginatively called "mp3s", then <artist>/<album>/<tracks>. If I tell iTunes to scan my "mp3s" directory, it found something like 10% of my music. It only works when I give it the whole list of artists subdirectories instead. Took me a while to figure that out, and it makes no sense. How hard can it be to implement a recursive scan? Then it takes something like 2 hours to import everything, and doesn't keep an eye on changes in the file structure, so I have to manually import or delete tracks that I add to or remove from my library. Plus it can't play Vorbis encoded files by default. Hey, Vorbis has only been around for 2 centuries after all. That thing really pissed me off, so I looked for alternative software, and it turns out that there's only one that's still being developed, and that's Mozilla Songbird.
I was very pleasantly surprised with it. It does exactly what I want almost out of the box, and is very customisable. It can use my music library as is, and automatically keeps track of changes. Also it needed about 10 minutes to import all of my music, including Vorbis files. It can also manage your files the way iTunes does if you want that, but not by default. And it supports addons, in the same way that Firefox and Thunderbird do. It's multi platform, and with addons you can customize it for each of them. And this is what I did for OSX.
First of all, surprise surprise, I installed Songbird. You can get it here
Then I wanted it to display track info through Growl. There are 3 addons available for that, but none of them actually works. One of them, called "Notify me", doesn't support the current version of Songbird (1.4.3 as I'm writing this), but it turns out that some guy managed fix that. It's not on the official Songbird addons website, but it worked out of the box for me. You can get it here
Last but not least, you might want to be able to use the media keys of your keyboard to control playback. There again there's an addon, which you can get here
. Problem is, pressing the play/pause key will start iTunes, and you can't turn that off in Snow Leopard. One trick to prevent that is to start the Quicktime player and let it run in the background. It takes little memory and no CPU, but still I don't like the idea. But then I thought, hey, if I'm not going to use iTunes anyway, I may as well get rid of it. It turns out that Apple themselves tell you how to do that, here
. That solved the problem in a very clean manner.
And that's it! I hope that can help a few people :)
I went to the last (sig) Breakpoint demoparty this year again in Bingen am Rhein, near Frankfurt, in Germany, the largest pure demo party (i.e. no gaming involved) in the world. Over a 1000 people, 1.75 light years of cables, 3.45 gazillion lines of code and 2 nuclear power stations were used. Really cool demos of course, but not quite as good as last year, in my opinion. However, there was definitely the nicest PC demo I've ever seen, Agenda Circling Forth
, by Fairlight/CNCD, who won the contest (unlimited size). And I've taken those two panoramic pictures of the event:
Now let's hope someone will take over and organise something similar next year, preferably in the south west of Germany, thanks in advance!
I've created a page
about my 3 weeks trip to Japan last August. For now it's only a bunch of sorted pictures that I like. I hope to improve that at some point and give more information for whoever that might interest.
I've decided to transfer my website from wordpress to google sites, as it seems to better suit my needs. Let's see how long it takes until I change my mind again.