Skip to content

Instantly share code, notes, and snippets.

still doing homework....

josh bowles jbowles

still doing homework....
Block or report user

Report or block jbowles

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
RatcliffObserhelp distance
SEE tokenizer
[NIST Ratcliff/Obershelp pattern recognition](
Compute the similarity of two strings as the number of matching characters divided by the total number of characters in the two strings.
Matching characters are those in the longest common subsequence plus, recursively, matching characters in the unmatched region on either side of the longest common subsequence.
//Luhn trait
pub trait Luhn {
fn luhn(self) -> bool;
impl Luhn for String {
fn luhn(self) -> bool {
let s = remove_whitespace(&self);
let d = Digits::digits(s);
if d.len() < 16 {
return false;
jbowles / luhn_4_styles_julia.jl
Last active Jul 5, 2018
luhn in julia, 4 styles
View luhn_4_styles_julia.jl
using BenchmarkTools
dbl2nd(da::Array{Int64,1}) = for i in 1:2:(length(da))
da[i] *= 2
mod9(da::Array{Int64,1}) = for i in 1:2:length(da)
if da[i] > 9
da[i] -= 9
jbowles / cz_ue_world_data_enrollment.fsx
Last active Dec 10, 2017
From the fslabbasic template get world bank data (updated version of the getting started example)
View cz_ue_world_data_enrollment.fsx
#load "../packages/FsLab/FsLab.fsx"
(* My Environment
visual studio code 2017 Version 1.18.1
mono --version ‹2.4.1›
Mono JIT compiler version (2017-06/e66d9abbb27 Wed Oct 25 12:10:41 EDT 2017)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors.
TLS: normal
SIGSEGV: altstack
jbowles / fibonacci_two_ways.ex
Created Dec 3, 2014
tail call optimizations through pattern matching in elixir
View fibonacci_two_ways.ex
defmodule Mather do
def numbers(x,y) do
f = fn
x,y when x>0 -> x + y
x,y -> x*y
IO.puts f.(x,y)
# A tail call optimized fibonacci.
View go1.2_brew_install_hack_for_lazy_and_impatient.rb
# Too lazy to make a pull request and too impatient to wait,
# Just tuck 1.2 into the devel version
## First,
## $brew unlink go
## $vim /usr/local/Library/Formula/go.rb
## around line 20 under the `devel' block edit the following
devel do
#url ''
#version '1.2rc5'
jbowles / mstatus.go
Last active Dec 29, 2015
gobike MStatus struct using with megajson experiment
View mstatus.go
package gobike
Example JSON:
jbowles / gobike_handler_megajson.go
Last active Dec 29, 2015
Handler for trying to get megajson to work with HTTP
View gobike_handler_megajson.go
Trying to use megajson with http.Get(url) but getting Decoding errors.
Have tried with various json responses using various structs.
Decoder errors at various indices (depending on json and structs I'm using):
==========Some Decoding Errors===============
2013/11/29 18:27:23 decoding error: Unexpected comma at 112: ,; expected colon // common for NewMStatusJSONDecoder(resp.Body)
2013/11/29 18:29:14 decoding error: Unexpected null at 153: ; expected '{' or string
2013/11/29 18:39:01 decoding error: Unexpected number at 9: 1.1; expected '{'
jbowles / mstatus_decoder.go
Created Nov 30, 2013
Generated code from megajson on MStatus struct
View mstatus_decoder.go
package gobike
import (
type MStatusJSONDecoder struct {
jbowles / easy_token.go
Last active Dec 26, 2015
Easy out of the box natural language tokenizer using Go standard library
View easy_token.go
package main
import (
func main() {
You can’t perform that action at this time.