This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nmap - <C-w>- | |
nmap + <C-w>+ | |
" Define different behavior in left/right window | |
if has("autocmd") | |
autocmd BufEnter,BufLeave * | |
\ if winnr() == 1 | | |
\ nmap < <C-w><| | |
\ nmap > <C-w>>| | |
\ else | | |
\ nmap < <C-w>>| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Source global definitions | |
[ -f /etc/bashrc ] && . /etc/bashrc | |
[ -f /etc/profile ] && . /etc/profile | |
export EDITOR=vim | |
export LC_ALL=en_US.UTF-8 | |
export LANG=en_US.UTF-8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# Redirect stdin, stdout, stderr of a daemon to /dev/pts/# | |
# | |
################################################################################################################# | |
# Ref: stdio buffering: http://www.pixelbeat.org/programming/stdio_buffering/ | |
# Default Buffering modes: | |
# stdin -> is always buffered | |
# stderr -> is always unbuffered | |
# if stdout is a terminal then buffering is automatically set to line buffered, else it is set to buffered |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Try this, 剛好是 14 個連續數字,才會echo出東西 | |
echo "./12M-20120419010203-aaaa-bbb-ccc.log" | sed -n "s/.*-\([0-9]\{13\}\)-.*/\1/p" | |
echo "./12M-20120419010203-aaaa-bbb-ccc.log" | sed -n "s/.*-\([0-9]\{14\}\)-.*/\1/p" | |
echo "./12M-20120419010203-aaaa-bbb-ccc.log" | sed -n "s/.*-\([0-9]\{15\}\)-.*/\1/p" | |
所以你可以判斷stdout吐出來的字串是否有長度不為0來判斷是否match | |
如下: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type='text/javascript'> | |
//<![CDATA[ | |
var times= 0; | |
function commentPhotoDo() { | |
var tag; | |
for(var i = 0; i < commentPhotoIds.length; i++){ | |
tag = document.createElement('script'); | |
tag.type = 'text/javascript'; | |
tag.src = 'http://chenkaie.110mb.com/avatar.php?maxheight=60&url='+encodeURIComponent(commentPhotoIds[i].url)+'&id='+encodeURIComponent(commentPhotoIds[i].id)+'&defaultimage='+encodeURIComponent('http://bloggerhacks.googlecode.com/files/No_Photo.PNG'); | |
//tag.src = 'http://bloggerhacks.googlecode.com/files/No_Photo.PNG)'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Modify below 2 variables if needed | |
ALBUM_NUM=50 | |
ALBUM_FOLDER="./SambaGhost-data/album/" | |
cd ${ALBUM_FOLDER} | |
for (( i = 1; i <= ${ALBUM_NUM}; i++ )); do | |
echo "==> Create folder ${i}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <sys/time.h> | |
struct timeval g_tvStart, g_tvEnd; | |
unsigned int g_uiDiff; | |
void ProfilingStart() | |
{ | |
g_uiDiff = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* $ gcc countbit.c -o countbit.out | |
* $ ./countbit.out | |
* =============================================================== | |
* <PROFILING> Start : [ProfilingStart] (1414405319.256769) | |
* <PROFILING> End : [ProfilingEnd] (1414405339.508215) g_uiDiff = 20251,446 | |
* =============================================================== | |
* =============================================================== | |
* <PROFILING> Start : [ProfilingStart] (1414405339.508239) | |
* <PROFILING> End : [ProfilingEnd] (1414405355.221734) g_uiDiff = 15713,495 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (self.CavalryLogger) { | |
CavalryLogger.start_js(["xTY7O"]); | |
} | |
__d('FileHasher', ['WebWorker', 'fileSliceName', 'emptyFunction', 'FileHashWorkerResource'], function a(b, c, d, e, f, g) { | |
if (c.__markCompiled) c.__markCompiled(); | |
h.isSupported = function() { | |
'use strict'; | |
return c('WebWorker').isSupported(); | |
}; |
OlderNewer