Skip to content

Instantly share code, notes, and snippets.

library(wavelets)
load_data <- function(filename, row) {
data = read.csv(filename, header=FALSE, sep=",")
return(data[[row]])
}
wavelet_transform <- function(data) {
Wavelet_out = matrix(0, 1, 8)
https://www.cs.swarthmore.edu/~turnbull/cs67/s09/labs/lab05.pdf
http://nxn.se/post/90198924975/extract-cluster-elements-by-color-in-python
https://joernhees.de/blog/2015/08/26/scipy-hierarchical-clustering-and-dendrogram-tutorial/
http://databasefaq.com/index.php/answer/205523/python-scipy-hierarchical-clustering-dendrogram-cutting-scipy-hierarchical-dendrogram-into-clusters-via-a-threshold-value
http://brandonrose.org/clustering
@geraldstanje
geraldstanje / gist:e2f6f3c35103460629fae54a5cc97109
Last active May 13, 2016 18:24
hex binning with Leaflet.js
http://jsfiddle.net/ts4oyyn0/10/
cc http://coagisweb.cabq.gov/arcgis/rest/services/public/environmentalissues/MapServer/1/query&#8221
http://bl.ocks.org/wboykinm/29ef7eda9e28932353fd
http://stackoverflow.com/questions/35468510/binning-data-into-a-hexagonal-grid-in-google-maps
http://stackoverflow.com/questions/19830527/using-d3-to-create-a-density-value-heatmap-layer-for-leaflet
python:
%html{:lang => "en", "ng-app" => "myApp"}
%head
%script{:src => "http://ajax.googleapis.com/ajax/libs/angularjs/1.0.5/angular.min.js"}
%script{:src => "https://maps.googleapis.com/maps/api/js?v=3.6&?key=AIzaSyAkyvfxLRt8uJ3gZlduH38ZQSF30_5N9cA&sensor=true"}
%script{:src => "http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"}
%meta{:charset => "utf-8"}/
%title My AngularJS App
%body
.container-fluid
.row
@geraldstanje
geraldstanje / gist:50ba6ce5fa872fb51b9a
Last active March 12, 2016 23:08
webgl tutorials
http://www.merixstudio.com/blog/webgl-hype-future-digital-interactive/
http://jsfiddle.net/ksRyQ/?utm_source=website&utm_medium=embed&utm_campaign=ksRyQ
https://aerotwist.com/tutorials/getting-started-with-three-js/
https://webglfundamentals.org/
https://www.shadertoy.com/view/XdsXRf
https://www.shadertoy.com/view/4s2SRt
http://stackoverflow.com/questions/18353107/radar-scanner-effect-using-jquery
http://jsbin.com/AMag/6/edit?html,css,js,console,output
https://github.com/lucasfilippi/d3-radar
http://codepen.io/jackrugile/pen/wqLsn
view-source:http://lab.hakim.se/radar/
http://stackoverflow.com/questions/18353107/radar-scanner-effect-using-jquery
https://github.com/shineforyou/PlaneRadar
view-source:http://s.codepen.io/jackrugile/fullpage/wqLsn?
@geraldstanje
geraldstanje / gist:6d51cbb84702bff4bb06
Last active January 18, 2016 12:30
get the max memory usage of an app
# start the app:
while true; do ./main; sleep 0.1; done;
# monitor:
max=0;
for i in {1..200};
do
x=`ps aux | grep -m1 main | awk '{print $6}'`;
if [ $x -gt $max ]; then
max=$x;
http://www.jonathanbeard.io/tutorials/FlexBisonC++
https://github.com/melihovv/JsonParser/tree/master/JsonParser
https://github.com/51103220/Assembly-Parser
@geraldstanje
geraldstanje / gist:885782cc3f6570637ca9
Last active October 23, 2015 19:36
C++ performance tutorials / talks
http://people.cs.clemson.edu/~dhouse/courses/405/papers/optimize.pdf
Chandler Carruth "Efficiency with Algorithms, Performance with Data Structures":
https://www.youtube.com/watch?v=fHNmRkzxHWs
Scott Meyers - The evolving search for effective C++ - Keynote @ Meeting C++ 2014:
https://www.youtube.com/watch?v=smqT9Io_bKo
Writing Quick Code in C++, Quickly:
https://www.youtube.com/watch?v=MvFj8qo1iuA
1. Dining philosopher
2. Given a random number generator that returns a number between [0,1], how would you build a RNG that accounted for weighting?
3. You have two arrays with N integers in them. Merge those arrays using a recursive algorithm so that the integers in the final array are sorted.
4. generators(in python) and about minesweeper.
5. given a query and a document, highlight the query in the document and return a snippet of the document itself. Don't use existing large 3rd party libraries.
6. Finding the longest palindrome in a given string.
7. query log, and how to get the top K most frequent ones
8. Maximum subarray problem
9. Generate all permutations of an alphanumeric string (lowercase/uppercase only if a letter) 10. How can you improve the service of Y?
11. Pick a random number from weighted list based on weight