Displaying keyword search results 1 - 10
Created by Dr. Xi on February 06, 2012 12:14:11 Last update: February 07, 2012 15:39:35
Oracle sqlplus command line tools does not support command line editing out-of-the-box. But on Linux there's a handy utility that enables command line editing with any command line tool: rlwrap - readline wrapper. Install rlwrap:
$ sudo apt-get install rlwrapCreate a keywords file .sql.dict (optional, but convenient):
false null true access add as asc begin by chec...It would be nice to add the tables names also. Create an alias for sqlplus (put it in .bashrc ):
alias sqlplus='rlwrap -f $HOME/.sql.dict sqlplus'
Created by alfa on July 15, 2011 13:25:45 Last update: July 15, 2011 13:25:45
Read the whole contents of a file into a String. It's better to read the whole file as bytes and convert to String than to read the file line by line and concatenate the lines.
String getFileContents(String fileName) throws...Using java.nio :
import java.io.FileInputStream; import java...
Created by Dr. Xi on June 21, 2011 15:54:00 Last update: June 22, 2011 11:33:09
Demo code for CSV parsing with SuperCSV parser . Java code:
import java.io.*; import java.util.List; imp...Test with a simple CSV file:
psmith01,CLASS2B,Peter Smith 1,YEAR2,1,N,ADVANCED,...The parser worked correctly:
Line 1 has 11 values: |psmith01| |CLASS2B|...Test with a more complicated CSV file:
"psmith01 abc", "CLASS2B " , " Peter...The parser messed up on all three lines:
Line 1 has 5 values: |psmith01 abc| |CLASS...Using two lines input:
"psmith01 abc", "CLASS2B " , " Peter...It generates an exception:
Line 1 has 5 values: |psmith01 abc| |CLASS...Add a new line in item two:
"One", "Two ", "Three"Result:
Line 2 has 3 values: |One| |Two | |...
Created by freyo on May 09, 2011 12:50:52 Last update: May 09, 2011 12:51:54
You can use the android.os.StatFs class to check for available space on the sd card. Example code:
// import android.os.Environment; // import...
Created by alfa on April 06, 2011 12:48:44 Last update: April 06, 2011 12:48:44
package com.demo.io; import java.io.*; ...
Created by Dr. Xi on March 24, 2011 12:11:14 Last update: March 24, 2011 12:22:03
This is the task: your client wants to know how the web application is used. That is pretty easy. A plethora of commercial tools or any of the free log analysis tools such as analog and AWStats would fit the bill. But here's the catch: they want to know not only what pages are visited by how many people and when, but also who logged in and did what. Your application is using form based authentication and therefore, everyone is anonymous in the web access log. What to do? This is a servlet filter that generates a web access log with authenticated user info that can be fed to log analysis tools such as analog and AWStats . Filter code (the output format is Apache...
Created by Dr. Xi on October 26, 2010 16:07:40 Last update: October 26, 2010 16:07:40
This is a more generic version, which can be expanded to accommodate additional file signatures.
import java.io.*; import java.util.*; pu...
Created by Fang on July 26, 2010 19:18:28 Last update: August 18, 2010 19:13:02
The tags <c:import> The <c:import> tag imports the contents of a URL and expose that in one of three ways: Import contents from a URL and write it out to the page (url may be relative or absolute):
<c:import url="theUrl" />Import contents from a URL and save it to a scoped variable string named by the var attribute. Use the scope attribute to define the scope of the exported variable.
<c:import url="theUrl" var="importTest" scope="ses...Import a URL and expose to a Reader object named by the varReader attribute. The scope attribute does not apply. The varReader scoped variable can only be accessed within the body of <c:import> .
<c:import url="theUrl" varReader="theReader"/><c:url> The <c:url> tag constructs a URL and writes it out to the...
Created by voodoo on July 11, 2009 15:14:55 Last update: July 29, 2010 22:45:48
cURL is a command line tool for transferring files with URL syntax. The main purpose and use for cURL is to automate unattended file transfers or sequences of operations. It's really easy to see HTTP headers with curl:
C:\>curl --head http://www.google.com HTTP/1.0 ...or, headers and page together (dump headers to stdout):
$ curl --dump-header - http://www.google.com HTTP/...Download openssl from openssl.org:
C:\>curl --help Usage: curl [options...] <url> ...
Created by James on June 30, 2010 20:14:28 Last update: July 03, 2010 18:41:12
The HTML page
<!DOCTYPE html> <html> <head> <title>jQu...Client Side Code
// called before upload submit function sta...Server Side Code Using Apache Commons FileUpload as example. Upload code (responds to fileUpload.do ):
final HttpSession session = httpServletRequest...Progress code (responds to uploadProgress.do ):
HttpSession session = httpServletRequest.getSe...