Skip to content

Instantly share code, notes, and snippets.

@tazjel
tazjel / bench.sh
Created August 6, 2013 05:40 — forked from davlgd/bench.sh
#! /bin/bash
### Blender compile & bench for Ubuntu
### Author : LEGRAND David - PC INpact
###
### [email protected]
### http://www.pcinpact.com
###
### test.blend is needed for benchmark
### http://www.eofw.org/bench/
#!/bin/bash
STR_ORIG="_blendobj"
STR_REPL="_blender_object"
files=$(grep -rlF "${STR_ORIG}" . --include=*.{py,rst} --exclude-dir="build" --exclude-dir=".git")
# --exclude="${0}" --exclude="*.pyc" --exclude="*.blend"
for f in $files; do
sed -i "s/${STR_ORIG}/${STR_REPL}/g" $f
import time
import socket
import base64
src = '192.168.1.2' # ip of remote
mac = '00-AB-11-11-11-11' # mac of remote
remote = 'python remote' # remote name
dst = '192.168.1.3' # ip of tv
app = 'python' # iphone..iapp.samsung
#!/bin/sh
SDK=`dirname $0`
SCRIPT=`basename $0`
SDKPARENT=`dirname $SDK`
PLATFORM=`uname -sp`
if [ "$PLATFORM" = "Darwin i386" -o "$PLATFORM" = "Darwin x86_64" ]; then
echo "iPhone Toolchain installer script by rpetrich"
echo ""
@tazjel
tazjel / search.py
Created October 21, 2013 07:02 — forked from GaretJax/search.py
import sys
import re
def iterwords(fh):
for number, line in enumerate(fh):
for word in re.split(r'\s+', line.strip()):
# Preprocess the words here, for example to strip out punctuation
# (the following example is sloooow, compile this regex if you
# really want to use it):
# coding=UTF-8
from __future__ import division
import re
# This is a naive text summarization algorithm
# Created by Shlomi Babluki
# April, 2013
class SummaryTool(object):
# coding=UTF-8
import nltk
from nltk.corpus import brown
# This is a fast and simple noun phrase extractor (based on NLTK)
# Feel free to use it, just keep a link back to this post
# http://thetokenizer.com/2013/05/09/efficient-way-to-extract-the-main-topics-of-a-sentence/
# Create by Shlomi Babluki
# May, 2013
# coding=UTF-8
import nltk
from nltk.corpus import brown
# This is a fast and simple noun phrase extractor (based on NLTK)
# Feel free to use it, just keep a link back to this post
# http://thetokenizer.com/2013/05/09/efficient-way-to-extract-the-main-topics-of-a-sentence/
# Create by Shlomi Babluki
# May, 2013
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import string
from text.blob import Blobber
from text.taggers import PerceptronTagger, PatternTagger, NLTKTagger
def accuracy(test_set, tagger):
n_correct = 0
total = 0
tb = Blobber(pos_tagger=tagger)
auth = OAuthHandler(CLIENT_ID, CLIENT_SECRET, CALLBACK)
auth.set_access_token(ACCESS_TOKEN)
api = API(auth)
venue = api.venues(id='4bd47eeb5631c9b69672a230')
stopwords = nltk.corpus.stopwords.words('portuguese')
tokenizer = RegexpTokenizer("[\w’]+", flags=re.UNICODE)