This is my recommended path for learning Haskell.
This file contains hidden or 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
#define USE_ROBIN_HOOD_HASH 1 | |
#define USE_SEPARATE_HASH_ARRAY 1 | |
template<class Key, class Value> | |
class hash_table | |
{ | |
static const int INITIAL_SIZE = 256; | |
static const int LOAD_FACTOR_PERCENT = 90; | |
struct elem |
This file contains hidden or 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
#load "packages/FsLab/FsLab.fsx" | |
open FSharp.Data | |
open XPlot.GoogleCharts | |
let bondUrl = "https://en.wikipedia.org/w/index.php?title=List_of_James_Bond_films&oldid=688916363" | |
type BondProvider = HtmlProvider<"https://en.wikipedia.org/w/index.php?title=List_of_James_Bond_films&oldid=688916363"> | |
let bondWiki = BondProvider.Load(bondUrl) |
This file contains hidden or 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
(use '[clojure.core.match :only [match]]) | |
(defn evaluate [env [sym x y]] | |
(match [sym] | |
['Number] x | |
['Add] (+ (evaluate env x) (evaluate env y)) | |
['Multiply] (* (evaluate env x) (evaluate env y)) | |
['Variable] (env x))) | |
(def environment {"a" 3, "b" 4, "c" 5}) |
This file contains hidden or 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
#! /usr/bin/python2 | |
import json | |
from TwitterAPI import TwitterAPI | |
c_key = '...' | |
c_sec = '...' | |
t_key = '...' | |
t_sec = '...' |
This file contains hidden or 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
{ | |
"$schema": "http://json-schema.org/draft-04/schema#", | |
"title": "Scriptoria object", | |
"description": "Meta-data about a publication registered in scriptoria", | |
"type": "object", | |
"properties": { | |
"source": { | |
"description": "URL of the original repository", | |
"type": "string" | |
}, |
This file contains hidden or 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
typedef struct | |
{ | |
unsigned int id; | |
Params *p; | |
} | |
pth; | |
void treatments(void *param, unsigned long s) | |
{ | |
//------------// |
This file contains hidden or 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
void create_assembled_pool(Params *p, double **pool, int divpool, double fert) | |
{ | |
// define and initialize the ecosystem list | |
//----------------------------------------- | |
sll ecosys; | |
sll_init(&ecosys,(void*)free_species); | |
// create the basal resources | |
//--------------------------- | |
basal(p,&ecosys,fert); |
This file contains hidden or 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
// clang -O3 -DHAVE_INLINE rngint.c -o rngint -lgsl -lgslcblas | |
#include <stdlib.h> | |
#include <stdio.h> | |
#include <time.h> | |
#include <gsl/gsl_rng.h> | |
#include <gsl/gsl_randist.h> | |
// Get an integer in the [a,b) semi-closed range. |