Recent Notes
Displaying keyword search results 1 - 7
Created by torstello on January 06, 2012 07:32:25
Last update: January 06, 2012 07:32:25
rdoc documentation:
usage(*args)
Display usage information ...
put something like this on top of your script:
# == Synopsis
# Blah blah blah.
#
...
method to display it
def output_usage
RDoc::usage('usa...
bind it to the '-h' option via optionparser
opts.on('-h', '--help') { output_help }
...
source
http://blog.toddwerth.com/entries/5
Created by freyo on August 17, 2011 12:29:46
Last update: August 17, 2011 12:29:46
In Android.mk , you can define LOCAL_JARJAR_RULES like this:
LOCAL_JARJAR_RULES := $(LOCAL_PATH)/jarjar-rules.t...
and in jarjar-rules.txt define a rule like this:
rule org.bouncycastle.** com.android.@0
The build will change all org.bouncycastle to com.android.org.bouncycastle . Therefore, in your classes which are dependent on the library produced, the import statements should look like:
import com.android.org.bouncycastle...
Help for the jarjar utility (in prebuilt/common/jarjar/ ):
$ java -jar jarjar-1.0rc8.jar
Jar Jar Links - ...
Created by Dr. Xi on December 05, 2009 20:12:16
Last update: December 05, 2009 20:46:45
It's quite easy for Perl to open a pipe and read from it:
$file = "nospace.txt";
open(IN, "cat $file |") ...
But the code breaks when the file name contains a space:
# This does not work!
$file = "yes space.txt";
...
On Windows, these don't work either:
# This does not work!
$file = "yes space.txt";
...
You need to use a technique called Safe Pipe Opens :
$file = "yes space.txt";
$prog = "cat";
...
Created by Dr. Xi on December 04, 2009 04:33:05
Last update: December 04, 2009 04:33:05
Variable Meaning $_ The default or implicit variable. @_ Within a subroutine the array @_ contains the parameters passed to that subroutine. $a, $b Special package variables when using sort() $<digit> Contains the subpattern from the corresponding set of capturing parentheses from the last pattern match, not counting patterns matched in nested blocks that have been exited already. $. Current line number for the last filehandle accessed. $/ The input record separator, newline by default. $| If set to nonzero, forces a flush right away and after every write or print on the currently selected output channel. Default is 0 (regardless of whether the channel is really buffered by the system or not; $| tells you only whether you've asked Perl explicitly to flush after...
Created by Dr. Xi on September 23, 2008 20:43:58
Last update: September 23, 2008 20:43:58
Variable Description
$0 The name of the ruby script file
$* The command line arguments
$$ Ruby interpreter's process ID
$? Exit status of last executed child process
$_ String last read by gets
$. Line number last read by interpreter
$! Last error message
$@ Location of error
$& String last matched by regexp
$~ The last regexp match, as an array of subexpressions
$n the nth subexpression in the last match (same as $~ )
$= Sase-insensitivity flag
$/ Input record separator
$\ Output record separator
Created by Dr. Xi on June 02, 2007 00:45:00
Last update: June 02, 2007 00:45:00
Use the diff command to find the difference between two files. It takes two arguments: 2 files, 1 file and 1 directory, or 2 directories.
diff file1 file2 # display the differe...
Created by Dr. Xi on April 26, 2007 03:17:14
Last update: May 05, 2007 19:50:26
To loop through an envionment variable:
@echo off
set a=1 2 3
for %%i in (%a%) d...
To loop through the command line arguments:
@echo off
for %%i in (%*) do echo %%i