Recent Notes

Displaying keyword search results 1 - 7
Created by magnum on September 11, 2012 11:59:43    Last update: September 11, 2012 11:59:43
Exerpt from bash documentation. HISTORY EXPANSION The bash shell supports a history expansion feature that is similar to the history expansion in csh. This feature is enabled by default for interactive shells, and can be disabled using the +H option to the set builtin command. Non-interactive shells do not perform history expansion by default. History expansions introduce words from the history list into the input stream, making it easy to repeat commands, insert the arguments to a previous command into the current input line, or fix errors in previous commands quickly. History expansion is performed immediately after a complete line is read, before the shell breaks it into words. It takes place in two parts. The first is to determine which line from the history...
Created by freyo on September 07, 2011 16:46:14    Last update: September 07, 2011 19:23:00
The Android unit test framework is based on JUnit 3 , not JUnit 4. Test cases have to extend junit.framework.TestCase or a subclass (such as android.test.InstrumentationTestCase ). Tests are identified by public methods whose name starts with test , not methods annotated with @Test (as in JUnit 4). An Android test suite is packaged as an APK, just like the application being tested. To create a test package, first you need to identify the application package it is testing. Google suggests to put the test package source in a directory named tests/ alongside the src/ directory of the main application. At runtime, Android instrumentation loads both the test package and the application under test into the same process. Therefore, the tests can invoke methods on...
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 August 20, 2009 04:03:07    Last update: August 20, 2009 04:03:07
Use alter package to recompile a PL/SQL package. SQL> alter package UTIL compile; Warning: P...
Created by Dr. Xi on September 29, 2008 23:03:40    Last update: September 29, 2008 23:04:08
Variables set automatically by shell: Variable Description $# Number of command-line arguments. $- Options currently in effect (arguments supplied to sh or to set). $? Exit value of last executed command. $$ Process number of current process. $! Process number of last background command. $0 First word; that is, command name. $n Individual arguments on command line (positional parameters). The Bourne shell allows only nine parameters to be referenced directly (n = 1-9); the Korn shell allows n to be greater than 9 if specified as ${n}. $* All arguments on command line ("$1 $2..."). $@ All arguments on command line, individually quoted ("$1" "$2" ...). Variables set automatically by Korn shell: Variable Description ERRNO Error number of last system call that failed. LINENO Current...
Created by Dr. Xi on September 10, 2008 03:37:17    Last update: September 10, 2008 15:48:31
Suppose you have a file with these lines: -- contents of update_contact.sql update co... You can execute this script from the SQL prompt by entering: @update_contact.sql And it would execute fine. Now you get the contents of the script into the SQL buffer by: GET update_contact.sql and use the / command to execute the buffer, you get ORA-00911 invalid character error for the semicolon at the first line. Confusing, right? It turned out that the semicolon is used by SQL*Plus to signify the end of a SQL command. When you enter SQL commands into SQL*Plus, it strips the trailing semicolon before sending the SQL command to the database. But when you import the contents of a file with the GET command, the semicolon is...
Created by Dr. Xi on June 03, 2008 03:42:48    Last update: September 07, 2008 18:34:10
When I ran the vssadmin command to view the storage used by "System Restore and Shadow Copies" , vista complained that I didn't have the right permissions, even though I was logged in as administrator! Microsoft Windows [Version 6.0.6000] Copyright ... To make it work you have to start the command prompt with "elevated administrator" privileges: 1. Click the "start" button and enter "cmd" into the "Start Search" box. 2. Right click the "cmd" icon in the "Programs" list and select "Run as Administrator". Alternatively, it you already set up a shortcut for the command prompt. just right click the shortcut and select "Run as Administrator".