diff --git a/lib/linguist/languages.yml b/lib/linguist/languages.yml index 2658f0d3..14883b4b 100644 --- a/lib/linguist/languages.yml +++ b/lib/linguist/languages.yml @@ -304,6 +304,16 @@ Delphi: - .lpr - .pas +DCPU-16 Assembly: + type: programming + lexer: dasm16 + primary_extension: .dasm16 + extensions: + - .dasm + - .dasm16 + aliases: + - dasm16 + Diff: extensions: - .diff @@ -604,6 +614,13 @@ JavaScript: filenames: - Jakefile +Julia: + type: programming + lexer: Julia + primary_extension: .jl + extensions: + - .jl + Kotlin: type: programming lexer: Kotlin diff --git a/linguist.gemspec b/linguist.gemspec index b6dd8b5b..23106946 100644 --- a/linguist.gemspec +++ b/linguist.gemspec @@ -11,6 +11,6 @@ Gem::Specification.new do |s| s.add_dependency 'charlock_holmes', '~> 0.6.6' s.add_dependency 'escape_utils', '~> 0.2.3' s.add_dependency 'mime-types', '~> 1.18' - s.add_dependency 'pygments.rb', '~> 0.2.8' + s.add_dependency 'pygments.rb', '~> 0.2.9' s.add_development_dependency 'rake' end diff --git a/test/fixtures/stockcorr.jl b/test/fixtures/stockcorr.jl new file mode 100644 index 00000000..58ba80a5 --- /dev/null +++ b/test/fixtures/stockcorr.jl @@ -0,0 +1,37 @@ +## Test case from Issue #445 + +#STOCKCORR - The original, unoptimised code that simulates two correlated assets +function stockcorr() + + ## Correlated asset information + CurrentPrice = [78. 102.] # Initial Prices of the two stocks + Corr = [1. 0.4; 0.4 1.] # Correlation Matrix + T = 500 # Number of days to simulate = 2years = 500days + n = 100000 # Number of simulations + dt = 1/250 # Time step (1year = 250days) + Div=[0.01 0.01] # Dividend + Vol=[0.2 0.3] # Volatility + + ## Market Information + r = 0.03 # Risk-free rate + + ## Define storages + SimulPriceA = zeros(T,n) # Simulated Price of Asset A + SimulPriceA[1,:] = CurrentPrice[1] + SimulPriceB = zeros(T,n) # Simulated Price of Asset B + SimulPriceB[1,:] = CurrentPrice[2] + + ## Generating the paths of stock prices by Geometric Brownian Motion + UpperTriangle=chol(Corr) # UpperTriangle Matrix by Cholesky decomposition + + for i = 1:n + Wiener = randn(T-1,2) + CorrWiener = Wiener*UpperTriangle + for j = 2:T + SimulPriceA[j,i] = SimulPriceA[j-1,i]*exp((r-Div[1]-Vol[1]^2/2)*dt+Vol[1]*sqrt(dt)*CorrWiener[j-1,1]) + SimulPriceB[j,i] = SimulPriceB[j-1,i]*exp((r-Div[2]-Vol[2]^2/2)*dt+Vol[2]*sqrt(dt)*CorrWiener[j-1,2]) + end + end + + return (SimulPriceA, SimulPriceB) +end diff --git a/test/test_blob.rb b/test/test_blob.rb index 42df3221..2e31f784 100644 --- a/test/test_blob.rb +++ b/test/test_blob.rb @@ -427,6 +427,9 @@ class TestBlob < Test::Unit::TestCase # Kotlin assert_equal Language['Kotlin'], blob("Foo.kt").language + + # Julia: http://julialang.org/ + assert_equal Language['Julia'], blob("stockcorr.jl").language end def test_lexer @@ -438,6 +441,7 @@ class TestBlob < Test::Unit::TestCase assert_equal Lexer['Text only'], blob("README").lexer assert_equal Lexer['Tea'], blob("foo.tea").lexer assert_equal Lexer['vhdl'], blob("foo.vhd").lexer + assert_equal Lexer['Julia'], blob("stockcorr.jl").lexer end def test_shebang_script