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 lang="en"> | |
<head> | |
<meta charset="utf-8" /> | |
<title>search as you type</title> | |
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" /> | |
<script src="http://code.jquery.com/jquery-1.9.1.js"></script> | |
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script> | |
<style> |
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 collections import deque | |
class SolrTermVectorCollector(object): | |
def __pathToTvrh(self, solrUrl, collection): | |
import urlparse | |
userSpecifiedUrl = urlparse.urlsplit(solrUrl) | |
schemeAndNetloc = urlparse.SplitResult(scheme=userSpecifiedUrl.scheme, | |
netloc=userSpecifiedUrl.netloc, | |
path='', | |
query='', |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 lang="en"> | |
<head> | |
<meta charset="utf-8" /> | |
<title>jQuery UI Slider - Default functionality</title> | |
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" /> | |
<script src="http://code.jquery.com/jquery-1.9.1.js"></script> | |
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script> | |
<link rel="stylesheet" href="/resources/demos/style.css" /> |
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
var crypto = require('crypto'); | |
//varies from -1 t0 1 | |
var pow2_31 = Math.pow(2,31); | |
var randNum = function(t,seed) { | |
var shasum = crypto.createHash('sha1'); | |
return shasum.update(""+seed+t).digest().readUInt32LE(0)/pow2_31-1; | |
} | |
var randNumGenMaker = function(seed) { |
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
{ | |
"metadata": { | |
"name": "" | |
}, | |
"nbformat": 3, | |
"nbformat_minor": 0, | |
"worksheets": [ | |
{ | |
"cells": [ | |
{ |
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 collections import defaultdict | |
import random | |
class MarkovModel(object): | |
""" | |
Takes iterator of tokens and makes a markov model of the tokens. n is the "order" of the model | |
None is a special token that serves as a sort of delimiter of phrases. | |
""" | |
@classmethod | |
def _tokenizer(cls,text,token_delim): |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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" | |
"github.com/Shopify/sarama" //GIT hash = b3d9702dd2d2cfe6b85b9d11d6f25689e6ef24b0 | |
"time" | |
) | |
var groupName = "trash" | |
var topicName = "event" |
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
/* MarkovModel creates a Markov model of text (or tokens) and allow you to generate new | |
* text from the model. It takes two optional arguments: | |
* | |
* tokenizer - a function that takes a string and returns an array of tokens | |
* defaults to a tokenizer that breaks on whitespace and lowercases everything | |
* shingle_n - the number of tokens that make up a state in the markov model | |
* the higher the number the more realistic the generated data, but the more | |
* training data required | |
* defaults to 1 | |
* join_str - string used to join text together |