Recent Notes

Displaying keyword search results 1 - 10
Created by Dr. Xi on April 29, 2013 09:00:48    Last update: April 29, 2013 09:00:48
In the case proposed by Diony , signing multiple elements by id, simply change the newSignedInfo to: // Create the SignedInfo final List transforms0... I must admit that I don't understand transformations, so take my example code with a grain of salt. Also, signing a doc fragment by PATH does not work, simply because there's no way to identify the fragment with a URI without referring to it by id. Reference ode from org.jcp.xml.dsig.internal.dom.DOMURIDereferencer : // Check if same-document URI and register...
Created by freyo on February 06, 2013 21:10:47    Last update: February 06, 2013 21:12:18
I have an old Samung phone to be used as a toy. After restoring back to factory image and power on, I was stuck at the activate service screen. Unfortunately, the four corner magic touch did not work. So I did quite a bit of digging and this is what worked on my Samsung Continuum: Press emergency call button, then at the dialer, press * # 8 3 7 8 6 6 3 3 , press the Home key From the home screen, tap phone icon, Dial * # 2 2 7 4 5 9 2 7 Enter SPC code: ______ displays tap in white box to show virtual keyboard, enter 6 digit code (default: 000000), tap OK Select “Hidden menu Enable”, tap OK From...
Created by magnum on December 25, 2012 15:14:42    Last update: December 25, 2012 15:14:42
The C function strtok tokenizes a string when you call it repeated with a NULL pointer. It should be mentioned that it destroys (alters) the original string. #include <stdio.h> #include <stdlib.h> #incl...
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 September 11, 2012 12:10:03    Last update: September 11, 2012 12:10:46
Sample code for UDP client and server in C. The server simply echos back the client message. The client stays in "receive" loop to demonstrate the connection-less nature of the UDP protocol. Server code: #include <stdio.h> #include <stdlib.h> #incl... Client code: #include <stdio.h> #include <stdlib.h> #incl... Try it out: Start the server with: ./udpserver 8888 Send message to server: ./udpclient localhost 8888 "Hi, it's me! " Server console displays: Received from 127.0.0.1:41776: Hi, it's me! UDP is connectionless. Send a message from a second client to the first client: $ ./udpclient localhost 41776 "From client 2" First client console displays: $ ./udpclient localhost 8888 "Hi, it's me! " Re... It should be noted that the distinction between client and server is blurry. The only major...
Created by Dr. Xi on August 13, 2012 14:54:44    Last update: August 13, 2012 14:54:44
According to wikipedia , only two characters are invalid in a file name: In Unix-like file systems the null character, as that is the end-of-string indicator and the path separator / are prohibited.
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...
Created by Dr. Xi on March 14, 2012 14:23:14    Last update: March 14, 2012 14:23:14
If forgotPasswordForm.error is a String and not null, you cannot test the error condition with: <!-- This does not work! --> <c:if test="${forg... You have to use "not empty": <c:if test="${not empty forgotPasswordForm.error}"...
Previous  1 2 3 4 5 6 7 8 9 10 Next