Skip to content

Instantly share code, notes, and snippets.

@bhenry
bhenry / plink-plonk.js
Created February 25, 2020 20:20 — forked from tomhicks/plink-plonk.js
Listen to your web pages
@bhenry
bhenry / jruby10.rb
Created July 29, 2016 15:20 — forked from IndianGuru/jruby10.rb
JRuby and Amazon S3
require "rubygems"
require "bundler/setup"
require 'yaml'
require 'aws-sdk'
#require 'jruby-openssl'
bucket_name = "talim"
file_name = "jrubyaws.txt"
@bhenry
bhenry / csv.lua
Created March 20, 2014 23:59 — forked from cuixin/csv.lua
-- 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
@bhenry
bhenry / 20.php
Created May 1, 2012 13:25 — forked from anonymous/20.php
euler 20
<?php
function facto($x){
$r = 1;
for($i=$x;$i>1;$i--){
$r *= $i;
}
return $r;
}
@bhenry
bhenry / mapping_trouble.clj
Created September 7, 2011 18:30 — forked from aufrank/mapping_trouble.clj
mapping trouble
(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))
<?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))
(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)
//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