## Where communities thrive

• Join over 1.5M+ people
• Join over 100K+ communities
• Free without limits
##### Activity
• Jul 22 07:50
CR: Project Euler #12 in Julia slower than Python?
• Jul 18 11:35
• Jun 21 15:10
• Jun 18 13:50
• May 20 18:50
• May 17 19:35
• May 10 12:30
• Apr 26 08:00
• Apr 21 20:05
• Mar 25 23:30
• Mar 02 12:55
• Feb 23 11:00
• Feb 13 17:25
• Feb 13 17:25
• Feb 12 20:25
n89hnfnqa
@n89hnfnqa:matrix.org
[m]
not I'm aware of, the array comprehension usually does the trick
Federico Simonetta
@00sapo
Is there a way to vectorize a function on the rows of a matrix?
something like CartesianIndex.(idx) but on the rows/columns?
n89hnfnqa
@n89hnfnqa:matrix.org
[m]
f.(eachrow(A))?
Federico Simonetta
@00sapo
doesn't work, in this case at least
n89hnfnqa
@n89hnfnqa:matrix.org
[m]
yeah, CartesianIndex won't work with iterators
n89hnfnqa
@n89hnfnqa:matrix.org
[m]
if you splatter indexes, then it'll work: A[1,CartesianIndex.(eachcol(idx)...)]
BridgingBot
@GitterIRCbot
[irc] <random-jellyfish> is it possible to convert a BigInt to a byte array?
[irc] <Andriamanitra> what do you mean by byte array?
[irc] <Andriamanitra> can you give an example?
[irc] <Andriamanitra> digits(BigInt(239742389234), base=16) probably gets you most of the way there but i'm not sure which data type byte array is
BridgingBot
@GitterIRCbot
[irc] <random-jellyfish> any type that would represent an array of bytes
[irc] <random-jellyfish> Vector{Int8}, Array{Int8}
[irc] <random-jellyfish> Julia should have a data type that can act both as an array and as a number
[irc] <random-jellyfish> a big int type
[irc] <random-jellyfish> e.g. so that you can access bits and bit slices from it, make changes on them
[irc] <random-jellyfish> and at the same time treat the whole thing as a number, be able to add, multiply, divide etc. with other numbers
[irc] <random-jellyfish> this is useful in digital electronics
[irc] <random-jellyfish> to model memories and registers
[irc] <random-jellyfish> BigInt doesn't have support for bit slicing or doing operations on individual bits
BridgingBot
@GitterIRCbot
[irc] <random-jellyfish> I mean it's possible to do it with masks and shifts
[irc] <random-jellyfish> but it would be easier to see it as an array of bits
[irc] <random-jellyfish> or by writing a separate package
BridgingBot
@GitterIRCbot
[irc] <Andriamanitra> maybe you want BitArray instead of BigInt then?
BridgingBot
@GitterIRCbot
[irc] <Andriamanitra> i guess there's no easy way to do regular arithmetic with them but bitshifts and xors etc work
BridgingBot
@GitterIRCbot
[irc] <Andriamanitra> really seems like BigInt(::BitVector) should be a thing but it isn't
BridgingBot
@GitterIRCbot
[irc] <phao> Hi.
[irc] <phao> I remember using Julia a while back and having issues with slow load times associated with the plot package (or something like that). It seemed that this was sort of an issue. Right? Is it still like that? Or am I imagining things? (hehe) Or ... something else?
BridgingBot
@GitterIRCbot
[irc] <AnAverageHuman> it's a little faster now
BridgingBot
@GitterIRCbot
[irc] <phao> Great!
BridgingBot
@GitterIRCbot
[irc] <Andriamanitra> "time to first plot" will always be slower than in interpreted languages but yeah it has improved quite a bit in the recent releases
[irc] <Andriamanitra> if the initial compilation time really bothers you, you could look into using sysimages: https://julialang.github.io/PackageCompiler.jl/dev/sysimages/
[irc] <Andriamanitra> (but take note of the sections about drawbacks)
BridgingBot
@GitterIRCbot
[irc] <dostoyevsky> I tend to run julia in short-lived docker containers, so initial compilation time is like always
BridgingBot
@GitterIRCbot
[irc] <AnAverageHuman> I think in that case you would bake the sysimage into your container creation process
meff
[m]
Fwiw I haven't had issues with "time to first plot" myself, though yeah it's slower than Python
BridgingBot
@GitterIRCbot
[irc] <lolollolololol> how well does julia perform, and especially in async/nonblocking socket programming, what lib does it use for it, etc. anyone can answer this for me?
meff
[m]
I haven't stress tested this lolollolololol, but I've done some async http fetching/parsing and it's certainly a lot faster than Python once JITted
I think the Julia ecosystem is a bit lacking on the server end of socket programming right now, and is probably missing clients for less popular protocols
BridgingBot
@GitterIRCbot
[irc] <john2gb0> is it possible to produce a compiled binary
[irc] <Andriamanitra> yes, although it's not always straight-forward
[irc] <Andriamanitra> this is the package you'll need: https://julialang.github.io/PackageCompiler.jl/dev/
BridgingBot
@GitterIRCbot
[irc] <Andriamanitra> it seems there's also this but i'm not familiar with it myself at all so you'll have to do your own research https://binarybuilder.org/
BridgingBot
@GitterIRCbot
[irc] <john2gb0> thanks!
BridgingBot
@GitterIRCbot
[irc] <dTal> What's the equivalent of "fancy indexing" in mumpy? If I have a list of indices, is there a better way of retrieving the corresponding values than writing a loop myself?
[irc] <dTal> *numpy
BridgingBot
@GitterIRCbot
[irc] <dTal> ...oh, you just pass a vector. How embarassing. As you were.
BridgingBot
@GitterIRCbot
[irc] <deimos_> apparently loading a 512GB json into a dataframe on a server with 512GB isn't allowed
[irc] <deimos_> WARNING: Out of memory killer killed these executables