Category Archives: Tricks

Export Eclipse Plugin, Assert Errors

Here is my scenario: I import Eclipse RSE( Remote System Explorer) plug-ins into my workspace and I want to build and test it myself. There are no errors in the workspace and running and debugging is all OK. And I … Continue reading

Posted in Bug Fix, Eclipse, Tricks | Tagged , | 3 Comments

VMWare Player, Ubuntu and Mac OSX

So you want to play some other operating systems for some new features, or test your applications on other OSs? Take a try on VMWare Player. It is free. Along with downloading and installing VMWare, you should also download OS … Continue reading

Posted in Tricks | Tagged , , , | 2 Comments

Port Mapping on Linux

Mapping port 80 to inner port 8080: /sbin/iptables -t nat -A PREROUTING -i eth+ -p tcp –dport 80 -j REDIRECT –to-port 8080 Well, I use this trick to avoid firewall blocking.

Posted in Tricks | 2 Comments

How To Replace “/” With “” in .bat File

Here is an example to replace string with a different delimiter in Windows’ *.bat file. for /f "tokens=1-15 delims=/" %%i in ("%1") do ( set _X1_=%%i set _X2_=%%j set _X3_=%%k set _X4_=%%l set _X5_=%%m set _X6_=%%n set _X7_=%%o set _X8_=%%p … Continue reading

Posted in Tricks | 1 Comment

Failed to Download Files from FTP Servers

Today, I came across a problem: I could not download files given by “ftp://…”. I could ping that server, but could not link to it. I was using FlashGet and I tried to change some preferences but didn’t work. At … Continue reading

Posted in Tricks | Leave a comment

Get Projects List in Eclipse Workbench

http://dev.eclipse.org/newslists/news.eclipse.newcomer/msg13300.html Add org.eclipse.core.resources in the Require-Bundle section in your plugin MANIFEST.MF file and invoke code: ResourcesPlugin.getWorkspace().getRoot().getProjects()

Posted in Eclipse, Java, Tricks | Leave a comment

Clean Eclipse Plugins’ Build Path Errors

Sometimes, Eclipse may have errors in calculating build paths, which may result in that some projects are marked as red cross error icons and further building is interrupted. The common error message for this would be “Project … is missing … Continue reading

Posted in Eclipse, Tricks | Leave a comment

Enablement Expression and Property Tester

Source: http://www.eclipse.org/webtools/wst/components/server/runOnServer.html Enablement Expression Performance Enablement expressions allow you to create arbitrarily complex expressions using ands, ors, nots, and Java code. For performance reasons, it’s always better to use the expression support instead of using Java code, which is slower … Continue reading

Posted in Eclipse, Tricks | Leave a comment

Create a Process and Read Its Output

This is a snippet of windows C++ code to create a process and read its output until some specific string is printed. This is useful for programmer to start a server and only to return until the server is started, … Continue reading

Posted in C++, Snippet, Tricks | Leave a comment

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