brew install homebrew/dupes/expect
unbuffer ./blablabla | ... | ...
add this stuff: | |
<build> | |
<plugins> | |
<plugin> | |
<artifactId>maven-assembly-plugin</artifactId> | |
<configuration> | |
<archive> | |
<manifest> | |
<mainClass>com.nicolamontecchio.gnappo.Gnappo</mainClass> |
cmake_minimum_required(VERSION 2.6) | |
project(ml) | |
add_library(boost_po STATIC IMPORTED) | |
set_property(TARGET boost_po PROPERTY | |
IMPORTED_LOCATION /usr/local/lib/libboost_program_options.a) | |
set(CMAKE_CXX_FLAGS "-std=c++11 -stdlib=libc++") |
def sample_discrete(probabilities): | |
bins = np.add.accumulate(probabilities) | |
return np.digitize([random.random()], bins) |
Force git to overwrite local files on pull (fixed homebrew w/ this) | |
git fetch --all | |
git reset --hard origin/master | |
find ip address from cmdline | |
wget -qO- http://ipecho.net/plain ; echo | |
package com.nicolamontecchio.chroma; | |
import java.io.*; | |
import javax.sound.sampled.*; | |
/** | |
* Read an audio file. Provided that the appropriate packages are in the classpath, mp3 and ogg should be readable too. The safest route is to read from a MONO, WAV file. | |
*/ | |
public class AudioReader { |
#include <Python.h> | |
static PyObject* say_hello(PyObject* self, PyObject* args) | |
{ | |
const char* name; | |
if (!PyArg_ParseTuple(args, "s", &name)) | |
return NULL; | |
printf("Hello %s!\n", name); |
;; ;; config using mac-port of emacs, | |
;; ;; see https://github.com/railwaycat/emacs-mac-port | |
;; ;; mac switch meta key | |
(setq mac-option-modifier 'meta) | |
(setq mac-command-modifier 'hyper) | |
(setq package-archives '(;;("gnu" . "http://elpa.gnu.org/packages/") | |
;;("marmalade" . "http://marmalade-repo.org/packages/") | |
("melpa" . "http://melpa.milkbox.net/packages/"))) |
find . -name "*.dat" -exec cat {} \; > filename |
;; zip sequences: | |
(map vector v1 v2 v3 ...) |