- Visit Julia home page to download pre-built binaries and access documentation
- Install VSCode, and install Julia Language extension
- For an interactive environment, try Pluto
Install these packages in your root environment:
Install these packages in your root environment:
using BenchmarkTools | |
g(y) = [[y[j], 2y[j]] for j in 1:length(y)] | |
f8(x) = reduce(hcat, x)' | |
function f11(v::Vector{Vector{T}}) where T | |
Mat = Matrix{T}(undef, length(v), length(v[1])) | |
@inbounds for row in 1:length(v) | |
for col in 1:length(v[1]) |
β Error: Gateway error | |
β time = 2021-05-14T08:27:03.245 | |
β conn = 20 | |
β exception = | |
β IOError: stream is closed or unusable | |
β Stacktrace: | |
β [1] check_open(x::Sockets.TCPSocket) | |
β @ Base ./stream.jl:386 | |
β [2] ssl_unsafe_write(ctx::MbedTLS.SSLContext, buf::Ptr{UInt8}, nbytes::UInt64) | |
β @ MbedT |
My test code:
using TypeDBClient
import TypeDBClient.grakn.protocol as P
client = TypeDBClient.CoreClient("127.0.0.1", 1729)
session = TypeDBClient.CoreSession(client, "social_network", P.Session_Type.DATA)
transaction = TypeDBClient.CoreTransaction(session, session.sessionID, P.Transaction_Type.READ, TypeDBClient.TypeDBOptions())
result = TypeDBClient.match(transaction, raw"""
match $loc has name "French Lick";
Set up test data
julia> bs = rand(Bool, 100000);
Using if/else:
julia> function foo(bs)
I built a cache that invalidates based on expiration time but then I realized that ExpiringCaches.jl (and few others) exist :-p
Just capturing what I did:
"""
TimedCache
A time-based cache. To construct a new cache, provie the types for key and value
and a retention period. It is lazy - when a cache entry expires, it is not removed
I ran this code:
using Revise, GraknClient, UUIDs
using GraknClient: CoreTransaction, Proto, GraknOptions, bytes
client = GraknClient.CoreClient("127.0.0.1", 1729)
session = GraknClient.CoreSession(client, "phone_calls", GraknClient.grakn.protocol.Session_Type.DATA, GraknClient.GraknOptions())
txn = CoreTransaction(session, session.sessionID, Proto.Transaction_Type.READ, GraknOptions())
@startuml | |
class Test | |
@enduml |
Error when calling transaction
with a Channel
argument:
julia> channel = Channel{GraknClient.grakn.protocol.Transaction_Client}(1)
julia> txn = GraknClient.transaction(client.core_stub.blockingStub, gRPCController(), channel)
ERROR: MethodError: no method matching meta(::Type{Channel{GraknClient.grakn.protocol.Transaction_Client}})
Closest candidates are:
meta(::ProtoBuf.ProtoMeta, ::Type, ::Vector{Pair{Symbol, Union{String, Type}}}, ::Vector{Symbol}, ::Vector{Int64}, ::Dict{Symbol, Any}) at /Users/tomkwong/.julia/packages/ProtoBuf/NJbMU/src/codec.jl:576
meta(::ProtoBuf.ProtoMeta, ::Type, ::Vector{Pair{Symbol, Union{String, Type}}}, ::Vector{Symbol}, ::Vector{Int64}, ::Dict{Symbol, Any}, ::Vector{Symbol}) at /Users/tomkwong/.julia/packages/ProtoBuf/NJbMU/src/codec.jl:576
module JavaScriptEmoji | |
export download_emojis, parse_emojis, gen_javascript | |
import JSON | |
function download_emojis() | |
url = "https://raw.githubusercontent.com/iamcal/emoji-data/master/emoji.json" | |
return JSON.parsefile(download(url)) | |
end |