Recent Notes

Displaying keyword search results 1 - 12
Created by voodoo on January 03, 2012 08:41:21    Last update: February 16, 2012 15:50:06
This is the command to print all regular files in the src folder but excluding all files within the .svn folders: $ find src -name .svn -prune -o -type f -print where -o is the or operator. Define a shortcut: ff () { find $1 -name .svn -prune -o -...
Created by freyo on May 13, 2011 15:45:29    Last update: September 20, 2011 08:08:12
This is an Android app that dumps any binarized xml file as plain text - to the sdcard on the device or emulator. build.xml : <?xml version="1.0" encoding="UTF-8"?> <project... AndroidManifest.xml <?xml version="1.0" encoding="utf-8"?> <man... res/layout/main.xml <?xml version="1.0" encoding="utf-8"?> <Lin... res/values/strings.xml : <?xml version="1.0" encoding="utf-8"?> <res... src/com/android/xmltool/DumpXml.java package com.android.xmltool; import java.ut... Screenshot Pre-built APK can be downloaded from: http://code.google.com/p/android-binxml-dump/
Created by freyo on August 22, 2011 15:32:23    Last update: August 22, 2011 15:32:56
Find ports for emulator devices: $ adb devices List of devices attached emul... Telnet to emulator console: $ telnet localhost 5554 Trying 127.0.0.1... ... Use " sms send " to send a message: sms send 1234 'A test message' OK
Created by jinx on April 20, 2011 09:28:01    Last update: April 20, 2011 09:28:46
This code fragment shows how to find the previous Sunday using PHP date/time functions. <?php $current_time = time(); $last_sunday =... Sample output: Current time: 1303316297 Last Sunday same time:...
Created by Dr. Xi on March 28, 2011 11:11:33    Last update: March 28, 2011 11:13:21
grep is a versatile command with many variations (grep, egrep, fgrep, then various implementations). It uses a regula expression (regex) pattern to filter input. But then there are basic and extended flavors of regex - leading to even more confusion. And, beware that there are lots of bad examples of regex in the wild... There are two critical questions to ask when you use grep: which grep implementation are you using? what is the flavor of the regex? Here are some examples for gnu grep v2.7: # Find all numbers (no decimal point), basic regex... Use the -o flag to show only the matching part instead of the whole matching line: grep -o -E '\b[0-9]{2}\b' The good thing about the gnu grep is that it...
Created by Dr. Xi on February 17, 2011 13:23:16    Last update: February 17, 2011 13:23:16
To find the PID of the tomcat instance that is currently running: ps -ef | grep java | grep tomcat | awk '{print $2}...
Created by Dr. Xi on February 01, 2011 14:38:55    Last update: February 01, 2011 14:40:59
Create the stuff you want to manufacture with the factory: package tc.demo; public class Junk { ... Create the factory: package tc.demo; import java.util.Enumerati... Tell Tomcat to use your factory. Create file context.xml and put it under the directory META-INF of your web application: <Context> <Resource name="/find/junk/here" ... Note that beside name , type and factory , you can put any arbitrary attribute in the Resource element. Access the thing with JNDI: <%@page language="java" import="javax.naming.*,tc.... The server side log looked like this: INFO: jndiName: here INFO: name: scope, value: ... Also note that, in contrast to Tomcat documentation , resource-ref is not needed in web.xml .
Created by Dr. Xi on September 18, 2008 21:38:27    Last update: February 06, 2010 21:55:26
Editing Shortcut Meaning Ctrl+C Copy Ctrl+V Paste Ctrl+X Cut Ctrl+Z Undo Ctrl+F Find Ctrl+G Find Again Viewing Shortcut Meaning Esc Stop Ctrl+R Reload Mozilla/NS: Ctrl+Shift+R, IE: Ctrl-F5 Force reload (not from cache) Home Go to top of page End Go to end of page Page Up Scroll up one page Page Down Scroll down one page Ctrl+- (minus sign) Make fonts smaller Ctrl++ (plus sign) Make fonts bigger Ctrl+0 Restore default font size Tools Shortcut Meaning Alt Toggle menu bar (IE7 only) Ctrl+T Open new tab Ctrl+N Open new window Ctrl+P Print Ctrl+I, Ctrl+B Bookmarks Ctrl+H History Ctrl+U View page source Ctrl+W Close Window or tab if more than one tab is open Ctrl+L Go to location box Ctrl+E Go to search box
Created by voodoo on January 24, 2010 06:29:11    Last update: January 24, 2010 19:31:22
SIKULI is Jython. AutoPy is Python. Both use bitmaps to find areas of interest. It seems that SIKULI comes with an IDE but AutoPy doesn't. A sample SIKULI script captured from the project site: A sample AutoPy script from the project site: import autopy def where_is_the_monkey_i_say(): ...
Created by Dr. Xi on December 11, 2007 22:10:28    Last update: January 14, 2010 03:39:31
The subroutine recurse traverses a directory tree. The function to be performed, which works on the current file with optional parameters, is passed in as a parameter. # perl - recursive dirctory tasks # 1. recursiv...
Created by Dr. Xi on September 06, 2007 22:22:04    Last update: September 06, 2007 22:22:28
This is an improved version with recursive capabilities. #!/bin/perl # find jar containing specified fil...
Created by Dr. Xi on August 10, 2007 19:53:32    Last update: August 10, 2007 19:53:32
As a Java developer, I often need to find out which Jar file to include on my classpath in order to fix some compilation error (undefined package, class etc). This is a little Perl script I wrote to facilitate this task. #!/bin/perl # find jar containing specified...