Recent Notes
Displaying notes 51 - 60
Created by Fang on October 31, 2011 12:54:05
Last update: October 23, 2012 12:31:16
In JSP you output the web application context path with:
${pageContext.request.contextPath}
Facelets are not JSPs, and there's no pageContext . So the above does not work.
But in facelets you can use request directly:
${request.contextPath}
For example, a link to the root URL:
<a href="${request.contextPath}">Home</a>
Servlet request URL:
<h2>#{request.requestURL}</h2>
Created by magnum on October 22, 2012 20:03:05
Last update: October 22, 2012 20:03:05
First, the test command that sleeps random number of seconds ( sleeper.sh ):
#!/bin/bash
stime=$[$RANDOM % 20]
sleep $sti...
As comparison, synchronous pipe code:
#include <sys/wait.h>
#include <stdio.h>
#in...
Asynchronous pipe code:
#include <sys/wait.h>
#include <stdio.h>
#in...
Created by magnum on October 22, 2012 19:54:43
Last update: October 22, 2012 19:54:43
Example 1, from the pipe man page. The parent then writes the string contained in the program's command-line argument to the pipe, and the child reads this string a byte at a time from the pipe and echoes it on standard output.
#include <sys/wait.h>
#include <stdio.h>
#in...
Example 2, child execs command given at the command line, then writes to stdout (of child), which is piped to parent. Parent reads from pipe and writes to stdout (of parent).
#include <sys/wait.h>
#include <stdio.h>
#in...
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 magnum on October 22, 2012 15:46:44
Last update: October 22, 2012 15:46:44
Example code from the Linux Programmer's Manual:
#include <stdio.h>
#include <stdlib.h>
#incl...
Created by James on October 19, 2012 09:50:08
Last update: October 19, 2012 09:50:08
Use window.location.hash to get the page fragment identifier in the URL. For example, if the URL is:
http://www.mysite.com/#frag1
window.location.hash is " #frag1 ".
Created by Dr. Xi on October 08, 2012 11:56:29
Last update: October 08, 2012 11:56:29
This example gets the annotation attributes of of a web service client generated by JAX-WS RI.
The generated web service client looks like this:
import javax.xml.ws.Service;
import javax.xml.w...
This is how to get the attributes for annotation @WebServiceClient :
WebServiceClient wsc = MyTestWebService.class.getA...
Note that even though name , targetNamespace and wsdlLocation are attributes, you get them using a method call.
Also, annotations are available at runtime only when they have RetentionPolicy.RUNTIME .
Created by dmbaturin on September 28, 2012 20:04:38
Last update: September 28, 2012 20:04:38
test
Created by voodoo on September 25, 2012 19:10:19
Last update: September 25, 2012 19:10:19
Here is a list of the most useful targets that the GNU Coding Standards specify (from automake manual ). make all Build programs, libraries, documentation, etc. (same as make). make install Install what needs to be installed, copying the files from the package's tree to system-wide directories. make install-strip Same as make install, then strip debugging symbols. Some users like to trade space for useful bug reports... make uninstall The opposite of make install: erase the installed files. (This needs to be run from the same build tree that was installed.) make clean Erase from the build tree the files built by make all. make distclean Additionally erase anything ./configure created. make check Run the test suite, if any. make installcheck Check the installed programs...
Created by Fang on September 22, 2012 08:25:20
Last update: September 22, 2012 08:25:20
DataGenetics has an analysis of the most frequently used PIN codes and least frequently used PIN codes. The list is copied below. Most Frequently Used PIN codes Rank PIN Frequency #1 1234 10.713% #2 1111 6.016% #3 0000 1.881% #4 1212 1.197% #5 7777 0.745% #6 1004 0.616% #7 2000 0.613% #8 4444 0.526% #9 2222 0.516% #10 6969 0.512% #11 9999 0.451% #12 3333 0.419% #13 5555 0.395% #14 6666 0.391% #15 1122 0.366% #16 1313 0.304% #17 8888 0.303% #18 4321 0.293% #19 2001 0.290% #20 1010 0.285% Least Frequently Used PIN codes Rank PIN Frequency #9980 8557 0.001191% #9981 9047 0.001161% #9982 8438 0.001161% #9983 0439 0.001161% #9984 9539 0.001161% #9985 8196 0.001131% #9986 7063 0.001131% #9987 6093 0.001131% #9988 6827 0.001101%...