CVS commands
VPN to my PC
Yahoo Email Plus in Outlook
Activate Window 7
Windows 7
- Click Start.
- Right-click Computer.
- Select Properties.
- At the bottom of this window, click Activate Windows now.
StringUtils.stripStart
String strTranAmount="000000000000000000"; strTranAmount = StringUtils.stripStart(strTranAmount, "0"); //the result is empty String strOrigAmount="000000000001000,00"; strOrigAmount = StringUtils.stripStart(strOrigAmount, "0"); //result 1000,00
JSON
Tell me again why we want to use JSON.parse() instead of eval()?
Understand JSON.parse() eventually will use eval(), but before that, it will do some checking for you, so it's safer.
Here is a link for details.
HTML5
JavaScript Function
Disable Adobe Updater
Android Development
Create symlinks in windows vista
mklink /D
Avery
epub to kindle
Android Phone -- HTC EVO 4G
- Advanced Task Killer - Close unwanted apps that maybe running in the background.
- Aldiko - eBook reader. Comes with a bunch of free books.
- Astrid Tasks - Best task list manager I have found so far. Has options for tasks list and reminders.
- ASTRO - Best file manager for the phone and SD card.
- AudioManager - Has a widget to control all the audio options for the phone in one place. Must have app if you put your phone on silence / vibrate only / custom audio profile for alerts and notifications.
- Foursquare - App to publish your location information based on nearby establishments. Pushes the same info to Facebook and Twitter.
- Google Sky Map - Shows off a real-time view of the stars based on where you point the phone. Best app to show off to your friends with the "WOW" factor.
- Meebo IM - All in one mobile instant messenger with AIM, Yahoo, MSN, GTalk. But uses a lot of battery if used continuously.
- Mint - All in one money manager to track expenses etc.
- Network - I use it to turn off the GSM radio and use CDMA only. This trick has improved my battery life.
- Photoshop.com Mobile - Have some fun with the pictures taken with the phone. Must have to show off to your iPhone fanboys.
- ShootMe - Phone screenshot grabber.
- Shopper - Google shopping app which has a built in barcode scanner. Runs a Google product search using pictures or barcode.
- Ustream - Live video broadcast phone to their website.
- XKCD Viewer - View XKCD cartoons and the hover over text.
EDIT - added more to the list based on suggestions:
- Dolphin HD Browser - Added to the list since it is faster and more option packed than default browser.
- Compass - Neat app to show off the built in capability.
- ScoreMobile FC - Something to keep track of the World Cup 2010 going on right now.
- World Newspapers
- MITBBS by Chenio Software
C++ compiler
using namespace std;
Quickly setup a AspectJ project
Eclipse 3.6 Update Site URL: | http://download.eclipse.org/tools/ajdt/36/update |
---|---|
Eclipse 3.5 Update Site URL: | http://download.eclipse.org/tools/ajdt/35/update |
AspectJ, Spring, and Guice
[Not exactly: Spring could inject values into non-Spring bean]
1. define bean in config as abstract plus the configurations, the id, let's see, is "testBean1"
2. add @configurable("testBean1") before the class in .java file.
3. add
It seems behind the scene, it's still AspectJ is doing all the work.
Guice
SQLite Data Types
Flex eventhandler mode
SQLite vs MySQL
SQLiteJDBC
It will create the test.db file in the root directory of the project.
Connection conn = DriverManager.getConnection("jdbc:sqlite:test.db");
Statement stat = conn.createStatement();
stat.executeUpdate("drop table if exists people;");
stat.executeUpdate("create table people (name, occupation);");
PreparedStatement prep = conn.prepareStatement( "insert into people values (?, ?);");
prep.setString(1, "Gandhi");
prep.setString(2, "politics");
prep.addBatch();
prep.setString(1, "Turing");
prep.setString(2, "computers");
prep.addBatch();
prep.setString(1, "Wittgenstein");
prep.setString(2, "smartypants");
prep.addBatch();
conn.setAutoCommit(false);
prep.executeBatch();
conn.setAutoCommit(true);
ResultSet rs = stat.executeQuery("select * from people;");
while (rs.next())
System.out.println("name = " + rs.getString("name"));
System.out.println("job = " + rs.getString("occupation"));
}
rs.close();
conn.close();
Some Java Stuff
SQLite
Flex 4, Air 2, and others
Change Cygwin ls colors
Eclipse conflicts with ClipMagic
Total Commander
set up FTP server at your machine using IIS 6
Quick Add Links to Windows Vista Explorer Favorite Links
If you’ve used Windows Vista for 5 minutes, you’ll have seen the Favorite Links when browsing around your filesystem. What is annoying is that by default the favorite links doesn’t include enough useful links.
Here’s the default links list (I’m sure you have seen this)
If you want to add a new link to the links bar, all you have to do is drag and drop the folder onto the links bar. I’m going to add my Computer link to the menu:
Now, it shows up in the list:
Much better!
Managing your links is extremely simple. Just open up your home directory by clicking on your icon on the start menu. You’ll see the LInks folder:
This folder contains all of the shortcuts to your favorite locations.
To remove an item from the list, you can either right-click the item and choose Remove Link, or just go to your Links folder and delete it from there.
Kindle On PC
Little tip on outlook attachments
Use command's output as input
Where is color of ls command defined?
Where is color of ls command defined?
by NIXCRAFT · 5 COMMENTS
1) Configuration file for the ls color command is /etc/DIR_COLORS for Linux. You can modify those colours if you want.
2) Here is list of most common colors: (RHEL 3.x/FCx/RH and other linux distros)
Executable files: Green
* Normal file : Normal
* Directory: Blue
* Symbolic link : Cyan
* Pipe: Yellow
* Socket: Magenta
* Block device driver: Bold yellow foreground, with black background
* Character device driver: Bold yellow foreground, with black background
* Orphaned syminks : Blinking Bold white with red background
* Missing links ( - and the files they point to) : Blinking Bold white with red background
* Archives or compressed : Red (.tar, .gz, .zip, .rpm)
* Image files : Magenta (.jpg, gif, bmp, png, tif)
3) They are stored in special shell variable called LS_COLORS
4) You can customized them in /etc/DIR_COLORS or file pointed by shell variable COLORS.
5) To customized colors you must use special string combination:
FILE-TYPE Attribute codes: Text color codes:Background color codes
Where,
- FILE-TYPE: is file type like DIR (for directories)
- Attribute codes:
- 00=none
- 01=bold
- 04=underscore
- 05=blink
- 07=reverse
- 08=concealed
- Text color codes:
- 30=black
- 31=red
- 32=green
- 33=yellow
- 34=blue
- 35=magenta
- 36=cyan
- 37=white
- Background color codes:
- 40=black
- 41=red
- 42=green
- 43=yellow
- 44=blue
- 45=magenta
- 46=cyan
- 47=white
For example to define Bold Blue color for DIR file type, entry should look as follows:
DIR 01;34
6) Let us modify dir color on Red Hat (Fedora) Linux:
# vi /etc/DIR_COLORS
Modify DIR entry
From:
DIR 01;34 # default is Bold blue with black background
To:
DIR 01;34;41 # NEW default is Bold blue with RED background
Save file.
7) Logout and login again, Please note that if you have shell variable defined COLORS then use that file (use echo $COLORS to find it out).
todo.txt
Search in cygwin
Open Windows Explorer in Cygwin
Run a Command as Administrator from the Windows 7 / Vista Run box
If you are a command line junkie like me, and have been testing out Windows 7 or Vista… one of the first things you’ll notice is that there is no way to run a command from the run box in “Administrator” mode. Until now.
To try this out, go to the run box and type in something (cmd, for example)
Now instead of hitting the Enter key, use Ctrl+Shift + Enter. You will be prompted with the obnoxious User Account Control dialog… but it will then open up a command prompt in Administrator mode.
Hint: You can use Alt + C to quickly close the User Account Control dialog in Vista, or Alt+Y in Windows 7.
HTML Parser
cygwin
Search multiple lines
CVS commands
Some Eclipse Text Edit Shortcut
Console2
I am using Console2, but there is one problem really bother me: I could display previous commands. When I hit Up arrow key, it always scroll the screen up. Finally, I found how to fix this: Settings->Hotkeys, uncheck "Use scroll lock for scrolling".
Now, I am happy.
Ant
So Ant In Action.
Build File contains ONE project.
Each project contains MULTIPLE targets.
Target contains tasks.
Tasks do the work.
You could invoke any of the tasks individually.
<target name="execute" depends="compile">
<java classname="org.antbook.welcome.Main" classpath="build/classes">
<arg value="a"/>
<arg value="b"/>
<arg file="."/>
</java>
</target>
ant -buildfile build.xml compile <==> ant compile
That's the default thing that I have been talking about, when you use ant without specifying build file name, ant will by default use file name build.xml.
Eclipse has a good integration with Ant, so you could invoke build.xml directly from Eclipse.
ant command-line options:
-help, -h: list the options Ant supports.
-Dproperty=value: set a property to a value. for example: ant -Dhost=localhost. set property host=localhost.
-buildfile
-keep-going, -k: when one target on the command line fails, still run other targets.
-logfile
-verbose, -v: Print verbose output for better debugging.
-diagnostics: Print information that might be helpful to diagnose or report problems.
-debug, -d: Print debugging information.
-logger
-propertyfile
-quiet, -q: Run a quiet build: only print errors.
Just as Java has classes and variables, Ant has datatypes and properties. Ant properties are immutable.
Ant allows flexibility in how Booleans can be specified with on, true, and yes.
${...} denotes a use of Ant property.
PATH, FILESET,
Export Eclipse
I need a plan to export that.
Command Line vs Runas
Documentum RESTful Web Service
I don't know how the project goes now, but I don't have a good feeling.
Last year, about the same time, I used the web service to build a demo for JPMorgan Chase, and I think it's actually pretty slick.
Craig Randall used to work on this project, but last year he moved on to work for Adobe, check http://craigrandall.net/.
It's sad that you see all these good people are leaving, and Documentum is kind of down......after all, documentum is my main skill to earn a living for about 5 years.
xdoclet
http://xdoclet.sourceforge.net/xdoclet/index.html
Reverse-xdoclet
http://www.gootz.net/gbin/reverse-xdoclet/
What this does is, you already have Bean, interface, xml....but you want to the bean class to have xdoclet tags, reverse-xdoclet will do it for you.
Every Day Shortcut Key
Fn + PgUp: turn light on/off.
Fn + Home: increase brightness.
Fn + End: decrease brightness.
F6: in a web browser, hit F6 will activate address bar.
CTR + tab: tab through web browser tabs.
START + D: toggle desktop
START + Pause: Display the System Properties dialog box
START + R: Open the Run dialog box
CTR + Esp: Open Start Menu
ALT + F4: Quit Program
CTR + START + F: search computer in network
control -> open control panel
calc -> calculator
control admintools ->Admin Tools
sysdm.cpl->System properties
services.msc->Services
devmgmt.msc->Device Manager
lusrmgr.msc-> User Accounts
osk->on screen keyboard
winchat->windows chat
appwiz.cpl->Add/Remove Program
clipbrd->clipboard viewer
intl.cpl->Regional Settings
iexplore->IE
winver->Check Windows Version
winword->Office Word
excel->Office Excel
powerpnt->Office PowerPoint
textpad->TextPad
timedate.cpl->Time Panel
mmsys.cpl->Sound and Audio
taskmgr.exe->Start Task Manager
http://windows.microsoft.com/en-US/windows-vista/Keyboard-shortcuts
http://mypchell.com/guides/34-guides/69-156-useful-run-commands
Quick Establishment on Database
1. build a database quickly---MySQL probably the best option.
2. write an utility to load/unload tables by using xml files as inputs.
3. ORM (object-oriented mapping), so could write Java codes against DB quickly. Hibernate?
4. Store the whole environment: VW Mare image.
Refcardz DZone
Groovy
Unix Grep
find . -name "*Bean.java" -exec echo "==={}:" \; -exec grep "re\"DefaultDataSource\"" -B1 -A3 {} \;
find . -name "*Extent.java" -exec grep "CLASSNAME =" '{}' > output.xml \;