This is how my current desktop looks like if all the applications are minimized (or in other spaces).
Monthly Archive for December, 2009
Unfortunately, I don’t have a luxury of using Mac in my work. Stuck with Windows XP, there was only one alternative for me, customize my Windows to work like a Mac on my house. No… not the user interface, for it there is already an article (though it’s bit old).
There were several applications I missed the most when I was using a Windows. I missed how typing ‘myemail’ will automatically expand it to my email address thanks to the courtesy of TextExpander.
And I missed my Spotlight, others may miss their Quicksilver, LaunchBar, Butler or whatever, but the point is I missed an application launcher.
And of course I missed my Growl and my BBEdit, or TextMate if that is matter.
So I’m looking for alternatives for those applications on my Windows and at the end, I’m pretty happy. This is what I do.
TextExpander
The most common used text expansion on Windows perhaps is Texter. This is more or less because it’s developed by Lifehacker team, which actively endorses the use of TextExpander. Unfortunately, the last version is 0.6 and it’s released two years ago. I found it hard to believe that this software is still to go.
Another application I found is Breezy. This application looks very good but on my very first try I found a very annoying bug. The very first template I created was my email address. So if I type ‘myemail’ it will expand to my email address. But I don’t why Breezy will replace this with my email address with ‘Q’ instead of ‘@’. I’m using a German keyboard and so this problem maybe is not that matter for you using a US or UK keyboard. I’m still tempted with this but until they got a fix for this particular bug, I won’t use the software.
So I kept looking and the last one I found was AutoHotKey. This one is an open source project and actually is more than a text expansion program. You can define any hotkey with it and the possibilities are almost limitless. The bad news is it doesn’t have a user interface and you will have to script your text expansion configurations. This isn’t really that hard and the fact that it doesn’t have an annoying bug make it my current choice.
So with AutoHotKey you have to define a script. For my email, the script is very easy:
; ; AutoHotkey Version: 1.x ; Language: English ; Platform: Win9x/NT ; Author: A.N.Other <myemail@nowhere.com> ; ; Script Function: ; Template script (you can customize this template by editing "ShellNew\Template.ahk" in your Windows folder) ; #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. SendMode Input ; Recommended for new scripts due to its superior speed and reliability. SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. :*:myemail::nanda.....@....
But it doesn’t stop just there. The list of other things you can do is BIG:
- Change the volume, mute, and other settings of any soundcard.
- Make any window transparent, always-on-top, or alter its shape.
- Use a joystick or keyboard as a mouse.
- Monitor your system. For example, close unwanted windows the moment they appear.
- Retrieve and change the clipboard’s contents, including file names copied from an Explorer window.
- Disable or override Windows’ own shortcut keys such as Win+E and Win+R.
- Alleviate RSI with substitutes for Alt-Tab (using keys, mouse wheel, or buttons).
- Customize the tray icon menu with your own icon, tooltip, menu items, and submenus.
- Display dialog boxes, tooltips, balloon tips, and popup menus to interact with the user.
- Perform scripted actions in response to system shutdown or logoff.
- Detect how long the user has been idle. For example, run CPU intensive tasks only when the user is away.
- Automate game actions by detecting images and pixel colors (this is intended for legitimate uses such as the alleviation of RSI).
- Read, write, and parse text files more easily than in other languages.
- Perform operation(s) upon a set of files that match a wildcard pattern.
- Work with the registry and INI files.
Spotlight/Quicksilver/LaunchBar/Butler
The one alternative for this application launcher is for me Launchy. This is also an open source project and also expandable like Quicksilver.
To make it works, you just need to type Alt+Space (or whatever hotkey you want) and start typing the beginning letters of the application you want to launch. It is a big time saver for me! And if you ready to explore more, you can even launch a website, do some calculations and even create your own extension for the application.
BBEdit/TextMate
I’ve written this before. The alternative for TextMate in Windows is E-TextEditor.
Beware that to use its full capabilities, you will be asked to install Cygwin on your Windows. This may be undesirable for some.
Good thing about E-TextEditor is it is compatible (they said so) with TextMate. So any bundle out there for TextMate can be used without any modification also in E-TextEditor.
The bad news about E-TextEditor is that it’s not free. But so do BBEdit and TextMate, so I don’t think it will be a big problem then. And another bad news is I think this application is not ready for a big file. For those big file, I suggest to use the Notepad++.
Growl
This one is pretty easy to find. Just search for ‘growl windows’ and you will get the site. Hopefully more and more applications will use this centralized notification system instead of building their own.
That’s for today. My Windows is looked a little bit better with those tools and if you have any idea how can I improve this, leave a comment down there.
SWT teams has provided two great tools to help you develop your SWT applications. Just follow the installation procedure and you should be OK.
The standard Java Profiler like one from YourKit or JProfiler are not really usable in SWT environment, especially for part where GUI is involved. For just one example, the memory detection of those profilers show you a different number compared to the one you see from Windows Task Manager.
Sleak is a tool you can use to detect memory leak in SWT. For example, if you forgot to dispose some of your system resources, you can use this tool to help you find the culprit.
From the picture above, you can ‘Snap’ all the used system resources and get all new resources from the last time you clicked ‘Snap’ by clicking ‘Diff’. If the total number of resources is constantly increasing, you can suspect that there is a leak on your SWT application. By clicking each resource on the combo box, you will see the representation of this resource on the right panel. Once you found resources that should have already been disposed, go back to your code and do the necessary fix. Isn’t that great?
The second tool available is SWT Spy. This is a view plugin that allow you to get the information about a widget that is below your mouse cursor. If you ever wondered what widget is used in a view and how is the configuration to make it look like what you see, this plugin will help you a lot about it.
More about these tools:
Back to the days when I use Swing, I often use JPanel as a filler to get the layout that I want. Especially if I’m not in the mood of using GridBagLayout or the circumstances just don’t allow me to use that powerful layout.
Now after I work for quite some time with SWT, I faced the same problem again. This time, I decide to use Composite as filler. Unfortunately, the solution is a bit harder than what I expected.
So this is my initial code.
package de.bwb.ims.dialog;
import org.eclipse.jface.viewers.ComboViewer;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
public class Test extends Composite {
private Button radioButton = null;
private Button radioButton1 = null;
private Composite composite = null;
private Combo combo = null;
private ComboViewer comboViewer = null;
public Test(Composite parent, int style) {
super(parent, style);
initialize();
}
private void initialize() {
GridLayout gridLayout = new GridLayout();
gridLayout.numColumns = 2;
gridLayout.makeColumnsEqualWidth = true;
radioButton = new Button(this, SWT.RADIO);
radioButton.setText("dsdsdsdsds");
radioButton1 = new Button(this, SWT.RADIO);
radioButton1.setText("sasasa");
this.setLayout(gridLayout);
createComposite();
createCombo();
setSize(new Point(300, 200));
}
private void createComposite() {
composite = new Composite(this, SWT.NONE);
}
private void createCombo() {
combo = new Combo(this, SWT.NONE);
comboViewer = new ComboViewer(combo);
}
}
Seems OK, right? But the result is not OK.
See that space between ’sasasa’ radio button and the combo box? Where is this come from? I try to set the size of composite without luck and it’s a little bit frustrating at once.
After doing the same thing again, I realized that in my previous example I don’t set the layout of the composite. So by adding this line:
composite.setLayout(new GridLayout());
Bla… now I get the correct layout:
It’s frustrating, isn’t it?
I just remembered those days when I always misspelled Google as Goggle. Google just introduced Google Goggle where you can basically search something based on what you see.
It’s now available only on Android platform and to make it works you just need to take a picture with the Android’s camera and search. If you’re lucky, you’ll get a result in a snap seconds.
This little video probably explains how it works more accurately.
Google Goggle currently understands Landmark, Book, Contact Info, Places, Artwork, Logo, and Wine. It’s a bit sad it doesn’t understand barcode yet. But if they eventually do, it will probably collapse the business of Red Laser.











