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
$ make presubmit | |
export HOSTOS=linux | |
export HOSTARCH=amd64 | |
export TARGETOS=linux | |
export TARGETARCH=amd64 | |
export TARGETVMARCH=amd64 | |
export CC=gcc | |
export ADDCFLAGS=-m64 -static | |
export NCORES=56 | |
export EXE= |
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
{ | |
"name": "fuchsia", | |
"target": "fuchsia/amd64", | |
"http": ":12345", | |
"workdir": "/usr/local/google/home/flowerhack/workdir.fuchsia", | |
"kernel_obj": "/usr/local/google/home/flowerhack/dancethetokage/fuchsia/out/build-zircon/build-x64", | |
"syzkaller": "/usr/local/google/home/flowerhack/whateverpath/src/github.com/google/syzkaller", | |
"image": "/usr/local/google/home/flowerhack/dancethetokage/fuchsia/out/x64/images/fvm.blk", | |
"sshkey": "/usr/local/google/home/flowerhack/dancethetokage/fuchsia/out/x64/ssh-keys/id_ed25519", | |
"reproduce": false, |
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
// We expect this program to terminate with a panic. | |
// Instead, it will loop forever. | |
package main | |
import( | |
"syscall" | |
) | |
func 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
>>> import sys | |
>>> sys.getrefcount("myrandomstring") | |
3 | |
>>> my_rand_str = "myrandomstring" | |
>>> sys.getrefcount(my_rand_str) | |
2 | |
>>> sys.getrefcount("hi") | |
7 | |
>>> class TestObj(object): | |
... def __init__(self): |
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
class TestNoseIsWeird: | |
def test_hello(self): | |
import pdb; pdb.set_trace() | |
print("Hello world!") | |
# This will succeed: | |
# nosetests -s test_nose_is_weird.py | |
# But this will *hang* in Python 2, and *crash* in Python 3 | |
# nosetests test_nose_is_weird.py | |
# In Python 2, it's not actually hanging—if you hit "c", it'll continue. |
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
/* A very simple grep. Currently only supports searching an exact | |
* string match within a single directory. | |
* Stuff that could be done in the future: actual regexp pattern | |
* matching, other features of grep that I don't actually use | |
*/ | |
use std::os; | |
use std::io::{File, Open, ReadWrite}; | |
fn 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
// compiled with rustc 0.13.0-dev | |
use std::io::{File, Open, ReadWrite}; | |
use std::collections::HashMap; | |
// use std::clone::Clone; // the compiler warns about unused imports, how cool | |
fn words_list(infile: &str) -> Vec<String> { | |
let p = Path::new(infile); | |
// Gives us a file handle on success | |
let mut file = match File::open_mode(&p, Open, ReadWrite) { |
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
# Initializing bytes is pretty easy | |
>>> my_bytestring = b'Reflection Eternal' | |
# Seems odd, though. Bytes are numbers, not strings. What encoding's being used? | |
>>> b'☃' | |
File "<stdin>", line 1 | |
SyntaxError: bytes can only contain ASCII literal characters. | |
# So bytes implicitly convert whatever you feed it via ASCII, and unicode makes it explode, even though... | |
>>> import sys |
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
import sys | |
def trollynamedtuple_init(self, *args): | |
for prop, arg in zip([i for i in dir(self) if not i.startswith('__')], args): | |
setattr(self, prop, arg) | |
def trollynamedtuple(typename, field_names): | |
tempclass = type(typename, (object,), {k: None for k in field_names.split()}) | |
tempclass.__init__ = trollynamedtuple_init | |
parent_frame = sys._getframe(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
def jankynamedtuple_init(self, *args): | |
for prop, arg in zip([i for i in dir(self) if not i.startswith('__')], args): | |
setattr(self, prop, arg) | |
def jankynamedtuple(typename, field_names): | |
tempclass = type(typename, (object,), {k: None for k in field_names.split()}) | |
tempclass.__init__ = jankynamedtuple_init | |
return tempclass |
NewerOlder