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
Loading voice2code.js ... No errors! | |
process_speech_input("loop from 1 to 10") | |
=> Processing: loop from 1 to 10 | |
spoken_code | |
=> ["loop from 1 to 10"] | |
generated_code | |
=> ["for (gpNqkpKMvWYH = 1; gpNqkpKMvWYH <= 10; gpNqkpKMvWYH++) { {{loop_body}} }"] |
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
vector<int> digitPermutationsOf(int n) { | |
vector<int> permutations; | |
// Convert integer to char array of digits | |
char digits[16]; // Max 16 digits allowed for ints | |
int size = sprintf(digits, "%d", n); | |
// Iterate through the digit array and save each permutation | |
std::sort(digits, digits + size); | |
do { |
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
#!/usr/bin/ruby | |
require 'cinch' # IRC framework | |
require 'marky_markov' # Markov chains | |
# Create persistent markov dictionary to read from | |
markov = MarkyMarkov::Dictionary.new('thunked', 3) | |
# Create IRC bot to feed data into markov dictionary | |
bot = Cinch::Bot.new do |
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
Generation 1 | |
Alice: 0.5 | |
Bob: 0.5 | |
Generation 2 | |
Alice: 0.9136221749087309 | |
Bob: 0.9048452243325479 | |
Generation 3 | |
Alice: 0.7525407199758025 | |
Bob: 0.7001147600768378 | |
Generation 4 |
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
## Author: Andrew Brown | |
## Created: 2014-02-11 | |
## Estimates cos using a Maclaurin series | |
function void = cosapprox (xrad, acceptable_error) | |
# Get true cos(xrad) value for error analysis | |
true_value = cos(xrad); | |
# Estimate value with Maclaurin series | |
term_index = 1; |
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
## Author: Andrew Brown | |
## Created: 2014-02-11 | |
## Estimates ln(x) with Taylor series | |
function void = taylor_log (x) | |
# Estimate value with Taylor series | |
approx = x - 1 | |
tic | |
for term_index = 1 : 100 | |
approx += ((-1)^term_index)*((x-1)^(term_index+1))/(term_index+1); |
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
// Create staggered JS events to handle the reading automagically | |
$.each(words, function (word_index, word) { | |
setTimeout(function () { | |
display_word(word, { | |
'left': left, | |
'pivot': center, | |
'right': right | |
}); | |
}, word_index * WORD_VISIBLE_TIME); | |
}); |
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> | |
<title>FaS Reader</title> | |
<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script> | |
<script src="http://code.jquery.com/jquery-migrate-1.2.1.min.js"></script> | |
<script type="text/javascript"> | |
$(document).ready(function() { | |
// Fast as Sanic Reader | |
var left = $('<span />').attr('id', 'left'), |
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
<script src="//code.jquery.com/jquery-1.11.0.min.js"></script> | |
<script> | |
function show_time() { | |
$('.clock').html(''); | |
$('.clock').css('text-align', 'center'); | |
$('body').css('overflow', 'hidden'); | |
var date = new Date(); |
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
eval(" | |
OlderNewer