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> | |
int main(){ | |
int pid = fork(); //子の場合: 0, 親の場合: 子のPID | |
//子の処理 | |
if (pid == 0){ | |
while(1){ | |
sleep(1); |
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 <unistd.h> | |
int main(){ | |
sleep(10); | |
execl("/bin/sleep","/bin/sleep","10",NULL); | |
puts("ここには来ない"); | |
} |
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> | |
int main(){ | |
int pid = fork(); //子の場合: 0, 親の場合: 子のPID | |
//子の処理 | |
if (pid == 0){ | |
puts("child"); | |
exit(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
/* fold.c nバイトずつ折り返す */ | |
#include <stdio.h> | |
#include <stdlib.h> | |
int main(int argc, char const* argv[]) | |
{ | |
if(argc != 2) | |
exit(1); | |
int i = 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
#!/bin/bash -xv | |
cat << FIN > /tmp/header | |
P2 | |
600 600 | |
255 | |
FIN | |
###真っ黒な画### | |
seq -w 0 359999 > /tmp/body |
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 | |
# github-connect.sh | |
# ----------------- | |
# Copyright 2012 Andrew Coulton - released under the BSD licence | |
# modified by Ryuichi Ueda 20140923 | |
# | |
# A simple command line script to set up and register an SSH key against a | |
# user's github account - for example when provisioning a new virtual | |
# machine for a developer. |
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
func mkNavi page: | |
grep -B 1 -A 1 "$page" | |
tr '\n' ' ' | |
awk '{print $1,$NF}' | |
tr ' ' '\n' | |
awk 'NR==1{print "前の記事",$1}NR==2{print "後の記事",$1}' | |
grep -v "$page" | |
sed 's/_/\\_/g' | |
proc fixPage dir page: |
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
syntax on | |
let g:neocomplcache_enable_at_startup = 1 | |
let g:neocomplcache_snippets_dir = $HOME.'/.vim/snippets' | |
syntax enable | |
" <C-k> にマッピング | |
imap <C-k> <Plug>(neocomplcache_snippets_expand) |
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
import /usr/bin/ as ub | |
import /bin/ as b | |
# not a Haskell code but a glue code | |
# how to write a procedure (function of bash) | |
proc pppp = | |
import /usr/bin/ as ub | |
ub.seq 1 10 | |
>>= ub.tail -r |
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
import PATH | |
# "file a = ..." and "file b" = ... are evaluated before "diff a b" | |
diff a b | |
where file a = seq 10 | |
file b = seq 10 | |
# ? is required because this diff returns 1 | |
? file ans = diff c d | |
where file c = seq 8 |
OlderNewer