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
/* | |
Copy this into the console of any web page that is interactive and doesn't | |
do hard reloads. You will hear your DOM changes as different pitches of | |
audio. | |
I have found this interesting for debugging, but also fun to hear web pages | |
render like UIs do in movies. | |
*/ | |
const audioCtx = new (window.AudioContext || window.webkitAudioContext)() |
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
require "rubygems" | |
require "bundler/setup" | |
require 'yaml' | |
require 'aws-sdk' | |
#require 'jruby-openssl' | |
bucket_name = "talim" | |
file_name = "jrubyaws.txt" |
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
-- Using lua to parse CSV file to a table. | |
-- Notice: first line must be data description filed. | |
-- The separator is '|', change it if you want. | |
-- Usage: csv = require('csv') | |
-- tab = csv.load('test.csv', ',') | |
-- table.foreach(tab[1], print) | |
-- print(tab[1].you_field) | |
--encoding=utf-8 |
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 | |
function facto($x){ | |
$r = 1; | |
for($i=$x;$i>1;$i--){ | |
$r *= $i; | |
} | |
return $r; | |
} |
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
(def nodes | |
{:k {:neighbors [:kaet] :activation 0.2} | |
:ae {:neighboars [:kaet] :activation 0.2} | |
:t {:neighbors [:kaet] :activation 0.2} | |
:kaet {:neighbors [:k :ae :t :cat] :activation 0.2} | |
:cat {:neighbors [:kaet] :activation 0.2}}) | |
(map #(:activation (% nodes)) (-> nodes :kaet :neighbors)) |
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 | |
session_start(); | |
$db = mysql_connect("localhost", "bdag", "bdag") or die("Could not connect."); | |
if(!$db) | |
die("no db"); | |
if(!mysql_select_db("bdaginventory",$db)) |
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
(do | |
(use 'clojure.test) | |
(defn re-test [ns] | |
(remove-ns ns) | |
(require :reload-all ns) | |
(run-tests ns))) | |
;; pick a namespace | |
(re-test 'clojure.test-clojure.other-functions) |
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
//pseudo code beloew | |
array = 1 2 3 4 1 2 3 4 5 1 2 3 | |
//should print at the end 1 2 3 4 5 with count 5 | |
max = 1 | |
maxstart = 0 | |
maxend = 0 | |