Re: [julia-users] Problems with MySQL sample code

2016-06-15 Thread Stefan Karpinski
Issue filed here: https://github.com/JuliaDB/MySQL.jl/issues/48. Thanks. On Tue, Jun 14, 2016 at 4:58 PM, Jacob Quinn wrote: > Yep, it's just like I said above, in the "mysql_execute(con" > command/line, you'll even notice the code highlighting in your email shows >

[julia-users] Re: ANN: Delegate.jl, delegation and type re-wrapped delegation

2016-06-15 Thread Jeffrey Sarnoff
Ok, afaik examples on README.md work with v0.4.5+ and v0.5.0-dev. Here they are: > import Base: length, last > type MyInts elems::Vector{Int} end; > type MyNums{T} elems::Vector{T} end; > @delegate_1field1var( MyInts, elems, [ length, last ] ); > @delegate_1field1var( MyNums, elems, [ length,

[julia-users] Re: translation python/ijulia

2016-06-15 Thread Henri Girard
Thanks works fine, in fact I use sagemath(python,matplotlib) and as I have a lot of programs to translate in ijulia I often fail. Without your help I couldn't imagine all these modifications. Julia list is terrific :) Quick and valid answers most the time :) My code with your suggestions : using

Re: [julia-users] Abstract version of rng=1:end ?

2016-06-15 Thread Matthew Pearce
Thanks for the suggestions folks. Tim, that functionality looks pretty nice, looking forward to playing with it. Yichao's suggestion solves my problem as described. However, what I was really interested in was multidimensional arrays, where the index produced by `endof` isn't as useful

[julia-users] ANN: Delegate.jl, delegation and type re-wrapped delegation

2016-06-15 Thread Jeffrey Sarnoff
> > Pkg.clone("https://github.com/Jeffrey-Sarnoff/Delegate.jl;) > using Delegate import <, <=, +, * immutable AnInt val::Int end int1 = AnInt(1) int2 = AnInt(2) @delegate_1field2vars AnInt.val [ (<), (<=) ]; # plain results @traject_1field2vars( MyInt, val, [

[julia-users] [ANN] Taro v0.3.0

2016-06-15 Thread Avik Sengupta
I'd like to announce a major new release for Taro - the Julia utility belt for working with document formats. Taro now features a new API to read and write excel files. Earlier, you could only dump the contents of a sheet into a dataframe. Now you can read and write data cell by cell. This

[julia-users] translation python/ijulia

2016-06-15 Thread Henri Girard
Hi, I would like to transform this python working example into a ijulia program , Any help HG var("w") u=1/pi*360;s=1/(pi*360) R=100;L=10;C=10E-6 w=1/(sqrt(L*C));var('omega') p=plot(abs(1/(1+i*omega*R*C-omega*omega*L*C)),omega,0,2*w,figsize=4,frame=True, fontsize=8,axes=False,color="green")

[julia-users] Re: translation python/ijulia

2016-06-15 Thread Gabriel Gellner
I imagine you are using something like sympy that is doing a mathematica like plot over omega (the var statements) In which case you need to change the line x = linspace(0, 2pi) to omega = linspace(0, 2*w) # which seems to be the true range from the python code, not 2pi and then you need to

Re: [julia-users] Abstract version of rng=1:end ?

2016-06-15 Thread Tim Holy
On Wednesday, June 15, 2016 2:21:01 AM CDT Matthew Pearce wrote: > Tim, that functionality looks pretty nice, looking forward to playing with > it. Well, I'm not sure whether it will ever be merged unless we can come up with a way to solve the problem of computation with `end`. > Yichao's

[julia-users] Will it be possible to run julia on a remote server in Atom now?

2016-06-15 Thread AStupidbear
I have seen this post https://github.com/JunoLab/atom-julia-client/issues/8. Has it been implemented in atom-julia-client?

[julia-users] printing datatables

2016-06-15 Thread Erwin Kalvelagen
In https://github.com/JuliaDB/SQLite.jl datatables are printed in a tabular format: while I get something much more ugly:

[julia-users] Re: ANN: Delegate.jl, delegation and type re-wrapped delegation

2016-06-15 Thread ggggg
Looks super useful, thanks. It looks like you let your example get out of date, here is a corrected version using Delegate import Base: <, <=, +, *, - # later I get WARNING: module Main should explicitly import < from Base if I don't import Base: immutable AnInt val::Int end int1 = AnInt(1)

[julia-users] Segfaults in SharedArrays

2016-06-15 Thread Nils Gudat
I've had a longstanding problem with random segfaults in a program I've written which recently re-appeared (see original discussion here: https://groups.google.com/forum/#!topic/julia-users/FV9AmKsZNuk) It appears that currently these segfaults are caused by the usage of SharedArrays (or at

[julia-users] Git submodules vs Julia submodules

2016-06-15 Thread Eric Forgy
Hi, I have a large private package that depends on many other private packages and each smaller package may depends on other private packages. It is a bit tangled, but working. For example: # A,B,C,D are all private packages module A using B, C, D ... end with module D using B, C ...

Re: [julia-users] Re: Defining a new numeric type with minimal effort

2016-06-15 Thread Jeffrey Sarnoff
Kevin, I just announced https://github.com/Jeffrey-Sarnoff/Delegate.jl -- it does what you want. On Saturday, June 11, 2016 at 12:15:23 PM UTC-4, Kevin Squire wrote:

[julia-users] Performance of TCPServer

2016-06-15 Thread Andrei Zh
I've just tested performance of TCP server/client in Julia REPL and find results pretty disappointing. The server is as simple as: server = listen(2000) while true sock = accept(server) begin while true @time readbytes(sock, 1024*1024) end end end It

[julia-users] Re: MethodError closest candidate is same as "no matching method" method

2016-06-15 Thread michael
That would almost definitely be it. I had been using @everywhere using Nemo as a hacky way of dealing with types not being defined on other processes. I've read the documentation where it gives the example DummyModule and talks about the scope but I've never really grasped the "correct" way to

[julia-users] Writable arrays

2016-06-15 Thread Robert DJ
In a function that modifies an array argument I would like to pass at least (Dense)Arrays and SubArrays (from `slice`). AbstractArray is too broad a type -- a LinSpace does not allow changing an entry. What would be a suitable class? Union{DenseArray, SubArray} works, but is there a better

[julia-users] persistent in Julia

2016-06-15 Thread chobbes158
I need to construct something which is a bit expensive. So I want to construct it only once and have it stored for further use. In Matlab, this is done by 'persistent'. Is there a similar thing in Julia? I searched the previous threads and didn't see any relevant discussion. Can anyone

Re: [julia-users] persistent in Julia

2016-06-15 Thread Tamas Papp
Depending on what that "something" is, you may 1. serialize it: http://docs.julialang.org/en/release-0.4/stdlib/io-network/?highlight=serialize#Base.serialize Flexible, but format may change between Julia versions. 2. save it using HDF5: https://github.com/JuliaIO/HDF5.jl Not as flexible as

Re: [julia-users] Segfaults in SharedArrays

2016-06-15 Thread Nils Gudat
That looks familiar, yes. Would this be available in 0.4.6 then? And if so, when is 0.4.6 expected to be released?

Re: [julia-users] eval() uses global name scope

2016-06-15 Thread Yichao Yu
On Wed, Jun 15, 2016 at 2:37 PM, Ford O. wrote: > vars() = (:x, :y, :z) > > foo(x, y, z) = eval(vars()[1]) + eval(vars()[2]) + eval(vars()[3]) > > x = y = z = 1 > > @show foo(10, 10, 10) > >> foo(10, 10, 10) = 3 > > > > Is this intended? Yes > >

Re: [julia-users] eval() uses global name scope

2016-06-15 Thread Mauro
On Wed, 2016-06-15 at 20:37, Ford O. wrote: > vars() = (:x, :y, :z) > > foo(x, y, z) = eval(vars()[1]) + eval(vars()[2]) + eval(vars()[3]) > > x = y = z = 1 > > @show foo(10, 10, 10) > > > foo(10, 10, 10) = 3 > > > > Is this intended? Yes

Re: [julia-users] Segfaults in SharedArrays

2016-06-15 Thread Tim Holy
Maybe see https://github.com/JuliaLang/julia/pull/16899? --Tim On Wednesday, June 15, 2016 9:04:06 AM CDT Nils Gudat wrote: > I've had a longstanding problem with random segfaults in a program I've > written which recently re-appeared (see original discussion here: >

[julia-users] Re: Git submodules vs Julia submodules

2016-06-15 Thread Tony Kelman
Assuming you're using Julia 0.4 here? Since Julia 0.5 has transitioned to using libgit2 for the package manager, I don't think you'll have explicit support for git submodules right away. On Wednesday, June 15, 2016 at 8:26:52 AM UTC-7, Eric Forgy wrote: > > I got it! :) > > I CAN use GIt

Re: [julia-users] Re: eval() uses global name scope

2016-06-15 Thread Yichao Yu
On Wed, Jun 15, 2016 at 2:55 PM, Yichao Yu wrote: > On Wed, Jun 15, 2016 at 2:44 PM, Ford O. wrote: >> Can you explain me what exactly happens, because I am completely lost... > > It is the intended behavior and doing it otherwise will have a huge >

Re: [julia-users] Re: eval() uses global name scope

2016-06-15 Thread Ford O.
So how should I rewrite the foo function to output 30?

Re: [julia-users] Re: eval() uses global name scope

2016-06-15 Thread Stefan Karpinski
Or use eval to define the function foo rather than in the definition of foo: @eval foo(x, y, z) = $(vars()[1]) + $(vars()[2]) + $(vars()[3]) On Wed, Jun 15, 2016 at 3:02 PM, Yichao Yu wrote: > On Wed, Jun 15, 2016 at 2:59 PM, Ford O. wrote: > > So how

[julia-users] eval() uses global name scope

2016-06-15 Thread Ford O.
vars() = (:x, :y, :z) foo(x, y, z) = eval(vars()[1]) + eval(vars()[2]) + eval(vars()[3]) x = y = z = 1 @show foo(10, 10, 10) foo(10, 10, 10) = 3 > Is this intended?

Re: [julia-users] Re: eval() uses global name scope

2016-06-15 Thread Yichao Yu
On Wed, Jun 15, 2016 at 2:44 PM, Ford O. wrote: > Can you explain me what exactly happens, because I am completely lost... It is the intended behavior and doing it otherwise will have a huge performance hit since the compiler has no way to know what you are doing.

Re: [julia-users] Re: eval() uses global name scope

2016-06-15 Thread Yichao Yu
On Wed, Jun 15, 2016 at 2:59 PM, Ford O. wrote: > So how should I rewrite the foo function to output 30? foo(x, y, z) = x + y + z If you don't know the variable names, build a dict and access it from there, that's effectively what eval is anyway.

[julia-users] Re: Custom string escaping in docstrings

2016-06-15 Thread Scott Jones
I think that the docstring system is looking for a normal string, not a string with any string macro. You can get around this by using the `@doc` macro directly, i.e. @doc R""" My docstring $a+\alpha$ """ -> function myfunc() end works fine. On Wednesday, June 15, 2016 at 7:51:27 PM UTC-4,

[julia-users] Re: Plotting lots of data

2016-06-15 Thread CrocoDuck O'Ducks
Hi, thank you very much, really

Re: [julia-users] Segfaults in SharedArrays

2016-06-15 Thread Tim Holy
Dunno, but if you can build julia from source, you can easily make the same change yourself and see if it fixes the problem. If not, then you know you should keep searching for the real answer. Best, --Tim On Wednesday, June 15, 2016 11:50:47 AM CDT Nils Gudat wrote: > That looks familiar,

[julia-users] Re: eval() uses global name scope

2016-06-15 Thread Ford O.
Thanks for clarification. On Wednesday, June 15, 2016 at 8:37:30 PM UTC+2, Ford O. wrote: > > vars() = (:x, :y, :z) > > foo(x, y, z) = eval(vars()[1]) + eval(vars()[2]) + eval(vars()[3]) > > x = y = z = 1 > > @show foo(10, 10, 10) > > foo(10, 10, 10) = 3 >> > > > Is this intended? > > >

[julia-users] Re: Performance of TCPServer

2016-06-15 Thread Andrei Zh
Seems like results I posted are specific to Julia 0.4 (0.4.1 to be precise), here are results for Julia 0.3 (about 10 times faster): elapsed time: 0.031528334 seconds (1048640 bytes allocated) elapsed time: 0.031559074 seconds (1048640 bytes allocated) elapsed time: 0.031342995 seconds (1048640

[julia-users] Re: Performance of TCPServer

2016-06-15 Thread Tony Kelman
Use 0.4.4 or 0.4.5. https://github.com/JuliaLang/julia/issues/14467 On Wednesday, June 15, 2016 at 1:46:34 PM UTC-7, Andrei Zh wrote: > > Seems like results I posted are specific to Julia 0.4 (0.4.1 to be > precise), here are results for Julia 0.3 (about 10 times faster): > > elapsed time:

[julia-users] Re: Performance of TCPServer

2016-06-15 Thread Andrei Zh
Thanks, Tony. Moving to Julia 0.4.5 improved speed to ~0.025 seconds per megabyte (~39Mb / sec). This is still far behind awesome 2.5Gb for Julia 0.5, but I think it doesn't make sense to spend time on identifying and backporting changes to 0.4 given stated release date for 0.5 [1]. [1]:

[julia-users] Custom string escaping in docstrings

2016-06-15 Thread Marius Millea
My docstrings often contain Latex so they have $ and \ characters in them, so I'd like to not have to escape them manually every time. I'm trying to do so by defining an R_str macro, but it seems to prevent the docstring from attaching to its function. Is there a way to achieve this? macro

[julia-users] parse.(Int64, x)

2016-06-15 Thread David Anthoff
I just tried to use the new dot syntax for vectorising function calls in order to convert an array of strings into an array of Int64. For example, if this would work, it would be very, very handy: x = ["1", "2", "3"] parse.(Int64, x) Right now I get an error, but I wonder whether this

[julia-users] Re: parse.(Int64, x)

2016-06-15 Thread John Myles White
I would be careful combining element-wise function application with partial function application. Why not use map instead? On Wednesday, June 15, 2016 at 3:47:05 PM UTC-7, David Anthoff wrote: > > I just tried to use the new dot syntax for vectorising function calls in > order to convert an

RE: [julia-users] Re: parse.(Int64, x)

2016-06-15 Thread David Anthoff
map of course works, but it is quite verbose. I’ve been working a group of new julia users lately, many of them from other languages like R, Python etc., and they roll their eyes when something that simple takes df[:x] = map(q->parse(Int64,q), df[:x]) It just is quite complicated for

Re: [julia-users] Re: parse.(Int64, x)

2016-06-15 Thread Tony Kelman
Try parse.([Int64], x) note that the output will be an Array{Any} because issue #4883 hasn't been fixed yet. The issue here is that broadcast doesn't treat types as "scalar-like." On Wednesday, June 15, 2016 at 4:19:09 PM UTC-7, David Anthoff wrote: > > map of course works, but it is quite

[julia-users] printing specific RGB colors

2016-06-15 Thread Anonymous
So I've gotten about as much mileage out of print_with_color() as I can, which is to say not much, it doesn't even print the right colors half the time. There's a bunch of color packages which seem to be concerned with abstractly manipulating different color parameterizations, but no mention

[julia-users] Conditional Definition of Functions?

2016-06-15 Thread Chris Rackauckas
There seems to be an interesting change between v0.4.5 and v0.5. Take a look at the following code: if largeFluctuations function σ(y,t) dσ = zeros(19) dσ[1] = noiseLevel*1.5y[1] dσ[18]= noiseLevel*6y[18] return(dσ) end else function σ(y,t) dσ =

Re: [julia-users] Re: Git submodules vs Julia submodules

2016-06-15 Thread Jacob Quinn
You're correct Eric; libgit2 isn't doing anything related to what you're doing here. You're really just telling Julia one more location to look in order to find a module definition. There's an open issue I created recently about how to do this more generally (i.e. without having to explicitly

[julia-users] Re: Git submodules vs Julia submodules

2016-06-15 Thread Eric Forgy
Hi Tony, I'm not sure I understand. I am using Julia 0.4.5 (Windows), but not using anything explicit from package manager to handle the Git submodules. I just do a `git submodule add ...` from the command line (not REPL). I can't imagine package manager breaking this in 0.5. Will it? This