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
/*! jQuery v1.10.2 | (c) 2005, 2013 jQuery Foundation, Inc. | jquery.org/license | |
//@ sourceMappingURL=jquery-1.10.2.min.map | |
*/ | |
(function(e,t){var n,r,i=typeof t,o=e.location,a=e.document,s=a.documentElement,l=e.jQuery,u=e.$,c={},p=[],f="1.10.2",d=p.concat,h=p.push,g=p.slice,m=p.indexOf,y=c.toString,v=c.hasOwnProperty,b=f.trim,x=function(e,t){return new x.fn.init(e,t,r)},w=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,T=/\S+/g,C=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,N=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,k=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,E=/^[\],:{}\s]*$/,S=/(?:^|:|,)(?:\s*\[)+/g,A=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,j=/"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,D=/^-ms-/,L=/-([\da-z])/gi,H=function(e,t){return t.toUpperCase()},q=function(e){(a.addEventListener||"load"===e.type||"complete"===a.readyState)&&(_(),x.ready())},_=function(){a.addEventListener?(a.removeEventListener("DOMContentLoaded",q,!1),e.removeEventListener("load",q,!1)):(a.detachEvent("onreadystatechange",q),e.detachEvent("o |
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
def bfs(root): | |
nodes = [(0,root)] | |
prev_level = 0 | |
while nodes: | |
level, node = nodes.pop(0) | |
if level > prev_level: | |
print node.value, | |
prev_level = level | |
for c in node.children: |
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
UP = (-1, 0) | |
LEFT = ( 0, -1) | |
DOWN = ( 1, 0) | |
RIGHT = ( 0, 1) | |
class Turtle: | |
"""The turtle crawls over the matrix starting at some position. | |
The turtle knows how to turn left and go forward.""" | |
def __init__(self, nrows, ncols, x, y): | |
self.x = x |
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
<html> | |
<head> | |
<title>Max Consecutive Sum</title> | |
</head> | |
<body> | |
Enter some integers: | |
<input type="text" id="txtInput" value="-1 5 6 -2 20 -50 4"></input> | |
<button onClick="btnOnClick();">Calculate</button> | |
<p> | |
Max consecutive sum is: <span id="divResult"></span> |
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
#!/bin/sh | |
# | |
# Adapted from: http://sunilkumarkopparapu.wordpress.com/2012/09/11/using-google-asr/ | |
# | |
LANGUAGE="en-US" | |
echo "1 SoX Sound Exchange -- Convert $1.wav to $1.flacC with 16000" | |
sox $1.wav $1.flac rate 16k | |
echo "2 Submit to Google Voice Recognition $1.flac" | |
wget -q -U "Mozilla/5.0" --no-proxy --post-file $1.flac --header="Content-Type: audio/x-flac; rate=16000" -O $1.ret "http://www.google.com/speech-api/v1/recognize?lang=${LANGUAGE}&client=chromium" | |
echo "3 SED Extract recognized 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
#include <stdlib.h> | |
#include <stdio.h> | |
#include <string.h> | |
#include <assert.h> | |
#define SPACE ' ' | |
void | |
reverse_words(char *sent, size_t len) | |
{ |
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
CFLAGS=-ggdb -Wall | |
all: quicksort.out | |
# $< the dependencies | |
# $@ the target | |
quicksort.out: quicksort.o | |
gcc -Wall -ggdb $< -o $@ | |
clean: |
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
if __name__ == "__main__": | |
pass |
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
<html> | |
<head> | |
<title>Binary search</title> | |
</head> | |
<body> | |
Enter a space-separated list of integers in increasing order:<br/> | |
<input id="txtArray" type="text" size="80" value="0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25"><br/> | |
Enter an integer to search for: | |
<input id="txtKey" type="text" size="4" value="22"><br/> | |
<input type="button" value="Initialize" onclick="onSearch();"> |
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
"""Behaves pretty much like cp -Pruv , except supports skipping directories. | |
Copy one directory to another recursively. If any subdirectories match a | |
specified regular expression pattern, they are not copied. | |
Also, directories containing a file called .nobackup are not backup up. | |
""" | |
import os | |
import os.path as P | |
import re |