{{ message }}

Instantly share code, notes, and snippets.

Ian Channing ianchanning

Last active May 11, 2016
internationalized version of wp-bcrypt
View wp-bcrypt.php

Created May 10, 2016
Copied from http://preshing.com/files/xkcd_pw.js.php
View xkcd_pw.js
 //------------------------------------------------------------------- // Copyright (c) 2011, Jeff Preshing // http://preshing.com/20110811/xkcd-password-generator // All rights reserved. // // Some parts based on http://www.mytsoftware.com/dailyproject/PassGen/entropy.js, copyright 2003 David Finch. // // Released under the Modified BSD License: // // Redistribution and use in source and binary forms, with or without
Created May 10, 2016
View hash_verify.php
Last active Apr 6, 2016
A Matlab program to iterate the logistic map - Dana Kester (with slight modifications by me)
View BifurDiag.m
 % http://www.po.gso.uri.edu/tracking/tracking/chaos/presentations/bifurcationmicroscope/ %BifurDiag.m is a Matlab program to construct a bifurcation diagram for the logistic map %to allow exploring the period doubling route to Chaos. Dana Kester, Oct. 2002 % The logistic map is x[t+1] = r*x[t]*(1-x[t]) where 0 < r < 4 is a parameter % value and 0 < x[t] < 1 is a variable. The user specifies the following: % rmin = the lowest value of r to three decimals (or maybe two decimals) % rmax = the highest value of r to three decimals (or maybe two decimals) % xo = initial value of x[t] % num = number of iterations
Last active Dec 27, 2016
View pascal-functional-learnings.md

This is my attempt at converting a solution to a pascal's triangle problem that I'd written in an imperitive manner into a functional one. I kind of hope that anyone reading this is also trying to figure out the meanings behind functional programming, I'm trying to describe all the steps that I go through.

It is a mini way of me trying to discover what being 'declarative' actually means.

I know the kind of definition e.g.:

1. "say what you want" not "how to do it"
2. picture vs recipie
3. `sqrt(2)` vs looping from `x = 1` finding the mean of `x` and `2/x`
4. SQL, Haskell vs C++, Java
Created Feb 3, 2016
Shortcut target to save command history to history.log
View doskey-shortcut.bat
 %windir%\system32\cmd.exe /K doskey exit=doskey/history\$g\$g%USERPROFILE%\history.log\$texit \$1 \$2
Last active Feb 3, 2016
Dos command history
View doskey.bat
 doskey /history >> %USERPROFILE%\history.txt%
Last active Apr 4, 2016
View segment-trees.md

Segment Trees

Wow they seem overly complex to learn about. They're a very easy concept, but there is a paucity of resources for explaining them.

Have a gander at the resources at the bottom for the ones I came across. Took me ages to figure out the differences between them.

Here, I assume you know about Binary Trees and recursion on Binary Trees.

Any code is in python which is about as close to pseudo code as you can get.

Last active Sep 8, 2019
What are the differences between segment trees, interval trees, binary indexed trees and range trees?
`k` is the number of reported results