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
# http://julesjacobs.github.io/2015/06/17/disqus-levenshtein-simple-and-fast.html | |
import sugar | |
import sequtils | |
import tables | |
import strutils | |
import hashes | |
type | |
SparseLevenshteinAutomaton = object |
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 requests | |
URL = "https://www.doabooks.org/oai?verb=ListRecords&from=2012-01-01&metadataPrefix=marcxml" | |
#URL = "https://publishing.cdlib.org/ucpressebooks/oai?verb=ListRecords&set=public&metadataPrefix=oai_dc" | |
#headers = {'Host': 'www.doabooks.org:443'} | |
r = requests.get(URL, verify=True) | |
print( r.text ) |
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
{'country.rank': ['1'], 'country.year': ['2008'], 'country.gdppc': ['141100'], 'country.neighbor.@name': ['Austria', 'Switzerland'], 'country.neighbor.@direction': ['E', 'W'], 'country.@name': ['Liechtenstein']} | |
{'country.rank': ['4'], 'country.year': ['2011'], 'country.gdppc': ['59900'], 'country.neighbor.@name': ['Malaysia'], 'country.neighbor.@direction': ['N'], 'country.@name': ['Singapore']} | |
{'country.rank': ['68'], 'country.year': ['2011'], 'country.gdppc': ['13600'], 'country.neighbor.@name': ['Costa Rica', 'Colombia'], 'country.neighbor.@direction': ['W', 'E'], 'country.@name': ['Panama']} |
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
<?xml version="1.0"?> | |
<data> | |
<country name="Liechtenstein"> | |
<rank>1</rank> | |
<year>2008</year> | |
<gdppc>141100</gdppc> | |
<neighbor name="Austria" direction="E"/> | |
<neighbor name="Switzerland" direction="W"/> | |
</country> | |
<country name="Singapore"> |
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, asyncnet, asyncdispatch | |
proc callback1(): Future[int] = | |
var retFuture = newFuture[int]("callback1") | |
echo "Callback1: Waiting" | |
sleep(3000) | |
retFuture.complete(10) | |
return retFuture |
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 -*- | |
# Author : Sirres Raphael | |
# Date: 16.12.2014 | |
# Description: Basic Posture Class | |
from naoqi import ALProxy | |
class NaoPosture: | |
def __init__(self, IP, PORT=9559): | |
self.postureProxy = ALProxy("ALRobotPosture", IP, PORT) | |
self.speed=0.7 |
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 -*- | |
# Author : Sirres Raphael | |
# Date: 16.12.2014 | |
# Description: Launch Server which serves a web page that performs the text recognition with the Web Speech API (Google Chrome). | |
# Recognized text is send to the server which on the other hand fowards the command to the NAO. | |
# | |
# How to use: 0. (Install pip: easy_install pip) Dont need this if pip is already installed | |
# 0. (Install bottle: pip install bottle) | |
# 1. Adapt the IP address in the main function. | |
# 2. Run the following command: python speech.py |