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
#define DEFAULTTREEHEIGHT 20 | |
#define DEFAULTITERATIONS 1000 | |
#include <sys/time.h> | |
#include <stdlib.h> | |
#include <stdio.h> | |
#include <math.h> | |
typedef struct{ | |
void* right; |
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
import cherrypy | |
import sqlite3 | |
import json | |
def wrap_html(function): | |
def new_function(*args, **kwargs): | |
return """\ | |
<html><body> | |
""" + function(*args, **kwargs) + """ | |
</body></html> |
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
squareRoot :: Integer -> Integer | |
squareRoot = floor . sqrt . (fromIntegral :: Integer -> Double) | |
isPrime :: Integer -> Bool | |
isPrime 1 = False | |
isPrime x = testDown x (squareRoot x) where | |
testDown a 1 = True | |
testDown a n | |
| a `mod` n == 0 = False | |
| otherwise = testDown a (n-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
;; Here are some examples of how to override the defaults for the | |
;; various prelude-emacs settings. To *append* to any of the | |
;; configurations attached to prelude-*-hooks, you can attach a | |
;; function to the appropriate hook: | |
;; disable whitespace-mode and whitespace-cleanup | |
(add-hook 'prelude-prog-mode-hook | |
(lambda () | |
(prelude-turn-off-whitespace) | |
(remove-hook 'before-save-hook 'whitespace-cleanup)) t) |
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
{ | |
/* Keybindings for emacs emulation. Compiled by Jacob Rus. | |
* | |
* This is a pretty good set, especially considering that many emacs bindings | |
* such as C-o, C-a, C-e, C-k, C-y, C-v, C-f, C-b, C-p, C-n, C-t, and | |
* perhaps a few more, are already built into the system. | |
* | |
* BEWARE: | |
* This file uses the Option key as a meta key. This has the side-effect | |
* of overriding Mac OS keybindings for the option key, which generally |
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
;;Haskell setup | |
(defun haskell-custom-setup () | |
(progn | |
(define-key haskell-mode-map (kbd "C-x C-s") 'haskell-mode-save-buffer) | |
(setq haskell-indent-offset 2) | |
(ghc-init) | |
(flymake-mode 1) | |
(defun haskell-mode-stylish-buffer-custom () |
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
print sorted([int(c) for c in [str(x * y) | |
for x in range(999, 99, -1) | |
for y in range(999, x - 1, -1)] | |
if all([c[i] == c[-1 - i] | |
for i in range(len(c) / 2)])])[-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
҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈⃦⃧⃜⃧⃛⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧ ⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧ه҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈⃦⃧⃜⃧⃛⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧ ⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧ه҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈⃦⃧⃜⃧⃛⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧ ⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧ه҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈⃦⃧⃜⃧⃛⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧ ⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧ه҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈⃦⃧⃜⃧⃛⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧ ⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧ه҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈⃦⃧⃜⃧⃛⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧ ⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧ه҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈ |
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
import requests | |
from bs4 import BeautifulSoup, NavigableString | |
def get_review_text(block): | |
"""Get just the text of a review from it's DIV""" | |
strings = [] | |
for possible_text in block.children: | |
if isinstance(possible_text, NavigableString): | |
stripped_text = possible_text.strip() |
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
package main | |
import ( | |
"fmt" | |
"crypto/skein" //https://github.com/wernerd/Skein3Fish | |
"encoding/hex" | |
"os" | |
"bufio" | |
"io" | |
"strings" |
OlderNewer