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 python | |
| # Run: grep 'Parsing SYM file' *.log | awk '{print $9}' | xargs ./avg_filesize.py | |
| import sys | |
| import os | |
| import tempfile | |
| import urllib2 | |
| import cPickle as pickle | |
| import contextlib | |
| from bisect import bisect | |
| import gzip |
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
| from __future__ import print_function | |
| import time | |
| import threading | |
| import multiprocessing | |
| N = 100000000 | |
| def count(n): | |
| while n: | |
| n -= 1 |
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
| #!/bin/bash -vex | |
| drv_path=/lib/modules/$(uname -r)/misc | |
| drv_list=$(lsmod | grep vbox | awk '{print $1}' | xargs echo -n) | |
| if test "$drv_list"; then | |
| modprobe -r $drv_list | |
| fi | |
| for d in $drv_path/*vbox*.ko; do | |
| insmod $d | |
| done |
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/python | |
| import operator | |
| def parent(i): | |
| return i/2 | |
| def left(i): | |
| return i*2 + 1 |
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
| BEGIN { | |
| CRASHSYMBOLS = "~/work/B2G/objdir-debug/dist/crashreporter-symbols/" | |
| } | |
| { | |
| if (system("test -d "CRASHSYMBOLS $2) == 0) { | |
| if (system("test -d "CRASHSYMBOLS $2"/"$1) == 0) { | |
| print $2" ok" | |
| } else { | |
| "ls " CRASHSYMBOLS $2"/" | getline id | |
| print "The ids for "$2" don't match: "$1 " "id |
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 <usb.h> | |
| #include <stdio.h> | |
| int main(int argc, char **argv) | |
| { | |
| struct usb_bus *bus; | |
| struct usb_device *dev = NULL; | |
| usb_dev_handle *handle; | |
| char dummy_data[5]; | |
| int ret; |
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
| from usb.core import find | |
| from usb.backend import openusb | |
| import sys | |
| if len(sys.argv) < 2: | |
| print ('Usage: python test-openusb.py idvendor:idproduct (in hex)') | |
| exit(1) | |
| vendor, product = list(map(lambda x: int(x, 16), sys.argv[1].split(':'))) |
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 <string> | |
| #include <vector> | |
| #include <algorithm> | |
| #include <iostream> | |
| #include <iterator> | |
| #include <unordered_map> | |
| using namespace std; | |
| namespace { |
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 <string.h> | |
| #include <stdlib.h> | |
| #define MAX_LEN 3000 | |
| #define AUX_LEN (MAX_LEN * 2 + 1) | |
| int fn[AUX_LEN]; | |
| char aux[AUX_LEN+1]; | |
| int p[AUX_LEN]; |
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 <ffi.h> | |
| #include <iostream> | |
| using namespace std; | |
| class IInterface { | |
| public: | |
| virtual void fn1(int a, int b) = 0; | |
| virtual void fn2(int a, int b) = 0; | |
| ~IInterface() {} |