I hereby claim:
- I am ztane on github.
- I am anttihaapala (https://keybase.io/anttihaapala) on keybase.
- I have a public key whose fingerprint is B811 2F0F ACC5 6F06 B79C 4E4D 69C6 71AF 0959 C672
To claim this, I am signing this object:
<?php | |
#Equivalent to this PHP codes: | |
$gmt_timezone = new DateTimeZone('GMT'); | |
$obj_date = new DateTime(null,$gmt_timezone); | |
echo $obj_date->format('d/m/Y h:i:s'); | |
#OR | |
date_default_timezone_set("GMT"); | |
echo date('d/m/Y h:i:s', time()); | |
?> |
% python3 millionaire.py | |
Out of 1000000 cases | |
Initial was eliminated in 499869 cases (49.9869 %) | |
Initial was not eliminated in 500131 cases (50.0131 %) | |
There answer was different from initial in 249818 cases | |
Thus changing is winning 49.95051296560301 % if initial was not eliminated |
import warnings | |
import inspect | |
NONE = object() | |
class TypingWarning(Warning): | |
pass | |
%{ | |
#include <stdio.h> | |
int line_num = 1; | |
%} | |
%% | |
"(" { printf("a opening parenthesis\n"); } | |
")" { printf("a closing parenthesis\n"); } | |
[0-9]+ { printf("a number: %s\n", yytext); } |
I hereby claim:
To claim this, I am signing this object:
# advent of code helpers for Python 3 | |
def input_file(filename='input'): | |
""" | |
Read the input from current working directory, | |
return as a string stripped | |
""" | |
with open(input) as f: | |
return f.read().strip() |
(function ($) { | |
function doSerializeArrayItems($current, target) { | |
$current.children().each(function (i, e) { | |
var $e = $(e), | |
tmp; | |
if (e.hasAttribute('data-form-item')) { | |
var o = {}; | |
target.push(o); | |
doSerialize($e, o); | |
} |
from collections import defaultdict | |
import time | |
i = 100 | |
for _ in range(3): | |
list_of_dictionaries = [{1: 1} for i in range(i)] | |
list_of_dictionaries.append(dict.fromkeys(range(i))) | |
n = sum(map(len, list_of_dictionaries)) |
int foo(int a, int b) { | |
if ((a-b)==0) { | |
return 1; | |
} | |
return 0; | |
} | |
int bar(int a, int b) { | |
if (a==b) { | |
return 1; |
#include <stdio.h> | |
#define BUGGY | |
void funcA(int s, int g) | |
{ | |
int i, j = 0, k; | |
int grp[4] = {-1, -1}; | |
for (i = 0, k = 0; i < 1; ++i) { |