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
# Markov Chain Algorithm (The Practice of Programming pg 62) | |
# set w1 and w2 to be the first two words in the text | |
# print w1 and w2 | |
# loop: | |
# randomly choose w3, one of successors of prefix w1 and w2 | |
# print w3 | |
# replace w1 and w2 by w2 and w3 | |
# repeat loop | |
import random |
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" | |
//"bytes" | |
//"strconv" | |
) | |
type AVLTree struct { | |
Val 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 main | |
import ( | |
"bytes" | |
"fmt" | |
"strconv" | |
) | |
func main() { | |
var champernowne bytes.Buffer |
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" | |
"math" | |
) | |
func main() { | |
var champernowne float64 | |
for n := 1; n <= 10; n++ { |
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 ( | |
"encoding/json" | |
"flag" | |
"fmt" | |
"io/ioutil" | |
"net/http" | |
) |
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
(ns get-images.core | |
(:require [clojure.tools.cli :refer [parse-opts]] | |
[net.cgrand.enlive-html :refer [select html-resource]] | |
[clojure.string :refer [split join]] | |
[clojure.java.io :refer [input-stream output-stream copy]]) | |
(:import [java.net URL] | |
[java.io File]) | |
(:gen-class)) | |
(def options |
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 BeautifulSoup import BeautifulSoup | |
from functools import partial | |
from urllib import urlretrieve | |
from urlparse import urljoin, urlparse | |
import argparse | |
import multiprocessing | |
import os | |
import sys | |
import urllib2 |
NewerOlder