I hereby claim:
- I am film42 on github.
- I am film42 (https://keybase.io/film42) on keybase.
- I have a public key whose fingerprint is CF06 2F6F 984C 0FA7 F955 A9D4 B42B B29C 5E42 9824
To claim this, I am signing this object:
require 'thread' | |
## | |
## THREADING EXAMPLE | |
## | |
## Ruby's array append is not "thread safe." This means that real | |
## concurrency models will have collision issues. This is not a good | |
## thing, but we'll find we can use real threading constructs to | |
## protect code that isn't "thread safe." Run this code on MRI and | |
## then try running this in jRuby and compare the results. |
package id3 | |
/** | |
* Created by: film42 on: 3/6/15. | |
*/ | |
object DecisionTreeUtils { | |
type Vector[A] = List[A] | |
type Matrix[A] = List[Vector[A]] |
(ns hn.realtime | |
(:require [cheshire.core :refer :all])) | |
(def base-url "https://hacker-news.firebaseio.com/v0") | |
(defn get-updates | |
"Return response regardless of condition" | |
[] (parse-string (slurp (str base-url "/updates.json")) true)) | |
(defprotocol IPoller |
(ns prime) | |
;; (coll, n) -> coll' | |
(defn- prime-check [coll n] | |
(empty? (filter #(zero? (mod n %)) coll))) | |
(defn is-prime? [n] | |
(loop [prime-list [] value 2] | |
(cond | |
;; Have the list, check for prime |
public class SpiralMatrix { | |
public static void spiralPrint( int[][] matrix ) { | |
int height = matrix.length; | |
int width = matrix[0].length; | |
int currCol = 0; | |
int currRow = 0; |
I hereby claim:
To claim this, I am signing this object:
#include <vector> | |
#include <map> | |
namespace postal { | |
template< class T > | |
class broker { | |
public: | |
typedef std::vector< std::function< void ( T ) > > FuncVector; |
#include <iostream> | |
#include <vector> | |
#include <fstream> | |
#include <string> | |
#include <cmath> | |
#include "functional.h" | |
#include "graph.h" | |
// DATA PARSING |
auto pi_series = []( long limit ){ | |
return rxcpp::observable<>::range(1, limit) | |
.map([](int k) { | |
return ( k % 2 == 0 ? -4 : 4 ) / ( long double )( ( 2 * k ) - 1 ); | |
}) | |
.sum() | |
.as_dynamic(); | |
}; |
// | |
// knn.h | |
// k_nearest_neighbor | |
// | |
// http://burakkanber.com/blog/machine-learning-in-js-k-nearest-neighbor-part-1/ | |
// | |
// Created by Garrett Thornburg on 8/1/14. | |
// Copyright (c) 2014 gt. All rights reserved. | |
// |