Monthly Archive for July, 2010

Page 2 of 5

My First Safari Extension: Copy All Links

Say you encountered a list of links you want to download. How did you do that? So far in Safari, what you can do is to copy the links one by one. Not that convenience huh? In Chrome, you can use Link2Clip and select all links, then Shift-C to copy all links.

I can’t find such extension for Safari in the unofficial Safari Extension repository. So I thought I will make it myself and in the same time learn a thing about Safari Extension.

It turns out that it’s not that hard. The only problem I encountered is just because the documentation of Safari objects is not complete and the fact that it must be created with Javascript. I hate Javascript! But after spending some time reading this post and watching the WWDC video session 505 and 506 about creating extensions for Safari, I finally managed to finish the plugin.

So please welcome to world my first plugin:

Copy All Links Safari Extension

(if you have a problem by downloading, try to right click and click Download Linked File)

How to use the extension. Well, first you need to install the extension. After that select any text with links and right click. Select Copy All Links and you’ll get a dialog will all links in there. You can copy the links by selecting the text in the dialog. It’s not that convenience but Safari Extension AFAIK doesn’t provide any way to insert something to the clipboard.

Be gentle with the safari extension. It is after all my first safari extension.

Pencil-based iPad standard

What a nice and cheap concept!

Java Raw Types

One thing I learnt from this is we should write instanceof generic types like this:

boolean a = (m instanceof Map<?,?>);

Oh well, before I usually suppress the warning by adding:

@SuppressWarnings("rawtypes")

or by using this:

boolean a = Map.isInstance(m);

Eclipse's Quick Diff: See What Changes You've Made Since Last Checkout

A new morning. You’ve checked out the last code from SVN. Stand up and prepare a coffee and when you were back to the computer, Eclipse had loaded the newest code. You ready to code. And you code. Until afternoon and you need to check-in the changes you’ve made. Now you wonder, what have you changed? You know the file you’ve changed, it’s decorated by Eclipse after all. But which lines?

This question is always arisen to most of us. Unfortunately, as default, Eclipse didn’t easily show which lines have you added since last check out. Before I know this feature, I usually compare my code with the latest code in repository. How annoying is that?

It turns out that Eclipse actually already have functionality for that. See this picture.

This feature is called Quick Diff. It is turned on as default but the reference source is the last saved version. If your project use SVN (or CVS, Mercurial, Git as long as you use the Eclipse plugin for that SCM), you can change the Quick Diff behavior to compare the code on your machine with the latest code in the SCM. How nice is that? If you delete lines, you’ll get something like this.

How to do that? As you can guess, go to Preferences and select General → Editors → Text Editors → Quick Diff. Then change the last combo box to SCM you used. That’s it. Now close the main screen and close all opened files. You’ll get the information about which lines have you changed once you open any files.

There is another option in the preference to ‘Show differences in overview ruler’. If you activate this, you’ll get something like in on the right side of the editor.

Now there is still problem with this quick diff functionality. If you have several projects that come from different SCMs, you can’t set the source project based. It’s so not nice and I have filed a enhancement request for that. Vote it up if you also want that functionality!

Youtube Web App is Faster Than the Native iPhone App

product manager Andrey Doronichev made it clear that the new web-based application is superior in just about every way

Way to go Google!

Mac Performance Guide

Having a Mac doesn’t mean you’ve already conquered the world. There are so many things you can consider to make the machine even faster and more reliable. Add memory, add SSD, configure a RAID, add eSATA card and so on. If you want to improve your Mac’s performance, this is the site you will enjoy.

Have questions about any web applications?

The first result of StackExchange 2.0 are out of beta. This Q&A site promised to answer all your question about any web applications. The beta has got 415 members with 477 questions. It’s just time for you to jump in.

Beautiful Pixels

Collection of beautifully designed applications.

Eclipse's Team Project Set: Easier Collaboration

Eclipse has this feature Team Project Set which is rarely used. Really rarely I must say.

The point of Team Project Set is when you have many projects on your workspace that build the entire application. People often ask new developers to just check out each project from CVS/SVN. While this works, it is certainly not efficient. With Team Project Set, you will get the same result just by several mouse clicks.

To use Team Project Set, first you have to have a workspace fully configured for your application. Now, click anywhere the Package View and select Export. Select Team Project Set from the list. You should get this dialog window.

Now select the projects you want to include in the Team Project Set and click Next. Select the target file and click finish. Your job is done. Now you can share the project set file to the new developers.

In the new workspace, you can do the reversed step that you do before. Do Import and select Team Project Set.

The next step is self-explanatory, select the project set file you’ve created before and click finish. Depends on the size of your projects, the process will take time anywhere from couple of seconds until several hours. And there you go, the complete projects of your application configured with the SCM.