Note: This is the archive of my old homepage. To continue to the new homepage, go to http://davidtanzer.net

This is the personal homepage of David Tanzer. Here you can find a blog-like collection of articles I write. The RSS newsfeed is available here. You can contact me via email: mail-AT-davidtanzer-DOT-net.

You may use everything I write in this blog (tagged as "Submitted by struppi") except the linked papers and some other parts with explicit exceptions to this license, in whole or in part, without asking as long as you give me credit (like for example: "David Tanzer (http://davidtanzer.net) wrote in his blog: [Some quote from this homepage]").

My Problem with GNU zealots

Yep, it's time for another rant after reading this blog posting by Robert Schuster. Short summary of the blog posting: He has filed a bug report in the Nokia Maemo platform (which provides an SDK for Nokia's Linux based devices) because Nokia doesn't release all of the internet tablet/IT OS as free software. Read that again: He has filed a bug report because Nokia doesn't release all of there software as free software. AFAICS Nokia didn't violate the GPL here (they have just built some proprietary applications for an embedded Linux OS), so they have a right to choose any license they want for their software. This "all software must be GPL" attitude of some people in the GNU community really leads nowhere. Without companies investing in free software it will never be used in a large scale, and you strongly discourage companies to do so if you always try to push them like this.

New contract assignment

Today in the morning I got a call that I could start a 6 month contract in Erlangen, Germany on Wednesday if I was available, and of course I said yes. I had a telephone interview last week, so they already knew me. That means I'll be in .de for quite some time now :-) It was quite a busy day so I didn't have the time to blog about this earlier.

Mac OS X: Drag and Drop files from the finder to a Java program

|

Update: Fixed < and > in the code examples.
Update (2): Here is a posting to an Apple Mailing List which basically describes the same problem. As of now (2007-07-06) there was now answer to this posting.

At the moment I am experimenting a little bit with Drag and Drop in Java Swing. What I want to do is drag some files from the finder to a JPanel, but my application only supports certain file types. So the idea was that I reject the drag (or the drop) if the file list contains unsupported file types, like:

public void dragEnter(DropTargetDragEvent e) {
	DataFlavor[] dataFlavours = e.getCurrentDataFlavors();
	for(int i=0; i<dataFlavours.length; i++) {
		if(dataFlavours[i].isFlavorJavaFileListType()) {
			List fileList = (List) e.getTransferable().getTransferData(dataFlavours[i]);
			//iterate the file list, and if all file types are supported do
			e.acceptDrag(DnDConstants.ACTION_COPY);
			//else do
			e.rejectDrag();
		}
	}
}

But we don't get a file list here, only the following error message:

2007-06-15 13:39:10.315 java[18163] CDataTransferer_dragQueryFile: plist not a valid NSArray (error XML parser error:
Unexpected character U at line 1
Old-style plist parser error:
    Unexpected ';' or '=' after key at line 1
[java-err] ).

It looks like you have to accept the drop before you get the file list, so you can't do the verification in the dragEnter method, but the following code works:

public void dragEnter(DropTargetDragEvent e) {
	e.acceptDrag(DnDConstants.ACTION_COPY);
}

public void drop(DropTargetDropEvent e) {
	DataFlavor[] dataFlavours = e.getCurrentDataFlavors();
	for(int i=0; i<dataFlavours.length; i++) {
		if(dataFlavours[i].isFlavorJavaFileListType()) {
			try {
				e.acceptDrop(DnDConstants.ACTION_COPY);
				List<File> fileList = (List<File>) e.getTransferable().getTransferData(dataFlavours[i]);
				//Iterate the file list...
			} catch (UnsupportedFlavorException e1) {
				// handle the exception
			} catch (IOException e1) {
			// handle the exception
			}
		}
	}
}

Sometimes people like these make me sick

| |

Felix von Leitner (Fefe), a so-called "Security Expert" and well known Apple-hater, writes in his blog that Thor Larholm (another "Security Expert"? I don't know...) has found a remote code execution exploit in the first public beta of Safari 3 for Windows. Ok, bad enough. Felix von Leitner then concludes that this is another example of Apple writing bad and insecure code.

First of all I want to note that we are talking about the first public beta of a program which didn't exist in this form so far, and I hope Mr. Larholm has reported the bug to Apple (as he should when he is participating in a Beta program). But let's come to the root of this code execution problem: It is how Windows handles URLs: It passes the complete URL to the protocol handler as a command line argument. Which looks like another security hole in the Windows API if you ask me. And then Mr. Larholm complains that Apple did not work around this problem: "When Apple released Safari for the Windows platform they neglected to implement a proper level of input validation for these arguments, which means that you can break out of the intended confines and wreak havoc."

So, yes, probably Apple should work around such gaping holes in the Windows API, but then again we are talking about the first f***ing beta version! Software comanies release beta versions to find exactly these kinds of problems! And by participating in a beta program you should know about the risks of using a not fully tested software product.

These poorly researched and biased stories are the reason why I stopped reading Fefe's blog a long time ago.

Quick Unit Converter 0.2

|

I just uploaded UnitC 0.2. The code for converting the units has been improved, and the units array is now greatly simplified. I also have added quite a lot of new units, but the accuracy is not too high in some cases. Again, please help me by sending me corrections or updates for the Units array. And if you have an idea for a Logo for this widget, please feel free to email me your idea or the logo as PNG. You can download the new version at the Quick Unit Converter project page.

Unit Converter Widget for OS X Dashboard

|

I have started to write a little dashboard widget to convert units. I know the dashboard already has a unit converter, but i don't really like it b/c I don't like selecting things from drop-down lists. My unit converter widget has only one text field, in which you enter a string like "1cm in m" and then press Enter to get the result. For example, if you want to know how many pixels at 300dpi are used in 12pt, you can enter "12pt in px300".

There are not very much supported units at the moment, and the accuracy of the conversion is not good enough yet. You can download the first version of this dashboard widget at the project page of the widget.

Windows Easy Transfer - Yeah, right...

|

My aunt bought a new laptop with vista installed, and she wanted to transfer the data from her old laptop (Win XP) using Windows Easy Transfer (let's call it WET from now on, b/c this is a really funny TLA). That must be easy, right? I mean, it even has the word easy in the product name! So after one day of unsuccessful attemts to transfer her Outlook application data she asked me to help her.

After doing a complete export of all application data I realized that she made a correct export the first time she tried it, but wasn't able to import in on the Vista notebook. The problem here is that WET by default writes .DAT files but by default it searches for .IMG files, and the switch where this can be changed is pretty well hidden. This means that my aunt simply couldn't find the export she made on the USB disk. I then started the import, and after some time of doing something (whatever), WET told me that it copied all the data to "C:\Quelldateien" (or something like this) but it didn't actually import anything. Who would have expected it to do this anyway?

I couldn't figure out how one could use the "imported" stuff from "C:\Quelldateien". I simply couldn't tell Outlook to use this data, and I didn't want to overwrite the whole application data folder, b/c my aunt has already created a new email account. After more than 1h of unsuccessful tries I decided to do the transfer the old-school way: Export the data in Outlook on the old PC and import it on the new one. There is no way to export all the data like this (for example, custom contact lists are not exported when you do this), but at least we have now all contacts and emails on the new laptop.

And now the morale of the story, so listen up, this is important: This is exactly the reason why I use a mac. It simply doesn't get in my way when I want to do some work. You have much less boring and time-wasting admin stuff to do than you would have with Windows or Linux. Ok, the mac is a little bit more expensive than a comparable PC, but it's really worth it. Because it lets me do my work without getting in my way.

OMGWTF Programming Contest

Back to a more technical topic again (yes, vacation is finally over...): I am considering to take part in the OMGWTF programming contest, which could be great fun. For more info about the contest click on the banner below.

OMGWTF Banner

Pics of me

I updated the about me page on this site, the main change I made was that I added some photos of me. Here it is. Just in case anybody is interested ;)

Vacation Photos

It only took me 3 weeks to get the photos and blog postings of my vacation in England online, so here they are:

And here are some of the photos i took, just click on the images to view the picasa albums:

England 2007 - London
England 2007 - Cornwall 1
England 2007 - Cornwall 2