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
if(a != b) { | |
return 0; | |
} else if(c > d) { | |
return 1; | |
} else if(e != f) { | |
e++; | |
return 3; | |
} else { | |
a.doSomeStuff(); | |
c.makeSomeThingsWith(b); |
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 <stdlib.h> | |
#include <string.h> | |
#define false 0 | |
#define true 1 | |
typedef int bool; | |
bool error(int depth) { | |
if(depth == 0) { | |
return true; |
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
NotEmptyList<T> getItems(); // always has at least one element. | |
List<T> maybeGetItems(); // might have zero elements. | |
T average(NotEmptyList<T> items) { | |
T value = 0; | |
for (T item: items.get()) { | |
value += item; | |
} | |
return value / items.get().size(); | |
} |
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
isPosix = os.name == 'posix' | |
isNt = os.name == 'nt' | |
isWin9x = os.name == 'win9x' | |
isMac = os.name == 'macos' | |
if isPosix: | |
do_posix_version() | |
elif isNt: | |
do_window_version() | |
elif isWin9x: |
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
10000000 1381753 V2WUU2 | |
10000000 221103 A0A0W0FIN8 | |
10000001 1381753 V2XGB0 | |
10000001 221103 A0A0W0F6P5 | |
1000000 192259 S8BUG6 | |
10000002 1381753 V2XRT4 | |
10000002 221103 A0A0W0F264 | |
10000003 1381753 V2WQU0 | |
10000003 221103 A0A0W0EWU1 | |
10000004 1381753 V2XU54 |
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
use std::fs::File; | |
use pbr::ProgressBar; | |
use std::io::Read; | |
pub struct ProgressFile { | |
file: File, | |
progress: ProgressBar<::std::io::Stdout>, | |
} | |
impl ProgressFile { |
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
start | |
test_mock (test_upload.UploaderTest) ... FAIL | |
NoneType: None | |
====================================================================== | |
FAIL: test_mock (test_upload.UploaderTest) | |
---------------------------------------------------------------------- | |
Traceback (most recent call last): | |
File "/usr/local/Cellar/python/3.7.1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/unittest/mock.py", line 1191, in patched | |
return func(*args, **keywargs) |
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
#![allow(unused_imports)] | |
extern crate regex; | |
#[macro_use] | |
extern crate lazy_static; | |
extern crate itertools; | |
extern crate pbr; | |
extern crate colored; | |
use std::collections::VecDeque; | |
use itertools::Itertools; | |
use pbr::ProgressBar; |
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
extern crate itertools; | |
extern crate linked_hash_set; | |
use itertools::Itertools; | |
use std::collections::HashMap; | |
use std::collections::HashSet; | |
use linked_hash_set::LinkedHashSet; | |
#[derive(Debug, Copy, Clone)] | |
enum OpType { |
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
use quickcheck::*; | |
use fasthash::MetroHasher; | |
use itertools::Itertools; | |
use im_rc::hashset::HashSet; | |
fn make_std_set(items: &[i32]) -> std::collections::HashSet<i32> { | |
items.iter().cloned().collect() | |
} | |
fn make_set(items: &[i32]) -> HashSet<i32, MyHasher> { |
OlderNewer