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
def all_p (ps): | |
def __predicate (*args, **kwargs): | |
return all (p(*args, **kwargs) for p in ps) | |
return __predicate | |
def any_p (ps): | |
def __predicate (*args, **kwargs): | |
return any (p(*args, **kwargs) for p in ps) | |
return __predicate |
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> | |
int a; /* tentative definition (in C, not C++)*/ | |
int a = 42; | |
int main (void) | |
{ | |
printf ("%d\n", a); | |
return 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
#include <iostream> | |
#include <vector> | |
#include <deque> | |
#include <list> | |
#include <set> | |
#include <unordered_set> | |
#include <forward_list> | |
#include <iterator> | |
template<typename C> |
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 <iostream> | |
#include <map> | |
#include <string> | |
#include <sys/types.h> | |
#include <pwd.h> | |
int | |
main (int argc, char *argv[]) | |
{ | |
std::map<std::string, std::string> nameshell; |
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/env perl | |
# yum -y install perl-DBD-Pg | |
use DBI; | |
use warnings; | |
$HOST = 'localhost'; | |
$NAME = 'db'; | |
@USER_RO = ('readonly', 'guest'); |
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 <pwd.h> | |
#include <string.h> | |
#include <unistd.h> | |
int | |
main (int argc, char *argv[]) | |
{ | |
const int s = 4096; |
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 <sys/stat.h> | |
#include <stdio.h> | |
int | |
main (int argc, char *argv[]) | |
{ | |
struct stat t; | |
while (*++argv != NULL) | |
{ |
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
def time_format (seconds): | |
m, s = divmod (seconds, 60) | |
h, m = divmod (m, 60) | |
if h: | |
return "{0:2}:{1:02}:{2:02}".format (h, m, s) | |
elif m: | |
return "{0:5}:{1:02}".format (m, s) | |
else: | |
return "{0:8}".format (s) |
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/env python | |
import sys, os | |
from collections import namedtuple | |
Color = namedtuple ("Color", "PURPLE CYAN DARKCYAN BLUE GREEN YELLOW RED BOLD UNDERLINE END") | |
color = Color ('\033[95m', '\033[96m', '\033[36m', '\033[94m', '\033[92m', '\033[93m', '\033[91m', '\033[1m', '\033[4m', '\033[0m') | |
def main (): |
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
#ifndef META_H | |
#define META_H | |
namespace mirek | |
{ | |
#include <climits> | |
// abs //////////////////////////////////////////////////////////////////////////////// | |
template<int N> |
OlderNewer