This file contains hidden or 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/time -l ./a.out test.txt | |
3000000 18000000 105000000 test.txt | |
0.17 real 0.14 user 0.03 sys | |
811008 maximum resident set size | |
0 average shared memory size | |
0 average unshared data size | |
0 average unshared stack size | |
207 page reclaims | |
0 page faults | |
0 swaps |
This file contains hidden or 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 <cstdint> | |
#include <cstring> | |
#include <iostream> | |
struct TFoo { | |
int Bar; | |
int Baz; | |
}; |
This file contains hidden or 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
IMAGE=$(sudo docker build . | tail -1 | awk '{ print $NF; }') | |
MNT="$WORKSPACE/.." | |
# patch MNT to point to the host directory | |
MNT=$(echo $MNT | sed -E 's|^.*jenkins_home|/Users/averchenko/Development/docker-book/jenkins/jenkins_home|') | |
CONTAINER=$(sudo docker run \ | |
-d \ | |
-v "$MNT":/opt/project \ | |
$IMAGE \ |
This file contains hidden or 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 <iostream> | |
class Foo { | |
public: | |
explicit Foo(int) { | |
throw "Wow!"; | |
} | |
}; | |
class Bar { |
This file contains hidden or 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/env python3 | |
def prepare(): | |
values = list(range(5)) | |
values.append(values) | |
return values | |
xs = prepare() | |
xs = xs + xs |
This file contains hidden or 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/env python3 | |
import functools | |
import inspect | |
import itertools | |
@functools.total_ordering | |
class Maybe: | |
"""Extension of the boolean logic. |
This file contains hidden or 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/env python3 | |
class Prop: | |
def __get__(self, instance, owner): | |
return 'foo' | |
class Foo: | |
foo = Prop() |
This file contains hidden or 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 -O3 -std=c99 -o match match.c */ | |
#include <unistd.h> | |
char* VALUES[] = { "false\n", "true\n" }; | |
unsigned long SIZES[] = { 6, 5 }; | |
int match(const char* restrict str, const char* restrict pattern) { |
This file contains hidden or 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> | |
/* | |
* matches str to one of the strings in set (at most 32), | |
* returns the matched string or NULL | |
*/ | |
char* strset(char** set, char* str) { | |
char* mset[32]; |
This file contains hidden or 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
# | |
# parameters (including heuristic defaults) | |
# | |
if [ -z ${MY_SCHEME+x} ] | |
then | |
export MY_SCHEME=${PROJECT_NAME} | |
fi | |
if [ -z ${MY_WORKSPACE+x} ] |
NewerOlder