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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Order</title> | |
<style type="text/css"> | |
body { | |
margin: 40px auto; | |
max-width: 650px; | |
line-height: 1.6; | |
font-size: 18px; |
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
using System; | |
using System.Diagnostics; | |
using System.Collections.Generic; | |
public class Tester { | |
public static void Main() { | |
var count = 1000000; | |
var tris0 = new int[count * 3]; | |
var tris1 = new int[count * 3]; |
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 max_of_array_ending_at(array, p): | |
if p == 0: | |
return array[0] if array[0] > 0 else 0 | |
subproblem = max_of_array_ending_at(array, p-1) | |
if subproblem + array[p] > 0: | |
return subproblem + array[p] | |
else: |
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
autocmd! | |
"Start pathogen | |
execute pathogen#infect() | |
"Recognize filetypes and indentation | |
filetype indent on | |
"Turn on syntax highlighting | |
syntax on |
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
from math import sqrt | |
def is_prime(n): | |
for divisor in range(2, int(sqrt(n))+1): | |
if n % divisor == 0: | |
return False | |
return True |
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
ACT I. | |
SCENE I. An open place. | |
[An open place. Thunder and lightning. Enter three Witches.] | |
FIRST WITCH. | |
When shall we three meet again | |
In thunder, lightning, or in rain? | |
SECOND WITCH. |
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
On day 2014-11-06 | |
05:18 am to 06:00 am -- code review | |
06:16 am to 07:32 am -- food | |
07:51 am to 08:25 am -- personal appointment | |
08:53 am to 09:55 am -- workout | |
10:32 am to 11:22 am -- sales call | |
11:29 am to 00:18 pm -- code review | |
00:18 pm to 01:30 pm -- reddit | |
01:30 pm to 01:59 pm -- sales call | |
02:47 pm to 03:23 pm -- work |
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
>>> pattern = "(([A-Z]{2}-){2}\d{2,3})|([A-Z]{2}-\d{4})" | |
>>> string = "GS-0214" | |
>>> import re | |
>>> re.match(pattern, string) | |
<_sre.SRE_Match object; span=(0, 7), match='GS-0214'> |
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 calc_pi(n): | |
s = 0 | |
sign = 1 | |
for i in range(n): | |
n = i*2 + 1 # n will be an odd number | |
s += sign * 1.0/n | |
sign *= -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 factors(n): | |
factors = [] | |
# This loop weeds out any factors of 2 that are in the number | |
while n % 2 == 0: | |
factors.append(2) | |
n //= 2 | |
# This variable holds the divisor that we're testing |