Skip to content

Instantly share code, notes, and snippets.

@estk
estk / main.go
Created Dec 14, 2016
A Tour of Go: Web Crawler Solution
View main.go
package main
import (
"fmt"
"sync"
)
type Crawler struct {
crawled map[string]bool
mux sync.Mutex
View .zpreztorc
#
# Sets Prezto options.
#
# Authors:
# Sorin Ionescu <sorin.ionescu@gmail.com>
#
#
# General
#
@estk
estk / .gitignore
Last active Aug 29, 2015
Network Flow Solver
View .gitignore
bower_components
*.swp
*.swo
View 2010-nums.csv
CIP6 name number percentage cumulativePercentage
42.0101 Psychology, General 382 0.1095183486238532 0.1095183486238532
52.0601 Business/Managerial Economics 356 0.10206422018348624 0.21158256880733944
23.9999 English Language and Literature/Letters, Other 216 0.06192660550458716 0.2735091743119266
03.0103 Environmental Studies 215 0.06163990825688073 0.3351490825688073
45.0201 Anthropology 156 0.04472477064220184 0.3798738532110092
54.0101 History, General 155 0.04443807339449541 0.4243119266055046
45.1101 Sociology 145 0.04157110091743119 0.46588302752293576
26.0406 Cell/Cellular and Molecular Biology 122 0.034977064220183485 0.5008600917431193
50.0701 Art/Art Studies, General 121 0.034690366972477064 0.5355504587155964
View randomInterval.hs
import System.Random
import Data.List
import Graphics.EasyPlot
-- Testing Aparatus
--
repeatTimes = 1000
testInstanceNum = 1000
trainInstanceNums = [100,200..1000]
View RadarChart.js
//Practically all this code comes from https://github.com/alangrafu/radar-chart-d3
//I only made some additions and aesthetic adjustments to make the chart look better
//(of course, that is only my point of view)
//Such as a better placement of the titles at each line end,
//adding numbers that reflect what each circular level stands for
//Not placing the last level and slight differences in color
//
//For a bit of extra information check the blog about it:
//http://nbremer.blogspot.nl/2013/09/making-d3-radar-chart-look-bit-better.html
//
View index.html
<!DOCTYPE html>
<meta charset="utf-8">
<style>
.container {
height: 400px;
display: flex;
justify-content:center;
align-items: center
}
View RadarChart.js
//Practically all this code comes from https://github.com/alangrafu/radar-chart-d3
//I only made some additions and aesthetic adjustments to make the chart look better
//(of course, that is only my point of view)
//Such as a better placement of the titles at each line end,
//adding numbers that reflect what each circular level stands for
//Not placing the last level and slight differences in color
//
//For a bit of extra information check the blog about it:
//http://nbremer.blogspot.nl/2013/09/making-d3-radar-chart-look-bit-better.html
//
@estk
estk / bundler.js
Created Aug 21, 2013
Don't mangle "$super".
View bundler.js
@@ -527,7 +527,7 @@ _.extend(Bundle.prototype, {
var combinedCode = codeParts.join('\n;\n');
var finalCode = uglify.minify(
- combinedCode, {fromString: true, compress: {drop_debugger: false}}).code;
+ combinedCode, {fromString: true, compress: {drop_debugger: false}, mangle: {except: ["$super"]}}).code;
addFile('js', finalCode);
@estk
estk / graph02.c
Created Jun 9, 2012
Portability problem with pa02
View graph02.c
128c128
< for (int i=0; edges[i] != nilEdge; i++) {
---
> for (int i=0; edges[i] != 0; i++) {
138c138
< edge_ref *edges = malloc (maxN * sizeof (struct edge));
---
> edge_ref *edges = calloc (maxN, sizeof (struct edge));