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
series = [ | |
10, | |
57, | |
33, | |
21, | |
19, | |
20, | |
18, | |
17, | |
24, |
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
alias gis='git status' | |
alias gaa='git add -A' | |
alias gdc='git diff --cached --color=always' | |
alias gdd='git diff --color=always' | |
alias gll='git log --color=always' | |
alias gpr='git pull --rebase' | |
# Show or count differences between branches. | |
# Usage to compare current branch against master: gbdl origin/master.. | |
alias gbcl="git rev-list --pretty=\"%h - %an, %ad : %s\"" | |
alias gbcc="git rev-list --count" |
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
// walkEvents walks an event list applying a hook function. | |
// This is intended to be parallelized. Apply only when the | |
// computation has no dependency on the order in which commits | |
// are processed. | |
// Source: http://esr.ibiblio.org/?p=8607#comment-2365265 | |
func walkEvents(events []Event, hook func(int, Event)) { | |
if control.flagOptions["serial"] { | |
for i, e := range events { | |
hook(i, e) | |
} |
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> | |
<script type="text/javascript"> | |
// https://github.com/mhwombat/grid/wiki/Triangular-tiles | |
function rectTriGrid(r, c) { | |
var res = []; | |
for (var y = 0; y <= 2*r-1; y++) { | |
for(var x = xMin(y); x <= xMax(c, y); x++) { |
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 <lua5.3/lua.hpp> | |
#include <stdlib.h> | |
#include <stdio.h> | |
static int draw_rectangle(lua_State *L) | |
{ | |
printf("function called\n"); | |
return 1; |
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
package main | |
import ( | |
"bufio" | |
"encoding/json" | |
"flag" | |
"fmt" | |
"io" | |
"io/ioutil" | |
"log" |
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
package main | |
import ( | |
"fmt" | |
"math" | |
) | |
// Cumulative distribution function for the standard normal distribution | |
// Percentage of data that lies within the standard distribution | |
func cdfNorm(x float64) float64 { |
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
package convert | |
/* | |
Usage, assuming o is a map[string]interface{} | |
errs := []error{} | |
errs = append(errs, c.AsString(c.FromUntypedMap(o, "nr")).Assign(&tmp.OrderId)) | |
errs = append(errs, c.AsString(c.FromUntypedMap(o, "status")).Assign(&tmp.Status)) | |
errs = append(errs, c.AsTime(c.FromUntypedMap(o, "date")).Assign(&tmp.Date)) | |
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
package main | |
import ( | |
"fmt" | |
"image" | |
_ "image/png" | |
"log" | |
"os" | |
) |
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
require(igraph) | |
require(expm) | |
G <- graph.tree(n=7,children=2) | |
V(G)$name <- LETTERS[1:length(V(G))] | |
co <- layout.reingold.tilford(G, params=list(root=1)) | |
plot(G, layout=co) | |
NewerOlder