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
int mypow10(int a) | |
{ | |
int a2 = a * a; | |
int a4 = a2 * a2; | |
int a5 = a4 * a; | |
return a5 * a5; | |
} |
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
#!/usr/bin/perl | |
use warnings; | |
use strict; | |
sub getmul($$$$) { | |
my $num = shift; | |
my $num2 = $num % 100; | |
my $last = $num2 % 10; | |
my $case = $num2 > 4 && $num2 < 21 ? 2 : | |
1 == $last ? 0 : | |
$last > 1 && $last < 5 ? 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
sergey@eeeteak:/tmp$ awk '{ if( /isok/ ) {print $0 >> "/dev/fd/4"} else {print $0 >> "/dev/fd/5"} }' 4>/tmp/passed 5>/tmp/failed | |
dgshbkl,hb | |
sdfbjh,,jhbdfv | |
cfzxmgvzxfisoksxfgvjhvb | |
dxfmgvmhv | |
dsxvjhbisok | |
sergey@eeeteak:/tmp$ cat /tmp/failed | |
dgshbkl,hb | |
sdfbjh,,jhbdfv | |
dxfmgvmhv |
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
sergey@eeeteak:/tmp$ while read; do if [[ "$REPLY" =~ isok ]]; then echo "$REPLY" >>/dev/fd/4; else echo "$REPLY" >>/dev/fd/5 ; fi; done 4>/tmp/passed 5>/tmp/failed | |
sadjhb | |
dsfgvjhbasdf | |
kjvhdffvzsed | |
jhszdfisokasf | |
sdfjhvasdfg | |
kjhgvgsedfgvaweesisok | |
zdsjhb | |
sergey@eeeteak:/tmp$ cat /tmp/passed | |
jhszdfisokasf |
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
#!/usr/bin/perl -w | |
use strict; | |
use utf8; | |
use encoding "utf8"; | |
binmode( STDIN, ':utf8' ); | |
binmode( STDOUT, ':utf8' ); | |
use Encode qw(decode_utf8); | |
my @month_names = qw/Январь Февраль Март Апрель Май Июнь Июль Август Сентябрь Октябрь Ноябрь Декабрь/; | |
my %months = (); |
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 <sys/time.h> | |
main() { | |
struct timeval tv; | |
gettimeofday(&tv, NULL); | |
printf("Content-Type: text/plain\n\n%d.%06d\n", tv.tv_sec, tv.tv_usec); | |
} |
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
#!/usr/bin/perl -w | |
use strict; | |
use FindBin; | |
1 == @ARGV or die "Usage: cat kernel-call-trace.txt |$FindBin::Script <system-map-file>\n"; | |
my $map = shift @ARGV; | |
my (@address, @type, @name); | |
open MAP, "<", $map or die $!; | |
while(<MAP>) { |
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
diff -Naur rsync-3.0.6/Makefile.in rsync-3.0.6-sleepflag/Makefile.in | |
--- rsync-3.0.6/Makefile.in 2009-04-11 03:24:49.000000000 +0400 | |
+++ rsync-3.0.6-sleepflag/Makefile.in 2010-08-05 22:05:32.000000000 +0400 | |
@@ -35,7 +35,7 @@ | |
OBJS1=flist.o rsync.o generator.o receiver.o cleanup.o sender.o exclude.o \ | |
util.o main.o checksum.o match.o syscall.o log.o backup.o | |
OBJS2=options.o io.o compat.o hlink.o token.o uidlist.o socket.o hashtable.o \ | |
- fileio.o batch.o clientname.o chmod.o acls.o xattrs.o | |
+ fileio.o batch.o clientname.o chmod.o acls.o xattrs.o sleeper.o | |
OBJS3=progress.o pipe.o |
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
#!/usr/bin/perl -w | |
use warnings; | |
my $i = 1; | |
my @in = <>; | |
while(@in) { | |
local $_; | |
$_ = shift @in or die; | |
s/^(\d+)(\r?)$/$i$2/ or die "number of line expected: $_"; |
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
package main | |
import "fmt" | |
import "code.google.com/p/go-tour/tree" | |
// Walk walks the tree t sending all values | |
// from the tree to the channel ch. | |
func Walk(t *tree.Tree, ch chan int) { | |
if t.Left != nil { | |
Walk( t.Left, ch ) |
OlderNewer