Recent Notes
Displaying keyword search results 81 - 90
Created by James on March 13, 2011 13:44:37
Last update: March 21, 2011 11:30:55
This is a jQuery input control that lets you enter any number of input rows of name and value pairs.
<!DOCTYPE html>
<html>
<head>
<title>jQu...
Created by freyo on March 08, 2011 15:15:04
Last update: March 08, 2011 15:15:39
Android Developer site gives instructions on how to connect to a phone from Ubuntu, but no instructions are given for Fedora. These are the steps I followed to connect adb to a Samsung phone on Fedora 14:
As root, create a file named /etc/udev/rules.d/51-android.rules with following contents (04e8 is Samsung vendor id):
SUBSYSTEM=="usb", ATTRS{idVendor}=="04e8", MODE="0...
As root, run udevadm control --reload-rules
Unlug the phone if clready connected.
Connect to phone with adb (kill server if already started):
$ ./adb kill-server
$ ./adb devices
* daemon...
Created by Dr. Xi on March 05, 2011 13:04:54
Last update: March 05, 2011 13:04:54
mysql> show character set;
+----------+--------...
Created by mak on March 02, 2011 15:50:56
Last update: March 02, 2011 15:50:56
Python list comprehension with if-else condition in general:
new_list =[ (F, T) [boolean test] for x in old_lis...
#!/usr/local/bin/python
l = [ 1, 2, 3, 4 ]
...
Created by freyo on February 23, 2011 13:38:23
Last update: February 23, 2011 13:38:23
The Java keytool utility does not support importing a private key directly from a file. But it does support merging a keystore with the -importkeystore command. So, for a private key generated with OpenSSL in PEM format, you first convert the PEM key into PKCS12 format , then merge the one-key PKCS12 store with the Java KeyStore:
C:\>keytool -importkeystore -srckeystore openssl_c...
Created by James on February 14, 2011 12:10:19
Last update: February 14, 2011 20:22:05
I have long noticed that IE8 displays a "broken page" icon while showing my web pages, but didn't pay much attention. Since the world in general considers IE to be broken, it's not so unlogical for IE to see much of the world as broken. Until one day I noticed that the Google home page was not "broken". Then I thought may be I should fix my pages also. So I moused over the "broken page" icon, and this is what I saw: Compatibility View: websites designed for older browsers will often look better, and problems such as out-of-place menus, images, or text will be corrected. Very descriptive indeed! Older browsers? Such as Firefox 1.5? When it comes to MS products, I often had better...
Created by woolf on February 10, 2011 13:25:20
Last update: February 10, 2011 13:25:20
If Command Extensions are enabled (which is enabled by default), then there are several dynamic environment variables that can be expanded but which don't show up in the list of variables displayed by SET . These variable values are computed dynamically each time the value of the variable is expanded (but see example below). If the user explicitly defines a variable with one of these names, then that definition will override the dynamic one described below: %CD% - expands to the current directory string. %DATE% - expands to current date using same format as DATE command. %TIME% - expands to current time using same format as TIME command. %RANDOM% - expands to a random decimal number between 0 and 32767. %ERRORLEVEL% - expands to the...
Created by woolf on February 10, 2011 12:51:14
Last update: February 10, 2011 13:06:11
Windows command line shell does not come with a sleep command. One trick is to emulate sleep using the ping command:
C:\>ping /?
Usage: ping [-t] [-a] [-n count...
To sleep for about 5 seconds:
@rem make sure to ping a non-existing IP, otherwis...
If you have the Windows Resource Kit installed, it does provide a sleep command:
C:\>sleep
Usage: sleep time-to-sleep-in-s...
Created by Dr. Xi on February 09, 2011 13:27:51
Last update: February 09, 2011 13:27:51
By the perldoc ,
use Module LIST;
is exactly equivalent to:
BEGIN { require Module; Module->import( LIST); }
Because of the BEGIN block, use is executed immediately. Therefore, it is not suitable for lazy loading of modules at runtime.
use does not work with a runtime variable:
C:\>perl
$cgi = "CGI";
require $cgi;
prin...
require works:
C:\>perl
$cgi = 'CGI';
require "${cgi}.pm";
...
Also, file extension is required if require is not passed a bareword:
// this works
require CGI;
// so does th...
Created by Dr. Xi on February 03, 2011 13:47:22
Last update: February 03, 2011 13:47:22
Read a directory and sort files by modified date (oldest to newest):
$dirname = ".";
opendir(DIR, $dirname) or die $...
Same, but with glob (note that the output is a bit different):
$dirname = ".";
@files = sort { -M $b <=> -M $...
Switch the places of $a and $b to order from newest to oldest.