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
package test; | |
public class Scope { | |
// public static void main(String [] args) { | |
// | |
// String word = "hello"; | |
// sayGoodbye(); | |
// System.out.println(word); | |
// |
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
// Create a file named "ChickenRanch (notice that this class is typoed). | |
public class ChikenRanch; | |
/*/* | |
// This program named ChickenRanch.java should print print | |
// the following including quotes: | |
// "Ranch it up!" | |
// | |
*/*/ | |
public static void main(String[] args) { |
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
import inspect | |
import threading | |
import queue | |
MANGLE_LEN = 256 # magic constant from compile.c | |
def mangle(name, klass): | |
if not name.startswith('__'): | |
return name | |
if len(name) + 2 >= MANGLE_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 <thread> | |
#include <iostream> | |
int main() { | |
std::thread other([]{ std::cout << "Hello." << std::endl; }); | |
other.join(); | |
return 0; | |
} |
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
import itertools | |
from xdist.dsession import LoadScheduling | |
""" | |
Custom scheduler implementation that prevents running in parallel tests, that belong same class (TestCase). | |
Custom scheduler support implemented in this PR: https://github.com/pytest-dev/pytest-xdist/pull/89 | |
""" | |
class GroupedLoadScheduling(LoadScheduling): | |
def check_schedule(self, node, duration=0): |
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
# This is how you would normally do a keyword argument | |
def normal_function(keyword_arg=None): | |
print(keyword_arg) | |
normal_function(keyword_arg='hello world') | |
# Function can take any number of keyword arguments, we might do this if we are lazy and don't want to | |
# specify an interface | |
def function(**kwargs): |
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
import sys | |
import re | |
match_regex = re.compile(r"(?P<bound_capture>std::bind\((?P<bound_function>&[\w:]+),[\s]+this\),)") | |
lambda_replace = r"[this]{ \g<bound_function>(); }," | |
file_list = sys.argv[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 | |
# NOTE: Script assumes that your origin is set to https://github.com/multifacet/gem5 | |
git checkout origin/sean/merging/events | |
scons -j20 build/ARM/gem5.opt | |
./build/ARM/gem5.opt --debug-flags=All configs/learning_gem5/part1/simple.py &> all-merging-events.debug | |
git checkout origin/master | |
scons -j20 build/ARM/gem5.opt |
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
[?1034hscons: Reading SConscript files ... | |
Checking for C header file Python.h... (cached) yes | |
Checking for C library pthread... (cached) yes | |
Checking for C library dl... (cached) yes | |
Checking for C library util... (cached) yes | |
Checking for C library m... (cached) yes | |
Checking for C library python2.7... (cached) yes | |
Checking for accept(0,0,0) in C++ library None... (cached) yes | |
Checking for zlibVersion() in C++ library z... (cached) yes | |
Checking for GOOGLE_PROTOBUF_VERIFY_VERSION in C++ library protobuf... (cached) yes |
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
(require 'package) | |
(add-to-list 'package-archives '("org" . "http://orgmode.org/elpa/")) | |
(add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/")) | |
(add-to-list 'package-archives '("melpa-stable" . "http://stable.melpa.org/packages/")) | |
(setq package-enable-at-startup nil) | |
(package-initialize) | |
(unless (package-installed-p 'use-package) |
NewerOlder