Smart approach to k-means: http://www.mattpeeples.net/kmeans.html
Nelder-Mead optimization: http://www.brnt.eu/phd/node10.html#SECTION00622200000000000000
http://scottlocklin.wordpress.com/2014/07/22/neglected-machine-learning-ideas/
http://www.serpentine.com/blog/2014/06/10/win-bigger-statistical-fights-with-a-better-jackknife/
https://en.wikipedia.org/wiki/Katz_centrality
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from urllib import request | |
from sys import argv, stdout, stderr | |
from time import sleep | |
from random import randrange | |
import re | |
def main(argv): | |
if len(argv) == 1: | |
try: | |
with open(argv[0], 'r') as f: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hsv.scale <- function (var, hmin, hmax=hmin, smin=1, smax=smin, vmin=1, vmax=vmin, | |
na.col=rgb(0.75, 0.75, 0.75)) | |
{ | |
var.min <- min(var, na.rm=TRUE) | |
var.max <- max(var, na.rm=TRUE) | |
h.f <- approxfun(c(var.min, var.max), c(hmin, hmax)) | |
s.f <- approxfun(c(var.min, var.max), c(smin, smax)) | |
v.f <- approxfun(c(var.min, var.max), c(vmin, vmax)) | |
tmp <- var |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
pdf("example.pdf") | |
on.exit(dev.off()) | |
plot(some.data) | |
})() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<style type="text/css"> | |
body { | |
-moz-columns: 20em; | |
-webkit-columns: 20em; | |
columns: 20em; | |
-moz-column-gap: 2em; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
g++ -std=c++11 -Wall -Wextra -c dlltest.cpp | |
g++ -shared -static-libgcc -static-libstdc++ -o dlltest.dll dlltest.o -Wl,--add-stdcall-alias |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
constexpr int fac(int n) | |
{ | |
return n <= 0 ? 1 : n * fac(n - 1); | |
} | |
struct [[weenie]] C { | |
void f() && { std::cout << "dying C's last gasp!\n"; } | |
void f() & { std::cout << "living, breathing C\n"; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <ios> | |
#include <iomanip> | |
#include <cstring> | |
#include <cstdlib> | |
int main(int argc, char **argv) | |
{ | |
if (argc != 2) { | |
std::cerr << "Usage: " << (argc ? argv[0] : "double") << " <number>\n"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Option Explicit | |
Public Function arrayAddress(ByRef arr() As Double) As Long | |
arrayAddress = VarPtr(arr(0)) | |
End Function | |
Public Sub investigateArrays() | |
Dim d(0 To 9) As Double | |
Dim x() As Double | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CXX=g++ | |
CXXOPTS=-std=c++11 -pedantic -Wall -Wextra -Werror -static-libgcc -static-libstdc++ | |
OPTOPTS=-O3 -fno-exceptions -fno-rtti -ffast-math -mfpmath=387 -msse3 -mtune=core2 -funroll-loops -s | |
DLLOPTS=-shared | |
LINKOPTS=-Wl,--add-stdcall-alias | |
LOG= | |
#LOG=-DLOGGING="log.txt" | |
callback.dll: callback.o | |
$(CXX) $(CXXOPTS) $(LOG) $(OPTOPTS) $(DLLOPTS) -o callback.dll callback.o $(LINKOPTS) |
OlderNewer