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
| SELECT | |
| Questions.CreationDate, | |
| Questions.Title, | |
| Tags.TagName, | |
| Answers.CreationDate as ResponseDate, | |
| datediff(minute, Questions.CreationDate, | |
| Answers.CreationDate) as ResponseTime, | |
| cast(DATEPART(hour, Questions.CreationDate) as int) as ResponseHour | |
| FROM Posts Questions | |
| join Posts Answers on Answers.id = Questions.AcceptedAnswerId |
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 bisect | |
| import csv | |
| import datetime | |
| survivalFile = open('Survival_lang_no_title.csv') | |
| reader = csv.reader(survivalFile) | |
| reader.next() # pop the first row | |
| minutes = [] | |
| langDict = {} |
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 main | |
| import ( | |
| "fmt" | |
| "github.com/chewxy/gogogadget" | |
| "unsafe" | |
| ) | |
| func main() { | |
| var x int64 = 1234 |
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 pointerTagging | |
| import ( | |
| "unsafe" | |
| "math/rand" | |
| "time" | |
| ) | |
| type vector struct { | |
| x int |
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 pointerTagging | |
| import ( | |
| "testing" | |
| ) | |
| func BenchmarkInitializingInterface(b *testing.B) { | |
| for i := 0; i < b.N; i++ { | |
| initializingConventional() | |
| } |
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 cv2 | |
| import numpy as np | |
| import matplotlib.pyplot as plt | |
| im = cv2.imread('IMG_3545S.JPG') | |
| # convert to greyscale for easy thresholding | |
| imgray = cv2.cvtColor(im, cv2.COLOR_BGR2GRAY) | |
| # get a threshold - basically splits the image into black and white |
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
| # Sorry for using Python 2.7 | |
| from ctypes import * | |
| import os, sys | |
| argv = int(sys.argv[1]) | |
| argv2 = int(sys.argv[2]) | |
| PROT_NONE = 0x0 | |
| PROT_READ = 0x1 | |
| PROT_WRITE = 0x2 |
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
| .LFB0: | |
| pushq %rbp | |
| movq %rsp, %rbp | |
| subq $64, %rsp | |
| movl %edi, -180(%rbp) | |
| movq %rdx, -160(%rbp) | |
| movq %rcx, -152(%rbp) | |
| movq %r8, -144(%rbp) | |
| movq %r9, -136(%rbp) | |
| testb %al, %al |
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 bs4 import BeautifulSoup | |
| import requests | |
| r = requests.get('http://golang.org/ref/spec') | |
| soup = BeautifulSoup(r.text) | |
| bnf = soup.find_all('pre', class_='ebnf') | |
| bnftxt = [x.get_text() for x in bnf] | |
| bnftxt = ''.join(bnftxt) |
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 bs4 import BeautifulSoup | |
| import requests | |
| r = requests.get('http://www.ecma-international.org/ecma-262/5.1/') | |
| soup = BeautifulSoup(r.text) | |
| sections = ('sec-A.1', 'sec-A.2', 'sec-A.3', 'sec-A.4', 'sec-A.5') | |
| appendix = [] | |
| for s in sections: |
OlderNewer