Skip to content

Instantly share code, notes, and snippets.

View PhDP's full-sized avatar
🏠
Working from home

Philippe Desjardins-Proulx PhDP

🏠
Working from home
View GitHub Profile
(ns type-level-tagger
{:doc "Implements State-of-the-art Unsupervised Part-of-speech Tagger
from \"Simple Type-Level Unsuperivsed POS Tagging\"
by Yoong-Keok Lee, Aria Haghighi and Regina Barzilay
(http://www.cs.berkeley.edu/~aria42/pubs/typetagging.pdf)
blog post: http://wp.me/pcW6S-x"
:author "Aria Haghighi (aria42@gmail.com)"}
(:use [clojure.java.io :only [reader]]
[clojure.contrib.duck-streams :only [with-out-writer]]
[clojure.contrib.seq-utils :only [indexed]]
@mre
mre / llvm_clang_eclipse.md
Last active February 28, 2020 08:03
LLVM, clang and clang++ under Eclipse

How to setup llvm and clang for eclipse

This guide is many years old is most likely outdated. I'll keep it here for reference; use at your own risk.

Tested on Mac OSX 10.6.7 with LLVM and CLANG version 2.9 Eclipse Helios Service Release 1 (Build 20100917-0705)

1) Installing LLVM and clang

@ckirkendall
ckirkendall / clojure-match.clj
Created June 15, 2012 02:26 — forked from bkyrlach/Expression.fs
Language Compare F#, Ocaml, Scala, Clojure, Ruby and Haskell - Simple AST example
(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})
@tpoisot
tpoisot / pylogis.py
Created September 10, 2012 20:14
Fit logistic growth with Python / probably poorly written, but the job is done
## PyLogis
import numpy as np
import scipy as sp
import matplotlib.pyplot as plt
# Param orders: r, K
def logis(x, y, p):
est = []
@kristianlm
kristianlm / gist:4108390
Created November 19, 2012 00:50
Running ViennaCL on Amazon GPU cluster (cg1.4xlarge)
[ec2-user@ip-10-33-4-246 grub]$ lspci
00:00.0 Host bridge: Intel Corporation 440FX - 82441FX PMC [Natoma] (rev 02)
00:01.0 ISA bridge: Intel Corporation 82371SB PIIX3 ISA [Natoma/Triton II]
00:01.1 IDE interface: Intel Corporation 82371SB PIIX3 IDE [Natoma/Triton II]
00:01.3 Bridge: Intel Corporation 82371AB/EB/MB PIIX4 ACPI (rev 01)
00:02.0 VGA compatible controller: Cirrus Logic GD 5446
00:03.0 3D controller: nVidia Corporation GF100 [Tesla S2050] (rev a3)
00:04.0 3D controller: nVidia Corporation GF100 [Tesla S2050] (rev a3)
00:05.0 Unassigned class [ff80]: XenSource, Inc. Xen Platform Device (rev 01)
@chrisfraser
chrisfraser / .hgignore
Created February 1, 2013 09:02
A full list of entries for the .hgignore file when using VS2012.
# use glob syntax
syntax: glob
*.obj
*.pdb
*.user
*.aps
*.pch
*.vspscc
*.vssscc
@PhDP
PhDP / networks.R
Last active December 16, 2015 08:59
Functions to generate geometric networks: random geometric graphs, connected random geometric graphs, random geometric trees.
# Functions to generate networks ("graphs") for spatial ecology.
#
# Stores the graph in a rather inefficient (but easy-to-use) adjacency matrix
# of boolean values.
#
# Key functions:
# - geograph returns a random geometric graph.
# - cgeograph returns a connected random geometric graph.
# - geotree returns a random geometric tree.
#
@mathias-brandewinder
mathias-brandewinder / gist:5558573
Last active October 31, 2023 05:05
Stub for F# Machine Learning Dojo
// This F# dojo is directly inspired by the
// Digit Recognizer competition from Kaggle.com:
// http://www.kaggle.com/c/digit-recognizer
// The datasets below are simply shorter versions of
// the training dataset from Kaggle.
// The goal of the dojo will be to
// create a classifier that uses training data
// to recognize hand-written digits, and
// evaluate the quality of our classifier
@PhDP
PhDP / scriptoria-mockup.html
Last active December 19, 2015 03:49
A first (failed) design for Scriptoria based on a Bootstrap example. I like the Orange/Red theme (revolution!!!!), and I like the idea of having each article in a small touch-friendly orange box, but it's very hard to read... UPDATE: I now use a less obnoxious color theme.
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<title>Scriptoria -- a database of scientific documents written with distributed revision control systems.</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
@PhDP
PhDP / measure.cc
Last active December 20, 2015 07:29
The measure as defined in the Porter algorithm.
/**
* Computes the measure of an English word as defined for the Porter algorithm.
* The definition of the measure can be found here:
* http://snowball.tartarus.org/algorithms/porter/stemmer.html
*
* ...but it's overtly complicated. Here's my definition:
*
* The *measure* of a word is the number of vowels followed by a consonant.
*
* Examples: