Recent Notes
Displaying keyword search results 1 - 10
Created by Dr. Xi on February 13, 2013 19:40:08
Last update: February 13, 2013 19:40:08
According to MSDN : On Windows 7 and on Windows Server 2008 R2 with the Wireless LAN Service installed, the operating system installs a virtual device if a Hosted Network capable wireless adapter is present on the machine. This virtual device normally shows up in the "Network Connections Folder" as "Wireless Network Connection 2" with a Device Name of "Microsoft Virtual WiFi Miniport adapter" if the computer has a single wireless network adapter. This virtual device is used exclusively for performing software access point (SoftAP) connections. The lifetime of this virtual device is tied to the physical wireless adapter. If the physical wireless adapter is disabled, this virtual device will be removed as well. On Windows 7, there's no UI to start or stop SoftAP....
Created by James on January 11, 2011 22:08:26
Last update: February 03, 2012 11:23:25
By default Firefox puts a dotted line box around the link or button label when you click them. Sometimes it's annoying and makes your sexy buttons look ugly. You can get rid of the dotted lines for links with outline:none in CSS, but that doesn't work for buttons.
<!doctype html>
<html>
<head>
<style t...
For buttons you need " button::-moz-focus-inner { border: 0; } ":
<!doctype html>
<html>
<head>
<style t...
I've also seen this:
/* get rid of those system borders being generated...
For more information :
Remove Button Focus Outline Using CSS
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 July 13, 2011 16:18:05
Last update: July 13, 2011 16:18:05
The goal is to read a file like this:
for (String line: textFileReader) {
// do s...
This is the code:
import java.io.*;
import java.util.Iterator;
...
Created by freyo on June 30, 2011 11:15:48
Last update: June 30, 2011 11:15:48
Install APK with adb :
$ platform-tools/adb install out/target/product/ge...
Error message in logcat:
D/PackageParser( 60): Scanning package: /data/ap...
The error was created by android.content.pm.PackageParser , which compares the android:minSdkVersion and android:targetSdkVersion attributes of the uses-sdk element of AndroidManifest.xml in the APK file against the SDK version of the device or emulator. The SDK version on the device has to be greater than that required by android:minSdkVersion .
In my case, since I built the package with AOSP, the target emulator has to be AOSP also. This is the relavant section in AndroidManifest.xml :
<uses-sdk android:minSdkVersion="AOSP"
...
And the relevant section in android.content.pm.PackageParser :
if (minCode != null) {
if (!minCode.equals(...
Created by Dr. Xi on June 22, 2011 07:33:45
Last update: June 22, 2011 11:57:54
Demo code for CSV parsing with OpenCSV . Java code:
import java.io.*; import au.com.bytecode.opencs... 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... Result: Line 1 has 4 values: |psmith01 abc| |CLASS... The parser: Escaped quote and backslash correctly Ignored spaces before the quotation mark - sometimes (see below) Counted spaces after the right quotation mark till the comma as content, including the right quotation mark (bug). Ignored improperly quoted item - silently (third line) Indeed, the OpenCSV parser has a problem with spaces: Input: "Smith, Jack", "210-345-8888" "Smith, J... Result: Line 1 has 2 values: | Smith, Jack| |210-3......
Created by Dr. Xi on June 22, 2011 09:42:35
Last update: June 22, 2011 11:39:40
Demo code for CSV parsing with Skife CSV . Java code:
import java.io.*; import java.util.*; import... 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... Result: Line 1 has 4 values: |psmith01 abc| | CLAS... The parser worked correctly. But notice that it counts the spaces outside of the quotes significant, and doing so consistently. One more test for spaces: "Smith, Jack" , "210-345-8888" "Smith, Jack"... Result: Line 1 has 2 values: | Smith, Jack | | 210... Add a new line in item two: "One", "Two ", "Three" Result: Line 1 has 2 values: |One| | Two| L...
Created by Dr. Xi on June 21, 2011 15:41:51
Last update: June 22, 2011 11:33:36
Demo code for CSV parsing with Apache Commons CSV parser .
Java code:
import java.io.*;
import org.apache.commons.csv...
Test with a simple CSV file:
psmith01,CLASS2B,Peter Smith 1,YEAR2,1,N,ADVANCED,...
Result:
Line 1 has 11 values:
|psmith01|
|CLASS2B|...
The parser worked correctly.
Test with a more complicated CSV file:
"psmith01 abc", "CLASS2B " , " Peter...
Result:
Line 1 has 4 values:
|psmith01 abc|
|CLASS...
The third line is invalid input, but throwing a Java IOException is a bit grave. Also, the parser is not able to escape a backslash.
Add a new line in item two:
"One", "Two
", "Three"
Result:
Line 2 has 3 values:
|One|
|Two
|
|...
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 Dr. Xi on June 22, 2011 07:12:02
Last update: June 22, 2011 11:32:02
Demo code for CSV parsing with OstermillerUtils .
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 6 values:
|psmith01 abc|
| "CLA...
Putting a space before the first quote:
"Smith, Jack","210-345-8888"
It dismissed the quotes:
Line 1 has 3 values:
| "Smith|
| Jack"|
...
Add a new line in item two:
"One", "Two
", "Three"
Result:
Line 1 has 2 values:
|One|
| "Two|
...