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
type Link | |
name::String | |
linkFun::Function | |
linkInv::Function | |
muEta::Function | |
end | |
type Dist | |
name::String | |
variance::Function |
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
# in http://dmbates.blogspot.com/2012/03/pk-models-in-r-and-in-julia.html I describe | |
# the motivation behind these functions. The test data is extracted from an R data set | |
# Use semicolons between elements to ensure this is a vector | |
Time = [0; 0.25; 0.57; 1.12; 2.02; 3.82; 5.1; 7.03; 9.05; 12.12; 24.37; 0; 0.27; 0.52; 1; 1.92; 3.5; 5.02; 7.03; 9; 12; 24.3; 0; 0.27; 0.58; 1.02; 2.02; 3.62; 5.08; 7.07; 9; 12.15; 24.17; 0; 0.35; 0.6; 1.07; 2.13; 3.5; 5.02; 7.02; 9.02; 11.98; 24.65; 0; 0.3; 0.52; 1; 2.02; 3.5; 5.02; 7.02; 9.1; 12; 24.35; 0; 0.27; 0.58; 1.15; 2.03; 3.57; 5; 7; 9.22; 12.1; 23.85; 0; 0.25; 0.5; 1.02; 2.02; 3.48; 5; 6.98; 9; 12.05; 24.22; 0; 0.25; 0.52; 0.98; 2.02; 3.53; 5.05; 7.15; 9.07; 12.1; 24.12; 0; 0.3; 0.63; 1.05; 2.02; 3.53; 5.02; 7.17; 8.8; 11.6; 24.43; 0; 0.37; 0.77; 1.02; 2.05; 3.55; 5.05; 7.08; 9.38; 12.1; 23.7; 0; 0.25; 0.5; 0.98; 1.98; 3.6; 5.02; 7.03; 9.03; 12.12; 24.08; 0; 0.25; 0.5; 1; 2; 3.52; 5.07; 7.07; 9.03; 12.05; 24.15] | |
# Or use the columnization indexing trick, this also work |
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
module Total where | |
import Data.Char | |
import System.IO | |
main = do | |
contents <- readFile "numbers.txt" | |
print $ add_up contents | |
add_up :: String -> Double |
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("ode.jl") | |
#load("winston.jl") | |
msdsys(t,y,m,b,k,Fext,xoff) = [0 1; -k./m b./m]*y + [0 0; sin(t.^2)./m k./m]*[Fext xoff]' | |
msdsys(t,y) = msdsys(t, y, 5, -0.5, 50, 0, 0) | |
function msd_analytic(t, m, b, k, x0) | |
wn = sqrt(k./m) | |
zeta = -b./m./2./wn | |
wd = wn.*sqrt(1-zeta.^2) |
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
''' | |
Usage: python getHeart.py YOURCODE [email protected] someregex | |
The "someregex" matches against the link text. | |
For instance: | |
* "flac" will get all the FLAC downloads | |
* "flac|VIDEO" will get FLAC and video | |
and so on. | |
''' | |
import os |
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
from base64 import b64decode | |
import struct | |
from zlib import crc32 | |
b64alphabet = [] | |
b64alphabet.extend([chr(x) for x in range(ord('A'),ord('Z')+1)]) | |
b64alphabet.extend([chr(x) for x in range(ord('a'),ord('z')+1)]) | |
b64alphabet.extend([chr(x) for x in range(ord('0'),ord('9')+1)]) | |
b64alphabet.extend(['+', '/']) |
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
package com.olearyp.ponyboard; | |
import android.app.Activity; | |
import android.os.Bundle; | |
import android.view.Window; | |
import android.webkit.WebSettings; | |
import android.webkit.WebSettings.ZoomDensity; | |
import android.webkit.WebView; | |
public class PonySWFLauncherActivity extends Activity { |
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
VirtualDub.Open(VirtualDub.params[0],"",0); | |
VirtualDub.audio.SetSource(0); | |
VirtualDub.audio.SetMode(0); | |
VirtualDub.audio.SetInterleave(1,500,1,0,0); | |
VirtualDub.audio.SetClipMode(1,1); | |
VirtualDub.audio.SetConversion(0,0,0,0,0); | |
VirtualDub.audio.SetVolume(); | |
VirtualDub.audio.SetCompression(); | |
VirtualDub.audio.EnableFilterGraph(0); | |
VirtualDub.video.SetInputFormat(0); |
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
#NoTrayIcon | |
; Original tab switch behavior for most applications | |
#IfWinNotActive ahk_class MozillaWindowClass | |
Browser_Back::^PgUp | |
Browser_Forward::^PgDn | |
#IfWinNotActive | |
; Firefox-specific behavior for Home Dash | |
#IfWinActive ahk_class MozillaWindowClass |
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
#!/bin/bash | |
# wget https://gist.github.com/raw/707468/cm-ec2-init.sh && . cm-ec2-init.sh | |
# Epic CM-on-EC2 Init Script for ami-4a0df923 | |
# Preemptively agree to the JDK license | |
echo "sun-java6-bin shared/accepted-sun-dlj-v1-1 boolean true" | sudo debconf-set-selections | |
# Get required packages | |
sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner" | |
sudo aptitude update |