Recent Notes
Displaying keyword search results 1 - 10
Created by voodoo on March 24, 2013 13:44:47
Last update: March 29, 2013 13:08:31
Use getpwnam group of functions. Example code:
#include <sys/types.h>
#include <pwd.h>
#inc...
For gid, use getgrnam
Created by freyo on February 09, 2013 14:22:42
Last update: February 09, 2013 14:22:42
To find out the DNS server ip address your computer is using, load this page in your browser:
http://myresolver.info/
Created by magnum on October 22, 2012 19:48:03
Last update: October 22, 2012 19:48:03
execl takes the full path name of the command and variable length of arguments terminated by NULL:
execl("/bin/ls", "/bin/ls", "-r", "-t", "-l", NULL...
where the second argument is argv[0] , but can be any string!
execlp will try to find the command from $PATH , so full path to command is not needed:
execl("ls", "ls", "-r", "-t", "-l", NULL);
execv is the equivalent of execl , except that the arguments are passed in as a NULL terminated array:
char *args[] = {"/bin/ls", "-r", "-t", "-l", NULL ...
execvp is the equivalent of execvl , excep that the arguments are passed in as a NULL terminated array:
char *args[] = {"ls", "-r", "-t", "-l", NULL };
...
Created by James on May 02, 2012 13:01:24
Last update: May 02, 2012 13:01:24
Use the .prev() function to find the previous sibling of the current element:
$(this).prev()
or
$(this).prev('.selected')
Created by voodoo on April 25, 2012 11:53:44
Last update: April 25, 2012 11:54:17
To find JSP files containing ' [0] ':
grep -l '\[0]' src/main/webapp/WEB-INF/views/*.jsp
or
grep -l \\[0] src/main/webapp/WEB-INF/views/*.jsp
Created by voodoo on January 03, 2012 08:41:21
Last update: February 16, 2012 15:50:06
This is the command to print all regular files in the src folder but excluding all files within the .svn folders:
$ find src -name .svn -prune -o -type f -print
where -o is the or operator.
Define a shortcut:
ff ()
{
find $1 -name .svn -prune -o -...
Created by Fang on February 08, 2012 21:15:00
Last update: February 08, 2012 21:15:00
This was the error message:
[ERROR] sun.security.validator.ValidatorExceptio...
The certificate was actually signed by Verisign, but somehow failed to pass Java cert validation.
To resolve the problem:
Download the cert from the server (with RetrieveSSLCert , for example)
Import the certificate into the keystore:
$ keytool -import -trustcacerts -alias myserver -f...
Define MAVEN_OPTS :
$ export MAVEN_OPTS='-Djavax.net.ssl.trustStore=/h...
The quotes must exist for the value of MAVEN_OPTS , and the path must be absolute ( ~/etc/mavenKeyStore.jks does not work).
Created by zhidao on January 18, 2012 12:03:32
Last update: January 18, 2012 12:03:32
I think this is simpler:
grep -l limit .*
Created by James on January 16, 2012 10:05:10
Last update: January 16, 2012 10:06:13
There are two ways to get the submit button:
Use the :submit selector (note the space between the form name and :submit ):
$('#the-form-id :submit')
Use attribute selector (also, space between form id and attribute selector):
$('#the-form-id [type="submit"] ')
// or
$(...
jQuery recommends the latter if you are concerned about performance:
Because :submit is a jQuery extension and not part of the CSS specification, queries using :submit cannot take advantage of the performance boost provided by the native DOM querySelectorAll() method. For better performance in modern browsers, use [type="submit"] instead.
Created by Dr. Xi on January 06, 2012 13:44:55
Last update: January 06, 2012 13:44:55
To exclude CVS directories:
grep -R -l --exclude-dir=CVS 'string_to_find‘ src
...
To exclude .svn directories:
grep -R -l --exclude-dir=.svn 'string_to_find‘ src...