#A Collection of NLP notes
##N-grams
###Calculating unigram probabilities:
P( wi ) = count ( wi ) ) / count ( total number of words )
In english..
1.Producer | |
1.request.required.acks=[0,1,all/-1] 0 no acknowledgement but ver fast, 1 acknowledged after leader commits, all acknowledged after replicated | |
2.use Async producer - use callback for the acknowledgement, using property producer.type=1 | |
3.Batching data - send multiple messages together. | |
batch.num.messages | |
queue.buffer.max.ms | |
4.Compression for Large files - gzip, snappy supported | |
very large files can be stored in shared location and just the file path can be logged by the kafka producer. | |
repeat 10 times | |
tell application "Safari" | |
activate | |
delay 0.4 | |
tell application "System Events" to set frontApp to name of first process whose frontmost is true | |
tell application "System Events" | |
tell application process frontApp | |
set _selection to value of attribute "AXFocusedUIElement" | |
tell _selection to perform action "AXShowMenu" | |
tell application "System Events" to key code 125 |
// a list of useful queries for profiler analysis. Starting with the most basic. | |
// 2.4 compatible | |
// | |
// output explained: | |
// | |
{ | |
"ts" : ISODate("2012-09-14T16:34:00.010Z"), // date it occurred | |
"op" : "query", // the operation type | |
"ns" : "game.players", // the db and collection |
#!/bin/sh | |
HOST=$1 | |
PORT=$2 | |
TIMEOUT=5 | |
if [ ! -x /usr/bin/nc ] ; then | |
echo "/usr/bin/nc is missing; required for $0 to run" | |
exit 3 |
#A Collection of NLP notes
##N-grams
###Calculating unigram probabilities:
P( wi ) = count ( wi ) ) / count ( total number of words )
In english..
from django.conf.urls import patterns, url | |
from . import views | |
urlpatterns = patterns('', | |
url(r'^entry/(?P<pk>\d+)\.pdf$', views.entry_as_pdf, name='entry_pdf'), | |
) |
var express = require('express'), | |
passport = require('passport'), | |
GoogleStrategy = require('passport-google').Strategy, | |
connect = require('express/node_modules/connect'), | |
http = require('http'), | |
path = require('path'), | |
util = require('util'), | |
fs = require('fs'), | |
redis = require('redis'), | |
cookie = require('cookie'), |
# clean everything up | |
echo "killing mongod and mongos" | |
killall mongod | |
killall mongos | |
echo "removing data files" | |
rm -rf data/config | |
rm -rf data/shard* | |
# For mac make sure rlimits are high enough to open all necessary connections | |
ulimit -n 2048 |
# original XML at http://www.w3.org/Math/characters/unicode.xml | |
# XSL for conversion: https://gist.github.com/798546 | |
unicode_to_latex = { | |
u"\u0020": "\\space ", | |
u"\u0023": "\\#", | |
u"\u0024": "\\textdollar ", | |
u"\u0025": "\\%", | |
u"\u0026": "\\&", |