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
import Image | |
import ImageDraw | |
# For gsheet module see https://gist.github.com/1638779 | |
import gsheet | |
# First param is spreadsheet ID and second param is sheet ID | |
WSHEET='0Atgd-n28fU3PdFFHSzJDNDhTS3NDMGx1NWNEdWNpOEE', 2 | |
CCSHEET='0Atgd-n28fU3PdGlsMTdLRUFqR3JvbktmcWhqTFpSZmc', 0 | |
# Second param is column index in sheet |
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
import urllib2 | |
DOC_PATH = 'https://docs.google.com/spreadsheet/pub?key=%s&output=txt' | |
GID_PARAM = '&single=true&gid=%s' | |
def load(docid, sheetid=None): | |
srcpath = DOC_PATH % docid | |
if sheetid != None: srcpath = srcpath + (GID_PARAM % sheetid) | |
src = urllib2.urlopen(srcpath) | |
return [l.split('\t') for l in src.readlines()] |
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
import os | |
import re | |
import shutil | |
import string | |
JPEG = re.compile(r'^img_\d{4}\.jpg$', re.I) | |
MOV = re.compile(r'^img_\d{4}\.mov$', re.I) | |
DATE = re.compile(r'^.*\d{4}-\d{2}-\d{2}$') | |
PHOTO_DST_DIR = './photo/' | |
VIDEO_DST_DIR = './video/' |
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
import org.semanticweb.owlapi.apibinding.OWLManager | |
import com.clarkparsia.pellet.owlapiv3.PelletReasonerFactory | |
def I = { org.semanticweb.owlapi.model.IRI.create(it) } | |
def file = "http://www.mindswap.org/2004/owl/mindswappers#" | |
println "Reading file ${file}…" | |
def manager = OWLManager.createOWLOntologyManager() | |
def ontology = manager.loadOntology(I(file)) |
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
import java.io.PrintWriter | |
import org.semanticweb.owlapi.apibinding.OWLManager | |
import com.clarkparsia.owlapi.explanation.DefaultExplanationGenerator | |
import com.clarkparsia.owlapi.explanation.io.manchester.ManchesterSyntaxExplanationRenderer | |
import com.clarkparsia.pellet.owlapiv3.PelletReasonerFactory | |
def I = { org.semanticweb.owlapi.model.IRI.create(it) } | |
def file = "http://owl.cs.manchester.ac.uk/repository/download?ontology=" + | |
"file:/Users/seanb/Desktop/Cercedilla2005/hands-on/people.owl" + |
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
<snippet> | |
<content>⇒</content> | |
<tabTrigger>=></tabTrigger> | |
<scope>source.scala</scope> | |
<description>Insert RIGHTWARDS DOUBLE ARROW ⇒</description> | |
</snippet> |
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
// Instructions: http://goo.gl/2JIC2 | |
static void Main(string[] args) | |
{ | |
var apiUrl = "http://api.vk.com/api.php"; | |
var dict = new Dictionary<string, string>(); | |
dict["api_id"] = "123456"; // Change this! | |
dict["v"] = "3.0"; | |
dict["format"] = "JSON"; | |
var api_secret = "1JH6TCDi8VBGyxQAZQ1Q"; // Change this! |
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
# coding=utf-8 | |
import urllib2 | |
import string | |
import os.path | |
from lxml.html import fromstring | |
from lxml import etree | |
from datetime import datetime | |
base_url = 'http://www.lomonosov-fund.ru/enc/ru/encyclopedia' | |
local_cache = 'cache/' |
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
import webapp2 | |
import html5lib | |
from html5lib import sanitizer,treebuilders,treewalkers | |
from html5lib.serializer.htmlserializer import HTMLSerializer | |
class MainPage(webapp2.RequestHandler): | |
def post(self): | |
self.response.headers['Content-Type'] = 'text/plain' | |
TREE = 'lxml' | |
input_data = self.request.get('content') |
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
declare @DomainCategoryID nvarchar(10) | |
declare @ProjectType nvarchar(50) | |
declare @ProjectCuratorID int | |
declare @Results table ( | |
ID int, | |
ProjectType nvarchar(50), | |
ProjectCuratorID int, | |
Phase nvarchar(50), | |
Publication nvarchar(50) | |
) |
OlderNewer