content
stringlengths
6
1.03M
input_ids
listlengths
4
535k
ratio_char_token
float64
0.68
8.61
token_count
int64
4
535k
<reponame>angusmoore/RSDSGE.jl function createarglist(parameters,vars,transmatrix) arg = Array{SymPy.Sym}(1) arg = [transmatrix.completelygeneric] # Transition prob first append!(arg,vars.contemps_sym) # Add in the steady state values # Non-switching vars first append!(arg,parameters.generic_sym[1,....
[ 27, 7856, 261, 480, 29, 648, 385, 5908, 382, 14, 6998, 5258, 8264, 13, 20362, 198, 8818, 2251, 853, 4868, 7, 17143, 7307, 11, 85, 945, 11, 7645, 6759, 8609, 8, 198, 220, 220, 220, 1822, 796, 15690, 90, 43094, 20519, 13, 43094, 92,...
2.30569
5,571
module MeasureToolbox # TODO make this an independent package # Import the necessary packages. import FastGaussQuadrature import JuMP import Distributions const JuMPC = JuMP.Containers using ..InfiniteOpt # include jl files here include("integrals.jl") include("expectations.jl") include("support_sums.jl") end # end ...
[ 21412, 24291, 25391, 3524, 1303, 16926, 46, 787, 428, 281, 4795, 5301, 198, 198, 2, 17267, 262, 3306, 10392, 13, 198, 11748, 12549, 35389, 1046, 4507, 41909, 1300, 198, 11748, 12585, 7378, 198, 11748, 46567, 507, 198, 9979, 12585, 44, 5...
3.442105
95
# --- # title: 932. Beautiful Array # id: problem932 # author: <NAME> # date: 2020-10-31 # difficulty: Medium # categories: Divide and Conquer # link: <https://leetcode.com/problems/beautiful-array/description/> # hidden: true # --- # # For some fixed `N`, an array `A` is _beautiful_ if it is a permutation of the # in...
[ 2, 11420, 198, 2, 3670, 25, 860, 2624, 13, 23762, 15690, 198, 2, 4686, 25, 1917, 24, 2624, 198, 2, 1772, 25, 1279, 20608, 29, 198, 2, 3128, 25, 12131, 12, 940, 12, 3132, 198, 2, 8722, 25, 13398, 198, 2, 9376, 25, 46894, 290, 4...
2.153061
392
<filename>stdlib/REPL/test/TerminalMenus/multiselect_menu.jl # This file is a part of Julia. License is MIT: https://julialang.org/license # This file tests the new Julia 1.6+ extension interface of TerminalMenus # To trigger the new interface, at least one configuration keyword argument must be supplied. # Check to ...
[ 27, 34345, 29, 19282, 8019, 14, 2200, 6489, 14, 9288, 14, 44798, 282, 10418, 385, 14, 16680, 786, 801, 62, 26272, 13, 20362, 198, 2, 770, 2393, 318, 257, 636, 286, 22300, 13, 13789, 318, 17168, 25, 3740, 1378, 73, 377, 498, 648, 1...
2.480148
1,083
<reponame>prakharcode/AstroTime.jl module Periods import Base: *, /, get, isapprox, show export TimeUnit, Second, Minute, Hour, Day, Year, Century, J2000, J1950, MJD, seconds, minutes, hours, days, years, centuries, Period, *, /, get include("constants.jl") """ All time units are subtypes of the abstrac...
[ 27, 7856, 261, 480, 29, 79, 430, 14636, 5605, 1098, 14, 32, 20661, 7575, 13, 20362, 198, 21412, 18581, 82, 198, 198, 11748, 7308, 25, 1635, 11, 1220, 11, 651, 11, 318, 1324, 13907, 11, 905, 198, 198, 39344, 3862, 26453, 11, 5498, ...
2.127804
1,917
<filename>lang/Julia/monte-carlo-methods.jl using Printf function monteπ(n) s = count(rand() ^ 2 + rand() ^ 2 < 1 for _ in 1:n) return 4s / n end for n in 10 .^ (3:8) p = monteπ(n) println("$(lpad(n, 9)): π ≈ $(lpad(p, 10)), pct.err = ", @sprintf("%2.5f%%", abs(p - π) / π)) end
[ 27, 34345, 29, 17204, 14, 16980, 544, 14, 2144, 660, 12, 7718, 5439, 12, 24396, 82, 13, 20362, 198, 3500, 12578, 69, 198, 198, 8818, 937, 660, 46582, 7, 77, 8, 198, 220, 220, 220, 264, 796, 954, 7, 25192, 3419, 10563, 362, 1343, ...
1.953947
152
@testset "Global" begin function kernel(X) ptr = AMDGPU.get_global_pointer(Val(:myglobal), Float32) Base.unsafe_store!(ptr, 3f0) nothing end hk = AMDGPU.rocfunction(kernel, Tuple{Int32}) exe = hk.mod.exe gbl = AMDGPU.get_global(exe.exe, :myglobal) gbl_ptr = Base.unsafe_convert(Ptr{Float32}, gbl.ptr) @test...
[ 31, 9288, 2617, 366, 22289, 1, 2221, 198, 198, 8818, 9720, 7, 55, 8, 198, 220, 220, 220, 50116, 796, 10324, 33346, 13, 1136, 62, 20541, 62, 29536, 7, 7762, 7, 25, 1820, 20541, 828, 48436, 2624, 8, 198, 220, 220, 220, 7308, 13, 1...
2.26935
323
<filename>src/glover_mcfarlane.jl @doc raw""" K, γ, info = glover_mcfarlane(G::AbstractStateSpace{Continuous}, γ = 1.1) Design a controller for `G` that maximizes the stability margin ϵ = 1/γ with normalized coprime factor uncertainty using the method of Glover and McFarlane ``` γ = 1/ϵ = ||[K;I] inv(I-G*K)*inv(M)...
[ 27, 34345, 29, 10677, 14, 4743, 2502, 62, 76, 12993, 49344, 13, 20362, 198, 31, 15390, 8246, 37811, 198, 220, 220, 220, 509, 11, 7377, 111, 11, 7508, 796, 1278, 2502, 62, 76, 12993, 49344, 7, 38, 3712, 23839, 9012, 14106, 90, 17875,...
2.498807
4,192
<gh_stars>1-10 # Add Max Trust Angle Constraints using SparseArrays, LinearAlgebra include("../constraints/constraints.jl") function getAlpha(theta, deg = true) if deg return -tand(theta) end return -tan(theta) end """ makeMaxThrustConstraint(NSteps::Int64, nDim::Int64, thetaMax::Float64) ...
[ 27, 456, 62, 30783, 29, 16, 12, 940, 198, 2, 3060, 5436, 9870, 42375, 1482, 2536, 6003, 198, 198, 3500, 1338, 17208, 3163, 20477, 11, 44800, 2348, 29230, 198, 198, 17256, 7203, 40720, 1102, 2536, 6003, 14, 1102, 2536, 6003, 13, 20362,...
2.166667
882
<reponame>eunjongkim/Touchstone.jl module Touchstone using ..Network export TouchstoneData, read_touchstone """ Touchstone data in its raw form, imported from a touchstone file `*.sNp` """ struct TouchstoneData nPort::Int nPoint::Int impedance::Float64 freq_unit::String data_type::String format_...
[ 27, 7856, 261, 480, 29, 68, 403, 32428, 74, 320, 14, 35211, 6440, 13, 20362, 198, 21412, 15957, 6440, 198, 3500, 11485, 26245, 198, 39344, 15957, 6440, 6601, 11, 1100, 62, 29332, 6440, 198, 37811, 198, 35211, 6440, 1366, 287, 663, 824...
2.238139
1,096
<gh_stars>0 # A module template for Koala supervised models ## INTRODUCTION # This file briefly describes the low-level methods that must be # implemented for each new Koala supervised learning algorithm. If # this algorithm is called "SomeAlgorithm", then this implementation # is conventionally contained in a module...
[ 27, 456, 62, 30783, 29, 15, 198, 2, 317, 8265, 11055, 329, 17634, 6081, 28679, 4981, 198, 198, 2235, 3268, 5446, 28644, 2849, 198, 198, 2, 770, 2393, 11589, 8477, 262, 1877, 12, 5715, 5050, 326, 1276, 307, 198, 2, 9177, 329, 1123, ...
3.711228
2,289
<gh_stars>1-10 using Documenter using QuranTree makedocs( sitename = "QuranTree.jl", format = Documenter.HTML( assets = ["assets/logo.ico"] ), modules = [QuranTree], authors = "<NAME>", pages = [ "Home" => "index.md", "Getting Started" => "man/getting_started.md", ...
[ 27, 456, 62, 30783, 29, 16, 12, 940, 198, 3500, 16854, 263, 198, 3500, 30018, 27660, 198, 198, 76, 4335, 420, 82, 7, 198, 220, 220, 220, 1650, 12453, 796, 366, 48, 42211, 27660, 13, 20362, 1600, 198, 220, 220, 220, 5794, 796, 1685...
2.244828
580
# reimplements methods: hessfact, hessfact! # and minor functions from LinAlg: full, A_mul_B! ..., reflectorApply! import LinearAlgebra import Base: A_mul_B!, Ac_mul_B!, A_mul_Bc!, copymutable, full import LinearAlgebra: hessfact, hessfact!, Hessenberg, HessenbergQ import LinearAlgebra: chkstride1, checksquare impo...
[ 198, 2, 21123, 1154, 902, 5050, 25, 339, 824, 22584, 11, 339, 824, 22584, 0, 198, 2, 290, 4159, 5499, 422, 5164, 2348, 70, 25, 1336, 11, 317, 62, 76, 377, 62, 33, 0, 2644, 11, 4079, 273, 44836, 0, 220, 198, 198, 11748, 44800, ...
2.136856
1,571
<reponame>jwscook/Kalman.jl<filename>example/trajectory_tracking/kalman.jl using Kalman, GaussianDistributions, LinearAlgebra using GaussianDistributions: ⊕ # independent sum of Gaussian r.v. using Statistics using GLMakie using StaticArrays function onestep(p, v) v += @SVector randn(2) w = 0.1 * @SVector rand...
[ 27, 7856, 261, 480, 29, 73, 86, 1416, 566, 14, 41428, 805, 13, 20362, 27, 34345, 29, 20688, 14, 9535, 752, 652, 62, 36280, 14, 74, 282, 805, 13, 20362, 198, 3500, 12612, 805, 11, 12822, 31562, 20344, 2455, 507, 11, 44800, 2348, 29...
2.176136
880
<reponame>aviks/Optim.jl<gh_stars>1-10 function modindex(i::Integer, m::Integer) x = mod(i, m) if x == 0 return m else return x end end function twoloop!(g_x::Vector, rho::Vector, s::Matrix, y::Matrix, m::Integer, ...
[ 27, 7856, 261, 480, 29, 15820, 591, 14, 27871, 320, 13, 20362, 27, 456, 62, 30783, 29, 16, 12, 940, 198, 8818, 953, 9630, 7, 72, 3712, 46541, 11, 285, 3712, 46541, 8, 198, 220, 220, 220, 2124, 796, 953, 7, 72, 11, 285, 8, 198,...
1.828002
2,657
<reponame>JuliaApproximation/BasisFunctions.jl # Laguerre and Hermite fail due to linear algebra problems in BigFloat supports_approximation(::Laguerre{BigFloat}) = false supports_approximation(::Laguerre{Double64}) = false supports_approximation(::Hermite{BigFloat}) = false supports_approximation(::Hermite{Double64})...
[ 27, 7856, 261, 480, 29, 16980, 544, 4677, 13907, 18991, 14, 15522, 271, 24629, 2733, 13, 20362, 198, 198, 2, 406, 11433, 263, 260, 290, 18113, 578, 2038, 2233, 284, 14174, 37139, 2761, 287, 4403, 43879, 198, 18608, 2096, 62, 1324, 139...
2.99297
569
A = zeros(UInt8, 10, 10, 10) for i in 1:8 A[i, 5, i:i+2] = 0x01 end A[9:10, 5, 8:10] = 0x01 blob_series = form_blobs(A) @test length(blob_series) == 10 for blobs in blob_series @test length(blobs) == 1 blob = blobs[1] @test blob.x.p == 5 @test blob.ratio ≈ 3.0 @test blob.area == 3 @test blo...
[ 32, 796, 1976, 27498, 7, 52, 5317, 23, 11, 838, 11, 838, 11, 838, 8, 198, 1640, 1312, 287, 352, 25, 23, 198, 220, 220, 220, 317, 58, 72, 11, 642, 11, 1312, 25, 72, 10, 17, 60, 796, 657, 87, 486, 198, 437, 198, 32, 58, 24, ...
1.865724
283
<filename>test/dependencies.jl @testset "get_project_deps" begin @testset "no jll" begin apply([git_clone_patch, project_toml_patch, cd_patch]) do options = CompatHelper.Options() subdir = only(options.subdirs) deps = CompatHelper.get_project_deps( GitForg...
[ 27, 34345, 29, 9288, 14, 45841, 3976, 13, 20362, 198, 31, 9288, 2617, 366, 1136, 62, 16302, 62, 10378, 82, 1, 2221, 198, 220, 220, 220, 2488, 9288, 2617, 366, 3919, 474, 297, 1, 2221, 198, 220, 220, 220, 220, 220, 220, 220, 4174, ...
2.150396
1,895
<reponame>UnofficialJuliaMirrorSnapshots/TimeseriesPrediction.jl-f218859d-9706-56aa-9ebf-1fa4ed7b8020 using TimeseriesPrediction using Test using Statistics, LinearAlgebra @testset "SymmetricEmbedding" begin @testset "Ordering in β_groups" begin γ = 0; τ = 1; r = 4; c = 0; bc = ConstantBoundary(10.); ...
[ 27, 7856, 261, 480, 29, 3118, 16841, 16980, 544, 27453, 1472, 43826, 20910, 14, 28595, 10640, 39156, 2867, 13, 20362, 12, 69, 17, 20356, 3270, 67, 12, 24, 35402, 12, 3980, 7252, 12, 24, 1765, 69, 12, 16, 13331, 19, 276, 22, 65, 17...
1.92672
2,238
<gh_stars>100-1000 module EventTrigger using ..Ahorn, Maple const placements = Ahorn.PlacementDict( "Event" => Ahorn.EntityPlacement( Maple.EventTrigger, "rectangle" ) ) function Ahorn.editingOptions(trigger::Maple.EventTrigger) return Dict{String, Any}( "event" => Maple.event_tri...
[ 27, 456, 62, 30783, 29, 3064, 12, 12825, 198, 21412, 8558, 48344, 198, 198, 3500, 11485, 10910, 1211, 11, 21249, 198, 198, 9979, 21957, 3196, 796, 7900, 1211, 13, 3646, 5592, 35, 713, 7, 198, 220, 220, 220, 366, 9237, 1, 5218, 7900,...
2.453901
141
function load_synonym_table(db::SQLite.DB; logger::Union{Nothing,SimpleLogger} = nothing)::VLResult # initialize - synonym_dictionary = Dict{String,String}() try # load the synonym table - sql_string = "SELECT * FROM LEXEME_SYNONYM_TABLE;" # execute the call - query_resu...
[ 8818, 3440, 62, 28869, 5177, 62, 11487, 7, 9945, 3712, 17861, 578, 13, 11012, 26, 49706, 3712, 38176, 90, 18465, 11, 26437, 11187, 1362, 92, 796, 2147, 2599, 25, 47468, 23004, 628, 220, 220, 220, 1303, 41216, 532, 198, 220, 220, 220, ...
2.315927
383
""" SumGreaterThan(x<:AbstractIntVar, v::Int) Summing constraint, states that `x[1] + x[2] + ... + x[length(x)] >= lower` """ struct SumGreaterThan <: Constraint x ::Array{<:AbstractIntVar} lower ::Int active ::StateObject{Bool} numberOfFreeVars ::Sta...
[ 37811, 198, 220, 220, 220, 5060, 13681, 263, 817, 272, 7, 87, 27, 25, 23839, 5317, 19852, 11, 410, 3712, 5317, 8, 198, 198, 13065, 2229, 32315, 11, 2585, 326, 4600, 87, 58, 16, 60, 1343, 2124, 58, 17, 60, 1343, 2644, 1343, 2124, ...
2.358239
1,499
<reponame>Nosferican/MixedModels.jl """ UniformBlockDiagonal{T} Homogeneous block diagonal matrices. `k` diagonal blocks each of size `m×m` """ struct UniformBlockDiagonal{T} <: AbstractMatrix{T} data::Array{T,3} facevec::Vector{SubArray{T,2,Array{T,3}}} end function UniformBlockDiagonal(dat::Array{T,3})...
[ 27, 7856, 261, 480, 29, 45, 418, 2232, 7490, 14, 44, 2966, 5841, 1424, 13, 20362, 198, 37811, 198, 220, 220, 220, 35712, 12235, 18683, 27923, 90, 51, 92, 198, 198, 28718, 32269, 2512, 40039, 2603, 45977, 13, 220, 4600, 74, 63, 40039...
2.061305
1,517
<gh_stars>0 @testset "Crimisini" begin if visualtests # Diagonal img = [i + j > 10 ? 0.1 : 0.2 for i in 1:10, j in 1:10] mask = [1.2cos(i) + i > j for i in 1:10, j in 1:10] out = inpaint(img, mask, Criminisi(5,5)) @plottest plot_before_after(img,mask,out) joinpath(datadir,"Diagonal.png") !istrav...
[ 27, 456, 62, 30783, 29, 15, 198, 31, 9288, 2617, 366, 34, 3036, 271, 5362, 1, 2221, 198, 220, 611, 5874, 41989, 198, 220, 220, 220, 1303, 6031, 27923, 198, 220, 220, 220, 33705, 220, 796, 685, 72, 1343, 474, 1875, 838, 5633, 657, ...
2.149723
541
""" Update the parameters of the model using the gardients (∇) and the learning rate (η). """ function update_model_weights(parameters, ∇, η) L = trunc(Int, length(parameters) / 2) # update the parameters (weights and biases) for all the layers for l = 1:L parameters[string("W_", l)] = min.(max.(pa...
[ 37811, 198, 10260, 262, 10007, 286, 262, 2746, 1262, 262, 16985, 2334, 357, 24861, 229, 8, 290, 262, 4673, 2494, 357, 138, 115, 737, 198, 37811, 198, 8818, 4296, 62, 19849, 62, 43775, 7, 17143, 7307, 11, 18872, 229, 11, 7377, 115, 8...
2.392739
303
<gh_stars>10-100 using EmpiricalRisks using Base.Test ## Auxiliary functions function verify_multipred(pred::PredictionModel{1,0}, θ, X::DenseMatrix) n = size(X, 2) @test ninputs(pred, X) == n rr = zeros(n) for i = 1:n rr[i] = predict(pred, θ, X[:,i]) end @test_approx_eq predict(pred,...
[ 27, 456, 62, 30783, 29, 940, 12, 3064, 198, 3500, 2295, 4063, 605, 49, 36730, 198, 3500, 7308, 13, 14402, 628, 198, 2235, 47105, 28129, 5499, 198, 198, 8818, 11767, 62, 16680, 541, 445, 7, 28764, 3712, 39156, 2867, 17633, 90, 16, 11...
2.093588
1,154
<filename>src/worksheet.jl<gh_stars>0 function Worksheet(xf::XLSXFile, sheet_element::EzXML.Node) @assert EzXML.nodename(sheet_element) == "sheet" sheetId = parse(Int, sheet_element["sheetId"]) relationship_id = sheet_element["r:id"] name = sheet_element["name"] target = "xl/" * get_relationship_...
[ 27, 34345, 29, 10677, 14, 5225, 25473, 13, 20362, 27, 456, 62, 30783, 29, 15, 198, 198, 8818, 10933, 25473, 7, 26152, 3712, 55, 6561, 55, 8979, 11, 9629, 62, 30854, 3712, 36, 89, 55, 5805, 13, 19667, 8, 198, 220, 220, 220, 2488, ...
2.566667
3,270
<filename>src/JuliaTutorial.jl module JuliaTutorial using Match export Menu include("menu.jl") include("LinearAlgebra.jl") include("MatrixFactorizations.jl") include("TextMining.jl") include("RecSys.jl") end
[ 27, 34345, 29, 10677, 14, 16980, 544, 51, 44917, 13, 20362, 198, 21412, 22300, 51, 44917, 198, 198, 3500, 13225, 198, 198, 39344, 21860, 628, 2291, 7203, 26272, 13, 20362, 4943, 198, 2291, 7203, 14993, 451, 2348, 29230, 13, 20362, 4943,...
3.056338
71
<filename>src/joLinearFunctionConstructors/joNFFT.jl # NFFT operators: joNFFT ## helper module module joNFFT_etc using NFFT using FFTW: fftshift, ifftshift using JOLI: jo_convert function apply_nfft_centered(pln,n,v::Vector{vdt},rdt::DataType) where vdt<:Union{AbstractFloat,Complex} iv=jo_conve...
[ 27, 34345, 29, 10677, 14, 7639, 14993, 451, 22203, 42316, 669, 14, 7639, 45, 5777, 51, 13, 20362, 198, 2, 399, 5777, 51, 12879, 25, 2525, 45, 5777, 51, 198, 198, 2235, 31904, 8265, 198, 21412, 2525, 45, 5777, 51, 62, 14784, 198, 2...
1.935768
1,588
<reponame>IanButterworth/ThreadPools.jl import Core.Compiler abstract type AbstractThreadPool end _detect_type(fn, itr) = Core.Compiler.return_type(fn, Tuple{eltype(itr)}) """ tforeach(fn, pool, itr) Mimics `Base.foreach`, but launches the function evaluations onto the provided pool to assign the tasks. # Ex...
[ 27, 7856, 261, 480, 29, 37776, 1537, 353, 9268, 14, 16818, 47, 10141, 13, 20362, 198, 11748, 7231, 13, 7293, 5329, 198, 198, 397, 8709, 2099, 27741, 16818, 27201, 886, 198, 198, 62, 15255, 478, 62, 4906, 7, 22184, 11, 340, 81, 8, ...
2.186268
1,471
<reponame>JuliaTelecom/DigitalComm.jl """ --- Quadrature Amplitude Modulation (QAM) hard decoding function Return the hard decoded constellation with voronoi baseds decision. The difference with bitDeMapping is that bitDeMapping returns the decoded bit sequence whereas hardConstellation returns the closest constellat...
[ 27, 7856, 261, 480, 29, 16980, 544, 31709, 785, 14, 27640, 6935, 13, 20362, 198, 37811, 198, 6329, 220, 220, 198, 4507, 41909, 1300, 44074, 3984, 3401, 1741, 357, 48, 2390, 8, 1327, 39938, 2163, 198, 13615, 262, 1327, 875, 9043, 38712...
2.417848
3,104
<filename>src/Potentials.jl abstract type AbstractPotential end struct ConstantPotential{T <: Number} <: AbstractPotential _::T end struct CoeffPotential{P <: AbstractPotential, T <: Number} <: AbstractPotential potential::P coefficient::T end struct PotentialFunction{P <: AbstractPotential, F <: Function} ...
[ 27, 34345, 29, 10677, 14, 25396, 14817, 13, 20362, 198, 397, 8709, 2099, 27741, 25396, 1843, 886, 198, 7249, 20217, 25396, 1843, 90, 51, 1279, 25, 7913, 92, 1279, 25, 27741, 25396, 1843, 198, 220, 220, 220, 4808, 3712, 51, 198, 437, ...
2.562564
983
<filename>src/evaluate.jl using MLBase using JSON using SimplePlot export network_enrichment, id2uniprot, id2truth, uniprot2truth, id2celltype, id2treatments, id2target, ishistone, random_cor_matrix, conditional_cov, truth_matrix, mask_matrix, unique_ppi_pairs, a...
[ 27, 34345, 29, 10677, 14, 49786, 13, 20362, 198, 3500, 10373, 14881, 198, 3500, 19449, 198, 3500, 17427, 43328, 198, 198, 39344, 198, 220, 220, 220, 3127, 62, 268, 7527, 434, 11, 198, 220, 220, 220, 4686, 17, 403, 541, 10599, 11, 19...
2.223735
6,463
import Base: convert import SymEngine: convert, free_symbols """ is_linearcombination(L::Basic) Return whether the expression `L` is a linear combination of its symbols. ### Input - `L` -- expression ### Output `true` if `L` is a linear combination or false otherwise. ### Examples ```jldoctest julia> using S...
[ 11748, 7308, 25, 10385, 198, 11748, 15845, 13798, 25, 10385, 11, 1479, 62, 1837, 2022, 10220, 198, 198, 37811, 198, 220, 220, 318, 62, 29127, 24011, 1883, 7, 43, 3712, 26416, 8, 198, 198, 13615, 1771, 262, 5408, 4600, 43, 63, 318, 2...
2.53267
3,520
<filename>test/utils.jl<gh_stars>1-10 using RandomizedPropertyTest, NOVAS, BenchmarkTools, Random, DataFrames rng = MersenneTwister(0) # Include un-exported c wrappers include("wrapper.jl") # Add custom isapprox to test tuples import Base.isapprox Base.isapprox(x::Tuple, y::Tuple; kws...) = isapprox(collect(x), coll...
[ 27, 34345, 29, 9288, 14, 26791, 13, 20362, 27, 456, 62, 30783, 29, 16, 12, 940, 198, 3500, 14534, 1143, 21746, 14402, 11, 8005, 53, 1921, 11, 25187, 4102, 33637, 11, 14534, 11, 6060, 35439, 198, 198, 81, 782, 796, 337, 364, 29727, ...
2.217035
1,221
module ThermalTraj using JuMP using NLopt using JSON export printTest export heading2XY export initTrajModel! export solveTraj! function printTest() println("Testing print from module ThermalTraj") end function heading2XY(h) e = -(h-90.0)#*pi/180.0 if e <= -180.0 e += 360.0 end return e*pi...
[ 21412, 41590, 15721, 73, 198, 198, 3500, 12585, 7378, 198, 3500, 22879, 8738, 198, 3500, 19449, 198, 198, 39344, 3601, 14402, 198, 39344, 9087, 17, 34278, 198, 39344, 2315, 15721, 73, 17633, 0, 198, 39344, 8494, 15721, 73, 0, 198, 198, ...
1.723515
2,105
import Base: length, first, last, getindex abstract IndexRepr immutable LineRepr <: IndexRepr id::NTuple{2, Int} end interior_indices(::LineRepr) = () immutable CircleArcRepr <: IndexRepr id::NTuple{3, Int} end interior_indices(::CircleArcRepr) = (2,) immutable EllipseArcRepr <: IndexRepr id::NTuple{3, ...
[ 11748, 7308, 25, 4129, 11, 717, 11, 938, 11, 651, 9630, 198, 198, 397, 8709, 12901, 6207, 81, 198, 198, 8608, 18187, 6910, 6207, 81, 1279, 25, 12901, 6207, 81, 198, 220, 220, 220, 4686, 3712, 11251, 29291, 90, 17, 11, 2558, 92, 19...
2.186616
6,575
# --- # title: 1339. Maximum Product of Splitted Binary Tree # id: problem1339 # author: <NAME> # date: 2020-10-31 # difficulty: Medium # categories: Dynamic Programming, Tree, Depth-first Search # link: <https://leetcode.com/problems/maximum-product-of-splitted-binary-tree/description/> # hidden: true # --- # # Given...
[ 2, 11420, 198, 2, 3670, 25, 1511, 2670, 13, 22246, 8721, 286, 13341, 2175, 45755, 12200, 198, 2, 4686, 25, 1917, 1485, 2670, 198, 2, 1772, 25, 1279, 20608, 29, 198, 2, 3128, 25, 12131, 12, 940, 12, 3132, 198, 2, 8722, 25, 13398, ...
2.285926
675
using Optim import Optim: optimize # Fitting logistic regression # # TODO: add support for dual formulation struct LogisticOptimizer penalty::AbstractPenalty dual::Bool fit_intercept::Bool algo::Optim.AbstractOptimizer options::Optim.Options end function LogisticOptimizer(; penalty=L2Penalty(0.0)...
[ 198, 3500, 30011, 198, 11748, 30011, 25, 27183, 198, 198, 2, 376, 2535, 2604, 2569, 20683, 198, 2, 198, 2, 16926, 46, 25, 751, 1104, 329, 10668, 31760, 198, 7249, 5972, 2569, 27871, 320, 7509, 198, 220, 220, 220, 7389, 3712, 23839, ...
1.982158
2,354
<filename>practice.jl using Statistics using ProgressMeter using MATLAB include("atn_module.jl") N = 10_000 # number of nodes m = 5 # number of active links per active node mu = 0.1 # probability I -> S tmax = 3000 # maximum duration of the simulation Ni = Int(0.01 * N) # init...
[ 27, 34345, 29, 39541, 13, 20362, 198, 3500, 14370, 198, 3500, 18387, 44, 2357, 198, 3500, 36775, 48780, 198, 17256, 7203, 265, 77, 62, 21412, 13, 20362, 4943, 198, 45, 796, 838, 62, 830, 220, 220, 220, 220, 220, 220, 220, 220, 220, ...
2.29918
488
""" MetaWeights{InnerMetaGraph<:MetaGraph,U<:Real} <: AbstractMatrix{U} Matrix-like wrapper for edge weights on a metagraph of type `InnerMetaGraph`. """ struct MetaWeights{InnerMetaGraph<:MetaGraph,U<:Real} <: AbstractMatrix{U} g::InnerMetaGraph end Base.show(io::IO, mv::MetaWeights) = print(io, "MetaWeight...
[ 37811, 198, 220, 220, 220, 30277, 1135, 2337, 90, 818, 1008, 48526, 37065, 27, 25, 48526, 37065, 11, 52, 27, 25, 15633, 92, 1279, 25, 27741, 46912, 90, 52, 92, 198, 198, 46912, 12, 2339, 29908, 329, 5743, 19590, 319, 257, 1138, 6111...
2.414747
651
<filename>script/optimization_concepts/integer_programming.jl #' --- #' title: Integer Programming #' --- #' **Originally Contributed by**: <NAME> #' While we already know how to set a variable as integer or binary in the `@variable` macro, #' this tutorial covers other JuMP features for integer programming a...
[ 27, 34345, 29, 12048, 14, 40085, 1634, 62, 43169, 82, 14, 41433, 62, 23065, 2229, 13, 20362, 198, 2, 6, 11420, 201, 198, 2, 6, 3670, 25, 34142, 30297, 201, 198, 2, 6, 11420, 201, 198, 201, 198, 2, 6, 12429, 22731, 2345, 6169, 41...
2.56325
2,166
using DataFrames using Libz """ parse_gtf_gene_features_to_df Arguments: filename: path to gtf file gene_ids: An array of gene_ids - if an empty array, then everything is parsed. feature_types: Set of feature types - e.g. Set({"gene"}) Returns: """ function parse_gtf_gene_features_to_df(filename, ...
[ 3500, 6060, 35439, 198, 3500, 7980, 89, 198, 37811, 198, 220, 21136, 62, 13655, 69, 62, 70, 1734, 62, 40890, 62, 1462, 62, 7568, 628, 220, 20559, 2886, 25, 198, 220, 220, 220, 29472, 25, 3108, 284, 308, 27110, 2393, 198, 220, 220, ...
1.996648
895
module ArrayInterfaceGPUArrays using Adapt using ArrayInterfaceCore using GPUArraysCore ArrayInterfaceCore.fast_scalar_indexing(::Type{<:GPUArraysCore.AbstractGPUArray}) = false @inline ArrayInterfaceCore.allowed_getindex(x::GPUArraysCore.AbstractGPUArray, i...) = GPUArraysCore.@allowscalar(x[i...]) @inline ArrayInte...
[ 21412, 15690, 39317, 33346, 3163, 20477, 198, 198, 3500, 30019, 198, 3500, 15690, 39317, 14055, 198, 3500, 11362, 3163, 20477, 14055, 198, 198, 19182, 39317, 14055, 13, 7217, 62, 1416, 282, 283, 62, 9630, 278, 7, 3712, 6030, 90, 27, 25,...
2.932773
357
# MIT License # Copyright (c) 2017: <NAME>, <NAME>, <NAME>, and contributors. struct _2UKP nSize::Int P1::Vector{Int} P2::Vector{Int} W::Vector{Int} C::Int end Base.show(io::IO, id::_2UKP) = print("Bi-Objective Knapsack Problem with $(id.nSize) variables.") set2UKP(n::Int, p1::Vector{Int}, p2::Vec...
[ 2, 17168, 13789, 198, 2, 15069, 357, 66, 8, 2177, 25, 1279, 20608, 22330, 1279, 20608, 22330, 1279, 20608, 22330, 290, 20420, 13, 198, 7249, 4808, 17, 15039, 47, 198, 220, 220, 220, 299, 10699, 3712, 5317, 198, 220, 220, 220, 350, 1...
2.11973
593
using Bokeh plotfile("display.html") x = linspace(0, 2pi) # plot returns a Plot object myplot = plot(x, sin.(x)) # which can then be displayed with showplot(myplot) # if you wish to generate a plot but not display it, you can use genplot genplot(myplot) # you can also specify the filename directly to genplot: genp...
[ 3500, 347, 2088, 71, 198, 198, 29487, 7753, 7203, 13812, 13, 6494, 4943, 198, 198, 87, 796, 300, 1040, 10223, 7, 15, 11, 362, 14415, 8, 198, 198, 2, 7110, 5860, 257, 28114, 2134, 198, 1820, 29487, 796, 7110, 7, 87, 11, 7813, 12195...
3.434932
292
<filename>src/FunctionalInterface/replace_macros.jl ## ------------------------------------------------------------------ function _macro_call_regex(name::String) str = string("(?>", "\\@", name, "(?>", "\\([^\\(]*\\)", ")?", ")") return Regex(str) end ## -----------------------------------------...
[ 27, 34345, 29, 10677, 14, 22203, 282, 39317, 14, 33491, 62, 20285, 4951, 13, 20362, 198, 2235, 16529, 438, 198, 8818, 4808, 20285, 305, 62, 13345, 62, 260, 25636, 7, 3672, 3712, 10100, 8, 198, 220, 220, 220, 965, 796, 4731, 7203, 7,...
2.472727
715
function test_complex_1() Random.seed!(0) f = x -> [exp(-30 / x), exp(-30 / x)] xtrue = 100 y = f(xtrue) T = 1 xDists = Uniform(10, 500) noiseDist = Normal(0, 0.01) signalModels = f λ = 2.0^-1.5 kernel = GaussianKernel(λ * y) ρ = 2.0^-20 xhat = perk(reshape(y, :, 1), T, ...
[ 8818, 1332, 62, 41887, 62, 16, 3419, 628, 220, 220, 220, 14534, 13, 28826, 0, 7, 15, 8, 198, 220, 220, 220, 277, 796, 2124, 4613, 685, 11201, 32590, 1270, 1220, 2124, 828, 1033, 32590, 1270, 1220, 2124, 15437, 198, 220, 220, 220, ...
1.953173
3,246
export ToeplitzOperator, HankelOperator mutable struct ToeplitzOperator{T<:Number} <: Operator{T} negative::Vector{T} nonnegative::Vector{T} end ToeplitzOperator(V::Vector{T},W::Vector{Q}) where {T<:Number,Q<:Number} = ToeplitzOperator{promote_type(T,Q)}(V,W) ToeplitzOperator(V::AbstractVector,W::Abstra...
[ 39344, 1675, 68, 489, 4224, 18843, 1352, 11, 9530, 7750, 18843, 1352, 628, 198, 76, 18187, 2878, 1675, 68, 489, 4224, 18843, 1352, 90, 51, 27, 25, 15057, 92, 1279, 25, 35946, 90, 51, 92, 198, 220, 220, 220, 4633, 3712, 38469, 90, ...
2.205501
1,927
<reponame>joshday/AtomicTables.jl #-----------------------------------------------------------------------------# CTable """ A Columnar data table. It is a simple wrapper around a NamedTuple of AbstractVectors (See `Tables.ColumnTable`). By default, ranges (e.g. `1:10`) will be `collect`-ed. ## Examples x =...
[ 27, 7856, 261, 480, 29, 73, 3768, 820, 14, 2953, 10179, 51, 2977, 13, 20362, 198, 198, 2, 10097, 32501, 2, 327, 10962, 220, 198, 37811, 198, 32, 29201, 283, 1366, 3084, 13, 220, 632, 318, 257, 2829, 29908, 1088, 257, 34441, 51, 29...
2.162666
3,166
<filename>server/server.jl module Server using DotEnv DotEnv.config() include("utils.jl") include("controller/requests.jl") include("types.jl") include("controller/network.jl") include("controller/commands.jl") using .Types, .Requests, Sockets, Dates function is_valid_command(command::String) if (!startswith(co...
[ 27, 34345, 29, 15388, 14, 15388, 13, 20362, 198, 21412, 9652, 198, 198, 3500, 22875, 4834, 85, 198, 35, 313, 4834, 85, 13, 11250, 3419, 198, 198, 17256, 7203, 26791, 13, 20362, 4943, 198, 17256, 7203, 36500, 14, 8897, 3558, 13, 20362,...
2.314252
856
# WHERE clause. mutable struct WhereClause <: AbstractSQLClause over::Union{SQLClause, Nothing} condition::SQLClause WhereClause(; over = nothing, condition) = new(over, condition) end WhereClause(condition; over = nothing) = WhereClause(over = over, condition ...
[ 2, 33411, 13444, 13, 198, 198, 76, 18187, 2878, 6350, 2601, 682, 1279, 25, 27741, 17861, 2601, 682, 198, 220, 220, 220, 625, 3712, 38176, 90, 17861, 2601, 682, 11, 10528, 92, 198, 220, 220, 220, 4006, 3712, 17861, 2601, 682, 628, 22...
2.348884
493
export PeriodicInterval immutable PeriodicInterval{T<:Number} <: PeriodicDomain{T} a::T b::T PeriodicInterval()=new(-convert(T,π),convert(T,π)) PeriodicInterval(a,b)=new(a,b) end PeriodicInterval()=PeriodicInterval{Float64}() PeriodicInterval(a::Int,b::Int) = PeriodicInterval(Float64(a),Float64(b))...
[ 198, 198, 39344, 18581, 291, 9492, 2100, 628, 198, 8608, 18187, 18581, 291, 9492, 2100, 90, 51, 27, 25, 15057, 92, 1279, 25, 18581, 291, 43961, 90, 51, 92, 198, 220, 220, 220, 257, 3712, 51, 198, 220, 220, 220, 275, 3712, 51, 198,...
2.162855
1,093
<filename>examples/example-Eb.jl println("Eb) Simulation of the four-step cascade after 1s-3p photo-excitation of Si^+: Configuration model.") @warn("\n\n !!! This example does not work properly at present !!! \n\n") # using JLD wr = load("zzz-Cascade-2019-04-26T08.jld"); data = wr["cascade data:"]; wa = Cascade.Sim...
[ 27, 34345, 29, 1069, 12629, 14, 20688, 12, 36, 65, 13, 20362, 198, 35235, 7203, 36, 65, 8, 41798, 286, 262, 1440, 12, 9662, 44847, 706, 352, 82, 12, 18, 79, 4590, 12, 41194, 3780, 286, 15638, 61, 10, 25, 28373, 2746, 19570, 198, ...
2.932099
162
<reponame>anowacki/TauPy """ # TauPy Use the Python package ObsPy to calculate seismic travel times and ray paths for teleseismic phases. ## Phases defined only by event depth and distance For this case, functions return vectors of `Phase`s, which only contain details of each phase in terms of distance from the even...
[ 27, 7856, 261, 480, 29, 272, 322, 441, 72, 14, 51, 559, 20519, 198, 37811, 198, 2, 36849, 20519, 198, 198, 11041, 262, 11361, 5301, 11086, 20519, 284, 15284, 37463, 3067, 1661, 290, 26842, 13532, 329, 198, 37524, 2771, 1042, 291, 2116...
2.793758
1,474
module ChartmetricScraper using HTTP, Dates import JSON export Token, newtoken!, albumrequest, playlistrequest, curatorrequest, Request, dorequest, parseresponse, getparameters, setparameters!, setparameter!, writestate, readstate!, buildrequesturl, getparse...
[ 21412, 22086, 4164, 1173, 3351, 38545, 198, 198, 3500, 14626, 11, 198, 220, 220, 220, 44712, 198, 11748, 19449, 198, 198, 39344, 29130, 11, 198, 220, 220, 220, 649, 30001, 28265, 198, 220, 220, 220, 5062, 25927, 11, 198, 220, 220, 220...
2.553073
179
using Test using JSON using MianalyzerBackend const GMeansController = MianalyzerBackend.GMeansController include("../TestSupport.jl") @testset "GMeanController" begin @testset ".call" begin request = Dict([("records", [[1.0, 1.0], [2.0, 2.0], [3.0, 3.0], [4.0, 4.0], [5.0, 5.0]])]) actual = JSON.parse(IOBu...
[ 3500, 6208, 198, 3500, 19449, 198, 3500, 337, 666, 3400, 9107, 7282, 437, 198, 9979, 402, 5308, 504, 22130, 796, 337, 666, 3400, 9107, 7282, 437, 13, 38, 5308, 504, 22130, 198, 198, 17256, 7203, 40720, 14402, 15514, 13, 20362, 4943, 1...
2.213043
230
<filename>test/jacvec_operators.jl using DiffEqBase, DiffEqOperators, ForwardDiff, LinearAlgebra, Test const A = rand(300,300) f(du,u) = mul!(du,A,u) f(u) = A*u x = rand(300) v = rand(300) du = similar(x) cache1 = ForwardDiff.Dual{DiffEqOperators.JacVecTag}.(x, v) cache2 = ForwardDiff.Dual{DiffEqOperators.JacVecTag}.(...
[ 27, 34345, 29, 9288, 14, 30482, 35138, 62, 3575, 2024, 13, 20362, 198, 3500, 10631, 36, 80, 14881, 11, 10631, 36, 80, 18843, 2024, 11, 19530, 28813, 11, 44800, 2348, 29230, 11, 6208, 198, 9979, 317, 796, 43720, 7, 6200, 11, 6200, 8,...
2.052206
1,360
begin function printBitMasks(V) E = Array{Int64}(2^6) for i in 1:2^6 E[i] = -1 end i = 1 for o in V contains = false for l in E if l == o contains = true end end if !contains E[i] = o i += 1 end end F = Array{Int64}(i-1) for j in 1:(i-1) F[j] = E[j] end F=s...
[ 27471, 198, 197, 8818, 3601, 13128, 44, 6791, 7, 53, 8, 198, 197, 197, 36, 796, 15690, 90, 5317, 2414, 92, 7, 17, 61, 21, 8, 198, 197, 197, 1640, 1312, 287, 352, 25, 17, 61, 21, 198, 197, 197, 197, 36, 58, 72, 60, 796, 532, ...
1.732036
1,336
<gh_stars>0 ccall(:jl_exit_on_sigint, Void, (Cint,), 0) push!(LOAD_PATH, "..") using JukaiNLP: DepParser, Perceptron, Unlabeled, Labeled, FeedForward, UnlabeledFeedForward using JukaiNLP: readconll, train!, decode, evaluate, toconll, initmodel!, MyAdaGrad using JukaiNLP.DepParsing: Token, readconll_withprobs using Me...
[ 27, 456, 62, 30783, 29, 15, 198, 198, 535, 439, 7, 25, 20362, 62, 37023, 62, 261, 62, 82, 328, 600, 11, 18331, 11, 357, 34, 600, 11, 828, 657, 8, 198, 198, 14689, 0, 7, 35613, 62, 34219, 11, 366, 492, 4943, 198, 3500, 449, 2...
2.46797
2,404
<gh_stars>10-100 using PastaQ using ITensors using Test using LinearAlgebra @testset "Gate generation: 1-qubit gates" begin i = Index(2, tags = "Qubit") g = gate("I", i) @test plev(inds(g)[1]) == 1 @test plev(inds(g)[2]) == 0 ggdag = g * prime(dag(g), 1; plev=1) @test ITensors.array(ggdag) ≈ Matrix{Int}...
[ 27, 456, 62, 30783, 29, 940, 12, 3064, 198, 3500, 11303, 64, 48, 198, 3500, 7283, 641, 669, 198, 3500, 6208, 198, 3500, 44800, 2348, 29230, 198, 198, 31, 9288, 2617, 366, 22628, 5270, 25, 352, 12, 421, 2545, 17435, 1, 2221, 198, 2...
1.966522
11,052
<reponame>AStupidBear/FastRecurFlux.jl<gh_stars>0 import Base: broadcasted LoopVectorization.vmap(f, x::ReverseDiff.TrackedArray) = ReverseDiff.track(vmap, f, x) drelu(x, Δ) = ifelse(x > 0, Δ, zero(x)) ReverseDiff.@grad function broadcasted(::typeof(relu), x::ReverseDiff.TrackedArray) relu.(x), Δ -> (nothing, dr...
[ 27, 7856, 261, 480, 29, 32, 1273, 7658, 36352, 14, 22968, 6690, 333, 37, 22564, 13, 20362, 27, 456, 62, 30783, 29, 15, 198, 11748, 7308, 25, 7025, 276, 198, 198, 39516, 38469, 1634, 13, 85, 8899, 7, 69, 11, 2124, 3712, 49, 964, ...
2.210909
275
using Literate Literate.markdown("foo.jl", "."; documenter=true) Literate.notebook("foo.jl", "."; documenter=true)
[ 3500, 17667, 378, 198, 43460, 378, 13, 4102, 2902, 7203, 21943, 13, 20362, 1600, 366, 526, 26, 3188, 263, 28, 7942, 8, 198, 43460, 378, 13, 11295, 2070, 7203, 21943, 13, 20362, 1600, 366, 526, 26, 3188, 263, 28, 7942, 8, 198 ]
2.738095
42
<reponame>RexWzh/LeetCode.jl # --- # title: 1025. Divisor Game # id: problem1025 # author: Indigo # date: 2022-04-14 # difficulty: Easy # categories: Math, Dynamic Programming # link: <https://leetcode.com/problems/divisor-game/description/> # hidden: true # --- # # Alice and Bob take turns playing a game, with Alice ...
[ 27, 7856, 261, 480, 29, 47389, 54, 23548, 14, 3123, 316, 10669, 13, 20362, 198, 2, 11420, 198, 2, 3670, 25, 838, 1495, 13, 4777, 271, 273, 3776, 198, 2, 4686, 25, 1917, 940, 1495, 198, 2, 1772, 25, 40673, 198, 2, 3128, 25, 33160...
2.472917
480
<filename>src/lib/SDL_ttf.jl # Julia wrapper for header: /Users/bieler/Downloads/SDL2_ttf-2.0.14/libSDL2_ttf.h # Automatically generated using Clang.jl wrap_c, version 0.0.0 include("SDL_ttf_h.jl") function TTF_Linked_Version() ccall((:TTF_Linked_Version, libsdl2_ttf), Ptr{SDL_version}, ()) end function TTF_ByteS...
[ 27, 34345, 29, 10677, 14, 8019, 14, 10305, 43, 62, 926, 69, 13, 20362, 198, 2, 22300, 29908, 329, 13639, 25, 1220, 14490, 14, 65, 8207, 263, 14, 10002, 82, 14, 10305, 43, 17, 62, 926, 69, 12, 17, 13, 15, 13, 1415, 14, 8019, 10...
2.214265
3,393
<filename>0012/lu!(F, X) example.jl # --- # jupyter: # jupytext: # formats: ipynb,jl:hydrogen # text_representation: # extension: .jl # format_name: hydrogen # format_version: '1.3' # jupytext_version: 1.11.2 # kernelspec: # display_name: Julia 1.6.2 # language: julia # n...
[ 27, 34345, 29, 405, 1065, 14, 2290, 0, 7, 37, 11, 1395, 8, 1672, 13, 20362, 198, 2, 11420, 198, 2, 474, 929, 88, 353, 25, 198, 2, 220, 220, 474, 929, 88, 5239, 25, 198, 2, 220, 220, 220, 220, 17519, 25, 20966, 2047, 65, 11, ...
2.021175
1,464
<gh_stars>1-10 using HDF5,JLD,KUnet isdefined(:xtrn) || (@date @load "zn11oparse1.jld") d0 = 6f0 c0 = 1f0 g0 = .1f0 nc = size(ytrn,1) niters=1000 nbatch=100 ntest=10000 net=net1=net2=net3=nothing KUnet.gpu(true) for y in (:ytrn, :ydev, :ytst) @eval $y=full($y) end # This speeds up the accuracy fn #xtrn1=xtrn[:,1:1...
[ 27, 456, 62, 30783, 29, 16, 12, 940, 198, 3500, 5572, 37, 20, 11, 41, 11163, 11, 42, 3118, 316, 198, 271, 23211, 7, 25, 742, 35906, 8, 8614, 4275, 4475, 2488, 2220, 366, 47347, 1157, 404, 17208, 16, 13, 73, 335, 4943, 198, 198, ...
1.854075
3,166
module SpecialArrays using Adapt using Base: @propagate_inbounds, @pure, @_inline_meta using Base: require_one_based_indexing, tail, unsafe_length using Compat using DocStringExtensions using Requires: @require using UnsafeArrays const NestedArray{V,M,N} = AbstractArray{<:AbstractArray{V,M},N} include("tuple.jl"...
[ 21412, 6093, 3163, 20477, 198, 198, 3500, 30019, 198, 198, 3500, 7308, 25, 2488, 22930, 37861, 62, 259, 65, 3733, 11, 2488, 37424, 11, 2488, 62, 45145, 62, 28961, 198, 3500, 7308, 25, 2421, 62, 505, 62, 3106, 62, 9630, 278, 11, 7894...
2.830189
265
""" randommask(n, Bernoulli(p)[ symmetric=true]) Generate a random Bernoulli mask of n × n. """ function randommask(n::Int, distribution::Bernoulli{T}; symmetric=true) where T n ≥ 2 || throw(DomainError(n, "n < 2")) if symmetric # Generates a random lower triangular matrix and then symmetrizes it ...
[ 37811, 198, 220, 220, 43720, 2002, 2093, 7, 77, 11, 6206, 280, 15516, 7, 79, 38381, 23606, 19482, 28, 7942, 12962, 198, 198, 8645, 378, 257, 4738, 6206, 280, 15516, 9335, 286, 299, 13958, 299, 13, 198, 37811, 198, 8818, 43720, 2002, ...
2.670913
1,413
using Makie, Dates, Observables, Printf, Images mss = [Millisecond(25), Millisecond(125)] t = Millisecond(Second(5)) fs = Int.(t./mss) fs[end] += 1 Δt = vcat((fill(ms, f) for (ms, f) in zip(mss, fs))...) Δt[1] = Millisecond(0) ts = cumsum(Δt) cd(tempdir()) dar = 2 w = length(ts) h = dar*w frame = Observable(1) point =...
[ 3500, 15841, 494, 11, 44712, 11, 19243, 2977, 11, 12578, 69, 11, 5382, 198, 198, 76, 824, 796, 685, 22603, 27866, 623, 7, 1495, 828, 9212, 27866, 623, 7, 11623, 15437, 198, 83, 796, 9212, 27866, 623, 7, 12211, 7, 20, 4008, 198, 95...
2.236629
1,234
<filename>test/vector.jl @testset "Vector: $TRef" for (TVec, T, TRef) in [ (ArbVector, Arb, Arb), (AcbVector, Acb, Acb), (ArbRefVector, Arb, ArbRef), (AcbRefVector, Acb, AcbRef), ] V = TVec(4, prec = 128) @test size(V) == (4,) @test precision(V) == 128 x = T(1.5) V[3] = x @test ...
[ 27, 34345, 29, 9288, 14, 31364, 13, 20362, 198, 31, 9288, 2617, 366, 38469, 25, 720, 5446, 891, 1, 329, 357, 6849, 721, 11, 309, 11, 7579, 891, 8, 287, 685, 198, 220, 220, 220, 357, 3163, 65, 38469, 11, 943, 65, 11, 943, 65, 8...
1.841445
1,356
# Code for video 3_3: Pkg.add("RDatasets") using RDatasets data = dataset("datasets", "iris") head(data) # 6x5 DataFrames.DataFrame # | Row | SepalLength | SepalWidth | PetalLength | PetalWidth | Species | # |-----|-------------|------------|-------------|------------|----------| # | 1 | 5.1 | 3.5 ...
[ 2, 6127, 329, 2008, 513, 62, 18, 25, 201, 198, 201, 198, 47, 10025, 13, 2860, 7203, 49, 27354, 292, 1039, 4943, 201, 198, 3500, 371, 27354, 292, 1039, 201, 198, 7890, 796, 27039, 7203, 19608, 292, 1039, 1600, 366, 29616, 4943, 201, ...
1.604106
6,916
""" A module which provides common astrodynamics calculations. # Extended help **Exports** $(EXPORTS) **Imports** $(IMPORTS) """ module Calculations export Circular, Elliptical, Parabolic, Hyperbolic export conic, keplerian, cartesian export perifocal, semimajor_axis export kepler, lambert, lambert_universal, lam...
[ 37811, 198, 32, 8265, 543, 3769, 2219, 6468, 14892, 4989, 873, 198, 9948, 3129, 602, 13, 198, 198, 2, 24204, 1037, 198, 198, 1174, 3109, 3742, 1174, 198, 198, 3, 7, 49864, 33002, 8, 198, 198, 1174, 3546, 3742, 1174, 198, 198, 3, 7...
2.797422
543
<reponame>thabbott/D92PVInversion<gh_stars>0 using D91PVInversion using IterativeSolvers using LinearAlgebra using SparseArrays using Random import PyPlot; const plt = PyPlot # Define functional form of PV anomaly function q′fun(x, y, z, A, L, H, p::Params) πc = p.π0 - 0.5 Π = p.Π return A*exp(-(x^2 + y^2)...
[ 27, 7856, 261, 480, 29, 400, 6485, 1252, 14, 35, 5892, 47, 53, 818, 9641, 27, 456, 62, 30783, 29, 15, 198, 3500, 360, 6420, 47, 53, 818, 9641, 198, 3500, 40806, 876, 36949, 690, 198, 3500, 44800, 2348, 29230, 198, 3500, 1338, 1720...
2.161182
1,793
<filename>examples/PlotPowerSpectrum.jl using MatterPower using Roots using Plots, LaTeXStrings # %% Specify a redshift redshift = 0 # %% Define a function to return a linear matter power spectrum (in units of Mpc^3/h^3) # as a function of the comoving wavenumber, kovh, in units of h/Mpc. # Here is an example using E...
[ 27, 34345, 29, 1069, 12629, 14, 43328, 13434, 49738, 6582, 13, 20362, 198, 3500, 16900, 13434, 198, 3500, 34341, 198, 3500, 1345, 1747, 11, 4689, 49568, 13290, 654, 198, 198, 2, 43313, 18291, 1958, 257, 2266, 30846, 198, 445, 30846, 796...
2.06345
1,119
using statmech_tm_solver using Documenter DocMeta.setdocmeta!(statmech_tm_solver, :DocTestSetup, :(using statmech_tm_solver); recursive=true) makedocs(; modules=[statmech_tm_solver], authors="<NAME> <<EMAIL>> and contributors", repo="https://github.com/<EMAIL>/statmech_tm_solver.jl/blob/{commit}{path}#{li...
[ 3500, 1185, 1326, 354, 62, 17209, 62, 82, 14375, 198, 3500, 16854, 263, 198, 198, 23579, 48526, 13, 2617, 15390, 28961, 0, 7, 14269, 1326, 354, 62, 17209, 62, 82, 14375, 11, 1058, 23579, 14402, 40786, 11, 36147, 3500, 1185, 1326, 354,...
2.185897
312
<filename>src/validation.jl ############################################################################## # Validation ############################################################################## testloss(R::PointResults) = R.testloss trainloss(R::PointResults) = R.trainloss thetaopt(R::PointResults) = R.theta lamb...
[ 27, 34345, 29, 10677, 14, 12102, 341, 13, 20362, 198, 29113, 29113, 7804, 4242, 2235, 198, 2, 3254, 24765, 198, 29113, 29113, 7804, 4242, 2235, 198, 198, 9288, 22462, 7, 49, 3712, 12727, 25468, 8, 796, 371, 13, 9288, 22462, 198, 27432...
2.783333
900
# # Optimization of the default MARGO configuration # ## Using `ClimateMARGO.jl` using ClimateMARGO using ClimateMARGO.Models using ClimateMARGO.Optimization # ## Loading preset configurations # Load the pre-defined default MARGO parameters, which are described by the ClimateModelParameters struct params = deepcopy(...
[ 2, 1303, 30011, 1634, 286, 262, 4277, 18805, 11230, 8398, 198, 198, 2, 22492, 8554, 4600, 37649, 40569, 11230, 13, 20362, 63, 198, 3500, 13963, 40569, 11230, 198, 3500, 13963, 40569, 11230, 13, 5841, 1424, 198, 3500, 13963, 40569, 11230, ...
3.881757
296
""" A structure that is assumed to hold a homogenous transform. """ struct basic_dh{T} mat::SMatrix{4,4,T,16} function basic_dh(t::SVector{3,T}) where {T} mat = SMatrix{4,4,T,16}( one(T), zero(T), zero(T), zero(T), zero(T), one(T), zero(T), zero(T), ...
[ 198, 37811, 198, 32, 4645, 326, 318, 9672, 284, 1745, 257, 3488, 27897, 6121, 13, 198, 37811, 198, 7249, 4096, 62, 34985, 90, 51, 92, 198, 220, 220, 220, 2603, 3712, 12310, 265, 8609, 90, 19, 11, 19, 11, 51, 11, 1433, 92, 198, 2...
1.608326
2,234
struct CommissionReport execId::String commission::Float64 currency::String realizedPNL::Union{Float64,Nothing} yield::Union{Float64,Nothing} yieldRedemptionDate::Union{Int,Nothing} # yyyymmdd format TODO: -> String or Date end struct ContractDescription contract::Contract derivativeSecTypes::Vect...
[ 7249, 4513, 19100, 198, 220, 2452, 7390, 3712, 10100, 198, 220, 5810, 3712, 43879, 2414, 198, 220, 7395, 3712, 10100, 198, 220, 6939, 13137, 43, 3712, 38176, 90, 43879, 2414, 11, 18465, 92, 198, 220, 7800, 3712, 38176, 90, 43879, 2414, ...
2.867203
994
<reponame>johnmyleswhite/IntertemporalChoiceHeuristics.jl function update_weights!( new_weights::Vector, weights::Vector, training_proportion::Real, ) n = round(Int, training_proportion * sum(weights)) π = weights ./ sum(weights) d = Distributions.Multinomial(n, π) rand!(d, new_weights) ...
[ 27, 7856, 261, 480, 29, 30686, 1820, 829, 11186, 14, 9492, 11498, 35738, 46770, 1544, 333, 3969, 13, 20362, 198, 8818, 4296, 62, 43775, 0, 7, 198, 220, 220, 220, 649, 62, 43775, 3712, 38469, 11, 198, 220, 220, 220, 19590, 3712, 3846...
2.585938
128
<reponame>LaudateCorpus1/AutoMLPipeline.jl<filename>examples/discourse_zevelev.jl # from discourse discussion with zevelev using Distributed addprocs() @everywhere using AutoMLPipeline, DataFrames #Get models. sk= AutoMLPipeline.SKLearners.learner_dict |> keys |> collect; sk= sk |> x-> sort(x,lt=(x,y)->lowercase(x)<lo...
[ 27, 7856, 261, 480, 29, 43, 3885, 378, 45680, 385, 16, 14, 27722, 5805, 47, 541, 4470, 13, 20362, 27, 34345, 29, 1069, 12629, 14, 15410, 9047, 62, 2736, 303, 2768, 13, 20362, 198, 2, 422, 18129, 5114, 351, 41271, 303, 2768, 198, 3...
2.314735
699
<reponame>gabehassler/RunMetrics.jl<gh_stars>0 using DataFrames, TimeZones, Statistics const DESIGN_COLS = Dict("speed" => 2, "climb" => 3) struct PreDesign hr::Vector{Float64} time::Vector{Float64} date::Float64 X::Matrix{Float64} # [speed climb] function PreDesign(rs:...
[ 27, 7856, 261, 480, 29, 70, 11231, 71, 562, 1754, 14, 10987, 9171, 10466, 13, 20362, 27, 456, 62, 30783, 29, 15, 198, 3500, 6060, 35439, 11, 3862, 57, 1952, 11, 14370, 198, 198, 9979, 22196, 16284, 62, 25154, 50, 796, 360, 713, 72...
1.806357
2,045
function Line(arg0::Line) return Line((Line,), arg0) end function Line(arg0::Vector3D, arg1::Vector3D, arg2::jdouble) return Line((Vector3D, Vector3D, jdouble), arg0, arg1, arg2) end function closest_point(obj::Line, arg0::Line) return jcall(obj, "closestPoint", Vector3D, (Line,), arg0) end function cont...
[ 8818, 6910, 7, 853, 15, 3712, 13949, 8, 198, 220, 220, 220, 1441, 6910, 19510, 13949, 11, 828, 1822, 15, 8, 198, 437, 198, 198, 8818, 6910, 7, 853, 15, 3712, 38469, 18, 35, 11, 1822, 16, 3712, 38469, 18, 35, 11, 1822, 17, 3712, ...
2.536151
899
import Base: reshape, vec, permutedims, permutedims! function reshape(a::KnetArray{T}, dims::Dims) where T if dims==size(a) a elseif prod(dims) != length(a) throw(DimensionMismatch()) else KnetArray{T,length(dims)}(a.ptr, dims) end end reshape(a::KnetArray, dims::Union{Int,Colo...
[ 11748, 7308, 25, 27179, 1758, 11, 43030, 11, 9943, 7241, 12078, 11, 9943, 7241, 12078, 0, 198, 198, 8818, 27179, 1758, 7, 64, 3712, 42, 3262, 19182, 90, 51, 5512, 5391, 82, 3712, 35, 12078, 8, 810, 309, 198, 220, 220, 220, 611, 53...
2.252336
535
const JNI_VERSION_1_1 = convert(Cint, 0x00010001) const JNI_VERSION_1_2 = convert(Cint, 0x00010002) const JNI_VERSION_1_4 = convert(Cint, 0x00010004) const JNI_VERSION_1_6 = convert(Cint, 0x00010006) const JNI_VERSION_1_8 = convert(Cint, 0x00010008) const JNI_TRUE = convert(Cchar, 1) const JNI_FALSE = convert(Cchar, 0...
[ 9979, 449, 22125, 62, 43717, 62, 16, 62, 16, 796, 10385, 7, 34, 600, 11, 657, 87, 18005, 18005, 8, 198, 9979, 449, 22125, 62, 43717, 62, 16, 62, 17, 796, 10385, 7, 34, 600, 11, 657, 87, 18005, 34215, 8, 198, 9979, 449, 22125, ...
2.224819
5,391
abstract type AbstractSQLHandle end #=================================================================================================== <SQLEnvironement> ===================================================================================================# struct SQLEnvironement <: AbstractSQLHandle ptr::Ptr{V...
[ 198, 397, 8709, 2099, 27741, 17861, 37508, 886, 198, 198, 2, 23926, 10052, 18604, 198, 220, 220, 220, 1279, 50, 48, 2538, 77, 2268, 972, 29, 198, 23926, 10052, 18604, 2, 198, 7249, 49747, 2538, 77, 2268, 972, 1279, 25, 27741, 17861, ...
3.201655
3,263
<reponame>gszep/BifurcationFit.jl<filename>test/minimal/pitchfork.jl ######################################################## model F(z::BorderedArray,θ::AbstractVector) = F(z.u,(θ=θ,p=z.p)) function F(u::AbstractVector,parameters::NamedTuple) @unpack θ,p = parameters f = first(u)*first(p)*first(θ) F = similar(u,ty...
[ 27, 7856, 261, 480, 29, 14542, 89, 538, 14, 33, 361, 333, 30907, 31805, 13, 20362, 27, 34345, 29, 9288, 14, 1084, 4402, 14, 79, 2007, 32523, 13, 20362, 198, 29113, 14468, 7804, 2746, 198, 37, 7, 89, 3712, 33, 24071, 19182, 11, 138...
2.453704
216
<filename>src/Types.jl<gh_stars>10-100 module Types abstract type AbstractDelayed end const SPACE_TYPE = Union{ Dict{Symbol, T} where T, AbstractDelayed, AbstractVector, } end # module
[ 27, 34345, 29, 10677, 14, 31431, 13, 20362, 27, 456, 62, 30783, 29, 940, 12, 3064, 198, 21412, 24897, 198, 198, 397, 8709, 2099, 27741, 13856, 16548, 886, 198, 198, 9979, 37253, 62, 25216, 796, 4479, 90, 198, 220, 220, 220, 360, 713...
2.666667
75
module PandaMPC using LinearAlgebra, Plots, ECOS, Convex, DelimitedFiles import LinearAlgebra, Plots, ECOS, Convex, DelimitedFiles ############################################################################### # This block contains the ball's trajectory simulation functions """ Given an array with the initial posit...
[ 21412, 41112, 44, 5662, 198, 198, 3500, 44800, 2348, 29230, 11, 1345, 1747, 11, 13182, 2640, 11, 1482, 303, 87, 11, 4216, 320, 863, 25876, 198, 198, 11748, 44800, 2348, 29230, 11, 1345, 1747, 11, 13182, 2640, 11, 1482, 303, 87, 11, ...
1.918331
10,016
mutable struct DocumentTermMatrix{T} dtm::SparseMatrixCSC{Int, Int} terms::Vector{T} column_indices::Dict{T, Int} end """ columnindices(terms::Vector{String}) Creates a column index lookup dictionary from a vector of terms. """ function columnindices(terms::Vector{T}) where T column_indices = Dic...
[ 76, 18187, 2878, 16854, 40596, 46912, 90, 51, 92, 198, 220, 220, 220, 288, 17209, 3712, 50, 29572, 46912, 34, 6173, 90, 5317, 11, 2558, 92, 198, 220, 220, 220, 2846, 3712, 38469, 90, 51, 92, 198, 220, 220, 220, 5721, 62, 521, 1063...
2.411801
3,203
Pointcloud = Array{T,N} where {T <: Real, N}
[ 12727, 17721, 796, 15690, 90, 51, 11, 45, 92, 810, 1391, 51, 1279, 25, 6416, 11, 399, 92, 198 ]
2.368421
19
using PermutationGroups using Groups.KnuthBendix @testset "Wajnryb presentation for Σ₄₁" begin genus = 4 Fn = FreeGroup(2genus) G = SpecialAutomorphismGroup(Fn) T = Groups.mcg_twists(G) # symplectic pairing in the free Group goes like this: # f1 ↔ f5 # f2 ↔ f6 # f3 ↔ f7 # f4 ↔ f...
[ 3500, 2448, 76, 7094, 38, 14459, 198, 3500, 27441, 13, 25095, 1071, 33, 19573, 198, 198, 31, 9288, 2617, 366, 54, 1228, 77, 563, 65, 10470, 329, 7377, 96, 158, 224, 226, 158, 224, 223, 1, 2221, 628, 220, 220, 220, 34306, 796, 604,...
1.63172
3,367
#Wrappers for functions directly in the rospy namespace export init_node, is_shutdown, spin, get_param, has_param, set_param, delete_param, logdebug, loginfo, logwarn, logerr, logfatal """ init_node(name; args...) Initialize this node, registering it with the ROS master. All arguments are passed on ...
[ 2, 36918, 11799, 329, 5499, 3264, 287, 262, 686, 2777, 88, 25745, 198, 39344, 2315, 62, 17440, 11, 318, 62, 49625, 2902, 11, 7906, 11, 198, 220, 220, 220, 220, 220, 220, 651, 62, 17143, 11, 468, 62, 17143, 11, 900, 62, 17143, 11, ...
2.558287
1,261
<reponame>SabbahMohammed/Dev<filename>src/solvind second order diffEq.jl using DifferentialEquations, LinearAlgebra using Plots plotly() #= m*x`` + b*x` + k*x + a*x^3 = -mg y = x` =# function fun(du,u,p,t) m,k,g,a,b = p du[1] = u[2] du[2] = -1/m*(b*u[2]+ k*u[1]+ a*u[1]^3+ m*g) end m, k, g, a = 1220.0, 35...
[ 27, 7856, 261, 480, 29, 50, 6485, 993, 38443, 10573, 14, 13603, 27, 34345, 29, 10677, 14, 34453, 50172, 1218, 1502, 814, 36, 80, 13, 20362, 198, 3500, 20615, 498, 23588, 602, 11, 44800, 2348, 29230, 198, 3500, 1345, 1747, 198, 29487, ...
1.770833
288
function get_comp(c::Char) if c=='A' return 'T' elseif c=='T' return 'A' elseif c=='C' return 'G' elseif c=='G' return 'C' else println("$c is not A, T, C, or G.") return 'N' end end get_revcomp(s::String) = reverse(join([get_comp(c) for c in s]))
[ 8818, 651, 62, 5589, 7, 66, 3712, 12441, 8, 198, 220, 220, 220, 611, 269, 855, 6, 32, 6, 1441, 705, 51, 6, 198, 220, 220, 220, 2073, 361, 269, 855, 6, 51, 6, 1441, 705, 32, 6, 198, 220, 220, 220, 2073, 361, 269, 855, 6, 34...
2.013986
143
<filename>src/data/water_value.jl struct WaterValueCut{T <: AbstractFloat} plant_indices::Dict{Plant, Int} coeffs::Vector{T} lb::T indices::Vector{Int} function WaterValueCut(plant_indices::Dict{Plant, Int}, coeffs::Vector{T}, lb::T, indices::Vector{Int}) where T <: AbstractFloat new{T}(pla...
[ 27, 34345, 29, 10677, 14, 7890, 14, 7050, 62, 8367, 13, 20362, 198, 7249, 5638, 11395, 26254, 90, 51, 1279, 25, 27741, 43879, 92, 198, 220, 220, 220, 4618, 62, 521, 1063, 3712, 35, 713, 90, 3646, 415, 11, 2558, 92, 198, 220, 220, ...
2.774922
1,284
<gh_stars>100-1000 using Distributions, StatsBase, Random Random.seed!(1) dist1 = TriangularDist(0,10,5) dist2 = DiscreteUniform(1,5) theorMean1, theorMean2 = mean(dist1), mean(dist2) N = 10^6 data1 = rand(dist1,N) data2 = rand(dist2,N) estMean1, estMean2 = mean(data1), mean(data2) println("Symmetric Triangular Dist...
[ 27, 456, 62, 30783, 29, 3064, 12, 12825, 198, 3500, 46567, 507, 11, 20595, 14881, 11, 14534, 198, 29531, 13, 28826, 0, 7, 16, 8, 198, 198, 17080, 16, 796, 7563, 21413, 20344, 7, 15, 11, 940, 11, 20, 8, 198, 17080, 17, 796, 8444,...
2.346154
208
<filename>src/clang/api/Lex/PreprocessorOptions.jl # PreprocessorOptions function PrintStats(x::PreprocessorOptions) @check_ptrs x return clang_PreprocessorOptions_PrintStats(x) end
[ 27, 34345, 29, 10677, 14, 565, 648, 14, 15042, 14, 45117, 14, 6719, 41341, 29046, 13, 20362, 198, 2, 3771, 41341, 29046, 198, 8818, 12578, 29668, 7, 87, 3712, 6719, 41341, 29046, 8, 198, 220, 220, 220, 2488, 9122, 62, 457, 3808, 212...
3.015873
63
<filename>src/ltsa.jl # Local Tangent Space Alignment (LTSA) # --------------------------- # Principal Manifolds and Nonlinear Dimension Reduction via Local Tangent Space Alignment, # <NAME>; <NAME> (2004), SIAM Journal on Scientific Computing 26 (1): 313–338. # doi:10.1137/s1064827502419154. #### LTSA type struct LT...
[ 27, 34345, 29, 10677, 14, 75, 912, 64, 13, 20362, 198, 2, 10714, 18816, 298, 4687, 978, 16747, 357, 27734, 4090, 8, 198, 2, 220, 22369, 6329, 198, 2, 32641, 1869, 361, 10119, 290, 8504, 29127, 34024, 33396, 2884, 10714, 18816, 298, ...
2.192893
788