Recent Notes
Displaying notes 91 - 100
Created by James on August 01, 2012 14:26:53
Last update: August 01, 2012 14:26:53
The jQuery size() function returns the number of elements in the jQuery object.
According to jQuery doc:
The .size() method is functionally equivalent to the .length property; however, the .length property is preferred because it does not have the overhead of a function call.
Created by Dr. Xi on August 01, 2012 11:40:19
Last update: August 01, 2012 11:40:19
Use copyfile in shutil :
$ python
Python 2.7.3 (default, Apr 20 2012, 22...
Created by Dr. Xi on July 30, 2012 12:42:19
Last update: July 30, 2012 12:43:12
There's no syntax for negative match. If you are doing negative match in Java code, you can do it like this:
if (!myString.matches(regexNotToMatch)) {
....
or,
if (!Pattern.matches(regexNotToMatch, myString)) {...
But there's no such luxury with the javax.validation.constraints.Pattern annotation. You have to resort to the zero-width negative lookahead trick:
// no 1111 or 2222,
// this regex blocks anyth...
Created by Fang on July 25, 2012 12:59:47
Last update: July 25, 2012 12:59:47
Example code:
import javax.xml.ws.BindingProvider;
import jav...
Wierdly, even though the response context ( ctx ) itself is a Map, you cannot iterate through the keys. This:
for (String key: ctx.keySet()) {
logger.inf...
fails:
WARN : InternalError - Handler execution resulted ...
Created by James on July 25, 2012 12:32:09
Last update: July 25, 2012 12:32:09
JavaScript (ECMAScript) does not support Unicode-aware character classes, for example, \p{L} or \p{Letter} . It does support \uFFFF for matching a single Unicode code point.
References:
Unicode Regular Expressions
Unicode Character Classes in ECMAScript Regular Expressions
Javascript + Unicode
Created by voodoo on July 25, 2012 12:25:42
Last update: July 25, 2012 12:25:42
Suppose I have a file ( passcode.txt ) containing the characters " 1234 " and I dump the file with od:
$ od -x -c passcode.txt
0000000 3231 343...
The numbers for 12 and 34 are reversed in the octal dump, i.e., 1 is 31, 2 is 32. But the printout is "3231".
Dumping 1 character a group shows this more clearly:
$ od -t x1 -c passcode.txt
0000000 31 32 33...
Created by Captain on November 22, 2010 04:34:37
Last update: July 22, 2012 20:36:26
HDTV modeline example:
1920x1080 148.5 1920 2008 2052 2200 1080 1084 1088...
MythTV modeline database: http://www.mythtv.org/wiki/Modeline_Database
<!DOCTYPE html>
<html>
<head>
<style ...
Reference:
Custom Resolutions on Intel Graphics
Created by magnum on July 16, 2012 18:30:41
Last update: July 16, 2012 18:30:41
Google's Chrome browser ignores proxy setting for FTP. When you enter an FTP url in the browser, it goes to the FTP server directly without going through the proxy, even when the proxy is manually configured.
I tested this for for versions 20.0.1132.47 and 20.0.1132.57 on Ubuntu and Windows 7.
Chromium bug report for the issue:
Issue 11227 : FTP not wrking behind (HTTP) Proxy
Created by magnum on July 04, 2012 20:52:12
Last update: July 04, 2012 20:52:12
Example 1:
Proxy-Authenticate: Basic realm="proxy"
Example 2:
Proxy-Authenticate: Digest realm="atlanta.com",
...
Example 3:
Proxy-Authenticate: NTLM
More examples from SIP: Session Initiation Protocol (RFC 3261)
Created by voodoo on July 04, 2012 14:34:42
Last update: July 04, 2012 15:29:47
Sample C program to read the whole stdin input into a char buffer until EOF:
#include <stdio.h>
#include <stdlib.h>
#incl...