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
| mm@cereal:~/dytest$ rustc -C prefer-dynamic --crate-type=dylib fooz.rs | |
| mm@cereal:~/dytest$ cat fooz.rs | |
| #[no_mangle] | |
| pub extern "C" fn foo(x: int) { | |
| println!("Cowabunga, {}", x); | |
| } | |
| mm@cereal:~/dytest$ cat test.py | |
| import ctypes | |
| fooz = ctypes.CDLL("/home/mm/dytest/libfooz-afaf02c9-0.0.so") |
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
| #[link(name="python2.7")] | |
| extern { | |
| fn Py_SetProgramName(name: *u8); | |
| fn Py_Initialize(); | |
| fn PyRun_SimpleString(command: *u8); | |
| fn Py_Finalize(); | |
| } | |
| fn main() { | |
| let args = std::os::args(); |
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
| LD_PRELOAD=/usr/lib/libclang.so ./bindgen -I /usr/lib/clang/3.4.1/include/ | |
| #the LD_PRELOAD helps it pickup the right clang version | |
| #the -I gives it clang's include files |
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
| function draw_pie_chart(container_selector, name, title, data) { | |
| // Build the chart | |
| $(container_selector).highcharts({ | |
| chart: { | |
| plotBackgroundColor: null, | |
| plotBorderWidth: null, | |
| plotShadow: false | |
| }, | |
| title: { |
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
| * Density of Real Numbers in R | |
| ∀a,b ∈ R, such that a < b, ∃t ∈ R such that a < t < b | |
| ** Proof | |
| ∀a, b, ∈ R, such that a < b | |
| let t = (a + b)/2 ∈ R since a, b ∈ R | |
| let δ = (b - a)/2 ∈ R |
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
| ~/p/vispy colorbar-vispy-plot *$ radon cc vispy -nc -a Sun Aug 2 00:36:08 IST 2015 | |
| vispy/scene/canvas.py | |
| M 321:4 SceneCanvas._process_mouse_event - C | |
| M 392:4 SceneCanvas._visual_bounds_at - C | |
| vispy/scene/visuals.py | |
| F 133:0 generate_docstring - C | |
| vispy/scene/cameras/base_camera.py | |
| M 227:4 BaseCamera.set_range - C | |
| vispy/scene/cameras/panzoom.py | |
| M 191:4 PanZoomCamera.viewbox_mouse_event - C |
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/env bash | |
| # automatically abort if any command fails | |
| set -e | |
| echo "This script assumes superuser privileges. You might have to run this script with sudo" | |
| echo "Installing dependencies required by sandhi..." | |
| apt-get update | |
| apt-get -y install git git-core autoconf automake make libtool g++ python-dev swig \ |
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
| call plug#begin('~/.vim/plugged') | |
| "Core | |
| Plug 'terryma/vim-expand-region' | |
| Plug 'Valloric/YouCompleteMe' | |
| Plug 'kien/ctrlp.vim' | |
| Plug 'majutsushi/tagbar' | |
| Plug 'ervandew/supertab' |
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
| alias airport="/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport" | |
| CURRENT_WIFI_SSID=$(eval airport -I | grep '^[[:space:]]*SSID' | sed -e 's/^.*SSID: //g') | |
| proxy() { | |
| export addy='http://www-west.sony.com:80' | |
| git config --global http.proxy $addy | |
| git config --global https.proxy $addy | |
| npm config set http-proxy $addy | |
| npm config set https-proxy $addy |
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
| {-# LANGUAGE StandaloneDeriving #-} | |
| {-# LANGUAGE FlexibleContexts #-} | |
| {-# LANGUAGE UndecidableInstances #-} | |
| module Main where | |
| data Free f a = Pure a | Branch (f (Free f a)) | |
| deriving instance (Show a, Show (f (Free f a))) => Show (Free f a) | |