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
<?php | |
$operators=array("+","-","*","/"); | |
$numbers=array("0","1","2","3","4","5","6","7","8","9"); | |
$a=array(); | |
function findNodesFirst($exp,&$buff,&$nums,&$op){ | |
//Check $exp is empty? | |
$newExp=""; |
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 pyttsx | |
engine = pyttsx.init() | |
engine.setProperty('rate', 100) | |
voices = engine.getProperty('voices') | |
engine.setProperty('voice', voices[1].id) | |
engine.say("A robot is a mechanical or virtual artificial agent, usually an electro-mechanical machine that is guided by a computer program or electronic circuitry.") | |
engine.runAndWait() |
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 pybrain.tools.shortcuts import buildNetwork | |
from pybrain.structure import FeedForwardNetwork | |
from pybrain.datasets import SupervisedDataSet | |
from pybrain.supervised.trainers import BackpropTrainer | |
from pybrain.structure import LinearLayer, SigmoidLayer, TanhLayer | |
from pybrain.structure import FullConnection | |
import random | |
def int2bin(a): |
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 pybrain.tools.shortcuts import buildNetwork | |
from pybrain.structure import FeedForwardNetwork | |
from pybrain.datasets import SupervisedDataSet | |
from pybrain.supervised.trainers import BackpropTrainer | |
from pybrain.structure import LinearLayer, SigmoidLayer, TanhLayer | |
from pybrain.structure import FullConnection | |
import random | |
def int2bin(a): |
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
#https://pythonhosted.org/pypng/ex.html | |
import png | |
import time | |
def map2png(name, amap, w, h): | |
amap2 = list(amap) | |
for i in range(len(amap2)): |
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 getch | |
while True: | |
# ... | |
char = getch.getch() # User input, but not displayed on the screen | |
# or | |
#char = getch.getche() # also displayed on the screen | |
print char |
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 SerialPort = require("serialport").SerialPort | |
var serialPort = new SerialPort("COM4", { | |
baudrate: 9600 | |
}); | |
serialPort.on("open", function () { | |
console.log('open'); | |
serialPort.on('data', function(data) { |
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
<html> | |
<script> | |
var errorCallback = function(e) { | |
console.log('Rejected', e); | |
}; | |
function init(){ | |
navigator.getUserMedia = navigator.getUserMedia || | |
navigator.webkitGetUserMedia || | |
navigator.mozGetUserMedia || |
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
<html> | |
<head> | |
<script> | |
function goFullScreen(elem){ | |
if (elem.requestFullscreen) { | |
elem.requestFullscreen(); | |
} else if (elem.msRequestFullscreen) { | |
elem.msRequestFullscreen(); | |
} else if (elem.mozRequestFullScreen) { | |
elem.mozRequestFullScreen(); |
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
<html> | |
<head> | |
<script> | |
var recognition = new webkitSpeechRecognition(); | |
recognition.continuous = true; | |
//recognition.interimResults = true; | |
function start(){ | |
recognition.onresult = function(event) { | |
console.log(event); | |
var output = document.getElementById("output"); |