Today I updated my HTC Magic to Android 2.1. I’m suprised how easy it is to update the phone. I decided to install the OpenEclair ROM.

It works very well :-) !

The following ressources helped me…

http://www.pocketpc.ch/htc-magic-root-und-rom/74727-htc-magic-rom-upgrade-anleitung.html

http://db.androidspin.com/androidspin_release_display.asp?releaseid=166

http://romdroid.wishu.de/uebersicht.php?phone=htc_magic

Thank you for all the positive comments on the first post. Feel free to test the revised snakeFbGmSync beta edition.

Features:

  • synchronize profile pictures from facebook to gmail
  • synchronize birthday from facebook to gmail

Download snakeFbGmSync from GitHub:

http://github.com/snakedj/snakeFbGmSync/downloads

snakeFbGmSync is open source. Most of the source code is under GNU, Apache or MIT Licence.

Supported Platforms:

- Mac OS X (64 bit)
- Windows (32 bit)

Use the following start parameters (Mac OS X):

java -XstartOnFirstThread -jar snakeFbGmSync_MacOsX_X64.jar

I  got 8 invites for Google Wave. Post your mail in the comments and I will send you an invitations.

It’s very simple to rotate a PdfContentByte element with iText. Sadly, bad documented.

BaseFont baseFontHelvetica = BaseFont.createFont(BaseFont.HELVETICA, "Cp1252", false);
PdfTemplate template = pdfContentByte.createTemplate(250, 200);    	    	
template.beginText();
template.setFontAndSize(baseFontHelvetica, 12);
template.showText("iText rotation");
template.endText();
 
float rotate = 90;
float x = 300;
float y = 0;        
float angle  = (float)(-rotate * (Math.PI / 180));
float xScale = (float)(Math.cos(angle));
float yScale = (float)(Math.cos(angle));
float xRote  = (float)(-Math.sin(angle));
float yRote  = (float)(Math.sin(angle)); 
 
pdfContentByte.addTemplate(template, xScale, xRote, yRote, yScale, x, y);

iText Website

Edit the .gitconfig file in your home directory, to solve this problem.

[gui]
recentrepo =

I have written a tool to synchronize (one way) facebook profile pictures and other data to gmail. If more then 100 users like this idea, I will program a GUI and publish it. Use the poll on the right side to vote for the application.

URL url = new URL("URL");
BufferedInputStream in = new BufferedInputStream(url.openStream());
FileOutputStream fos = new FileOutputStream("PATH/FILENAME");
BufferedOutputStream bout = new BufferedOutputStream(fos,1024);
byte data[] = new byte[1];
while (in.read(data, 0, 1) >= 0) {
      bout.write(data);
}
bout.close();
in.close();

A friend of mine asked me this week how to read a file with different encoding. You can use the InputStreamReader. To read a file with a different encoding, you just have to specify the encoding in the constructor.

FileInputStream fis = new FileInputStream("FILENAME");
InputStreamReader isr = new InputStreamReader(fis, "UTF-8");
BufferedReader b = new BufferedReader(isr);
b.readLine();

Use this to check which encodings are avaiable on your system.

SortedMap<string, Charset> avaiableCharsets = Charset.availableCharsets();
for(String charset:avaiableCharsets.keySet())
{
System.out.println(charset);
}

Nice video preview about the upcoming jdk7. I especially like the new Modularization features.

JDK7 Video Preview with Danny Coward

What a bummer! It works just over vpn tunnel… ;-)