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:
| $ film42@mbp ~/D/D/S/C/t/a/build (master)> | |
| valgrind --leak-check=full --dsymutil=yes ./avl_tree_tests | |
| ==65466== Memcheck, a memory error detector | |
| ==65466== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al. | |
| ==65466== Using Valgrind-3.11.0.SVN and LibVEX; rerun with -h for copyright info | |
| ==65466== Command: ./avl_tree_tests | |
| ==65466== | |
| --65466-- run: /usr/bin/dsymutil "./avl_tree_tests" | |
| Running test: Contains Tests | |
| Malloc'd tree |
| 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(); | |
| }; |