Recent Notes

Displaying keyword search results 1 - 5
Created by Dr. Xi on March 02, 2011 11:39:18    Last update: March 09, 2011 12:19:30
Some peculiarities about Java PrintWriter: PrintWriter never throws any exceptions. From JavaDoc : Methods in this class never throw I/O exceptions, although some of its constructors may. The client may inquire as to whether any errors have occurred by invoking checkError(). When error occurs, you'll never know anything more than that it occured, because checkError returns boolean. When a character is out of the range of the character encoding of the PrintWriter, it prints a question mark (?). But this is not an error. Test code: import java.io.*; public class TestPrintWri... Latin1 test result: java TestPrintWriter iso-8859-1 | od -bc 000000... UTF-8 test result: java TestPrintWriter utf-8 | od -bc 0000000 141... Also, the constructor throws a FileNotFoundException when you try to write to a...
Created by mak on March 04, 2011 14:17:32    Last update: March 04, 2011 14:18:35
To create a zipfile in python: Code: #!/usr/local/bin/python import zipfile #... Test unzip -l test.zip Archive: test.zip Lengt... To read a zipfile in python: Code: #!/usr/local/bin/python import zipfile #...
Created by nogeek on August 05, 2010 15:13:24    Last update: August 05, 2010 15:13:24
Read from stdio and print out rot13: import java.io.BufferedReader; import java.io.I... The ROT13 translated Fourth Amendment reads: Gur evtug bs gur crbcyr gb or frpher va gurve crefbaf, ubhfrf, cncref, naq rssrpgf, ntnvafg haernfbanoyr frnepurf naq frvmherf, funyy abg or ivbyngrq, naq ab Jneenagf funyy vffhr, ohg hcba cebonoyr pnhfr, fhccbegrq ol Bngu be nssvezngvba, naq cnegvphyneyl qrfpevovat gur cynpr gb or frnepurq, naq gur crefbaf be guvatf gb or frvmrq.
Created by Dr. Xi on January 08, 2010 03:53:37    Last update: January 08, 2010 03:54:56
This is an Ant custom task to merge Properties files I lifted from http://marc.info/?l=ant-user&m=106442688632164&w=2 , with some minor bug fixes. Example usage: <taskdef name="mergeProperty" classname="ant.task.... Implementation: package ant.task.addon; import java.io.Buff...
Created by Dr. Xi on August 27, 2007 19:53:37    Last update: August 27, 2007 19:58:53
This script does bulk replacement recursively for all sub-directories. #!/bin/perl process_dir("."); sub proces...