Skip to content

Instantly share code, notes, and snippets.

@egonSchiele
egonSchiele / diners.hs
Last active April 23, 2022 17:29
Dining philosophers solution in Haskell using STM. Taken from http://rosettacode.org/wiki/Dining_philosophers#Haskell with some minor modifications.
import Control.Monad
import Control.Concurrent
import Control.Concurrent.STM
import System.Random
import Text.Printf
-- Forks
type Fork = TMVar Int
newFork :: Int -> IO Fork
@reetinder
reetinder / haskell-org.el
Created November 6, 2012 06:30
Literate Haskell with Org Mode Documentation
;;; haskell-org.el --- Literate Haskell with Org Mode Documentation
;; Copyright (C) 2003, 2007 Free Software Foundation, Inc.
;; Authors: Dave Love <fx@gnu.org>
;; Keywords: languages, wp
;; Created: Sept 2003
;; $Revision: 1.5 $
;; URL: http://www.loveshack.ukfsn.org/emacs
;; Modified by Reetinder Sidhu on oct. 30, 2012 for org-mode support.
@alexott
alexott / minimial-cedet-config.el
Created October 22, 2012 07:30
Working configuration for CEDET from bzr & GNU Emacs (with working C++ & Java name completion)
;;; minimial-cedet-config.el --- Working configuration for CEDET from bzr
;; Copyright (C) Alex Ott
;;
;; Author: Alex Ott <alexott@gmail.com>
;; Keywords: cedet, C++, Java
;; Requirements: CEDET from bzr (http://cedet.sourceforge.net/bzr-repo.shtml)
;; Do checkout of fresh CEDET, and use this config (don't forget to change path below)
@timelyportfolio
timelyportfolio / jgb data.r
Created October 16, 2012 21:49
japanese governement bond jgb historical data
#get Japan yield data from the Ministry of Finance Japan
#data goes back to 1974
require(latticeExtra)
require(xtsExtra)
url <- "http://www.mof.go.jp/english/jgbs/reference/interest_rate/"
filenames <- paste("jgbcme",c("","_2010","_2000-2009","_1990-1999","_1980-1989","_1974-1979"),".csv",sep="")
#load all data and combine into one jgb data.frame
@mbostock
mbostock / .block
Last active February 9, 2016 01:04 — forked from mbostock/.block
Irregular Histogram
license: gpl-3.0