View gist:9727758f4847d2e7d86e
foo = "\\"
bar = "\n"
manyescapes = "\\\\\\\\"
manyescapes2 = "\n\\\n\\"
View cuda.h
/* Minimal declarations for CUDA support. Testing purposes only. */
#define __constant__ __attribute__((constant))
#define __device__ __attribute__((device))
#define __global__ extern "C" __attribute__((global))
#define __host__ __attribute__((host))
#define __shared__ __attribute__((shared))
#define __launch_bounds__(...) __attribute__((launch_bounds(__VA_ARGS__)))
#define __forceinline__ __attribute__((always_inline))
View gist:036a046bbcb8ab761115
diff --git a/lib/CodeGen/CodeGenPrepare.cpp b/lib/CodeGen/CodeGenPrepare.cpp
index dc5f67b..6aa60c6 100644
--- a/lib/CodeGen/CodeGenPrepare.cpp
+++ b/lib/CodeGen/CodeGenPrepare.cpp
@@ -1640,6 +1640,7 @@ bool AddressingModeMatcher::MatchScaledValue(Value *ScaleReg, int64_t Scale,
static bool MightBeFoldableInst(Instruction *I) {
switch (I->getOpcode()) {
case Instruction::BitCast:
+ case Instruction::AddrSpaceCast:
// Don't touch identity bitcasts.
View .htaccess
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/
View lexer.go
// Lexer for the TableGen language.
package main
import (
"fmt"
"io/ioutil"
"log"
"time"
"unicode/utf8"
)
View gist:9158301
def foo(): # told you
y = 2
file_input [2 children]
funcdef [5 children]
NAME('def') [lineno=1, column=0, prefix='']
NAME('foo') [lineno=1, column=4, prefix=' ']
parameters [2 children]
LPAR('(') [lineno=1, column=7, prefix='']
RPAR(')') [lineno=1, column=8, prefix='']
View gist:9158261
Input code:
x = 1 # told you
y = 2
Breakdown of the lib2to3 parse tree. The thingies with [N children] are nodes. The rest are leaves.
file_input [3 children]
View Loop benchmark
const unsigned N = 400 * 1000 * 1000;
volatile unsigned long long counter = 0;
// Don't inline the benchmarking code into main
void __attribute__((noinline)) tightloop();
void __attribute__((noinline)) loop_with_extra_call();
void tightloop() {
unsigned j;
View gist:6202493
import io
from test.support import import_fresh_module
import csv
csv_other = import_fresh_module('csv', fresh=['_csv', 'csv'])
f = io.StringIO('foo\x00,bar\nbaz,42')
reader = csv.reader(f)
View gist:5797351
#-------------------------------------------------------------------------------
# lexer.py
#
# A generic regex-based Lexer/tokenizer tool.
# See the if __main__ section in the bottom for an example.
#
# Eli Bendersky (eliben@gmail.com)
# This code is in the public domain
# Last modified: August 2010
#-------------------------------------------------------------------------------