Monthly Archives: May 2007

Why JavaScript’s Date#getMonth Start From Zero?

Today, one of my colleague asked me a question about JavaScript’s document.lastModified, here was my answer for her: javascript:dd=new Date(document.lastModified);alert(dd.getFullYear() + “.” + (dd.getMonth() + 1) + “.” + dd.getDate() + “//” + dd.getHours() + “:” + dd.getMinutes() + “:” … Continue reading

Posted in JavaScript, Tricks | Leave a comment

RSE Sucks

I do think that Remote System Explorer (RSE)? sucks for its plugin management. Too many small size (about 10k – 20k) plugins, about 42 plugins (about 30 core plugins), while all Eclipse SDK plugins number is 141.

Posted in Eclipse, Project Management | Leave a comment

Backup and Restore Databases in MySQL

Just simple as following: mysqldump -h host -u user -p –databases db > dbbackup mysqldump -h host -u user -p CREATE DATABASE restored; mysql -h host -p -u user restored < dbbackup

Posted in MySQL | Leave a comment

Upgrade to WordPress 2.2

My blog is based on WordPress. Today I saw that there was a new version of 2.2, and decided to upgrade. As there are chances to upgrade frequently, I wrote a shell for myself: #!/bin/sh cd $1 $2 cp wp-config.php … Continue reading

Posted in Blog Tips | Leave a comment

Snippet: Open Editor a Local File in Eclipse

Here is codes to open editor a local file in Eclipse: IFileStore fileStore = EFS.getLocalFileSystem() .getStore(new Path(file.getParent())); fileStore= fileStore.getChild(file.getName()); if (!fileStore.fetchInfo().isDirectory() && fileStore.fetchInfo().exists()) { IWorkbenchWindow fWindow = Java2ScriptUIPlugin.getDefault() .getWorkbench().getActiveWorkbenchWindow(); IWorkbenchPage page = fWindow.getActivePage(); try { IDE.openEditorOnFileStore(page, fileStore); } catch (PartInitException … Continue reading

Posted in Eclipse, Snippet | Leave a comment

Tools for Smart or Normal People?

I came across this question when I read those discussion emails about how a folder should be arranged. Arranging a folder may be easy for us, just create some sub folders and put some files into them accordingly. Does it … Continue reading

Posted in Software Requirement | Leave a comment

“Compare With …” Bug Fix in Subversive 1.1.2

There are two known bugs in Subversive 1.1.2 at the time of this writing. 1. “Compare with? …” will fail to get content from SVN repository if the given file has history of being moved or copied from other location. … Continue reading

Posted in Bug Fix | 1 Comment

Vim Tricks

To replace a block of text into String in vim, try the following commands: :%s/\/\/gc :%s/\n/\n” +\r”/gc To replace specific string into another in lots of files, e.g. replace *.java’s package name “net.sf.j2s.” into another name “org.java2script.”, follow the instructions: … Continue reading

Posted in Tricks, Vim | Leave a comment

Less User Configurations

When designing software, there is a rule: Do NOT let user see much of its configurations. That is to say, make the software simpler, user may feel more comfortable. And if you let user configure too much, you won’t get … Continue reading

Posted in Software Requirement | Leave a comment

Focus On Your Key Problem

Always place your most skilled developers to the key problem. No matter the developers like to dive into the problem or not. Don’t place too much expectation on those fresh developers for the key problem. Or, you will get an … Continue reading

Posted in Project Management | Leave a comment