Disable Aero Shake in Windows 7

June 3rd, 2009

Of all the new UI features, Aero Shake is arguably the most gimmicky. I find that I trigger it quite often by accident by moving a window very quickly to peek at something else behind it. If you have the same issue, How-to Geek details a registry fix on disabling Aero Shake.


Vista and file deletion

April 27th, 2009

I’ve been running Windows Vista for about a year and a half (my desktop hasn’t been reinstalled once), and find it to be great. But every once in a while I still encounter the ridiculously slow performance issue where file operations take forever - even simply browsing into a folder with Explorer. Here is an example of a folder deletion of a small source project with a bunch of Git history in it that Windows has been busy deleting for a good half an hour now:

Photobucket

A whole bunch of fixes were supposed to have been included in SP1 but it seems like some problems still remain :-(

UPDATE: it’s something to do with the folder being shared - and unsharing takes extremely long, while keeping the hard drive very busy. Possibly some kind of dodgy recursive file system metadata update? Deleting from the command line with “rmdir /s” solved the problem in the end.


Annotation-based dispatch for Spring ApplicationEvents

April 8th, 2009

I created a little extension that allows you to dispatch Spring application context events in a clean and type-safe way to POJO beans. Instead of implementing the ApplicationListener interface, one can simply create a handler as follows:

public class EventListener {
    @EventHandler
    public void onAppEvent(MyCustomEvent event) {
        // ...
    }
}

The code is available as a zipped up Maven project or via Git:

git clone http://pavel.tcholakov.net/code/eventhandler-annotation.git/

Related Spring forum thread.


Official: Bulgarians are slackers

February 2nd, 2009

Well, either that, or have very weak immune systems on the whole. A survey of companies in Europe and America found that workers in Bulgaria take on average roughly twice as many days off as sick leave every year compared to workers from the next two highest-scoring countries, Portugal and the Czech Republic (see chart). I wonder if that correlates in any way to workers feeling of being fairly compensated for their time?


Ars Technica compares Windows 7’s new taskbar to the OS X Dock

January 24th, 2009

I always thought the OS X Dock a great app until I actually had to use it for a while. Then I discovered that it wasn’t all that great at managing multiple minimized windows. At least it’s slicker than anything Windows has ;-) (Expose didn’t help me much either, oddly enough.)

I haven’t been all that impressed with the Windows 7 taskbar so far either but it’s great that Microsoft is trying to improve it. That’s not to say that I don’t like it - but until more apps start integrating themselves better into it, I don’t think we’ll see its full potential.

Full article.


Quick and easy image resizing with Java ImageIO

December 26th, 2008

There are quite a lot of examples of image resizing floating around the web but they all seem to access all sort of hidden features and classes deep inside the JDK to achieve their goal. Here is the most straightforward method that I could come up with - all in all just 5 lines of code. It requires ImageIO and requires Java 1.4 or later to run. If the ImageIO.write() method accepted plain ol’ AWT Image arguments it could have been reduced further still to three lines, but you have to give it a BufferedImage instance as input.

The snippet below assumes that there exist the following variables (coloured green in the code):

  • an input stream to read from
  • a desired width variable (specifying the height as -1 tells the toolkit to preserve the original aspect ratio)
  • and an output stream to write the encoded image to.

Sample code:

import java.awt.Image;
import java.awt.image.BufferedImage;
import javax.imageio.ImageIO;
// ...

BufferedImage sourceImage = ImageIO.read(inputStream);
Image thumbnail = sourceImage.getScaledInstance(width, -1, Image.SCALE_SMOOTH);
BufferedImage bufferedThumbnail = new BufferedImage(thumbnail.getWidth(null),
                                                    thumbnail.getHeight(null),
                                                    BufferedImage.TYPE_INT_RGB);
bufferedThumbnail.getGraphics().drawImage(thumbnail, 0, 0, null);
ImageIO.write(bufferedThumbnail, "jpeg", outputStream);

From the Christmas Decorations Gone Wrong Dept.

December 24th, 2008



From the Christmas decorations gone wrong dept.

Originally uploaded by Pavel Tcholakov

Sandton, circa 2008. Surely someone must have seen this coming? :-)


PC Game Piracy Examined

December 21st, 2008

I came across this very interesting analysis of the state of the PC games market. I don’t agree with the general attitude towards console gaming (i.e. that it’s unquestionably a sub-par experience) but it raises some very interesting points of discussion.

In fact, in one of the very articles that it links to, Crytek’s engine tech licensing manager is quoted as saying that they were able to port their game engine to current console hardware with very good results. CryENGINE 2 is possibly the most technologically advanced 3D game engine to be widely deployed at the moment. Be that as it may, it clearly demonstrates how the staggering amount of pirated games is shaping future developments.


Powering the world

November 14th, 2008

Scary prospect: the International Energy Agency predicts that the share of electricity produced from coal will rise to about 44% by the year 2030, approximately double that of renewable energy sources.


Quickies

October 31st, 2008

I have been writing exams during the last couple of weeks so not much time for posting. I wrote three so far, with very good results, and there is one more to go - Artificial Intelligence. I wonder if I can come up with an automaton that writes the exam for me? These should be the last papers I write for my BSc degree in Computer Science.

I just finished reading The Economist’s special feature on the financial crisis from the October 11th 2008 edition. It’s a fascinating, if long, read starting with When fortune frowned. On the subject of financial crises, one theory suggests a link between the number of Starbucks franchises and the state of a country’s economy.

In case you have missed the mini banner on the blog, I published my first photo book with a collection of Orange River images. Check it out! I ordered one of all the available options, and they look great. I think my favourite is the Hardcover ImageWrap option. I will be ordering some more in time for Christmas! In the mean time Blurb has launched a premium grade paper option which should look even better.

The Pentax K-m has started shipping in the UK. Paired with the upcoming 15mm Limited prime lens, it should make one hell of a lightweight travel kit. (Pentax DSLRs use an APS-C sized sensor so the field of view would be equivalent to a ~23mm ultra-wide lens on a 35mm film camera.)

McLaren F1 chassis number 65 got sold at an auction for a record-setting £2.3m. Despite losing its top spot as the fastest production car some time ago, to many people it remains the supercar thanks its uncompromising and unique lightweight design.

Adobe’s Creative Suite 4 might have only just began shipping, but Nvidia is quick to cash on it with the Quadro CX. As far as I can tell it is mostly just a rebranded GTX 260, and the only application that really benefits from it is video transcoding from Premiere. For Photoshop CS4, even the most basic cards should benefit from the new OpenGL-based image canvas based on Adobe’s specs. The Nvidia Quadro CX does however offer dual DisplayPort interfaces and 30-bit colour so it’s not all badge engineering.

And in gaming news, the Mirror’s Edge demo is up on both Xbox Live and PSN as of today. I hope it lives up to the hype - it is busy downloading as I type.