content stringlengths 6 1.03M | input_ids listlengths 4 535k | ratio_char_token float64 0.68 8.61 | token_count int64 4 535k |
|---|---|---|---|
using QuantumSpatialSearch
using BenchmarkTools
N = 10
psi0 = 1/sqrt(N) * ones(ComplexF64, N)
maxdt = 0.01
println("Precompiling")
spatialsearch(psi0, star_graph_Ad;
maxdt=maxdt, # maximum allowed time for dt
gamma=1. / N,
posW=1,
time=2*s... | [
3500,
29082,
4561,
34961,
18243,
198,
3500,
25187,
4102,
33637,
198,
198,
45,
796,
838,
198,
862,
72,
15,
796,
352,
14,
31166,
17034,
7,
45,
8,
1635,
3392,
7,
5377,
11141,
37,
2414,
11,
399,
8,
198,
9806,
28664,
796,
657,
13,
486,... | 1.606957 | 575 |
<filename>src/main.jl<gh_stars>0
include("MainModule.jl")
import Gtk
function main()
win = MainModule.MainWindow()
Gtk.showall(win)
if !isinteractive()
c = Condition()
Gtk.signal_connect(win, :destroy) do widget
notify(c)
end
wait(c)
end
end
| [
27,
34345,
29,
10677,
14,
12417,
13,
20362,
27,
456,
62,
30783,
29,
15,
198,
17256,
7203,
13383,
26796,
13,
20362,
4943,
198,
11748,
402,
30488,
198,
8818,
1388,
3419,
198,
220,
1592,
796,
8774,
26796,
13,
13383,
27703,
3419,
198,
220... | 2.385965 | 114 |
for (S,T) in ((:SafeInt8, :Int8), (:SafeInt16, :Int16), (:SafeInt32, :Int32), (:SafeInt64, :Int64), (:SafeInt128, :Int128))
@eval begin
function parse(::Type{$S}, str::A) where {A<:AbstractString}
(occursin('.', str) || occursin('e', str) || occursin('f', str)) && return Meta.parse(str)
x = pa... | [
1640,
357,
50,
11,
51,
8,
287,
14808,
25,
31511,
5317,
23,
11,
1058,
5317,
23,
828,
357,
25,
31511,
5317,
1433,
11,
1058,
5317,
1433,
828,
357,
25,
31511,
5317,
2624,
11,
1058,
5317,
2624,
828,
220,
357,
25,
31511,
5317,
2414,
11,... | 2.162476 | 517 |
<reponame>danielzhaotongliu/MALTrendsWeb
{"score_count": 121342, "score": 7.84, "timestamp": 1575954761.0}
{"score_count": 117795, "score": 7.86, "timestamp": 1555254980.0}
{"score_count": 111838, "score": 7.88, "timestamp": 1522273404.0}
{"score_count": 100872, "score": 7.94, "timestamp": 1484588872.0}
{"score_count":... | [
27,
7856,
261,
480,
29,
67,
6321,
89,
3099,
313,
506,
4528,
84,
14,
44,
31429,
10920,
82,
13908,
198,
4895,
26675,
62,
9127,
1298,
1105,
1485,
3682,
11,
366,
26675,
1298,
767,
13,
5705,
11,
366,
16514,
27823,
1298,
1315,
2425,
3865,... | 2.299145 | 585 |
# Copyright (c) 2021 <NAME>
# Copyright (c) 2000 <NAME>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later versi... | [
2,
220,
220,
220,
15069,
357,
66,
8,
33448,
1279,
20608,
29,
198,
2,
220,
220,
220,
15069,
357,
66,
8,
4751,
1279,
20608,
29,
198,
2,
198,
2,
220,
220,
220,
770,
1430,
318,
1479,
3788,
26,
345,
460,
17678,
4163,
340,
290,
14,
... | 2.131944 | 864 |
<filename>src/nomodule.jl
## for development
using DSP
using HDF5
if !isdefined(:WarpedArray)
include("types.jl")
end
include("rasta.jl")
include("mfccs.jl")
include("warpedarray.jl")
include("feacalc.jl")
include("io.jl")
| [
27,
34345,
29,
10677,
14,
26601,
375,
2261,
13,
20362,
198,
2235,
329,
2478,
198,
198,
3500,
360,
4303,
198,
3500,
5572,
37,
20,
198,
198,
361,
5145,
271,
23211,
7,
25,
54,
5117,
276,
19182,
8,
198,
220,
220,
220,
2291,
7203,
1919... | 2.395833 | 96 |
export ZeroPad
"""
`ZeroPad([domainType::Type,] dim_in::Tuple, zp::Tuple)`
`ZeroPad(x::AbstractArray, zp::Tuple)`
Create a `LinearOperator` which, when multiplied to an array `x` of size `dim_in`, returns an expanded array `y` of size `dim_in .+ zp` where `y[1:dim_in[1], 1:dim_in[2] ... ] = x` and zero elsewhere. ... | [
39344,
12169,
26114,
628,
198,
37811,
198,
63,
28667,
26114,
26933,
27830,
6030,
3712,
6030,
11,
60,
5391,
62,
259,
3712,
51,
29291,
11,
1976,
79,
3712,
51,
29291,
8,
63,
198,
198,
63,
28667,
26114,
7,
87,
3712,
23839,
19182,
11,
19... | 1.977925 | 1,359 |
using VisualDL
# initialize
train_logger = VisualDLLogger("tmp", 1, "train")
test_logger = as_mode(train_logger, "test")
# log scalars
for i in 1:100
with_logger(train_logger) do
@log_scalar s0=(i,rand()) s1=(i, rand())
end
with_logger(test_logger) do
@log_scalar s0=(i,rand()) s1=(i, rand... | [
3500,
15612,
19260,
198,
198,
2,
41216,
198,
27432,
62,
6404,
1362,
796,
15612,
35,
3069,
519,
1362,
7203,
22065,
1600,
352,
11,
366,
27432,
4943,
198,
9288,
62,
6404,
1362,
796,
355,
62,
14171,
7,
27432,
62,
6404,
1362,
11,
366,
92... | 2.103774 | 424 |
<reponame>getzlab/HTSLib.jl<gh_stars>1-10
# NOTE: This file contains machine-generated code by translate_exported_functions.jl.
# double kf_lgamma(double z);
@defun kf_lgamma(z::Cdouble)::Cdouble
# double kf_erfc(double x);
@defun kf_erfc(x::Cdouble)::Cdouble
# double kf_gammap(double s, double z);
@defun kf_gammap(... | [
27,
7856,
261,
480,
29,
1136,
89,
23912,
14,
39,
4694,
25835,
13,
20362,
27,
456,
62,
30783,
29,
16,
12,
940,
198,
2,
24550,
25,
770,
2393,
4909,
4572,
12,
27568,
2438,
416,
15772,
62,
1069,
9213,
62,
12543,
2733,
13,
20362,
13,
... | 2.321739 | 345 |
using HDF5, JLD, KDTrees, DataFrames
using Dates
function testingTimes (start::Int64, finish::Int64, radius::Float64)
startingHour = start
endingHour = finish
radius = 140.0
nodePositions = load("../Cities/Manhattan/manhattan.jld","positions")
trainingNumRides = zeros(Int64, length(nodePositions), length(nodePos... | [
3500,
5572,
37,
20,
11,
449,
11163,
11,
509,
24544,
6037,
11,
6060,
35439,
198,
3500,
44712,
198,
198,
8818,
4856,
28595,
357,
9688,
3712,
5317,
2414,
11,
5461,
3712,
5317,
2414,
11,
16874,
3712,
43879,
2414,
8,
198,
197,
38690,
43223... | 2.44678 | 1,475 |
<reponame>ChrisRackauckas/SimpleDiffEq.jl
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# Test related to the Runge-Kutta 4th order solver
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
using SimpleDiffEq, StaticArrays, OrdinaryDiffEq, Test
functi... | [
27,
7856,
261,
480,
29,
15645,
49,
441,
559,
694,
292,
14,
26437,
28813,
36,
80,
13,
20362,
198,
2,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
... | 1.757157 | 1,956 |
using Documenter, DataIndexer
makedocs(;
modules=[DataIndexer],
format=Documenter.HTML(),
pages=[
"Home" => "index.md",
],
repo="https://github.com/lizz/DataIndexer.jl/blob/{commit}{path}#L{line}",
sitename="DataIndexer.jl",
authors="lizz",
assets=String[],
)
| [
3500,
16854,
263,
11,
6060,
15732,
263,
198,
198,
76,
4335,
420,
82,
7,
26,
198,
220,
220,
220,
13103,
41888,
6601,
15732,
263,
4357,
198,
220,
220,
220,
5794,
28,
24941,
263,
13,
28656,
22784,
198,
220,
220,
220,
5468,
41888,
198,
... | 2.263158 | 133 |
<filename>src/lC_common_h.jl
macro c(ret_type, func, arg_types, lib)
local args_in = Any[ symbol(string('a',x)) for x in 1:length(arg_types.args) ]
quote
$(esc(func))($(args_in...)) = ccall( ($(string(func)), $(Expr(:quote, lib)) ), $ret_type, $arg_types, $(args_in...) )
end
end
macro ctypedef(fake_t,real_t)... | [
27,
34345,
29,
10677,
14,
75,
34,
62,
11321,
62,
71,
13,
20362,
198,
20285,
305,
269,
7,
1186,
62,
4906,
11,
25439,
11,
1822,
62,
19199,
11,
9195,
8,
198,
220,
1957,
26498,
62,
259,
796,
4377,
58,
6194,
7,
8841,
10786,
64,
3256,... | 2.289247 | 9,058 |
using Meshing
using GeometryTypes
using LinearAlgebra: dot, norm
using FileIO
# generate an SDF of a sphere
sdf_sphere = SignedDistanceField(HyperRectangle(Vec(-1,-1,-1.),Vec(2,2,2.))) do v
sqrt(sum(dot(v,v))) - 1 # sphere
end
m = GLNormalMesh(sdf_sphere, MarchingCubes())
save("sphere.ply",m)
| [
3500,
14937,
722,
198,
3500,
2269,
15748,
31431,
198,
3500,
44800,
2348,
29230,
25,
16605,
11,
2593,
198,
3500,
9220,
9399,
198,
198,
2,
7716,
281,
311,
8068,
286,
257,
16558,
198,
82,
7568,
62,
2777,
1456,
796,
36215,
45767,
15878,
7... | 2.529412 | 119 |
<gh_stars>1-10
struct SpecParams{T<:AF}
lines::AA{T,1}
depths::AA{T,1}
conv_blueshifts::AA{T,1}
variability::AA{Bool,1}
coverage::Tuple{T,T}
resolution::T
lambdas::AA{T,1}
soldata::SolarData{T}
end
"""
SpecParams(; lines=[], depths=[], variability=[], resolution=7e5)
Construct a `S... | [
27,
456,
62,
30783,
29,
16,
12,
940,
198,
7249,
18291,
10044,
4105,
90,
51,
27,
25,
8579,
92,
198,
220,
220,
220,
3951,
3712,
3838,
90,
51,
11,
16,
92,
198,
220,
220,
220,
21593,
3712,
3838,
90,
51,
11,
16,
92,
198,
220,
220,
... | 2.505629 | 977 |
<filename>src/form/acp.jl
""
function constraint_power_balance_shunt_dispatch(pm::AbstractACPModel, n::Int, i::Int, bus_arcs, bus_arcs_dc, bus_arcs_sw, bus_gens, bus_storage, bus_shunts_var, bus_pd, bus_qd, bus_gs_const, bus_bs_const)
vm = var(pm, n, :vm, i)
p = get(var(pm, n), :p, Dict()); PowerModel... | [
27,
34345,
29,
10677,
14,
687,
14,
330,
79,
13,
20362,
628,
198,
15931,
198,
8818,
32315,
62,
6477,
62,
20427,
62,
1477,
2797,
62,
6381,
17147,
7,
4426,
3712,
23839,
33056,
17633,
11,
299,
3712,
5317,
11,
1312,
3712,
5317,
11,
1323,... | 1.978776 | 4,052 |
export iauAper13
"""
In the star-independent astrometry parameters, update only the
Earth rotation angle. The caller provides UT1, (n.b. not UTC).
This function is part of the International Astronomical Union's
SOFA (Standards of Fundamental Astronomy) software collection.
Status: support function.
Given:
ut11 ... | [
39344,
220,
544,
84,
32,
525,
1485,
198,
37811,
198,
818,
262,
3491,
12,
34750,
6468,
398,
11973,
10007,
11,
4296,
691,
262,
198,
22840,
13179,
9848,
13,
220,
383,
24955,
3769,
19255,
16,
11,
357,
77,
13,
65,
13,
407,
18119,
737,
... | 2.551077 | 1,811 |
<filename>src/dynamics/dynamical_models.jl
#-----------------------#
# GENERIC MODEL METHODS #
#-----------------------#
@doc """Generic constructor for a DynamicalModel's underlying ODEFunctions."""
function (T::Type{<:Abstract_ModelODEFunctions})(args...; kwargs...)
_ode, deduplicate_terms = ODESystem(T, args...... | [
27,
34345,
29,
10677,
14,
67,
4989,
873,
14,
67,
4989,
605,
62,
27530,
13,
20362,
198,
2,
19351,
6329,
2,
198,
2,
24700,
1137,
2149,
19164,
3698,
337,
36252,
50,
1303,
198,
2,
19351,
6329,
2,
198,
198,
31,
15390,
37227,
46189,
237... | 2.711126 | 1,492 |
<reponame>harisbal/dash-bootstrap-components<filename>docs/components_page/components/form/simple.jl
using DashBootstrapComponents
email_input = dbc_formgroup([
dbc_label("Email", html_for="example-email"),
dbc_input(type="email", id="example-email", placeholder="Enter email"),
dbc_formtext("Are you on ema... | [
27,
7856,
261,
480,
29,
9869,
271,
6893,
14,
42460,
12,
18769,
26418,
12,
5589,
3906,
27,
34345,
29,
31628,
14,
5589,
3906,
62,
7700,
14,
5589,
3906,
14,
687,
14,
36439,
13,
20362,
198,
3500,
16189,
36476,
26418,
7293,
3906,
198,
19... | 3.130045 | 223 |
module MangalTestUsers
using Mangal
using Test
@test typeof(users()) <: Vector{MangalUser}
end
| [
21412,
27609,
282,
14402,
14490,
628,
220,
220,
220,
1262,
27609,
282,
198,
220,
220,
220,
1262,
6208,
628,
220,
220,
220,
2488,
9288,
2099,
1659,
7,
18417,
28955,
1279,
25,
20650,
90,
44,
648,
282,
12982,
92,
198,
220,
220,
220,
22... | 2.478261 | 46 |
#################################################################
###### Functionality related to observation dimensionality ######
#################################################################
# Note: The functions are designed to work on two
# dimensional data containers (i.e. matrices)
# Opposide dimension... | [
29113,
29113,
2,
198,
4242,
2235,
15553,
1483,
3519,
284,
13432,
15793,
1483,
46424,
2,
198,
29113,
29113,
2,
198,
197,
197,
2,
5740,
25,
383,
5499,
389,
3562,
284,
670,
319,
734,
220,
198,
197,
197,
2,
38517,
1366,
16472,
357,
72,
... | 2.840703 | 1,764 |
<reponame>EvoArt/BDA_Julia_demos<filename>to_compile.jl
using DataFrames,Distributions,CairoMakie,StatsFuns
df1 = DataFrame( θ = 0.375:0.001:0.525)
α,β = 438,544
posterior = Beta(α,β)
# the pdf function 'knows' when it is supplied a Beta distribution
df1.p =pdf.(posterior,df1.θ);
df2 =DataFrame(θ = LinRange(quantile(p... | [
27,
7856,
261,
480,
29,
36,
13038,
8001,
14,
33,
5631,
62,
16980,
544,
62,
9536,
418,
27,
34345,
29,
1462,
62,
5589,
576,
13,
20362,
198,
3500,
6060,
35439,
11,
20344,
2455,
507,
11,
34,
18131,
44,
461,
494,
11,
29668,
37,
13271,
... | 2.601523 | 394 |
<reponame>martinvanleeuwen/RenderJay<gh_stars>1-10
function hit_box(minx::T, miny::T, minz::T, maxx::T, maxy::T, maxz::T, ray::Ray{T}) where {T<:AbstractFloat}
minx2v1 = minx - ray.x
maxx2v1 = maxx - ray.x
miny2v1 = miny - ray.y
maxy2v1 = maxy - ray.y
minz2v1 = minz - ray.z
maxz2v1 = maxz - ray.... | [
27,
7856,
261,
480,
29,
13822,
259,
10438,
7197,
84,
21006,
14,
45819,
30568,
27,
456,
62,
30783,
29,
16,
12,
940,
198,
8818,
2277,
62,
3524,
7,
1084,
87,
3712,
51,
11,
949,
88,
3712,
51,
11,
949,
89,
3712,
51,
11,
3509,
87,
3... | 1.903305 | 7,353 |
using GeoStats
@info "All tests of the GeoStats.jl framework are available in submodules"
| [
3500,
32960,
29668,
198,
198,
31,
10951,
366,
3237,
5254,
286,
262,
32960,
29668,
13,
20362,
9355,
389,
1695,
287,
850,
18170,
1,
198
] | 3.791667 | 24 |
using Test, Convex, Cliffords, SCS, SchattenNorms, Distributions, QuantumInfo
import Random
import Base.kron
set_default_solver(SCSSolver(verbose=0, eps=1e-6, max_iters=5_000))
function paulichannel(p::Vector{T}) where T <: Real
n_ = log(4,length(p))
if !isinteger(n_)
error("Probability vector must h... | [
3500,
6208,
11,
1482,
303,
87,
11,
23501,
3669,
11,
6374,
50,
11,
3059,
41769,
35393,
82,
11,
46567,
507,
11,
29082,
12360,
198,
11748,
14534,
198,
198,
11748,
7308,
13,
74,
1313,
198,
198,
2617,
62,
12286,
62,
82,
14375,
7,
6173,
... | 2.040816 | 637 |
<filename>src/format/plain/oper.jl
# ----------------- Border methods ------------------------
@doc """
Holds infomation on the presence or absence of a border.
""" ->
type Border
horizontal::Matrix{Bool}
vertical::Matrix{Bool}
end
function Border(tbl::Table)
n, m = size(tbl)
return new(fill(false, n+1, m)... | [
27,
34345,
29,
10677,
14,
18982,
14,
25638,
14,
3575,
13,
20362,
198,
2,
34400,
12,
15443,
5050,
220,
22369,
198,
31,
15390,
37227,
198,
39,
10119,
1167,
296,
341,
319,
262,
4931,
393,
8889,
286,
257,
4865,
13,
198,
37811,
4613,
198... | 2.208249 | 994 |
<filename>test/samplespaces.jl
# DenseSampleSpace
s = samplespace(zeros(4,2), 100)
@test size(ShapleyValues.data(s)) == (4,0)
ShapleyValues.addsample!(s, ones(4))
@test ShapleyValues.data(s) == ones(4,1)
ShapleyValues.reset!(s)
@test size(ShapleyValues.data(s)) == (4,0)
ShapleyValues.addsample!(s, ones(4))
ShapleyValu... | [
27,
34345,
29,
9288,
14,
82,
12629,
43076,
13,
20362,
198,
198,
2,
360,
1072,
36674,
14106,
198,
82,
796,
8405,
10223,
7,
9107,
418,
7,
19,
11,
17,
828,
1802,
8,
198,
31,
9288,
2546,
7,
2484,
499,
1636,
40161,
13,
7890,
7,
82,
... | 2.292683 | 328 |
## csgObject
abstract type csgObject <: Object end
export csgUnion
struct csgUnion <: csgObject
objects :: Array{Object,1}
function csgUnion(objects)
if length(DeleteDuplicates(deleteat!(objects, isempty.(objects)))) == 0
Empty()
elseif length(DeleteDuplicates(deleteat!(objects, i... | [
2235,
269,
45213,
10267,
198,
198,
397,
8709,
2099,
269,
45213,
10267,
1279,
25,
9515,
886,
198,
198,
39344,
269,
45213,
38176,
198,
7249,
269,
45213,
38176,
1279,
25,
269,
45213,
10267,
198,
220,
220,
220,
5563,
7904,
15690,
90,
10267,... | 2.221445 | 2,145 |
<filename>test/items_test.jl
using Test
using SearchLight
using Item
@testset "Item unit tests" begin
@test 1 == 1
end
| [
27,
34345,
29,
9288,
14,
23814,
62,
9288,
13,
20362,
198,
3500,
6208,
198,
3500,
11140,
15047,
198,
3500,
9097,
198,
198,
31,
9288,
2617,
366,
7449,
4326,
5254,
1,
2221,
198,
220,
220,
220,
2488,
9288,
352,
6624,
352,
198,
437,
198
... | 2.883721 | 43 |
function read_dtf(file_path::String)::DataFrames.DataFrame
"""
Helper function that allows you to read DTF files into a DataFrame.
The DataFrame can then be used to reconstruct the orderbook.
Argument Descriptions:
`file_path::String` : Relative path to file.
"""
FLAG_EMPTY = 0b00... | [
8818,
1100,
62,
67,
27110,
7,
7753,
62,
6978,
3712,
10100,
2599,
25,
6601,
35439,
13,
6601,
19778,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
5053,
525,
2163,
326,
3578,
345,
284,
1100,
360,
10234,
3696,
656,
257,
6060,
19778,
1... | 2.09727 | 1,758 |
<reponame>deyandyankov/POMDPSimulators.jl
# mdp step simulator and stepthrough
@testset "gridstepsim" begin
p = LegacyGridWorld()
solver = RandomSolver(MersenneTwister(2))
policy = solve(solver, p)
sim = StepSimulator("s,sp,r,a,ai", rng=MersenneTwister(3), max_steps=100)
n_steps = 0
for (s, sp, ... | [
27,
7856,
261,
480,
29,
2934,
88,
10757,
962,
709,
14,
47,
2662,
35,
3705,
320,
24325,
13,
20362,
198,
2,
285,
26059,
2239,
35375,
290,
2239,
9579,
198,
31,
9288,
2617,
366,
25928,
9662,
14323,
1,
2221,
198,
220,
220,
220,
279,
79... | 2.164788 | 1,153 |
using TOML
using Test
using Dates
const jsnval = Dict{String,Function}(
"string" =>identity,
"float" => (s -> Base.parse(Float64, s)),
"integer" => (s -> Base.parse(Int64, s)),
"datetime" => (s -> Base.parse(DateTime, s, dateformat"yyyy-mm-ddTHH:MM:SSZ")),
"array" => (a -> map(jsn2data, a))... | [
3500,
41526,
43,
198,
198,
3500,
6208,
198,
3500,
44712,
198,
198,
9979,
474,
16184,
2100,
796,
360,
713,
90,
10100,
11,
22203,
92,
7,
198,
220,
220,
220,
366,
8841,
1,
5218,
738,
414,
11,
198,
220,
220,
220,
366,
22468,
1,
220,
... | 2.726894 | 2,402 |
<gh_stars>0
# using SafeTestsets
using MinimaxAI
using Test
# MinimaxAI.playBones(ai = 2,N=20)
@testset "Seeing if it works" begin
@test playBones(N = 2, ai =2) == nothing
@test playBones(N = 25, ai = 2) == nothing
@test playTicTacToe(ai = 2) == nothing
@test playConnect4(ai = 2, method = "minimaxAB",... | [
27,
456,
62,
30783,
29,
15,
198,
2,
1262,
19978,
51,
3558,
1039,
198,
3500,
1855,
320,
897,
20185,
198,
3500,
6208,
198,
2,
1855,
320,
897,
20185,
13,
1759,
33,
1952,
7,
1872,
796,
362,
11,
45,
28,
1238,
8,
628,
198,
31,
9288,
... | 2.436975 | 238 |
include("src/DiscretisedFluidQueues.jl")
using .DiscretisedFluidQueues
using LinearAlgebra, SparseArrays, StableRNGs
using Test
T = [-2.5 2 0.5; 1 -2 1; 1 2 -3];
C = [0.0; 2.0; -3.0];
m = -1 .+ 2*Int.(DiscretisedFluidQueues._strictly_pos.(C));
S = DiscretisedFluidQueues.PhaseSet(C);
model = DiscretisedFluidQueues.Bo... | [
17256,
7203,
10677,
14,
15642,
1186,
1417,
37,
2290,
312,
15681,
947,
13,
20362,
4943,
198,
3500,
764,
15642,
1186,
1417,
37,
2290,
312,
15681,
947,
198,
3500,
44800,
2348,
29230,
11,
1338,
17208,
3163,
20477,
11,
520,
540,
49,
10503,
... | 2.137681 | 414 |
# Julia wrapper for header: /home/astukalov/.julia/v0.5/Sundials/deps/usr/include/kinsol/kinsol.h
# Automatically generated using Clang.jl wrap_c, version 0.0.0
function KINCreate()
ccall((:KINCreate,libsundials_kinsol),KINMemPtr,())
end
function __KINSetErrHandlerFn(kinmem::KINMemPtr,ehfun::KINErrHandlerFn,eh_d... | [
2,
22300,
29908,
329,
13639,
25,
1220,
11195,
14,
459,
2724,
282,
709,
11757,
73,
43640,
14,
85,
15,
13,
20,
14,
20602,
8231,
14,
10378,
82,
14,
14629,
14,
17256,
14,
5331,
349,
14,
5331,
349,
13,
71,
198,
2,
17406,
4142,
7560,
... | 2.271055 | 8,917 |
#==============================================================================#
# Options to give in parameter file
#==============================================================================#
#------------------------------------------------------------------------------#
# Files
#-------------------------------... | [
2,
23926,
25609,
855,
2,
198,
2,
18634,
284,
1577,
287,
11507,
2393,
198,
2,
23926,
25609,
855,
2,
198,
198,
2,
10097,
26171,
2,
198,
2,
13283,
198,
2,
10097,
26171,
2,
198,
198,
2,
900,
2429,
8690,
11,
3975,
11,
290,
46895,
239... | 3.472747 | 899 |
<filename>julia/juliaScript.jl<gh_stars>0
println("hello world")
function sphere_vol(r)
return 4/3*pi*r^3
end
quadratic(a,sqr_term,b) = (-b+sqr_term)/2a #2a == 2*a
function quadratic2(a::Float64, b::Float64, c::Float64)
sqr_term = sqrt(Complex(b^2-4a*c))
r1 = quadratic(a,sqr_term,b)
r2 = quadrati... | [
27,
34345,
29,
73,
43640,
14,
73,
43640,
7391,
13,
20362,
27,
456,
62,
30783,
29,
15,
198,
35235,
7203,
31373,
995,
4943,
198,
198,
8818,
16558,
62,
10396,
7,
81,
8,
198,
220,
220,
220,
1441,
604,
14,
18,
9,
14415,
9,
81,
61,
... | 2.076923 | 195 |
module TensorGraphicalModels
using SparseArrays
using LinearAlgebra
using Kronecker
using SpecialMatrices
using BandedMatrices
using Distributions
using Random
using DataFrames
using MatrixEquations
using PDMats
using TensorToolbox
using LightGraphs
using GLMNet
using Arpack
using Statistics
using Debugger
using Prin... | [
21412,
309,
22854,
37065,
605,
5841,
1424,
198,
198,
3500,
1338,
17208,
3163,
20477,
198,
3500,
44800,
2348,
29230,
198,
3500,
13685,
505,
15280,
198,
3500,
6093,
19044,
45977,
198,
3500,
10243,
276,
19044,
45977,
198,
3500,
46567,
507,
1... | 2.96875 | 224 |
<gh_stars>10-100
let
@test C_LIGHT == 299792458.0
@test AU == 1.49597870700e11
@test MJD_ZERO == 2400000.5
@test MJD2000 == 51544.0
@test GPS_TAI == -19.0
@test TAI_GPS == -GPS_TAI
@test TT_TAI == 32.184
@test TAI_TT == -TT_TAI
@test GPS_TT ... | [
27,
456,
62,
30783,
29,
940,
12,
3064,
198,
1616,
198,
220,
220,
220,
2488,
9288,
327,
62,
43,
9947,
220,
220,
220,
220,
6624,
31011,
3720,
1731,
3365,
13,
15,
198,
220,
220,
220,
2488,
9288,
27548,
220,
220,
220,
220,
220,
220,
... | 1.708333 | 696 |
<gh_stars>1-10
function ETDRK4(SLPDE::SemiLinearPDE{1, S}, T::Number, n::Int) where S
U0 = SLPDE.U0[1]
U = deepcopy(U0) # solution spherical harmonic coefficients
NU = zero(U) # nonlinearity spherical harmonic coefficients
# ETDRK4 stages
A = zero(U)
B = zero(U)
C = zero(U)
NA = zero(U)... | [
27,
456,
62,
30783,
29,
16,
12,
940,
198,
8818,
12152,
7707,
42,
19,
7,
8634,
5760,
36,
3712,
13900,
72,
14993,
451,
5760,
36,
90,
16,
11,
311,
5512,
309,
3712,
15057,
11,
299,
3712,
5317,
8,
810,
311,
198,
220,
220,
220,
471,
... | 1.758701 | 6,436 |
__precompile__()
module RLEVectors
using Compat
import Compat.String
using Reexport
@reexport using DataFrames
# RLEVector type
export RLEVector, FloatRle, IntegerRle, BoolRle, StringRle, rfirst, rwidth, rlast, rvalue, nrun, similar, collect, similar
import Base: show, length, size, start, next, done, Forward, firs... | [
834,
3866,
5589,
576,
834,
3419,
198,
198,
21412,
371,
2538,
53,
478,
669,
198,
198,
3500,
3082,
265,
198,
11748,
3082,
265,
13,
10100,
198,
3500,
797,
39344,
198,
31,
631,
87,
634,
1262,
6060,
35439,
628,
198,
2,
371,
2538,
38469,
... | 2.763308 | 1,052 |
export rational_roots
"""
`_divisors(n)` returns a `Set` of all the positive divisors of the integer `n`.
"""
function _divisors(n::Integer)
@assert n != 0 "Can't list all the divisors of zero"
if abs(n) == 1
return Set(1)
end
f = collect(factor(abs(n)))
powers = tuple([x[2] for x in f]...)... | [
39344,
9377,
62,
19150,
198,
198,
37811,
198,
63,
62,
7146,
271,
669,
7,
77,
8,
63,
5860,
257,
4600,
7248,
63,
286,
477,
262,
3967,
2659,
271,
669,
286,
262,
18253,
4600,
77,
44646,
198,
37811,
198,
8818,
4808,
7146,
271,
669,
7,
... | 2.119901 | 809 |
<gh_stars>0
# pointer intrinsics
# TODO: can we use constant propagation instead of passing the alignment as a Val?
using Core: LLVMPtr
@generated function pointerref(ptr::LLVMPtr{T,A}, i::Int, ::Val{align}) where {T,A,align}
sizeof(T) == 0 && return T.instance
JuliaContext() do ctx
eltyp = convert(L... | [
27,
456,
62,
30783,
29,
15,
198,
2,
17562,
22496,
873,
198,
198,
2,
16926,
46,
25,
460,
356,
779,
6937,
43594,
2427,
286,
6427,
262,
19114,
355,
257,
3254,
30,
198,
198,
3500,
7231,
25,
27140,
53,
7378,
2213,
198,
198,
31,
27568,
... | 1.985386 | 1,916 |
using KrylovKit
using LinearAlgebra
using DelimitedFiles
using Plots
# Load the file that contains the Polyharmonic interpolator function
include("polyHarmonicInterp.jl")
include("bisectionMethod.jl")
function calculateParents(offspring::Vector{T}, minChrom::Int,
maxChrom::Int,stepChrom::Int) where T<:Real
[ (x =... | [
3500,
41662,
27086,
20827,
198,
3500,
44800,
2348,
29230,
198,
3500,
4216,
320,
863,
25876,
198,
3500,
1345,
1747,
198,
198,
2,
8778,
262,
2393,
326,
4909,
262,
12280,
29155,
9229,
39555,
1352,
2163,
198,
17256,
7203,
35428,
39,
1670,
9... | 2.640898 | 2,005 |
<gh_stars>1-10
#examples of using sac2jld2 functions to convert sac files to jld2 format.
using SeisIO, SeisConvert
# Saves individual sac file (in) to JLD2 file.
# The output file name will be the same as the input, with new extension *.jld2.
infile = "BK.HUMO.BHZ.sac"
sac2jld2(infile)
#
# """
# Saves individual sac... | [
27,
456,
62,
30783,
29,
16,
12,
940,
198,
2,
1069,
12629,
286,
1262,
5360,
17,
73,
335,
17,
5499,
284,
10385,
5360,
3696,
284,
474,
335,
17,
5794,
13,
198,
3500,
1001,
271,
9399,
11,
1001,
271,
3103,
1851,
198,
2,
311,
3080,
198... | 2.760163 | 492 |
module Extremes
using Distributions, DataFrames, Dates
using Optim
using LinearAlgebra, Statistics
using Mamba, ProgressMeter
using Gadfly
import CSV
import ForwardDiff, SpecialFunctions
import Distributions.quantile
import Statistics.var
import Base.length, Base.maximum, Base.sum
include("utils.jl")
include("struc... | [
21412,
47871,
274,
198,
198,
3500,
46567,
507,
11,
6060,
35439,
11,
44712,
198,
3500,
30011,
198,
3500,
44800,
2348,
29230,
11,
14370,
198,
3500,
337,
31842,
11,
18387,
44,
2357,
198,
3500,
20925,
12254,
198,
198,
11748,
44189,
198,
117... | 2.569498 | 518 |
<reponame>langfzac/Limbdark.jl
if VERSION >= v"0.7"
using DelimitedFiles
end
include("../../../src/transit_poly_struct.jl")
function profile_transit_poly!(trans,flux,b)
t1 = time_ns()
for k=1:10
for i=1:length(b)
trans.b = b[i]
flux[i] = transit_poly_g(trans)
end
end
... | [
27,
7856,
261,
480,
29,
17204,
69,
49897,
14,
43,
14107,
21953,
13,
20362,
198,
361,
44156,
2849,
18189,
410,
1,
15,
13,
22,
1,
198,
220,
1262,
4216,
320,
863,
25876,
198,
437,
198,
198,
17256,
7203,
40720,
40720,
40720,
10677,
14,
... | 2.039535 | 430 |
abstract type Writer{C,T} end
mutable struct TypedBuffer{T<:NTuple{<:Any,Array}}
size::Int # The current number of data entries in the buffer.
maxsize::Int # The maximum number of data entries in the buffer.
data::T # Tuple that contains a fixed number of data vectors with length `maxsize`.
end
@generat... | [
397,
8709,
2099,
26606,
90,
34,
11,
51,
92,
886,
628,
198,
76,
18187,
2878,
17134,
276,
28632,
90,
51,
27,
25,
11251,
29291,
90,
27,
25,
7149,
11,
19182,
11709,
198,
220,
220,
220,
2546,
3712,
5317,
1303,
383,
1459,
1271,
286,
136... | 2.630058 | 1,038 |
@testset "promotion" begin
for (mr,br) in ((DynamicAxis(10), OneTo(10)),)
@testset "$(typeof(br)) lower range" begin
@test last(promote(br, mr)) == mr
@test last(promote(mr, br)) == mr
end
for (mr2,br2) in ((DynamicAxis(10), OneTo(10)),
... | [
198,
31,
9288,
2617,
366,
16963,
9650,
1,
2221,
198,
220,
220,
220,
329,
357,
43395,
11,
1671,
8,
287,
14808,
44090,
31554,
271,
7,
940,
828,
220,
220,
220,
220,
220,
220,
220,
220,
1881,
2514,
7,
940,
36911,
8,
198,
220,
220,
2... | 1.675119 | 631 |
<reponame>ethansaxenian/RosettaDecode
println("£")
println("\302\243"); # works if your terminal is utf-8
| [
27,
7856,
261,
480,
29,
2788,
504,
897,
268,
666,
14,
35740,
15253,
10707,
1098,
198,
35235,
7203,
14988,
4943,
198,
35235,
7203,
59,
22709,
59,
26660,
15341,
1303,
2499,
611,
534,
12094,
318,
3384,
69,
12,
23,
198
] | 2.717949 | 39 |
const jobs = 12
mutable struct Environment
seq::Int
cnt::Int
Environment() = new(0, 0)
end
const env = [Environment() for i in 1:jobs]
const currentjob = [1]
seq() = env[currentjob[1]].seq
cnt() = env[currentjob[1]].cnt
seq(n) = (env[currentjob[1]].seq = n)
cnt(n) = (env[currentjob[1]].cnt = n)
function... | [
9979,
3946,
796,
1105,
198,
198,
76,
18187,
2878,
9344,
198,
220,
220,
220,
33756,
3712,
5317,
198,
220,
220,
220,
269,
429,
3712,
5317,
198,
220,
220,
220,
9344,
3419,
796,
649,
7,
15,
11,
657,
8,
198,
437,
198,
198,
9979,
17365,... | 1.916211 | 549 |
printstyled(" seismogram differentiation/integration\n", color=:light_green)
convert_file = path*"/SampleFiles/SEIS/2019_M7.1_Ridgecrest.seis"
S = randSeisData(3, s=1.0)
S.units = ["m/s2", "m", "m/s"]
U = deepcopy(S)
S1 = deepcopy(S)
printstyled(" conversion to m/s\n", color=:light_green)
redirect_stdout(out) do
... | [
4798,
34365,
992,
7203,
220,
30518,
21857,
32488,
14,
18908,
1358,
59,
77,
1600,
3124,
28,
25,
2971,
62,
14809,
8,
198,
198,
1102,
1851,
62,
7753,
796,
3108,
9,
1,
14,
36674,
25876,
14,
5188,
1797,
14,
23344,
62,
44,
22,
13,
16,
... | 1.965305 | 1,297 |
module BetweenFlags
include("types.jl")
include("tokenize.jl")
end | [
21412,
14307,
40053,
201,
198,
201,
198,
17256,
7203,
19199,
13,
20362,
4943,
201,
198,
17256,
7203,
30001,
1096,
13,
20362,
4943,
201,
198,
201,
198,
437
] | 2.703704 | 27 |
<filename>src/small_intestine.jl
const cosmic_fl = joinpath(homedir(), "haplox/Bone/data/cosmic/CosmicCompleteExport.tsv")
function numsamplesofcancer(cancer)
sampleids = Set{ASCIIString}()
open(cosmic_fl) do file
header = readline(file)
header = split(header, "\t")
while !eof(file)
... | [
27,
34345,
29,
10677,
14,
17470,
62,
600,
27374,
13,
20362,
198,
198,
9979,
23464,
62,
2704,
796,
4654,
6978,
7,
71,
12657,
343,
22784,
366,
3099,
489,
1140,
14,
49580,
14,
7890,
14,
6966,
9383,
14,
36734,
9383,
20988,
43834,
13,
91... | 2.002801 | 714 |
test_data_name = "hotel_test.pkl"; # test data set name
test_scene_id = 0; # test data id
start_time_idx = 401; # start time index in test data
... | [
9288,
62,
7890,
62,
3672,
796,
366,
8940,
417,
62,
9288,
13,
79,
41582,
8172,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
... | 1.440299 | 536 |
<gh_stars>1-10
"""
read_particles_in_geometry( filename::String, blocks::Vector{String},
geometry::AbstractGadgetGeometry;
parttype::Integer=0, verbose::Bool=true,
use_keys::Bool=true, do_shift_across_box_border::Bool=tr... | [
27,
456,
62,
30783,
29,
16,
12,
940,
198,
37811,
198,
220,
220,
220,
1100,
62,
3911,
2983,
62,
259,
62,
469,
15748,
7,
29472,
3712,
10100,
11,
7021,
3712,
38469,
90,
10100,
5512,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
... | 2.305822 | 1,357 |
<reponame>UnofficialJuliaMirror/PolynomialAmoebas.jl-438ff524-9f0e-576b-9874-0fc608798f85
@testset "Spine2D" begin
@polyvar x y
f = x^2*y + y^2 + 3x^2*y^3 + y^4 + x^4*y^4
S = spine(f)
@test length(components_complement(S)) == 5
@test sprint(show, S) ==
"""Spine2D{DynamicPolynomials.Polynomi... | [
27,
7856,
261,
480,
29,
3118,
16841,
16980,
544,
27453,
1472,
14,
34220,
26601,
498,
5840,
78,
1765,
292,
13,
20362,
12,
43704,
487,
48057,
12,
24,
69,
15,
68,
12,
37452,
65,
12,
4089,
4524,
12,
15,
16072,
28688,
43240,
69,
5332,
... | 2.074074 | 324 |
using Test
using CodecZlib
using GraphIO.LGCompressed
@testset "LGCompressed" begin
for g in values(allgraphs)
readback_test(LGCompressedFormat(), g; testfail=true)
end
end
| [
3500,
6208,
198,
3500,
39298,
57,
8019,
198,
3500,
29681,
9399,
13,
41257,
7293,
2790,
198,
198,
31,
9288,
2617,
366,
41257,
7293,
2790,
1,
2221,
198,
220,
220,
220,
329,
308,
287,
3815,
7,
439,
34960,
82,
8,
198,
220,
220,
220,
2... | 2.638889 | 72 |
abstract type AbstractRealLineDiscretizer{T} <: AbstractVector{T} end
unwrap(x) = x
wrap(x, val) = val
function Base.size(discr::AbstractRealLineDiscretizer)
(Base.length(discr), )
end
struct RealLineDiscretizer{L, R, T, G <:AbstractVector{T}} <: AbstractRealLineDiscretizer{Interval{L, R, T}}
grid::G
end
f... | [
397,
8709,
2099,
27741,
15633,
13949,
15642,
1186,
7509,
90,
51,
92,
220,
1279,
25,
27741,
38469,
90,
51,
92,
886,
198,
198,
403,
37150,
7,
87,
8,
796,
2124,
198,
37150,
7,
87,
11,
1188,
8,
796,
1188,
198,
198,
8818,
7308,
13,
7... | 2.360558 | 1,506 |
module DegreesOfFreedom
using MacroTools: @capture
using Printf: @printf, @sprintf
using StaticArrays: SVector
using ..QuantumOperators: OperatorUnit, ID, OperatorPack, OperatorSum, Operator, Operators, valuetolatextext, idtype
using ..Spatials: AbstractPID, AbstractBond, Point, Bonds, pidtype
using ...Essentials: dty... | [
21412,
25905,
6037,
5189,
38885,
198,
198,
3500,
42755,
33637,
25,
2488,
27144,
495,
198,
3500,
12578,
69,
25,
2488,
37435,
11,
2488,
82,
37435,
198,
3500,
36125,
3163,
20477,
25,
20546,
9250,
198,
3500,
11485,
24915,
388,
18843,
2024,
... | 2.550614 | 21,743 |
<reponame>matrixfunctions/GraphMatFun.jl<gh_stars>1-10
## Memory handling for memory
#
struct CodeMem
slots::Vector{Symbol}
slot_names::Vector{String}
special_names::Dict{Symbol,String}
end
# Creates a memory object
# k is the number of slots
# slot_name_fun(i) should return a string
# which is the nam... | [
27,
7856,
261,
480,
29,
6759,
8609,
12543,
2733,
14,
37065,
19044,
24629,
13,
20362,
27,
456,
62,
30783,
29,
16,
12,
940,
198,
2235,
14059,
9041,
329,
4088,
198,
198,
2,
198,
7249,
6127,
13579,
198,
220,
220,
220,
17314,
3712,
38469... | 2.51117 | 761 |
<filename>initialguess_stoch.jl
# INITIAL GUESS FOR STOCHASTIC APPROXIMATION ALGORITHM BASED ON A GP MODEL
# returns initial guess given line penalty parameters
function getInitialGuess(gamma_line::Float64,delta_line::Float64,useGurobi::Bool=true)
# set generator bounds violation penalty parameters
gamma_gen... | [
27,
34345,
29,
36733,
5162,
408,
62,
301,
5374,
13,
20362,
198,
2,
3268,
2043,
12576,
19348,
7597,
7473,
3563,
46,
3398,
11262,
2149,
3486,
31190,
55,
3955,
6234,
8355,
38,
1581,
10554,
44,
29809,
1961,
6177,
317,
14714,
19164,
3698,
... | 2.144338 | 2,411 |
using JuliaFormatter
format("tools/juliapkg/src")
format("tools/juliapkg/test") | [
3500,
22300,
8479,
1436,
198,
198,
18982,
7203,
31391,
14,
73,
32176,
499,
10025,
14,
10677,
4943,
198,
18982,
7203,
31391,
14,
73,
32176,
499,
10025,
14,
9288,
4943
] | 2.758621 | 29 |
using HTTPClient.HTTPC
using JSON
using Compat
using Base.Test
import Compat.String
const upload_file = joinpath(dirname(@__FILE__), "uploadfile.txt")
# get a request bin name
r=HTTPC.post("http://requestb.in/api/v1/bins", "")
@test r.http_code == 200
jdict = JSON.parse(String(r.body))
@test haskey(jdict, "name")
... | [
3500,
14626,
11792,
13,
6535,
51,
5662,
198,
3500,
19449,
198,
3500,
3082,
265,
198,
3500,
7308,
13,
14402,
198,
198,
11748,
3082,
265,
13,
10100,
198,
198,
9979,
9516,
62,
7753,
796,
4654,
6978,
7,
15908,
3672,
7,
31,
834,
25664,
8... | 2.46036 | 2,611 |
"""
Estimate Stochastic Differential Equation
This module uses @debug to report estimation error messages.
"""
module EstimateSDE
export isdiagonalizable,TimeSeriesModel,VectorSde,
statedim,measdim,logpdf,testprocess,
autocovz,autocov,statcovz,statcov,randtimes, convert
export Sde
export checkstable, ... | [
37811,
198,
22362,
1920,
520,
5374,
3477,
20615,
498,
7889,
341,
198,
198,
1212,
8265,
3544,
2488,
24442,
284,
989,
31850,
4049,
6218,
13,
198,
37811,
198,
21412,
10062,
1920,
50,
7206,
198,
198,
39344,
318,
10989,
27923,
13821,
11,
757... | 3.054228 | 1,088 |
let
conc_CH4_preind = 710.0 # ppb
conc_N2O_preind = 273.0 # ppb
cacheterm = 0.47 * log(1 + 2.01e-5*(conc_CH4_preind*conc_N2O_preind)^0.75 +
+ 5.31e-15*conc_CH4_preind*(conc_CH4_preind*conc_N2O_preind)^1.52)
global function radiativeforcing!(Concentration, RadiativeForcing)
# Saturation of CH4 absorpt... | [
1616,
198,
197,
1102,
66,
62,
3398,
19,
62,
3866,
521,
220,
197,
28,
767,
940,
13,
15,
197,
197,
2,
9788,
65,
198,
197,
1102,
66,
62,
45,
17,
46,
62,
3866,
521,
197,
197,
28,
38549,
13,
15,
197,
197,
2,
9788,
65,
628,
197,
... | 2.142617 | 1,192 |
<filename>examples/ex_e.jl
# hydra-growing example
#
using ShapeFactory
compass = CartesianIndex.(((1, 0), (0, -1), (-1, 0), (0, 1)))
function scale_idx(idx, n)
return idx + (idx - one(idx)) * (n-1)
end
function stencil(grid, index, hv)
for di in CartesianIndices((0:1, 0:1))
grid[... | [
27,
34345,
29,
1069,
12629,
14,
1069,
62,
68,
13,
20362,
198,
2,
25039,
12,
25167,
1672,
201,
198,
2,
201,
198,
201,
198,
3500,
25959,
22810,
201,
198,
201,
198,
201,
198,
5589,
562,
796,
13690,
35610,
15732,
12195,
19510,
16,
11,
... | 1.824383 | 1,378 |
<reponame>ylxdzsw/WebDisplay.jl
using Restful
import Restful.json
const _web = Restful.app()
const extra_header = Ref{String}("")
_web.get("/") do req, res, route
theme = get(ENV, "WEB_DISPLAY_THEME", "light")
res.html(extra_header[] * read(joinpath(@__DIR__, "..", "assets", "$theme.html"), String))
end
_web... | [
27,
7856,
261,
480,
29,
2645,
24954,
89,
2032,
14,
13908,
23114,
13,
20362,
198,
3500,
8324,
913,
198,
11748,
8324,
913,
13,
17752,
198,
198,
9979,
4808,
12384,
796,
8324,
913,
13,
1324,
3419,
198,
9979,
3131,
62,
25677,
796,
6524,
... | 2.448276 | 377 |
<filename>src/Bridges/Constraint/norm_to_lp.jl
"""
NormInfinityBridge{T}
The `NormInfinityCone` is representable with LP constraints, since
``t \\ge \\max_i \\lvert x_i \\rvert`` if and only if
``t \\ge x_i`` and ``t \\ge -x_i`` for all ``i``.
"""
struct NormInfinityBridge{T,F,G} <:
SetMapBridge{T,MOI.Nonne... | [
27,
34345,
29,
10677,
14,
33,
32124,
14,
3103,
2536,
2913,
14,
27237,
62,
1462,
62,
34431,
13,
20362,
198,
37811,
198,
220,
220,
220,
11220,
18943,
6269,
37385,
90,
51,
92,
198,
198,
464,
4600,
35393,
18943,
6269,
34,
505,
63,
318,
... | 2.11334 | 4,138 |
<gh_stars>0
using Gadfly, DataFrames
xs = 0:0.1:20
df = DataFrame(
x=xs,
y=cos(xs),
ymin=cos(xs) .- 0.5,
ymax=cos(xs) .+ 0.5,
)
plot(df, x=:x, y=:y, ymin=:ymin, ymax=:ymax, Geom.line, Geom.ribbon)
| [
27,
456,
62,
30783,
29,
15,
198,
198,
3500,
20925,
12254,
11,
6060,
35439,
198,
198,
34223,
796,
657,
25,
15,
13,
16,
25,
1238,
198,
198,
7568,
796,
6060,
19778,
7,
198,
220,
220,
220,
2124,
28,
34223,
11,
198,
220,
220,
220,
33... | 1.697674 | 129 |
# Copyright (c) 2019 <NAME>, <NAME>, and contributors
#
# Use of this source code is governed by an MIT-style license that can be found
# in the LICENSE.md file or at https://opensource.org/licenses/MIT.
module TestCHighs
using HiGHS
using Test
function small_test_model()
cc = [1.0, -2.0]
cl = [0.0, 0.0]
... | [
2,
15069,
357,
66,
8,
13130,
1279,
20608,
22330,
1279,
20608,
22330,
290,
20420,
198,
2,
198,
2,
5765,
286,
428,
2723,
2438,
318,
21825,
416,
281,
17168,
12,
7635,
5964,
326,
460,
307,
1043,
198,
2,
287,
262,
38559,
24290,
13,
9132,... | 2.150974 | 1,232 |
<gh_stars>0
# ATTENTION: This file was generated, do not edit by hand.
module GAP_pkg_unipot
using Pkg.Artifacts
using GAP
function __init__()
# ensure GAP will load the correct instance of this package
path = artifact"unipot"
@debug "GAP package 'unipot' path = " * path
GAP.Globals.SetPackagePath(Gap... | [
27,
456,
62,
30783,
29,
15,
198,
2,
26195,
45589,
25,
770,
2393,
373,
7560,
11,
466,
407,
4370,
416,
1021,
13,
198,
21412,
402,
2969,
62,
35339,
62,
403,
541,
313,
198,
198,
3500,
350,
10025,
13,
8001,
37199,
198,
3500,
402,
2969,... | 2.603015 | 199 |
using CpuId, LLVM
features = split(unsafe_string(LLVM.API.LLVMGetHostCPUFeatures()), ',')
avx512f = any(isequal("+avx512f"), features)
register_size = avx512f ? 64 : 32
register_count = avx512f ? 32 : 16
cache_size = CpuId.cachesize()
num_cores = CpuId.cpucores()
avx2 = any(isequal("+avx2"), features)
# Should I ju... | [
3500,
327,
19944,
7390,
11,
27140,
15996,
198,
198,
40890,
796,
6626,
7,
13271,
8635,
62,
8841,
7,
3069,
15996,
13,
17614,
13,
3069,
15996,
3855,
17932,
36037,
23595,
3419,
828,
705,
4032,
8,
198,
615,
87,
25836,
69,
796,
597,
7,
78... | 2.549296 | 426 |
<gh_stars>0
"""
Create a geometry object of the appropriate type from it's well known
binary (WKB) representation.
### Parameters
* `data`: pointer to the input BLOB data.
* `spatialref`: handle to the spatial reference to be assigned to the created
geometry object. This may be `NULL` (default).
"""
function unsaf... | [
27,
456,
62,
30783,
29,
15,
198,
37811,
198,
16447,
257,
22939,
2134,
286,
262,
5035,
2099,
422,
340,
338,
880,
1900,
198,
39491,
357,
54,
22764,
8,
10552,
13,
198,
198,
21017,
40117,
198,
9,
4600,
7890,
63,
25,
17562,
284,
262,
5... | 2.668617 | 17,602 |
<reponame>ethansaxenian/RosettaDecode
function newton(f, fp, x::Float64,tol=1e-14::Float64,maxsteps=100::Int64)
##f: the function of x
##fp: the derivative of f
local xnew, xold = x, Inf
local fn, fo = f(xnew), Inf
local counter = 1
while (counter < maxsteps) && (abs(xnew - xold) > tol) && (... | [
27,
7856,
261,
480,
29,
2788,
504,
897,
268,
666,
14,
35740,
15253,
10707,
1098,
198,
8818,
649,
1122,
7,
69,
11,
277,
79,
11,
2124,
3712,
43879,
2414,
11,
83,
349,
28,
16,
68,
12,
1415,
3712,
43879,
2414,
11,
9806,
20214,
28,
3... | 2.220588 | 272 |
<gh_stars>1-10
module XML2011
using Dates
using EzXML
using Printf
include("types.jl")
include("moeda.jl")
include("posicao.jl")
include("pais.jl")
include("write.jl")
include("read.jl")
include("validate.jl")
end # module
| [
27,
456,
62,
30783,
29,
16,
12,
940,
198,
198,
21412,
23735,
9804,
198,
198,
3500,
44712,
198,
3500,
21034,
55,
5805,
198,
3500,
12578,
69,
198,
198,
17256,
7203,
19199,
13,
20362,
4943,
198,
17256,
7203,
5908,
18082,
13,
20362,
4943,... | 2.609195 | 87 |
function get_Kσs(sp::LinearElasticityProblem{dim, TT}, dofs, cellvalues) where {dim, TT}
E = YoungsModulus(sp)
ν = PoissonRatio(sp)
dh = sp.ch.dh
n = ndofs_per_cell(dh)
global_dofs = zeros(Int, n)
Kσs = [zeros(TT, n, n) for i in 1:getncells(dh.grid)]
Kσ_e = zeros(TT, n, n)
ψ_e = zeros(TT... | [
8818,
651,
62,
42,
38392,
82,
7,
2777,
3712,
14993,
451,
9527,
3477,
414,
40781,
90,
27740,
11,
26653,
5512,
466,
9501,
11,
2685,
27160,
8,
810,
1391,
27740,
11,
26653,
92,
198,
220,
220,
220,
412,
796,
6960,
82,
5841,
23515,
7,
2... | 1.699253 | 1,473 |
<reponame>titusfranz/DTWA
module DTWA
using LinearAlgebra: Matrix
using DataStructures: OrderedDict
using LinearAlgebra
using UnsafeArrays
using Distributions
using DifferentialEquations
using Parameters
using StaticArrays
include("mean_field.jl")
export hamiltonian!
include("spin_states.jl")
export ProductState
exp... | [
27,
7856,
261,
480,
29,
83,
17506,
69,
2596,
89,
14,
24544,
15543,
198,
21412,
24311,
15543,
198,
198,
3500,
44800,
2348,
29230,
25,
24936,
198,
3500,
6060,
44909,
942,
25,
14230,
1068,
35,
713,
198,
3500,
44800,
2348,
29230,
198,
350... | 3.171053 | 228 |
<filename>deckanalysis.jl<gh_stars>0
using ArenaSim
using Statistics
include("utils.jl")
files = readdir("decks/top8")
decks = ArenaSim.deckreader_mtgo_format.( joinpath.("decks/top8", files),
strip_sideboard = false)
decks = deckinfo.(decks)
pars = SimParameters(
icrs_per_pack = ArenaSim.icrgen_qc(0.5,0,0),
... | [
27,
34345,
29,
35875,
20930,
13,
20362,
27,
456,
62,
30783,
29,
15,
198,
3500,
10937,
8890,
198,
3500,
14370,
198,
198,
17256,
7203,
26791,
13,
20362,
4943,
198,
198,
16624,
796,
1100,
15908,
7203,
12501,
591,
14,
4852,
23,
4943,
198,... | 2.493557 | 776 |
#############
# ROW #
#############
"""Holds file true data and render data"""
mutable struct Row
"file data, a row of text"
chars::String
"a row of text as rendered on screen"
render::String
end
Row(s::String) = Row(s, "")
"""Update the `render` string using the `chars` string"""
function upd... | [
7804,
4242,
2,
198,
2,
220,
220,
220,
371,
3913,
220,
220,
220,
1303,
198,
7804,
4242,
2,
198,
198,
37811,
39,
10119,
2393,
2081,
1366,
290,
8543,
1366,
37811,
198,
76,
18187,
2878,
11314,
198,
220,
220,
220,
366,
7753,
1366,
11,
... | 2.311969 | 1,529 |
@testset "Testing lss.jl" begin
rough_kwargs = Dict(:atol => 1e-7, :rtol => 1e-7)
# set up
A = .95
C = .05
G = 1.
mu_0 = [.75;]
Sigma_0 = fill(0.000001, 1, 1)
ss = LSS(A, C, G, mu_0)
ss1 = LSS(A, C, G, mu_0, Sigma_0)
vals = stationary_distributions(ss, max_iter=1000, tol=1e-9... | [
31,
9288,
2617,
366,
44154,
300,
824,
13,
20362,
1,
2221,
628,
220,
220,
220,
5210,
62,
46265,
22046,
796,
360,
713,
7,
25,
265,
349,
5218,
352,
68,
12,
22,
11,
1058,
17034,
349,
5218,
352,
68,
12,
22,
8,
628,
220,
220,
220,
1... | 1.878378 | 962 |
<reponame>plotly/DashBio.jl
module DashBio
using Dash
const resources_path = realpath(joinpath( @__DIR__, "..", "deps"))
const version = "0.7.0"
include("dashbio_alignmentchart.jl")
include("dashbio_fornacontainer.jl")
include("dashbio_ideogram.jl")
include("dashbio_igv.jl")
include("dashbio_molecule2dviewer.jl")
in... | [
27,
7856,
261,
480,
29,
29487,
306,
14,
43041,
42787,
13,
20362,
198,
198,
21412,
16189,
42787,
198,
3500,
16189,
198,
198,
9979,
4133,
62,
6978,
796,
1103,
6978,
7,
22179,
6978,
7,
2488,
834,
34720,
834,
11,
366,
492,
1600,
366,
10... | 2.234163 | 3,015 |
abstract GoogleChart
## Concrete type for Core charts
type CoreChart <: GoogleChart
packages::Vector
chart_type::AbstractString
id::AbstractString
width::Integer
height::Integer
options::Dict
data::Any
xtra::AbstractString ## xtra javascript as a string
end
## Charts from
## https://... | [
397,
8709,
3012,
45488,
198,
198,
2235,
1482,
38669,
2099,
329,
7231,
15907,
198,
4906,
7231,
45488,
1279,
25,
3012,
45488,
198,
220,
220,
220,
10392,
3712,
38469,
198,
220,
220,
220,
8262,
62,
4906,
3712,
23839,
10100,
198,
220,
220,
... | 2.33387 | 2,483 |
using ArgParse
function parse_commandline()
s = ArgParseSettings(
description="This program computes and/or verifies an approximate sum of squares decomposition for element
`Adj_n + k·Op_n - l·Δ_n ~ Σξ_i*ξ_i ∈ Σ²₂ ISAut(F_n)`.
Parameters `-n`, `-k` and `-l` must be provided when executing the script. \... | [
3500,
20559,
10044,
325,
198,
198,
8818,
21136,
62,
21812,
1370,
3419,
198,
220,
220,
220,
264,
796,
20559,
10044,
325,
26232,
7,
198,
220,
220,
220,
6764,
2625,
1212,
1430,
552,
1769,
290,
14,
273,
3326,
6945,
281,
27665,
2160,
286,
... | 2.152083 | 480 |
#
# Copyright (c) 2021 <NAME>, <NAME>, <NAME>
# Licensed under the MIT license. See LICENSE file in the project root for details.
#
pathToFMU = "https://github.com/ThummeTo/FMI.jl/raw/main/model/" * ENV["EXPORTINGTOOL"] * "/SpringPendulum1D.fmu"
myFMU = fmi2Load(pathToFMU)
comp = fmi2Instantiate!(myFMU; loggingOn=fal... | [
2,
198,
2,
15069,
357,
66,
8,
33448,
1279,
20608,
22330,
1279,
20608,
22330,
1279,
20608,
29,
198,
2,
49962,
739,
262,
17168,
5964,
13,
4091,
38559,
24290,
2393,
287,
262,
1628,
6808,
329,
3307,
13,
198,
2,
198,
198,
6978,
2514,
232... | 2.584926 | 942 |
<reponame>CodeTako/AdventOfCode2020
s = open("input") do file
readlines(file)
end
nums = map(x->parse(Int64,x), s);
lookingFor = Set();
for num in nums
if(in(num, lookingFor))
println(num * (2020-num));
break;
end
push!(lookingFor, 2020-num);
end
| [
27,
7856,
261,
480,
29,
10669,
51,
25496,
14,
2782,
1151,
5189,
10669,
42334,
198,
82,
796,
1280,
7203,
15414,
4943,
466,
2393,
198,
220,
220,
220,
1100,
6615,
7,
7753,
8,
198,
437,
198,
198,
77,
5700,
796,
3975,
7,
87,
3784,
2957... | 2.210938 | 128 |
<gh_stars>1-10
using PartedArrays, Test, ForwardDiff
using BenchmarkTools
using DocStringExtensions
"Sense of a constraint (inequality / equality / null)"
abstract type ConstraintType end
"Inequality constraints"
abstract type Equality <: ConstraintType end
"Equality constraints"
abstract type Inequality <: Constraint... | [
27,
456,
62,
30783,
29,
16,
12,
940,
198,
3500,
2142,
276,
3163,
20477,
11,
6208,
11,
19530,
28813,
198,
3500,
25187,
4102,
33637,
198,
3500,
14432,
10100,
11627,
5736,
198,
198,
1,
41166,
286,
257,
32315,
357,
500,
13237,
1220,
10537... | 2.309798 | 5,042 |
using StaticTools
using Test
using ManualMemory: MemoryBuffer
const GROUP = get(ENV, "GROUP", "All")
@static if GROUP == "Core" || GROUP == "All"
@testset "IO" begin include("testllvmio.jl") end
@testset "libc" begin include("testllvmlibc.jl") end
@testset "Parsing" begin include("testparse.jl") end
@... | [
3500,
36125,
33637,
198,
3500,
6208,
198,
3500,
17969,
30871,
25,
14059,
28632,
198,
198,
9979,
44441,
796,
651,
7,
1677,
53,
11,
366,
46846,
1600,
366,
3237,
4943,
198,
198,
31,
12708,
611,
44441,
6624,
366,
14055,
1,
8614,
44441,
66... | 2.518433 | 434 |
<reponame>AI4DBiological-Systems/NMRSpectraSimulator.jl
function prepcouplingalgorithm(N_spins::Int)
# for Hamiltonian.
Id = getsingleId()
Ix = getsingleIx()
Iy_no_im = getsingleIynoim()
Iz = getsingleIz()
# for testing or coherence.
Ip = getsingleI⁺()
Im = getsingleI⁻()
Iy = getsin... | [
27,
7856,
261,
480,
29,
20185,
19,
11012,
15071,
12,
11964,
82,
14,
32755,
6998,
806,
430,
8890,
8927,
13,
20362,
198,
8818,
3143,
66,
280,
11347,
282,
42289,
7,
45,
62,
2777,
1040,
3712,
5317,
8,
198,
220,
220,
220,
1303,
329,
11... | 1.852342 | 7,260 |
<reponame>jack-dunham/PEPOKit
@doc raw"""
hsbondenv(p::PEPOTensor)
Returns the Hilbert-Schmidt bond evironment of a tensor
"""
function hsbondenv(vp::VectorPEPOTensor{S}, bond::S) where {S<:IndexSpace}
hs, wu, eu = hilbertschmidt(vp)
guess = InfiniteMPS([codomain(hs)[2]], [bond])
ts, envs, _ = leading_... | [
27,
7856,
261,
480,
29,
19650,
12,
67,
403,
2763,
14,
47,
8905,
11380,
270,
198,
31,
15390,
8246,
37811,
198,
220,
220,
220,
289,
36299,
623,
24330,
7,
79,
3712,
47,
8905,
2394,
22854,
8,
198,
198,
35561,
262,
47718,
12,
14874,
21... | 1.791619 | 2,601 |
using DataFrames
using LinearAlgebra
mutable struct HiddenLayer
number_of_neurons::Integer
weight_matrix::Matrix{Float64}
weight_initializer::Function
bias_vector::Vector{Float64}
activation_function::Function
end
function return_name(x)
return String(Symbol(x))
end
function activations(... | [
3500,
220,
6060,
35439,
198,
3500,
44800,
2348,
29230,
628,
198,
76,
18187,
2878,
20458,
49925,
628,
220,
220,
220,
1271,
62,
1659,
62,
710,
333,
684,
3712,
46541,
198,
220,
220,
220,
3463,
62,
6759,
8609,
3712,
46912,
90,
43879,
2414... | 2.400303 | 1,981 |
<filename>docs/make.jl<gh_stars>0
using MyWeb
using Documenter
using DocumenterTools: Themes
# Generate Sass files.
for w in ("light", "dark")
header = read(joinpath(@__DIR__, "style.scss"), String)
theme = read(joinpath(@__DIR__, "$(w)defs.scss"), String)
write(joinpath(@__DIR__, "$(w).scss"), header*"\n"... | [
27,
34345,
29,
31628,
14,
15883,
13,
20362,
27,
456,
62,
30783,
29,
15,
198,
3500,
2011,
13908,
198,
3500,
16854,
263,
198,
3500,
16854,
263,
33637,
25,
383,
6880,
198,
198,
2,
2980,
378,
48572,
3696,
13,
198,
1640,
266,
287,
5855,
... | 2.259459 | 555 |
<reponame>zsunberg/ContinuousPOMDPTreeSearchExperiments.jl<filename>vdptag/profile.jl<gh_stars>1-10
using POMDPs
using ContinuousPOMDPTreeSearchExperiments
using POMDPToolbox
using POMCPOW
using VDPTag
using MCTS
using DataFrames
using ParticleFilters
using ProfileView
pomdp = VDPTagPOMDP()
#=
rng = MersenneTwister(1... | [
27,
7856,
261,
480,
29,
89,
19155,
3900,
14,
17875,
5623,
47,
2662,
6322,
27660,
18243,
20468,
6800,
13,
20362,
27,
34345,
29,
20306,
457,
363,
14,
13317,
13,
20362,
27,
456,
62,
30783,
29,
16,
12,
940,
198,
3500,
350,
2662,
6322,
... | 1.801802 | 1,221 |
<filename>src/components.jl
immutable Shape
vertices::AVec
end
"get an array of tuples of points on a circle with radius `r`"
function partialcircle(start_θ, end_θ, n = 20, r=1)
@compat(Tuple{Float64,Float64})[(r*cos(u),r*sin(u)) for u in linspace(start_θ, end_θ, n)]
end
"interleave 2 vectors into each other (li... | [
27,
34345,
29,
10677,
14,
5589,
3906,
13,
20362,
198,
198,
8608,
18187,
25959,
198,
220,
9421,
1063,
3712,
10116,
721,
198,
437,
198,
198,
1,
1136,
281,
7177,
286,
12777,
2374,
286,
2173,
319,
257,
9197,
351,
16874,
4600,
81,
63,
1,... | 2.512522 | 2,236 |
<gh_stars>1-10
using Bootstrap
@testset "recalcuate!" begin
# SG
res = Equipercentile(sgtabX, sgtabY)
res.data.X.raw = collect(1:40)
recalculate!(res.data.X)
@test res.data.X.stats.μ == 20.5
@test res.data.X.table.freq == map(j -> count(i -> i == j, collect(1:40)), res.data.X.table.scale)
... | [
27,
456,
62,
30783,
29,
16,
12,
940,
198,
3500,
18892,
26418,
198,
198,
31,
9288,
2617,
366,
8344,
282,
66,
4985,
2474,
2221,
198,
220,
220,
220,
1303,
26147,
198,
220,
220,
220,
581,
796,
7889,
9346,
1087,
576,
7,
45213,
8658,
55... | 2.271318 | 1,290 |
<filename>src/BHMM/BHMM.jl
"""
BHMM([a::AbstractVector{T}, ]A::AbstractMatrix{T}, B::AbstractVector{<:Categorical}) where F where T
Build an BHMM with transition matrix `A` and observations distributions `B`.
If the initial state distribution `a` is not specified, a uniform distribution is assumed.
Observations ... | [
27,
34345,
29,
10677,
14,
33,
39,
12038,
14,
33,
39,
12038,
13,
20362,
198,
37811,
198,
220,
220,
220,
347,
39,
12038,
26933,
64,
3712,
23839,
38469,
90,
51,
5512,
2361,
32,
3712,
23839,
46912,
90,
51,
5512,
347,
3712,
23839,
38469,... | 2.587203 | 969 |
# This file is auto-generated by AWSMetadata.jl
using AWS
using AWS.AWSServices: apigatewayv2
using AWS.Compat
using AWS.UUIDs
"""
create_api(name, protocol_type)
create_api(name, protocol_type, params::Dict{String,<:Any})
Creates an Api resource.
# Arguments
- `name`: The name of the API.
- `protocol_type`:... | [
2,
770,
2393,
318,
8295,
12,
27568,
416,
30865,
9171,
14706,
13,
20362,
198,
3500,
30865,
198,
3500,
30865,
13,
12298,
5432,
712,
1063,
25,
2471,
10055,
1014,
85,
17,
198,
3500,
30865,
13,
40073,
198,
3500,
30865,
13,
52,
27586,
82,
... | 3.192737 | 29,325 |
<gh_stars>1-10
module MyIOModule
using DelimitedFiles
export readtodict
export niceprint
export nicewrite
export replacelineswithstring
function readtodict(filename::String, allowed)
println("")
f = open(filename)
vars = Dict{String,Any}()
println("Reading config from $filename")
for line in each... | [
27,
456,
62,
30783,
29,
16,
12,
940,
198,
21412,
2011,
40,
2662,
375,
2261,
198,
198,
3500,
4216,
320,
863,
25876,
198,
198,
39344,
1100,
83,
375,
713,
198,
39344,
3621,
4798,
198,
39344,
9200,
413,
6525,
198,
39344,
2186,
330,
2065... | 2.161557 | 848 |
abstract type AbstractMesh1D end
abstract type AbstractPeriodicMesh1D <: AbstractMesh1D end
isperiodic(mesh::AbstractMesh1D) = false
isperiodic(mesh::AbstractPeriodicMesh1D) = true
function Base.show(io::IO, mesh::AbstractMesh1D)
print(io,
typeof(mesh), " with ", numcells(mesh), " cells in ", bounds(mesh))
end... | [
198,
397,
8709,
2099,
27741,
37031,
16,
35,
886,
198,
397,
8709,
2099,
27741,
5990,
2101,
291,
37031,
16,
35,
1279,
25,
27741,
37031,
16,
35,
886,
198,
198,
271,
41007,
291,
7,
76,
5069,
3712,
23839,
37031,
16,
35,
8,
796,
3991,
1... | 2.261576 | 10,150 |
using DiffEqProblemLibrary, Sundials, Test
using DiffEqProblemLibrary.ODEProblemLibrary: importodeproblems; importodeproblems()
import DiffEqProblemLibrary.ODEProblemLibrary: prob_ode_linear, prob_ode_2Dlinear
prob = prob_ode_2Dlinear
integrator = init(prob,CVODE_BDF())
step!(integrator)
integrator(integrator.t,Val{1}... | [
3500,
10631,
36,
80,
40781,
23377,
11,
3309,
8231,
11,
6208,
198,
3500,
10631,
36,
80,
40781,
23377,
13,
16820,
40781,
23377,
25,
1330,
375,
538,
305,
22143,
26,
1330,
375,
538,
305,
22143,
3419,
198,
11748,
10631,
36,
80,
40781,
2337... | 2.756579 | 152 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.