Recent Notes

Displaying keyword search results 41 - 50
Created by voodoo on June 21, 2011 08:19:33    Last update: June 21, 2011 08:34:28
Got "base64: invalid input" error: $ base64 -d base64_encoded.txt >original.bin ba... which can be easily dismissed as "input is invalid base64 encoded" or "partial input". But I know it's valid base64 encoded input! The problem was, the input was base64 encoded on Windows! The error goes away after converting to Unix format with dos2unix . dos2unix < base64_encoded.txt | base64 -d >origina... Version of base64 used: $ base64 --version base64 (GNU coreutils) 8.5 ...
Created by magnum on June 20, 2011 20:32:38    Last update: June 20, 2011 20:32:38
Here, = prints line number followed by new line, N appends the next line of input into the pattern space . Print line number at beginning of line, followed by a space: sed = test.txt | sed 'N;s/\n/ /' Print line number at beginning of line, followed by a tab: sed = test.txt | sed 'N;s/\n/\t/' Print line number right adjusted with 6 leading spaces: sed = test.txt | sed 'N; s/^/ /; s/\(.\{6,\}\...
Created by woolf on June 18, 2011 21:21:56    Last update: June 18, 2011 21:34:56
I haven't test these. They are collected for reference only. With mencoder, from HOWTO: Convert and write AVCHD (.mts) to DVD with Linux mencoder -oac copy -ovc lavc -of mpeg -mpegopts fo... With HandBrake (GUI): Transcoding AVHD (Cannon HF100 .mts) into a usable open format (MKV w/ FFMPEG) With ffmpeg & WinFF (GUI and command line): How to convert Canon .mts video files to other formats in Ubuntu With mencoder, from Transcoding AVCHD (.mts or .m2ts) files using mencoder on Linux (no deinterlacing): # 1 pass mencoder $file -o ./$file.avi -oac cop... With ffmpeg, from Stuttering playback of canon MTS files #!/bin/bash for i in "$i"*.MTS; do name="${i%.*... #!/bin/bash for i in "$i"*.MTS; do name="${i%.*... With mencoder, from [MEncoder-users] problems with AVCHD (.mts) + Deinterlace...
Created by alfa on June 02, 2011 13:04:18    Last update: June 02, 2011 13:04:18
Some javap usage examples. Start from HelloWorld.java : @Deprecated public class HelloWorld { pu... javap -c HelloWorld outputs: Compiled from "HelloWorld.java" public class He... javap -v HelloWorld outputs ( -v for verbose mode): Compiled from "HelloWorld.java" public class He... The output consists of: " Compiled from... " header Class attributes. For the HelloWorld example, there are two: SourceFile and Deprecated . Minor and major class file version Constant pool Disassembled code LineNumberTable for debugging purposes. javap by default only prints package/protected/public members. To display all members including private, use the -p switch. javap -v -p HelloWorld
Created by alfa on May 25, 2011 20:17:52    Last update: May 25, 2011 20:39:35
In Java regex, by default, the dot character does not match the newline character ( \n ). It matches a newline character only when the DOTALL flag is set. Example: import java.util.regex.*; public class Dota...
Created by alfa on May 25, 2011 20:36:09    Last update: May 25, 2011 20:36:56
Character Matches . Any character in DOTALL mode; otherwise, any character but the line terminators. \d A digit: [0-9] \D A non-digit: [^0-9] \s A whitespace character: [ \t\n\x0B\f\r] \S A non-whitespace character: [^\s] \w A word character: [a-zA-Z_0-9] \W A non-word character: [^\w] ^ The beginning of the input, and the beginning of a line if in MULTILINE mode. $ The end of the input, and the end of a line if in MULTILINE mode. \b A word boundary \B A non-word boundary \A The beginning of the input \G The end of the previous match \Z The end of the input but for the final terminator, if any \z The end of the input \1 , \2 , etc. Back reference to the...
Created by alfa on May 25, 2011 20:08:21    Last update: May 25, 2011 20:08:21
In MULTILINE mode, ^ matches the begging of the string as well as the beginning of a new line; $ matches the end-of-string as well as the newline character. In normal (non- MULTILINE mode), ^ only matches the begging of the string; $ only matches the end-of-string. Example: import java.util.regex.*; public class ...
Created by woolf on May 20, 2011 14:00:35    Last update: May 20, 2011 14:01:36
To remove new line characters from a file: with tr : tr -d '\n' < the-file.txt or cat the-file.txt | tr -d '\n' with sed : sed ':a;N;$!ba;s/\n//g' the-file.txt or cat the-file.txt | sed ':a;N;$!ba;s/\n//g' The sed version is a bunch of commands to manipulate the register etc. Regex replace " s/\n//g " does not work because sed regex works on a single line. More tips from this Linux blog: http://linux.dsplabs.com.au/rmnl-remove-new-line-characters-tr-awk-perl-sed-c-cpp-bash-python-xargs-ghc-ghci-haskell-sam-ssam-p65/
Created by woolf on May 20, 2011 13:46:04    Last update: May 20, 2011 13:46:04
The Unix utility can convert a binary stream to hex and reverse it. The -p (or -ps ) switch means "plain", or "postscript" mode. $ cat >test.txt Line one Line two Line th...
Created by James on May 19, 2011 16:02:40    Last update: May 19, 2011 16:05:05
Finally, MathJax makes showing math equations in the browser a reality! Here are some simple demos. A simple example: <!doctype html> <html> <head> <title>Math... Add HTML styling for Firefox: <!doctype html> <html> <head> <title>Math...
Previous  1 2 3 4 5 6 7 8 9 10 Next