Dataset Viewer
Auto-converted to Parquet Duplicate
conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Add convenience function to parse strings directly.\n" }, { "from": "human", "value": "function parse(io::IO)\n d = Decoder()\n decode(d, JSON.parse(io))\nend\n" }, { "from": "gpt", "value": "function parse(io::IO)\n d = Decoder()\n decode(d,...
julia
chosen
[ { "from": "system", "value": "Update repl io stream flushing\n" }, { "from": "human", "value": "module EclipseREPL\nfunction execute(statement)\n status=\"complete\"\n mimeType=\"text/plain\"\n try\n expression = parse(statement,1; greedy=true, raise=false)\n if isa(expression[1],Expr)\...
julia
chosen
[ { "from": "system", "value": "Use PackageSpec when installing PyCall\n" }, { "from": "human", "value": "script, output = ARGS\n\nusing Pkg\n\ncompilerenv = abspath(\"compilerenv\")\nPkg.activate(compilerenv)\nPkg.add([\n PackageSpec(\n name = \"PackageCompiler\",\n uuid = \"9b87...
julia
chosen
[ { "from": "system", "value": "Fix removal of temp directory if tests fail\n" }, { "from": "human", "value": "using Base.Test\n\nfor (root, dirs, files) in walkdir(\"exercises\")\n for exercise in dirs\n # Allow only testing specified execises\n if !isempty(ARGS) && !(exercise in...
julia
chosen
[ { "from": "system", "value": "Implement skeleton codes for Loop.attach_periodic_callback and Loop.dettach_periodic_callback\n" }, { "from": "human", "value": "module loop\n\nexport Loop\n\ntype Loop\n\n instance::Function\n start::Function\n stop::Function\n attach_periodic_callback::Functio...
julia
chosen
[ { "from": "system", "value": "Add test for cli usage" }, { "from": "human", "value": "@testset \"Cli Function Tests\" begin\n\n @test isdefined(Julz, :cli) == true\n\nend\n" }, { "from": "gpt", "value": "@testset \"Cli Function Tests\" begin\n\n @test isdefined(Julz, :cli) == true\...
julia
chosen
[ { "from": "system", "value": "Change Backslash for slash ini path\n" }, { "from": "human", "value": "using Base.Test\nusing Tlaloc\n\n#=\n\n# Testing constructor\nengine = TlalocEngine(string(dirname(Base.source_path()),\"\\\\test_conf.ini\"))\n@test typeof(engine) == TlalocEngine\n@test engine....
julia
chosen
[ { "from": "system", "value": "Create type `gameState`, `Index`, 'Number`, and `LeftoverNumbers`.\n\nThis type is like a C's `struct`. It will gather variable in a meaningful bundle. Index, number, etc is clearer on intention than leaving it as `Int`. It is also easier to pass a `struct` around functions,...
julia
chosen
[ { "from": "system", "value": "Refactor ap for UKFs to use the new UKF API\n\nTests now fail because covs uses the old style\n" }, { "from": "human", "value": "include(\"unscentedtypes.jl\")\n\n# Predict and update functions\n\n# Now a target for abstraction\nfunction ap(f::AdditiveUnscentedModel...
julia
chosen
[ { "from": "system", "value": "Expand test file to exercise more code.\n" }, { "from": "human", "value": "using CGP\nusing Base.Test\n\nfunction getparameters()\n return default_parameters(3, 3, 9, 2, 3, 1)\nend\n\nfuncs = default_funcs()\nparameters = getparameters()\nchromosome = random_chro...
julia
chosen
[ { "from": "system", "value": "Modify run tests to run the new UKF tests\n" }, { "from": "human", "value": "using Kalman\nusing Base.Test\n\ninclude(\"bkftest.jl\")\ninclude(\"ekftest.jl\")\ninclude(\"ukftest.jl\")\n\nif VERSION >= v\"0.4.0-\"\n include(\"nullabletest.jl\")\nend\n" }, { ...
julia
chosen
[ { "from": "system", "value": "Deploy Documenter manual from Julia 0.6 rather than from nightlies\n\nWhenever tests failed on nightlies, the manual was not deployed.\n" }, { "from": "human", "value": "using Documenter, DataFrames\n\n# Build documentation.\n# ====================\n\nmakedocs(\n ...
julia
chosen
[ { "from": "system", "value": "Add accessor for state mean.\n" }, { "from": "human", "value": "module kalman;\nimport StateSpace;\nimport Distributions;\n\nexport newModel,initialGuess,predict,update;\n\nfunction initialGuess(observationMatrix::Array{Float64,1},varianceMatrix::Array{Float64,1})\n...
julia
chosen
[ { "from": "human", "value": "Move from notebook to script\n" }, { "from": "gpt", "value": "function init_s_grid(Ns)\n if any( (Ns .% 2) .== 0 )\n error(\"Ns must be odd numbers\")\n end\n NN = round.(Int, (Ns-1)/2)\n Npoints = prod(Ns)\n s = zeros(3,Npoints)\n ip = 0\n ...
julia
chosen
[ { "from": "system", "value": "Add access to work directory" }, { "from": "human", "value": "export Window,\n include_asset\n\nimmutable Window\n alive::Input\n dimension::Input\n route::Input\n dir::String\n assets::Input\nend\n\nWindow(;\n alive=true,\n dimension=(0px...
julia
chosen
[ { "from": "system", "value": "Fix typos which stopped tests\n" }, { "from": "human", "value": "using Kalman\nusing Base.Test\n\ns = UnscentedState([1.0, 0.0],4*eye(2),0.1,2.0,0.0)\n\n@test s.x == [1.0,0.0]\n@test s.p == [4.0 0; 0 4.0]\n@test_approx_eq s.σ[5] [1.0,-sqrt(0.08)]\n\n@test_approx_eq ...
julia
chosen
[ { "from": "system", "value": "Fix typo in wheelgraph example\n" }, { "from": "human", "value": "using Interact\nusing LightGraph\nusing VisJS\n\n# Little slow to update!\n@manipulate for i=1:100\n VisJS.drawGraph(WheelGraph(i))\nend\n" }, { "from": "gpt", "value": "using Interact\...
julia
chosen
[ { "from": "system", "value": "Add test for “export_all_files” macro" }, { "from": "human", "value": "@testset \"Export All Files Macro Tests\" begin\n\n @test isdefined(Julz, Symbol(\"@export_all_files\")) == true\n\nend\n" }, { "from": "gpt", "value": "initial_dir = pwd()\n\ncd(\"d...
julia
chosen
[ { "from": "system", "value": "Update to new Julia file ops\n" }, { "from": "human", "value": "using DataFrames\n\nmodule Clustering\n using DataFrames\n\n import Base.print, Base.show, Base.repl_show\n\n export k_means, dp_means\n\n include(joinpath(julia_pkgdir(), \"Clustering\", \"...
julia
chosen
[ { "from": "system", "value": "Use different language construct for platform specific code\n" }, { "from": "human", "value": "__precompile__()\n\nmodule MPI\n\nusing Compat\n\nif @windows? true : false\n\tinclude(\"win_mpiconstants.jl\")\nelse\n\tconst depfile = joinpath(dirname(@__FILE__), \"..\...
julia
chosen
[ { "from": "system", "value": "Fix sln_mll test so that zero! works\n" }, { "from": "human", "value": "include(\"abstract_neural_networks.jl\")\n\nfunction zero!(nn::NeuralNetworkStorage)\n # Zeroes out all of the arrays in the neural network type\n names = names(nn)\n types = nn.types\n...
julia
chosen
[ { "from": "system", "value": "Check for the right version of IJulia\n" }, { "from": "human", "value": "using Compat\n\nfunction main()\n info(\"Enabling widgetsnbextension\")\n try\n run(`$(IJulia.jupyter) nbextension enable --py widgetsnbextension`)\n catch err\n warn(\"C...
julia
chosen
[ { "from": "system", "value": "Add an example given keywords values" }, { "from": "human", "value": "\"\"\"\n Ricker(; <keyword arguments>)\n\nCreate a Ricker wavelet.\n\n# Arguments\n\n**Keyword arguments**\n\n* `dt::Real=0.002`: sampling interval in secs.\n* `f0::Real=20.0`: central frequenc...
julia
chosen
[ { "from": "system", "value": "Add verbose=true to debug Mac OS\n" }, { "from": "human", "value": "# Inspired from https://github.com/JuliaDatabases/MySQL.jl/blob/36eaf2bfbbdd9a27c408d0b2a734fff0d81b63ad/deps/build.jl\nmodule Anon1 end\nmodule Anon2 end\n\n@static if VERSION < v\"1.3.0\"\n\nusing...
julia
chosen
[ { "from": "system", "value": "Move the test platform from 32bit to 64bit, set the parameter data type manually for now\n" }, { "from": "human", "value": "function imread(filename::String)\n\thnd = Mat(ccall( (:imread, \"../libcv2\"), Ptr{Void},(Ptr{Uint8},), bytestring(filename)))\n\treturn hnd...
julia
chosen
[ { "from": "system", "value": "Generalize messages containing 2D points\n" }, { "from": "human", "value": "VERSION >= v\"0.4.0\" && __precompile__(true)\n\nmodule SLAM\n\nexport\n # Types\n Scene,\n SlamState,\n EKFSlamState,\n PFSlamState,\n Vehicle,\n \n # Functions\n ...
julia
chosen
[ { "from": "system", "value": "Implement Loop.start, Loop.stop and some features\n" }, { "from": "human", "value": "module loop\n\nexport Loop\n\ntype Loop\n\n instance::Function\n start::Function\n stop::Function\n attach_periodic_callback::Function\n dettach_periodic_callback::Function\n\n...
julia
chosen
[ { "from": "system", "value": "Fix fcn signature in docs\n" }, { "from": "human", "value": "#!/usr/bin/env julia\n\nimport JSON\n\n\"\"\"\n gen( x, name )\n\nGenerate fixture data and write to file.\n\n# Arguments\n\n* `x`: x-values\n* `y`: y-values\n* `name::AbstractString`: output filename\n...
julia
chosen
[ { "from": "system", "value": "Add temporary to avoid terrible auto-formatting\n" }, { "from": "human", "value": "@testset \"AWSConfig\" begin\n @testset \"default profile assumes role\" begin\n access_key_id = \"assumed_access_key_id\"\n config_dir = joinpath(@__DIR__, \"configs...
julia
chosen
[ { "from": "system", "value": "Update to new package name.\n" }, { "from": "human", "value": "println(\"IntelPSE: build.jl begin.\")\nprintln(\"IntelPSE: Building j2c-array shared library\")\nrun(`icpc -fPIC -shared -o libj2carray.so.1.0 j2c-array.cpp`)\nprintln(\"IntelPSE: build.jl done.\")\n" ...
julia
chosen
[ { "from": "system", "value": "Add warm up step in julia benchmark.\n" }, { "from": "human", "value": "require(\"src/svmlight.jl\")\nrequire(\"src/liblinear.jl\")\n\nimport StatsBase: fit, predict\nimport MLBase: roc, recall, precision, f1score\nimport liblinear: ClassificationParams, Classificat...
julia
chosen
[ { "from": "system", "value": "Add skeleton code for Loop\n" }, { "from": "human", "value": "module loop\n\nexport Loop\n\ntype Loop\n\n instance::Function\n start::Function\n stop::Function\n attach_periodic_callback::Function\n dettach_periodic_callback::Function\n\n function Loop()\n ...
julia
chosen
[ { "from": "system", "value": "Change k->addVectors in Julia example\n" }, { "from": "human", "value": "include(\"occa.fl\")\n\nentries = 5\n\ndevice = occa.device(\"OpenMP\", 0, 0);\n\n# Dynamic range?\na = [convert(Float32, 1 - i) for i in 1:5]\nb = [convert(Float32, i ) for i in 1:5]\nab ...
julia
chosen
[ { "from": "system", "value": "Use joinpath() more rigorously & remove @show.\n" }, { "from": "human", "value": "#CppSimData: A Julia wrapper for CppSimData tools\n#-------------------------------------------------------------------------------\nmodule CppSimData\n\nconst rootpath = realpath(join...
julia
chosen
[ { "from": "system", "value": "Use W = scale(W,s) rather than scale\\!(W,s)\n" }, { "from": "human", "value": "using ParallelAccelerator\n\n#using CompilerTools\n#CompilerTools.ReadWriteSet.set_debug_level(3)\n#ParallelAccelerator.CGen.set_debug_level(3)\n\n@acc function normalizeW(W::DenseMatrix...
julia
chosen
[ { "from": "system", "value": "Remove cloning of Docile master. [skip ci]\n" }, { "from": "human", "value": "\n### TODO: remove. Until Docile is tagged we need master here. ###\nPkg.checkout(\"Docile\")\n\nmodule LexiconTests\n\nusing Docile\n@document\n\nusing Docile.Interface, Lexicon, FactChec...
julia
chosen
[ { "from": "system", "value": "Update to latest Julia file operations\n" }, { "from": "human", "value": "require(\"Options\")\nrequire(\"Distributions\")\nrequire(\"Calculus\")\n\nmodule Optim\n using OptionsMod\n using Distributions\n using Calculus\n\n function loadoptim(filename)\n...
julia
chosen
[ { "from": "system", "value": "Enable docs deployment via travis\n" }, { "from": "human", "value": "using Documenter, Hecke\n\nmakedocs(\n modules = Hecke,\n clean = true,\n doctest = false,\n)\n\n#deploydocs(\n# deps = Deps.pip(\"pygments\", \"mkdocs\", \"mkdocs-material\", \"pytho...
julia
chosen
[ { "from": "system", "value": "Remove GR gks workaround, works OOTB now\n" }, { "from": "human", "value": "# auto reload edited files\n@schedule begin\n sleep(0.1)\n @eval using Revise\nend\n\n# fix GR.jl: \"Launching GKSTerm failed.\"\n@schedule begin\n sleep(0.1)\n @eval gkstermpath...
julia
chosen
[ { "from": "system", "value": "Use type parameter for goal.\n" }, { "from": "human", "value": "export fitness, hamming_max, hamming_raw\n\n# Evaluates the fitness of a particular chromosome relative to a\n# particular goal. The sum of the Hamming distances for each output\n# relative to the goal ...
julia
chosen
[ { "from": "system", "value": "Fix startswith function, which was horribly borken.\n" }, { "from": "human", "value": "function startswith(str::AbstractString, pats...)\n for pat in pats\n if start(search(str, pat)) != 1\n return false\n end\n end\n true\nend\n\nf...
julia
chosen
[ { "from": "system", "value": "Make constant name a little clearer.\n" }, { "from": "human", "value": "const JSON_MAX_INT = 2^53 -1\nconst JSON_MIN_INT = -JSON_MAX_INT\n\nconst MAX_INT64 = 2^63-1\nconst MIN_INT64 = -(2^63)\n\nconst MAP_AS_ARR = \"^ \"\nconst ESC = \"~\"\nconst SUB = \"^\"\nconst ...
julia
chosen
[ { "from": "human", "value": "Implement HMC sampler using Radford Neal's R code.\n" }, { "from": "gpt", "value": "# Adapted directly from Radford Neal's R code\n\n# Alternative interface using Density type\nhmc_sampler(x::Array{Float64}, dd::DifferentiableDensity, epsilon::Float64, L::Int64) = hm...
julia
chosen
[ { "from": "system", "value": "Define abstract Action types and the Percept type. Added TableDrivenAgentProgram implementation of the abstract AgentProgram DataType.\n" }, { "from": "human", "value": "type Agent\n\talive::Bool\n\n\tfunction Agent()\n\t\treturn new(Bool(true))\n\tend\nend\n\n\nfun...
julia
chosen
[ { "from": "system", "value": "Make XMLError a subtype of Exception\n\nThis allows FactCheck to handle LightXML errors properly" }, { "from": "human", "value": "\nabstract XMLError\n\nimmutable XMLParseError <: XMLError\n msg::String\nend\n\nimmutable XMLNoRootError <: XMLError\nend\n\nimmutab...
julia
chosen
[ { "from": "system", "value": "Fix Documenter by changing from nightly to v0.5.\n" }, { "from": "human", "value": "using Documenter, Optim\n\n# use include(\"Rosenbrock.jl\") etc\n\n# assuming linux.\n#run('mv ../LICENSE.md ./LICENSE.md')\n#run('mv ../CONTRIBUTING.md ./dev/CONTRIBUTING.md')\nmake...
julia
chosen
[ { "from": "system", "value": "Read data from a file\n" }, { "from": "human", "value": "\nfunction read_data(x::String, mode::String)\n\n num_features = num_labels = 0\n\n if x == \"scene\"\n num_features = 294\n num_labels = 6\n end\n\n if x == \"yeast\"\n num_fe...
julia
chosen
[ { "from": "system", "value": "Move ap up to make it consistent with types.jl\n" }, { "from": "human", "value": "using ForwardDiff\n\nabstract ExtendedKalmanFilter <: KalmanFilter\n\ntype NonlinearModel <: Model\n f::Function\n j::Function\n g::Function\n q::Matrix\n function Nonli...
julia
chosen
[ { "from": "system", "value": "Add module Abaqus back to code\n\nAbaqus module is added back to code into `deprecations.jl` to make\ncode in seminar paper run on 0.3.3.\n" }, { "from": "human", "value": "# This file is a part of JuliaFEM.\n# License is MIT: see https://github.com/JuliaFEM/JuliaFE...
julia
chosen
[ { "from": "system", "value": "Add \"lunar\" to list of possible rosdistros" }, { "from": "human", "value": "#Test basic rospy interactions\ninit_node(\"jltest\", anonymous=true)\n\n#Parameters\n@test length(RobotOS.get_param_names()) > 0\n@test has_param(\"rosdistro\")\n@test chomp(get_param(\"r...
julia
chosen
[ { "from": "system", "value": "Remove reference to AbstractString for compatibility with 0.3\n" }, { "from": "human", "value": "module nj\n\nfunction topExpr(mod::Module,paths::Array{ASCIIString,1})\n res = Expr(:toplevel,:(eval(x) = Core.eval(mod,x)),:(eval(m,x) = Core.eval(m,x)))\n for path...
julia
chosen
[ { "from": "system", "value": "Add a choice between dense and sparse features.\n" }, { "from": "human", "value": "module KUparser\n\nusing Compat\nusing KUnet\n\ninclude(\"util.jl\");\t export @date, evalparse, pxyequal, testnet\ninclude(\"sentence.jl\"); export Sentence, Corpus, wdim, wcnt, w...
julia
chosen
[ { "from": "system", "value": "Add empty error message, which we'll remove when we have conditions in Tlaloc to see if the variable is set\n" }, { "from": "human", "value": "function getContent(req::Request, res::Response)\n loginPage = Page(tlaloc,\"login.html\",Dict())\n Response(render(login...
julia
chosen
[ { "from": "system", "value": "Add test for “include_all_files” function" }, { "from": "human", "value": "@testset \"Include All Files Function Tests\" begin\n\n @test isdefined(Julz, :include_all_files) == true\n\nend\n" }, { "from": "gpt", "value": "@testset \"Include All Files Fun...
julia
chosen
[ { "from": "system", "value": "Use SIMD in Julia serial example\n" }, { "from": "human", "value": "#!/usr/bin/env julia\n\nfunction picalc(numsteps)\n\n println(\"Calculating PI using:\")\n println(\" \", numsteps, \" slices\")\n println(\" \", 1, \" worker(s)\")\n start = time()\n\n sum =...
julia
chosen
[ { "from": "system", "value": "Fix exercise etl: removed list sorting\n" }, { "from": "human", "value": "function transform(input::Dict)\n output = []\n for i = input\n for j = map(lowercase, i[2])\n pair = (j, i[1])\n push!(output, pair)\n end\n end\n...
julia
chosen
[ { "from": "system", "value": "Add SHA line to tests\n" }, { "from": "human", "value": "#### Test Harness\n\nusing Morsel\napp = Morsel.app()\n\nroute(app, GET, \"/liba.tar\") do req,sys\n path = dirname(@__FILE__)\n path = joinpath(path,\"files\")\n readall(`tar c liba`)\nend\n\n@async ...
julia
chosen
[ { "from": "system", "value": "Change SGD momentum to a keyword argument\n" }, { "from": "human", "value": "export SGD\r\n\r\n\"\"\"\r\n SGD\r\n\r\nStochastic Gradient Descent.\r\n\r\n* rate: learning rate\r\n* momentum: momentum coefficient\r\n\"\"\"\r\ntype SGD\r\n rate::Float64\r\n mo...
julia
chosen
[ { "from": "system", "value": "Fix tests on Julia 0.4\n" }, { "from": "human", "value": "module Seq\n\nusing Compat\nusing Docile\nusing Base.Intrinsics\n\nimport Base: convert, complement, getindex, show, length, start, next, done, copy, reverse,\n show, endof, ==, isless, clipboard,...
julia
chosen
[ { "from": "system", "value": "Add basic conversion for Observations\n" }, { "from": "human", "value": "abstract KalmanFilter\n\nabstract LinearKalmanFilter <: KalmanFilter\n\nabstract Model\n\nabstract ObservationModel\n\ntype State{T}\n x::Vector{T}\n p::Matrix\nend\n\nBase.(:(==))(x1::St...
julia
chosen
[ { "from": "system", "value": "Use MySQL as example instead\n" }, { "from": "human", "value": "using BinaryProvider # requires BinaryProvider 0.3.0 or later\n\n# Parse some basic command-line arguments\nconst verbose = \"--verbose\" in ARGS\nconst prefix = Prefix(get([a for a in ARGS if a != \"--...
julia
chosen
[ { "from": "system", "value": "Disable Gadfly test for julia 0.4\n" }, { "from": "human", "value": "using JuliaReport\nusing Base.Test\n\n\n#Test chunk options and output formats\n\nweave(\"documents/chunk_options.noweb\", plotlib=nothing)\nresult = readall(open(\"documents/chunk_options.md\"))\n...
julia
chosen
[ { "from": "system", "value": "Change parameters defaults to be useful.\n" }, { "from": "human", "value": "export Parameters, default_parameters\n\nimmutable Parameters\n mu::Integer\n lambda::Integer\n mutrate::FloatingPoint\n targetfitness::FloatingPoint\n\n numinputs::Integer\n ...
julia
chosen
[ { "from": "system", "value": "Remove need_inline tests and enable coverage run with inlining on\n\nFix #18\n" }, { "from": "human", "value": "module CoverageBase\nusing Coverage\nexport testnames, runtests\n\nconst need_inlining = [\"reflection\", \"meta\"]\n\nfunction julia_top()\n dir = joi...
julia
chosen
[ { "from": "system", "value": "Fix failing test by adding necessary convert method\n" }, { "from": "human", "value": "using Gadfly\n\nset_default_plot_size(6inch, 6inch)\n\nimport Base: show, +, -, /, *, isless, one, zero, isfinite\n\nstruct Percent\n value::Float64\nend\n\n# Functions necessa...
julia
chosen
[ { "from": "system", "value": "Fix images in flex boxes, but not really :\\\n" }, { "from": "human", "value": "export list, image, link, abbr\n\n@api list => List <: Tile begin\n curry(tiles::AbstractArray)\n kwarg(ordered::Bool=false)\nend\n\nrender(l::List) =\n Elem(l.ordered ? :ol : :...
julia
chosen
[ { "from": "system", "value": "Add new functions from AHW.\n" }, { "from": "human", "value": "export Func, default_funcs\n\ntype Func\n func::Function\n arity::Integer\nend\n\nfunction default_funcs()\n return [Func(&, 2), Func(|, 2)]\nend\n\n" }, { "from": "gpt", "value": "e...
julia
chosen
[ { "from": "system", "value": "Remove old types and export new methods and types.\n\nUse EKF in parent module\n" }, { "from": "human", "value": "module Kalman\n\nexport State, \nObservation, \nKalmanFilter, \nLinearKalmanFilter, \nBasicKalmanFilter, \nBasicKalmanFilterP,\nModel, \nObservationMode...
julia
chosen
[ { "from": "system", "value": "Remove reference to old Mutation.jl file.\n" }, { "from": "human", "value": "module CGP\n\ninclude(\"BitString.jl\")\ninclude(\"Func.jl\")\ninclude(\"Parameters.jl\")\ninclude(\"Node.jl\")\ninclude(\"Chromosome.jl\")\ninclude(\"Goal.jl\")\ninclude(\"Fitness.jl\")\n#...
julia
chosen
[ { "from": "system", "value": "Remove unicode mu and lambda for compatibility.\n" }, { "from": "human", "value": "export mu_lambda\n\nfunction mu_lambda(p::Parameters, goal::Goal, gens::Integer)\n μ = p.mu\n λ = p.lambda\n funcs = p.funcs\n perfect = p.targetfitness\n\n pop = @para...
julia
chosen
[ { "from": "system", "value": "Remove MachineLearning from build test\n" }, { "from": "human", "value": "println(\"Starting...\")\nusing MachineLearning\nusing DataFrames\nusing Gadfly\nusing TextAnalysis\nusing IJulia\nusing SQLite\nusing XGBoost\nprintln(\"Ok!\")\n" }, { "from": "gpt", ...
julia
chosen
[ { "from": "system", "value": "Update Julia code to encapsulate processing into a function.\n" }, { "from": "human", "value": "counts = Dict{String,Int}()\n\nopen(ARGS[1],\"r\") do f\n for line in eachline(f)\n for word in split(line)\n counts[word] = get(counts,word,0) + 1 \...
julia
chosen
[ { "from": "system", "value": "Enable the picard group tests\n" }, { "from": "human", "value": "@testset \"Orders in absolute number fields\" begin\n println(\"NfOrd.jl\")\n @time include(\"NfOrd/NfOrd.jl\")\n\n println(\"Elem.jl\")\n @time include(\"NfOrd/Elem.jl\")\n println(\"Ideal.jl\")\...
julia
chosen
[ { "from": "system", "value": "Order of index.jl and datavec.jl was backwards\n" }, { "from": "human", "value": "require(\"options.jl\")\nimport OptionsMod.*\n\nload(\"src/datavec.jl\")\nload(\"src/index.jl\")\nload(\"src/namedarray.jl\")\nload(\"src/dataframe.jl\")\nload(\"src/formula.jl\")\nloa...
julia
chosen
[ { "from": "system", "value": "Use Array{Float64} instead of zeros\n" }, { "from": "human", "value": "using PyPlot\nconst plt = PyPlot\n\nfunction plot_band_structure( evals, kpath; filename=\"BANDS.pdf\" )\n\n Nkpts = size(kpath)[2]\n Nstates = size(evals)[1]\n\n Xcoords = zeros(Float64,Nkpts...
julia
chosen
[ { "from": "system", "value": "Print errors for failed tests by default\n\nErrors can optionally be silenced by passing -q\n" }, { "from": "human", "value": "#\n# Correctness Tests\n#\n\nfatalerrors = length(ARGS) > 0 && ARGS[1] == \"-f\"\nanyerrors = false\n\nusing Base.Test\nusing DataFrames\n\...
julia
chosen
[ { "from": "system", "value": "Append the continue option to wget\n" }, { "from": "human", "value": "using Images: data, Image, load\nENV[\"PYTHON\"] = \"/usr/bin/python3\"\nusing PyCall\nusing PartsBasedDetector: make_estimator, estimate\n\n\nfilename = \"dress.jpg\"\nurl = \"http://images0.chic...
julia
chosen
[ { "from": "system", "value": "Fix bug where colored test printout broke test\n" }, { "from": "human", "value": "@testset \"Test Function Tests\" begin\n\n @test isdefined(Julz, :test) == true\n\n dummy_package = \"$(dirname(@__FILE__))/../../../../JulzDummy\"\n\n cp(\"dummy\", dummy_package, ...
julia
chosen
[ { "from": "system", "value": "Include sets and irrationals in the parametric types examples\n" }, { "from": "human", "value": "@assert typeof(1:10) == UnitRange{Int64}\n@assert typeof(0x5 // 0x22) == Rational{UInt8}\n@assert typeof(5 // 34) == Rational{Int64}\n@assert typeof(8.75im) == Complex{F...
julia
chosen
[ { "from": "system", "value": "Test of ER runs for directed and undirected version\n" }, { "from": "human", "value": "using RandomGraphs\nusing Graphs\nusing Base.Test\n\nn = 100\np = 0.5\n\nlet u_er = erdos_renyi_graph(n, m)\n\t@test num_vertices(u_er) == n\n\t@test !is_directed(u_er)\nend\n\nle...
julia
chosen
[ { "from": "system", "value": "Disable Winston tests on travis\n" }, { "from": "human", "value": "using Weave\nusing Base.Test\n\n# Running Changin plotlib in tests segfault, unless they are run\n# using separate processes.\n#run(`julia --code-coverage=user -e 'include(\"winston_formats.jl\")'`)\...
julia
chosen
[ { "from": "system", "value": "Correct path to test file\n" }, { "from": "human", "value": "@testset \"Misc\" begin\n include(\"Misc/AbelianGrp.jl\")\n include(\"Misc/psibound.jl\")\n include(\"Misc/InfinitePlaces.jl\")\nend\n \n" }, { "from": "gpt", "value": "@testset \"Misc\" be...
julia
chosen
[ { "from": "system", "value": "Save up memory in hausdorff distance" }, { "from": "human", "value": "#### Similarity and dissimilarity measures between images ####\n\n\"\"\"\n`hausdorff_distance(imgA, imgB)` is the modified Hausdorff distance\nbetween binary images (or point sets).\n\nReferences\...
julia
chosen
[ { "from": "system", "value": "Use average of 20 runs for Julia timings.\n" }, { "from": "human", "value": "macro timeit(ex,name)\n t, i = gensym(2)\n quote\n $t = @elapsed $ex\n printf(\"%s took %.1f ms\\n\", $name, $t*1000)\n end\nend\n" }, { "from": "gpt", "...
julia
chosen
[ { "from": "system", "value": "Disable windows + MPI tests\n" }, { "from": "human", "value": "using Test\nusing MPI\n\n# Do the MPI tests first so we do not have mpi running inside MPI\n# XXX: Currently not working on windows, not sure why\nif !Sys.iswindows()\n @testset \"mpi tests\" begin\n ...
julia
chosen
[ { "from": "system", "value": "Add equality and hash functions to tagged values.\n" }, { "from": "human", "value": "immutable Tag\n rep::AbstractString\nend\n\ntype TaggedValue\n tag::AbstractString\n value::Any\nend\n" }, { "from": "gpt", "value": "immutable Tag\n rep::Ab...
julia
chosen
[ { "from": "system", "value": "Remove the old code that is not working in Julia-0.7\n" }, { "from": "human", "value": "# double factorial\nfactorial2(n) = prod(n:-2:1)\n\ndist2(dx,dy,dz) = dx*dx + dy*dy + dz*dz\n\nfunction pairs(n::Int64,which=\"diag\")\n function _it()\n for j in 1:n\n...
julia
chosen
[ { "from": "system", "value": "Fix call to deprecated At_mul_B\n" }, { "from": "human", "value": "function nnls(A::AbstractMatrix, b::AbstractVector, ops::Options)\n # Set up the preconditioner as the inverse diagonal of the Hessian\n a = sum(A.^2, 1)\n @defaults ops precondprep=(P, x, l...
julia
chosen
[ { "from": "system", "value": "Use fit! instead of fit as it is deprecated\n" }, { "from": "human", "value": "import SVMLightLoader: load_svmlight_file\nimport SoftConfidenceWeighted: init, fit, predict\n\n\n# The code is from below:\n# http://thirld.com/blog/2015/05/30/julia-profiling-cheat-shee...
julia
chosen
[ { "from": "system", "value": "Add test for “get_all_files” function" }, { "from": "human", "value": "@testset \"Get All Files Function Tests\" begin\n\n @test isdefined(Julz, :get_all_files) == true\n\nend\n" }, { "from": "gpt", "value": "@testset \"Get All Files Function Tests\" be...
julia
chosen
[ { "from": "system", "value": "Remove GR clone in travis tests\n" }, { "from": "human", "value": "Pkg.add(\"ImageMagick\")\nPkg.build(\"ImageMagick\")\n\nPkg.clone(\"GR\")\nPkg.build(\"GR\")\n\nPkg.clone(\"https://github.com/JuliaPlots/PlotReferenceImages.jl.git\")\n\n# Pkg.clone(\"https://github...
julia
chosen
[ { "from": "system", "value": "Add some skeleton codes as comments\n" }, { "from": "human", "value": "module session\n\ntype Session\n address::String\n timeout::Int\n loop::Loop\n builder::Tcp\n reconnect_limit::Int\n pack_encoding::String\n unpack_encoding::String\n\n function Session(s...
julia
chosen
[ { "from": "system", "value": "Fix typo where ‘ was used instead of “" }, { "from": "human", "value": "function get_all_files(cur_item)\n nested_files = get_nested_files(cur_item)\n clean_files_list(nested_files)\n\n nested_files\nend\n\nfunction get_nested_files(cur_item)\n nested_files = []...
julia
chosen
[ { "from": "system", "value": "Add a test for generate_version_file\n" }, { "from": "human", "value": "module HTMLWriterTests\n\nusing Compat.Test\nusing Compat\n\nimport Documenter.Writers.HTMLWriter: jsescape\n\n@testset \"HTMLWriter\" begin\n @test jsescape(\"abc123\") == \"abc123\"\n @t...
julia
chosen
[ { "from": "system", "value": "Make some informative output when tests fail\n" }, { "from": "human", "value": "using Base.Test\n\nfunction runtests()\n nprocs = min(4, CPU_CORES)\n exename = joinpath(JULIA_HOME, Base.julia_exename())\n testdir = dirname(@__FILE__)\n testfiles = sort(f...
julia
chosen
[ { "from": "system", "value": "Use Base.Sys.shlib_ext instead of pulling from BinDeps\n" }, { "from": "human", "value": "using BinDeps\n\nENV[\"JULIA_ROOT\"] = abspath(JULIA_HOME, \"../../\")\n\ncd(joinpath(Pkg.dir(), \"Clang\", \"deps\", \"src\") )\nrun(`make`)\nif (!ispath(\"../usr\")) \n run(...
julia
chosen
[ { "from": "system", "value": "Make MeshColor only RGB to prevent confusion about type\n" }, { "from": "human", "value": "using Color\n\nabstract MaterialPrimitive\n\nimmutable Material{P<:MaterialPrimitive} <: Compose3DNode\n primitives::Vector{P}\nend\n\nimmutable MeshColor{T<:ColorValue} <:...
julia
chosen
[ { "from": "system", "value": "Remove LU factorization from update.\n\nChanges to 0.4 broke this line.\n\nI will check if this changes performance significantly and\nreimplement if needed.\n" }, { "from": "human", "value": "#######\n# Universal Kalman filtering methods\n\nfunction predict!(kf::Ka...
julia
chosen
[ { "from": "system", "value": "Allow ddataframe test to be run from any directory\n" }, { "from": "human", "value": "using DataFrames\nusing DataArrays\n\nconst datafile = \"data/distributed/test.csv\"\nconst nloops = 10\n\nfunction load_pkgs()\n println(\"loading packages...\")\n @everywhe...
julia
chosen
[ { "from": "system", "value": "Use `mapreduce` for Julia functional example\n\n`mapreduce` combines `reduce` and `map` into a single function, avoiding\nallocating intermediate arrays. This improves performance by a factor of ~3.\n" }, { "from": "human", "value": "#!/usr/bin/env julia\n\np(n) = ...
julia
chosen
End of preview. Expand in Data Studio
README.md exists but content is empty.
Downloads last month
7