This file contains 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 genS_jl(I) | |
s0 = 600.0 | |
r = 0.02 | |
sigma = 2.0 | |
T = 1.0 | |
M = 100 | |
dt = T/M | |
a = (r - 0.5*sigma^2)*dt | |
b = sigma*sqrt(dt) |
This file contains 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
using Roots | |
# Alternative "mean" definition that operates on the binary representation | |
# of a float. Using this definition, bisection will never take more than | |
# 64 steps. | |
function _middle(x::Float64, y::Float64) | |
# Use the usual float rules for combining non-finite numbers | |
if !isfinite(x) || !isfinite(y) | |
return x + y | |
end |
This file contains 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
using PowerSeries | |
function series_loop() | |
accum = 0.0 | |
for i = 1:10000 | |
accum += sin(Series(1.0*i, 1.0)).ep | |
end | |
end | |
function dual_loop() |
This file contains 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
jason:knox jm843$ host gmail.com | |
gmail.com has address 74.125.239.53 | |
gmail.com has address 74.125.239.54 | |
gmail.com has IPv6 address 2607:f8b0:4010:801::1016 | |
gmail.com mail is handled by 30 alt3.gmail-smtp-in.l.google.com. | |
gmail.com mail is handled by 10 alt1.gmail-smtp-in.l.google.com. | |
gmail.com mail is handled by 20 alt2.gmail-smtp-in.l.google.com. | |
gmail.com mail is handled by 5 gmail-smtp-in.l.google.com. | |
gmail.com mail is handled by 40 alt4.gmail-smtp-in.l.google.com. | |
jason:knox jm843$ nc alt3.gmail-smtp-in.l.google.com 25 |
This file contains 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
run(`wget http://julialang.org/images/logo.png`) | |
# Open png file for reading | |
fp = ccall(:fopen, Ptr{Uint8}, (Ptr{Uint8}, Ptr{Uint8}), "logo.png", "r") | |
# Read first 8 bytes | |
initial_bytes = Array(Uint8, 8) | |
ccall(:fread, Ptr{Uint8}, (Ptr{Uint8}, Uint8, Uint8, Ptr{Uint8}), initial_bytes, 1, 8, fp) | |
# Check that we actually have a png file |
NewerOlder