Re: [julia-users] Re: What is the value of time_ns() before it wraps?

2016-11-25 Thread Yichao Yu
On Fri, Nov 25, 2016 at 1:56 AM, Jeffrey Sarnoff wrote: > On Thursday, November 24, 2016 at 11:30:36 PM UTC-5, Jeffrey Sarnoff wrote: >> The help says "Get the time in nanoseconds. The time corresponding to 0 is >> undefined, and wraps every 5.8 years." I want to know

Re: [julia-users] Is something interesting happening with Julia pulse; 0.6 breaking changes?

2016-11-25 Thread Yichao Yu
On Fri, Nov 25, 2016 at 9:20 AM, Páll Haraldsson wrote: > > > http://pkg.julialang.org/pulse.html > > Not only red dipped a lot, also blue (0.4) (and black (0.5)) for a while.. > > > [Red there may not be the best color, while I understand to be 0.6, not 0.2..] > > >

Re: [julia-users] How to vonvet Char to Float64, what wrong ?

2016-11-25 Thread Yichao Yu
On Fri, Nov 25, 2016 at 8:48 AM, Milan Bouchet-Valat wrote: > Le vendredi 25 novembre 2016 à 00:35 -0800, programista...@gmail.com a > écrit : >> How to convert Char to Float? What wrong ? > Use parse(Float64, string(x)), with x the Char. > He actually has a string and not a

Re: [julia-users] Got an exception of type ErrorException outside of a @test: type DataType has no field FactorMargin

2016-11-23 Thread Yichao Yu
lement Array{Array{Int64,1},1}: [1] julia> [[1];] 1-element Array{Int64,1}: 1 > > On Wed, Nov 23, 2016 at 9:54 PM, Yichao Yu <yyc1...@gmail.com> wrote: >> >> On Wed, Nov 23, 2016 at 6:50 PM, Kevin Liu <kvt...@gmail.com> wrote: >> > Attached! >&g

Re: [julia-users] Got an exception of type ErrorException outside of a @test: type DataType has no field FactorMargin

2016-11-23 Thread Yichao Yu
×2×2 Array{Int64,3}: [:, :, 1] = 1 3 5 7 [:, :, 2] = 2 4 6 8 ``` You are not giving `permutedims` the correct second parameters (https://github.com/hpoit/MLN.jl/blob/1c13725666f34587e57c4a1757e6222cacaeab73/BN/src/FactorOperations.jl#L66). > > On Wed, Nov 23, 2016 at

Re: [julia-users] Got an exception of type ErrorException outside of a @test: type DataType has no field FactorMargin

2016-11-23 Thread Yichao Yu
te: >> >> Do you want a cut in the profits for helping me get it to work? It's a >> marathon. I still have Markov Random Field and Markov Logic Network in >> line... and two of the largest private Brazilian banks on standby. >> >> > On Nov 22, 2016, at 19:39, Yi

Re: [julia-users] Got an exception of type ErrorException outside of a @test: type DataType has no field FactorMargin

2016-11-22 Thread Yichao Yu
t; > On Tue, Nov 22, 2016 at 6:54 PM, Yichao Yu <yyc1...@gmail.com> wrote: >> >> On Tue, Nov 22, 2016 at 3:45 PM, Kevin Liu <kvt...@gmail.com> wrote: >> > Yichao, I used a hashtag in the last message to show you what I want to >> > do. Is it clear? >&

Re: [julia-users] Got an exception of type ErrorException outside of a @test: type DataType has no field FactorMargin

2016-11-22 Thread Yichao Yu
FactorMargin`? What's the extra `Factor.` for? > > On Nov 22, 2016, at 18:27, Yichao Yu <yyc1...@gmail.com> wrote: > >>> Yichao and DPSanders, I have already used instances of Factor on >>> runtests.jl, instances A, B, and C >> >> AFAICT you are stil

Re: [julia-users] Got an exception of type ErrorException outside of a @test: type DataType has no field FactorMargin

2016-11-22 Thread Yichao Yu
> Yichao and DPSanders, I have already used instances of Factor on runtests.jl, > instances A, B, and C AFAICT you are still accessing a non existing field of a type[1] and it's unclear what you actually want to do. [1]

Re: [julia-users] Passing Dictionary from Julia to C function using ccall

2016-11-22 Thread Yichao Yu
Hmmm, I thought you can't start a new thread on julia-users anymore On Tue, Nov 22, 2016 at 2:18 AM, Alexander Lyapin wrote: > Is there way to pass Dictionary from Julia to C function using ccall??? > > I have to divide all dictionaries for subarrays and then send

Re: [julia-users] Got an exception of type ErrorException outside of a @test: type DataType has no field FactorMargin

2016-11-18 Thread Yichao Yu
On Thu, Nov 17, 2016 at 2:39 PM, Kevin Liu <kvt...@gmail.com> wrote: > Right, I need the instance of Factor Then use the instance of Factor. > > On Thursday, November 17, 2016 at 5:33:05 PM UTC-2, Yichao Yu wrote: >> >> On Thu, Nov 17, 2016 at 2:27 PM, Kevin Liu <k

Re: [julia-users] Got an exception of type ErrorException outside of a @test: type DataType has no field FactorMargin

2016-11-17 Thread Yichao Yu
is defined on Factor.jl, and that file evaluates fine. AFAICT the `Factor`is a type so `Factor.FactorMargin` is definitely wrong. > > The main file, BN.jl, includes Factor.jl and FactorOperations.jl and exports > Factor, and also evaluates fine. > > On Wednesday, November 16, 201

Re: [julia-users] Got an exception of type ErrorException outside of a @test: type DataType has no field FactorMargin

2016-11-16 Thread Yichao Yu
Contents/Resources/julia/lib/julia/sys.dylib:? > >in process_options(::Base.JLOptions) at ./client.jl:262 > >in _start() at ./client.jl:318 > >in _start() at > /Applications/Julia-0.5.app/Contents/Resources/julia/lib/julia/sys.dylib:? > > Test Summary: |

Re: [julia-users] Got an exception of type ErrorException outside of a @test: type DataType has no field FactorMargin

2016-11-16 Thread Yichao Yu
On Wed, Nov 16, 2016 at 6:50 PM, Kevin Liu wrote: > From this issue https://github.com/JuliaPy/PyPlot.jl/issues/157 I understand ^^ This is irrelevant unless you are using PyCall > > `Factor[:FactorMargin](A, Remove_var, Remain_var, Remove_dims, Remain_dims)` > (line 85 of

Re: [julia-users] How to tell if Val{T} is using a fast route

2016-11-16 Thread Yichao Yu
On Wed, Nov 16, 2016 at 10:06 AM, FANG Colin wrote: > In performance tips, it says > > Essentially, Val{T}works only when T is either hard-coded (Val{3}) or > already specified in the type-domain. > > Suppose I have > > ff(::Type{Val{1}}) = 1 > > I guess the following is on a

Re: [julia-users] Base.Threads user feedback: it's great. please keep it. anyone tried hybrid (addprocs + Threads)?

2016-11-15 Thread Yichao Yu
ental in 0.6. > > > On 14 November 2016 at 23:59, Yichao Yu <yyc1...@gmail.com> wrote: >> >> On Mon, Nov 14, 2016 at 5:08 PM, Florian Oswald >> <florian.osw...@gmail.com> wrote: >> > I'm not sure how many people are using Base.Threads out there, I c

Re: [julia-users] Re: Reloading module doesn't redefine constant

2016-11-15 Thread Yichao Yu
Does indentation >> affect `include("FactorOperations.jl")`? If I pull it back to where `module` >> starts, it says `incomplete module at ... requires end`. Then pushing it >> under `type` defines `module`. >> >> On Mon, Nov 14, 2016 at 11:57 PM, Yichao Yu <

Re: [julia-users] Re: Reloading module doesn't redefine constant

2016-11-15 Thread Yichao Yu
On Mon, Nov 14, 2016 at 10:35 PM, Kevin Liu wrote: > Does indentation affect `include("FactorOperations.jl")`? If I pull it back No. > to where `module` starts, it says `incomplete module at ... requires end`. > Then pushing it under `type` defines `module`. Unclear what you

Re: [julia-users] Re: Reloading module doesn't redefine constant

2016-11-14 Thread Yichao Yu
ys, you passed a type `FactorNode.FactorNode.Factor` instead of a `Symbol` to `isdefined`. It's unclear what you want to test though given `Factor` was defined right above. > > > (see attachment) > > On Monday, November 14, 2016 at 10:41:43 PM UTC-2, Yichao Yu wrote: >> >>

Re: [julia-users] Re: Reloading module doesn't redefine constant

2016-11-14 Thread Yichao Yu
On Mon, Nov 14, 2016 at 7:39 PM, Kevin Liu wrote: > > > On Monday, November 14, 2016 at 10:36:07 PM UTC-2, Kevin Liu wrote: >> >> Help! (see attachment) This is not related to reloading. You can't have a global variable with the same name of the module since that's already

Re: [julia-users] Base.Threads user feedback: it's great. please keep it. anyone tried hybrid (addprocs + Threads)?

2016-11-14 Thread Yichao Yu
On Mon, Nov 14, 2016 at 5:08 PM, Florian Oswald wrote: > I'm not sure how many people are using Base.Threads out there, I came across > it by accident and think it works great. It's under the heading > "experimental" in the manual, so I just wanted to encourage the

Re: [julia-users] Benchmarking a function with parameters

2016-11-14 Thread Yichao Yu
On Mon, Nov 14, 2016 at 8:16 AM, Uwe Fechner wrote: > Hello, > > why does the following code not work (no benchmark result shown, no error > message or warning): > using BenchmarkTools > > function add2!(vec, result) > """ Calculate the sum of two 3d vectors and

Re: [julia-users] Re: Escaped $ in Strings has a strange behavior

2016-11-07 Thread Yichao Yu
On Mon, Nov 7, 2016 at 10:55 PM, cdm <cdmclean@gmail.com> wrote: > > > On Monday, November 7, 2016 at 7:51:34 PM UTC-8, Yichao Yu wrote: >> >> Just to be clear. print/println does not "un-decorate" anything at >> all. It's `show`/`display`/`dump`

Re: [julia-users] Re: Escaped $ in Strings has a strange behavior

2016-11-07 Thread Yichao Yu
On Mon, Nov 7, 2016 at 10:48 PM, cdm <cdmclean@gmail.com> wrote: > > On Monday, November 7, 2016 at 7:31:52 PM UTC-8, Yichao Yu wrote: >> >> >> Both? I don't see the difference. I'm only saying that `show` does not >> simply write the string to the s

Re: [julia-users] Re: Escaped $ in Strings has a strange behavior

2016-11-07 Thread Yichao Yu
16 at 7:28:38 PM UTC-8, cdm wrote: >> >> On Monday, November 7, 2016 at 7:23:10 PM UTC-8, Yichao Yu wrote: >>> >>> fwiw, show does more stuff on the string than either print or println. >>> None of them return anything even though print and println do

Re: [julia-users] Re: Escaped $ in Strings has a strange behavior

2016-11-07 Thread Yichao Yu
On Mon, Nov 7, 2016 at 10:28 PM, cdm <cdmclean@gmail.com> wrote: > On Monday, November 7, 2016 at 7:23:10 PM UTC-8, Yichao Yu wrote: >> >> fwiw, show does more stuff on the string than either print or println. >> None of them return anything even though print and

Re: [julia-users] Re: Escaped $ in Strings has a strange behavior

2016-11-07 Thread Yichao Yu
On Mon, Nov 7, 2016 at 10:16 PM, cdm <cdmclean@gmail.com> wrote: > > > On Monday, November 7, 2016 at 7:13:03 PM UTC-8, Yichao Yu wrote: >> >> > so, more "stuff" is happening >> > within the println() function ... >> >

Re: [julia-users] Re: Escaped $ in Strings has a strange behavior

2016-11-07 Thread Yichao Yu
On Mon, Nov 7, 2016 at 10:06 PM, cdm wrote: > > in the terminal: > > julia> a = "i have \$100 ..." > "i have \$100 ..." > > julia> aa = eval(a) > "i have \$100 ..." ^^ FWIW, this is a no-op > > julia> a == aa > true ^^ Which should make this not very surprising. > >

Re: [julia-users] How can I run this "raijin", fx auto trading program?

2016-11-05 Thread Yichao Yu
On Sun, Nov 6, 2016 at 12:32 AM, <pepepepe25...@gmail.com> wrote: > could not run it means I don't know how to run a script. Thank you for your > reply. http://docs.julialang.org/en/latest/manual/getting-started/?highlight=script > > 2016年11月6日日曜日 10時16分18秒 UTC+9 Yichao Yu: &

Re: [julia-users] How can I run this "raijin", fx auto trading program?

2016-11-05 Thread Yichao Yu
On Sat, Nov 5, 2016 at 6:49 AM, wrote: > > > I found "raijin" in https://github.com/iuraiura/raijin > I could download it and rewrite some parameters, but I could not run it. > Could you help me? What do you mean by "you could not run it"? You don't know how to run a

Re: [julia-users] Where does Pkg.clone() put files?

2016-11-05 Thread Yichao Yu
On Sat, Nov 5, 2016 at 2:40 PM, Dean Schulze wrote: > I'm on Ubuntu 15. I can't find this answer anywhere. > Pkg.dir(), same as all other package operations.

Re: [julia-users] Adding ZMQ fails on debian-strech ARM

2016-11-05 Thread Yichao Yu
On Sat, Nov 5, 2016 at 3:55 AM, Lutfullah Tomak wrote: > 1)System libzmq fails because binary tarball(julia-0.5) from julialang.org > includes old libstdc++ shared library hence Pkg.build("ZMQ") fails. 2) I > tried to build julia-0.5 with the system's gcc (6.2) but build

Re: [julia-users] Equivalance of SymbolNode in Julia-0.5

2016-11-05 Thread Yichao Yu
On Sat, Nov 5, 2016 at 2:12 AM, AStupidbear wrote: > Thanks. Though there are still confusing errors after replacing "SymbolNode" > to "Slot". As I said, simply replacing `SymbolNode` with `Slot` won't work.

Re: [julia-users] Getting parameter names from Method

2016-11-04 Thread Yichao Yu
On Fri, Nov 4, 2016 at 6:31 PM, David Anthoff wrote: > Is there a way to get the names of the parameters of a method from a Method > type instance on julia 0.5? Roughly: nargs tell you how many arguments the method accepts, the first one being the object (function) being

Re: [julia-users] Re-export variable define in __init__ of submodule with precompilation

2016-11-04 Thread Yichao Yu
On Fri, Nov 4, 2016 at 12:30 PM, Simon Byrne wrote: > How can I reexport a variable defined in the __init__ method of a > submodule, to play nice with precompilation. > > The following gives me a "WARNING: could not import Foo.bar into > TestExport": > > __precompile__() >

Re: [julia-users] Passing N-D Julia arrays to C functions

2016-11-04 Thread Yichao Yu
On Fri, Nov 4, 2016 at 9:22 AM, Alexander Lyapin wrote: > There is a topic: > https://groups.google.com/d/msg/julia-users/EK9oNzzaoAk/kJqagPL0Ku0J > > However could some one give an example how to pass 3-d or 4-d array to C > function. > > I have Array{Float64, 4} and

Re: [julia-users] Equivalance of SymbolNode in Julia-0.5

2016-11-04 Thread Yichao Yu
On Fri, Nov 4, 2016 at 4:37 AM, AStupidbear wrote: > According to this issue, the definition of SymbolNode disappears in > Julia-0.5. Since there's no response from the author, I want to know the > equivalence of SymbolNode in Julia-0.5, how I can fix this deprecation. I

Re: [julia-users] create command with spaces without quoting

2016-11-03 Thread Yichao Yu
On Thu, Nov 3, 2016 at 12:17 PM, Andre Bieler wrote: > I want to generate a command for imagemagick and use options loaded from a > file. > So the number of utilized options is not known beforehand. > > An example might look like: > > convert -density 300 somefile.pdf

Re: [julia-users] Where can I put code that will be run every time "using Module" is executed, and not just the first time?

2016-11-02 Thread Yichao Yu
On Nov 2, 2016 8:12 PM, "Scott Lundberg" wrote: > > In Jupyter it is convenient to dump JS library code to the notebook when "using Module" is run. This is simple to do in the Module's __init__(), and saves a ton of memory since later visualizations can share this common

Re: [julia-users] best way to reinstall packages after upgrading Julia?

2016-11-01 Thread Yichao Yu
On Nov 1, 2016 4:32 PM, "Steven G. Johnson" wrote: > > When you upgrade from (say) Julia 0.4 to 0.5, you have to re-install all of the packages because the package directory changes. It seems like there should be an automated way to do this. Does something like this

Re: [julia-users] Indexing a large matrix is MUCH slower (~ 150x) slower in 0.5 (and 0.6) than 0.4.7

2016-10-31 Thread Yichao Yu
gt; samples: 11 > evals/sample: 1 > time tolerance: 5.00% > memory tolerance: 1.00% > memory estimate: 727.55 mb > allocs estimate: 79 > minimum time: 425.82 ms (0.06% GC) > median time: 485.95 ms (11.31% GC) > mean time: 482.6

Re: [julia-users] Indexing a large matrix is MUCH slower (~ 150x) slower in 0.5 (and 0.6) than 0.4.7

2016-10-31 Thread Yichao Yu
On Mon, Oct 31, 2016 at 6:34 PM, Ian Butterworth wrote: > I'm not sure of the etiquette, but I'm cross-posting this from stackoverflow > as it seems like quite a significant issue... > > As an example: > > x = rand(10,10,100,4,4,1000) #Dummy array > > tic() > r =

Re: [julia-users] 0.5 new generators syntax question

2016-10-31 Thread Yichao Yu
On Mon, Oct 31, 2016 at 3:42 PM, Jesse Jaanila wrote: > Hi, > > I was experimenting with the new 0.5 features and they are great! But to my > surprise, > the generator syntax doesn't work as I'm expecting. Let's say I want to > calculate > some summation. With the old

Re: [julia-users] inconsistent 'unique' in Atom

2016-10-30 Thread Yichao Yu
it to the Atom plugin instead. (I believe they have their own more specific forum). There should be enough Atom users here to verify your issue too if it's not urgent. > > thanks a lot, > > On Sunday, October 30, 2016 at 7:14:07 PM UTC-7, Yichao Yu wrote: >> >> On Sun, O

Re: [julia-users] inconsistent 'unique' in Atom

2016-10-30 Thread Yichao Yu
On Sun, Oct 30, 2016 at 10:05 PM, wrote: > Hi folks, > > I've noticed that in v5 the expression > > > unique([122 122.5 10 10.3]) > > > gives as result the following vector: > > 122 123 10 10.3 > > > Any device? Is there any maximum number of characters displayed in the >

Re: [julia-users] Array horizontal concatenation

2016-10-30 Thread Yichao Yu
On Oct 30, 2016 12:30 PM, "Anthony Ashley" wrote: > > Hello, > > I noticed that implied hcat does not work if a space is omitted between the arrays to be concatenated. For example: > > [[1 2][3 4]] > > gives: > > ERROR: MethodError: `typed_hcat` has no method matching

Re: [julia-users] Using -args to execute a function for different parameters

2016-10-29 Thread Yichao Yu
On Sat, Oct 29, 2016 at 4:21 PM, <varun...@gmail.com> wrote: > I don't understand what the post means. Could you please elaborate a bit? > > > On Saturday, 29 October 2016 22:04:32 UTC+2, Yichao Yu wrote: >> >> > 3. This is the most confusing part for

Re: [julia-users] Using -args to execute a function for different parameters

2016-10-29 Thread Yichao Yu
> 3. This is the most confusing part for me. I really don't get the Julia > equivalent of these two lines. if __name__ == "__main__": > main(sys.argv[1:]) None. > > Could you please clarify my questions? > > > On Thursday, 27 October 2016 15:05:57 UTC+2, Yic

Re: [julia-users] Parsing complex numbers

2016-10-28 Thread Yichao Yu
On Fri, Oct 28, 2016 at 3:53 PM, Jérémy Béjanin wrote: > I've noticed that parsing a string representing a real number yields a real > number, but parsing a string representing a complex number yields an > expression that must subsequently be evaluated. Is there a reason

Re: [julia-users] anonymous function

2016-10-28 Thread Yichao Yu
On Fri, Oct 28, 2016 at 2:59 PM, digxx wrote: > I didnt see it > f = function () > end > > defines an anonymous function and assigns it to a variable f.

Re: [julia-users] anonymous function

2016-10-28 Thread Yichao Yu
On Fri, Oct 28, 2016 at 2:30 PM, digxx wrote: > ok: > > f(x)=x^2 is not an anonymous function > however > f=x->x^2 is an anonymous function > > unfortunately my function is not just one line so I cant use f=x->x^2 and I > have to use something like > > function f(x) > > >

Re: [julia-users] anonymous function

2016-10-28 Thread Yichao Yu
On Fri, Oct 28, 2016 at 2:19 PM, Michele Zaffalon wrote: > I have read somewhere that your second approach is doing two things at the > same time: defining an anonymous function and assigning the name f to it. No it's not. It defines a function named `f` f = function

Re: [julia-users] anonymous function

2016-10-28 Thread Yichao Yu
On Fri, Oct 28, 2016 at 2:12 PM, digxx wrote: > So an anonymous function I can write like this > > f=x->x^2 > > is it also possible to make an anonymous function out of this: > > function f(x) > > x^2 > > end No. What are you trying to do?

Re: [julia-users] CPU_CORES is deprecated

2016-10-28 Thread Yichao Yu
https://github.com/JuliaLang/julia/blob/master/NEWS.md#library-improvements-1 On Fri, Oct 28, 2016 at 8:27 AM, Yichao Yu <yyc1...@gmail.com> wrote: > Sys.CPU_CORES > > On Fri, Oct 28, 2016 at 8:14 AM, Nils Gudat <nils.gu...@gmail.com> wrote: >> As the tit

Re: [julia-users] CPU_CORES is deprecated

2016-10-28 Thread Yichao Yu
Sys.CPU_CORES On Fri, Oct 28, 2016 at 8:14 AM, Nils Gudat wrote: > As the title says - getting a warning but the constant still exist. There's > none of the ususal "use ... instead" in the warning, what's the replacement > (if any) for this in 0.5?

Re: [julia-users] Re: Input a data from the console

2016-10-27 Thread Yichao Yu
On Fri, Oct 28, 2016 at 12:01 AM, Jeffrey Sarnoff wrote: > And although readline() yields a String, if you are asking for, say, a Int > or a Float64 value, you can add a second version of `input`: > > ``` > typealias ParseableNumber Union{Float64, Float32, Signed,

Re: [julia-users] Using -args to execute a function for different parameters

2016-10-27 Thread Yichao Yu
On Thu, Oct 27, 2016 at 8:48 AM, wrote: > Hi Josef, > > I shall paste a function that I used for my python files. Would it be okay > if I asked you for some help to do the same in Julia? I've implemented most > of the code but this still remains to be done in Julia and I

Re: [julia-users] Re: How do the file name / module name mapping rules work?

2016-10-26 Thread Yichao Yu
FWIW I dont think this question has anything to do with naming conventions and package organizations. > On Wednesday, October 26, 2016 at 1:44:34 PM UTC-4, ma...@maasha.dk wrote: >> >> Using the example package https://github.com/JuliaLang/Example.jl/ I am >> wondering: >> >> >> the root level

Re: [julia-users] Re: a default module name?

2016-10-26 Thread Yichao Yu
On Wed, Oct 26, 2016 at 3:46 PM, Ryan Gardner wrote: > Oh, Main > > import Main.foo import ..foo > > Thanks. > > > On Wednesday, October 26, 2016 at 3:27:50 PM UTC-4, Ryan Gardner wrote: >> >> say I have code: >> >> >> type foo >>a >> end >> >> module MyModule >>

Re: [julia-users] Binary read

2016-10-25 Thread Yichao Yu
On Tue, Oct 25, 2016 at 4:05 PM, Aleksandr Mikheev wrote: > Hello, sorry if this question have already been asked, but I could not find > a similar thread. So, I have a .dat ("numbers.dat") file, which I should > open. I believe I should do something like this: > >> f =

Re: [julia-users] llvm call error

2016-10-25 Thread Yichao Yu
erates code with i64 as input and no >>> jl_value_t appears. is it possible to do the same with arrays? >>> Array{Float32,2} genrates a jl_value_t? Is there an array type that can do >>> this? For example fixed arrays? >>> >>> Finally, is this featur

Re: [julia-users] llvm call error

2016-10-25 Thread Yichao Yu
On Mon, Oct 24, 2016 at 8:15 PM, wrote: > Hi All, > > I am trying to call llvm ir generated from julia. > > Here is my function: > > function incr(a::Array{Int64}) a+1; end > > > thus: > > @code_llvm(incr([1 2 5 6 7])) > > returns: > > define %jl_value_t*

Re: [julia-users] ERROR: UndefVarError: PkgDev not defined

2016-10-24 Thread Yichao Yu
On Mon, Oct 24, 2016 at 5:57 PM, J Luis wrote: > Hi, > > I'm trying to tag a new version of a package for the first time (initial tag > was done with 0.4) but > > Pkg.update() > ... > WARNING: julia is fixed at 0.5.0-rc4+0 conflicting with requirement for > GLFW: [0.5.0,∞) >

Re: [julia-users] String escape when ccall-ing DLL functions on Windows

2016-10-23 Thread Yichao Yu
On Sun, Oct 23, 2016 at 1:22 PM, 中山慎太郎 wrote: > Hello, > > I'm trying to ccall my DLL as follows : > > function start(args :: Array{String, 1}) > return ccall((:TestFunction, "mydll.dll"), Int32, (Int32, > Ptr{Ptr{UInt8}}), length(args), args) > end > > The C declaration is

Re: [julia-users] A "two-languages" problem when embedding Julia

2016-10-22 Thread Yichao Yu
t;current thread support development". We'll likely add that later but the first "stable" version of threading support will unlikely support that. Relevant issues, https://github.com/JuliaLang/julia/issues/16134 and (more accurately) https://github.com/JuliaLang/julia/issues/17573 &g

Re: [julia-users] A "two-languages" problem when embedding Julia

2016-10-22 Thread Yichao Yu
> Now, let me ask two questions. > - Will the current thread support development allow embedding Julia into > multiple threads (even if it is as multiple instances)? > No. > - What are my options **today**, if any, to somehow overcome this > limitation? > You can only call julia runtime/code

Re: [julia-users] Testing uncommitted changes to a package

2016-10-21 Thread Yichao Yu
Add $PWD/src to LOAD_PATH instead. This way you can also make sure you are not using Pkg incorrectly in your package. On Fri, Oct 21, 2016 at 11:11 AM, Chandrakant G < chandrakant.gopa...@gmail.com> wrote: > Hi guys, > I am getting my feet wet with Julia and its pretty nice so far. > I am

Re: [julia-users] Julia crashes on using PyPlot after workspace() on Mac OSX Yosemite

2016-10-20 Thread Yichao Yu
https://github.com/JuliaLang/julia/issues/16467 On Thu, Oct 20, 2016 at 3:10 AM, Vishnu Raj wrote: > Hi, > > I'm in OSX 10.10 and is facing the following problem. First I import > PyPlot by 'using PyPlot' and plot some stuff, it works. Now if i call a > workspace() and

Re: [julia-users] Can't overwrite some methods in 0.5.0

2016-10-20 Thread Yichao Yu
On Wed, Oct 19, 2016 at 10:33 PM, Alex Mellnik <a.r.mell...@gmail.com> wrote: > Yichao, > > I'm afraid I'm not following -- could you expand on that a bit? Thanks, > https://github.com/JuliaLang/julia/issues/265 > > Alex > > On Wednesday, October 19, 2016 at 4:4

Re: [julia-users] Can't overwrite some methods in 0.5.0

2016-10-19 Thread Yichao Yu
On Oct 19, 2016 7:26 PM, "Alex Mellnik" wrote: > > Here's my bizarre find of the day. Most functions can be overwritten without problems: > > function add7(i) > 7 + i > end > Out[1]: > add7 (generic function with 1 method) > In [2]: > > add7(0) > add7(0) > Out[2]: > 7

Re: [julia-users] Embedding Julia in C++ - Determining returned array types

2016-10-19 Thread Yichao Yu
On Wed, Oct 19, 2016 at 12:54 PM, Kyle Kotowick wrote: > Aha, that fixed it! > > I'm running into one issue though. What do I do with the data when it's a > "Float16" type? C++ has no way to represent a 16-bit float, so I'm having > difficulty converting it to a regular 32-bit

Re: [julia-users] variable scope inside @threads loop?

2016-10-19 Thread Yichao Yu
On Wed, Oct 19, 2016 at 10:08 AM, Jingpeng Wu wrote: > > > Currently, it seems that every variable was shared to all threads, which > limit the application range a lot. Is there anyway to define private > variable to each threads? similar with OpenMP. > Same as normal

Re: [julia-users] Embedding Julia in C++ - Determining returned array types

2016-10-18 Thread Yichao Yu
On Tue, Oct 18, 2016 at 8:57 PM, Isaiah Norton wrote: > The issue here is that `jl_array_eltype` is already returning a type. > > `jl_typeis(v, t)` becomes `jl_typeof(v) == t`, so your checks become: > > jl_typeof(array_type) == jl_int64_type > > But > >

Re: [julia-users] thread safe locks and Julia 0.4

2016-10-18 Thread Yichao Yu
On Tue, Oct 18, 2016 at 3:53 PM, Ryan Gardner wrote: > The documentation for Julia 0.5.0 says that the lock returned by > ReentrantLock() "is NOT threadsafe" ( http://docs.julialang.org/en/ > release-0.5/stdlib/parallel/ see ReentrantLock()) . What does that > mean? I

Re: [julia-users] Recasting arrays

2016-10-18 Thread Yichao Yu
On Tue, Oct 18, 2016 at 1:38 PM, Jérémy Béjanin wrote: > I have seen the rem(a,b) function being used to recast numbers, but I was > wondering if there was a way to recast arrays as in C. > Do note that this is undefined in standard C. > > Say, for example, that I

Re: [julia-users] row of a matrix

2016-10-17 Thread Yichao Yu
On Mon, Oct 17, 2016 at 9:22 AM, Chang Kwon wrote: > > It seems that the way Julia handles A[1,:] changed in v0.5. > > *julia> **A = [1 2 3; 4 5 6]* > > *2×3 Array{Int64,2}:* > > * 1 2 3* > > * 4 5 6* > > > *julia> **A[1,:]* > > *3-element Array{Int64,1}:* > > * 1* > > *

Re: [julia-users] Some questions on array comprehensions; e.g. disabling bounds checking possible? And correct way for non-1-based

2016-10-16 Thread Yichao Yu
On Sun, Oct 16, 2016 at 12:01 PM, Páll Haraldsson wrote: > > I was prototyping: > > julia> a=[1,2,3,1,2] > > julia> b=[a[i] 4-element Array{Bool,1}: > true > true > false > true > > > In the beginning when trying stuff out I

Re: [julia-users] Reductions sometimes not typestable?

2016-10-15 Thread Yichao Yu
On Sat, Oct 15, 2016 at 6:21 PM, jw3126 <jw3...@gmail.com> wrote: > > > On Sunday, October 16, 2016 at 12:12:14 AM UTC+2, Yichao Yu wrote: >> >> >> >> 2016-10-15 18:06 GMT-04:00 jw3126 <jw3...@gmail.com>: >> >>> myop(::Int16, ::Int1

Re: [julia-users] Reductions sometimes not typestable?

2016-10-15 Thread Yichao Yu
2016-10-15 18:06 GMT-04:00 jw3126 : > myop(::Int16, ::Int16) = Int32(1) > myop(::Int16, ::Int32) = Int64(1) > myop(::Int16, ::Int64) = Int128(1) > myop(::Int16, ::Int128) = Int128(1) > > foldr(myop, Int16[1]) |> typeof |> println > foldr(myop, Int16[1,1]) |> typeof |> println >

Re: [julia-users] Type-stable global variables?

2016-10-15 Thread Yichao Yu
On Sat, Oct 15, 2016 at 8:59 AM, Andrei Zh wrote: > What is the most straightforward way to make a variable in the global > scope that can change it's value, but not its type? So far I use this: > > const GLOBAL_VAR = [MyType[]] # array with single element > >

Re: [julia-users] FactCheck.jl bundled with Julia?

2016-10-14 Thread Yichao Yu
; > 2016-10-14 18:05 GMT-07:00 Yichao Yu <yyc1...@gmail.com>: > >> On Oct 14, 2016 8:52 PM, "Júlio Hoffimann" <julio.hoffim...@gmail.com> >> wrote: >> > >> > Oh really? I'm not following it closely. Please let me know why that is >> the c

Re: [julia-users] FactCheck.jl bundled with Julia?

2016-10-14 Thread Yichao Yu
On Oct 14, 2016 8:52 PM, "Júlio Hoffimann" wrote: > > Oh really? I'm not following it closely. Please let me know why that is the case, I was planning to switch to FactCheck. Afaict the new test in base is a improved version of FactCheck. > > -Júlio

Re: [julia-users] GC rooting for embedding: what is safe and unsafe?

2016-10-14 Thread Yichao Yu
On Fri, Oct 14, 2016 at 7:03 AM, Bart Janssens wrote: > Hi, > > Replies below, to the best of my understanding of the Julia C interface: > > On Fri, Oct 14, 2016 at 11:47 AM Gunnar Farnebäck > wrote: > >> Reading through the threads and issues on gc

Re: [julia-users] Memory allocation issue when using external packages in module

2016-10-14 Thread Yichao Yu
On Fri, Oct 14, 2016 at 4:14 AM, Jan wrote: > Thanks for the hint. That seems to be the reason! > > I have a couple of follow up questions so that I learn more about Julia. > Would be nice if someone takes a couple of minutes to educate me. > > I found a simple example

Re: [julia-users] Memory allocation issue when using external packages in module

2016-10-13 Thread Yichao Yu
Likely https://github.com/JuliaLang/julia/issues/18465 On Thu, Oct 13, 2016 at 11:56 AM, Jan wrote: > Hi! > > I´ve tried to reduce my problem to a smaller one, but I didn´t succeed. > However, I hope someone can help me even though the problem description is > a bit

Re: [julia-users] Question about type ambiguity

2016-10-12 Thread Yichao Yu
On Wed, Oct 12, 2016 at 2:41 PM, Mauro <mauro...@runbox.com> wrote: > On Wed, 2016-10-12 at 20:03, Yichao Yu <yyc1...@gmail.com> wrote: > > On Wed, Oct 12, 2016 at 1:22 PM, esproff <espr...@gmail.com> wrote: > > > >> Consider the code: > &g

Re: [julia-users] Question about type ambiguity

2016-10-12 Thread Yichao Yu
On Wed, Oct 12, 2016 at 1:22 PM, esproff wrote: > Consider the code: > > abstract AbstractFoo > > type Foo <: AbstractFoo > end > > f(x::AbstractFoo, y::Integer) = "method 1" > f(x::Foo, y::Real) = "method 2" > > foo = Foo() > f(foo, 1) > > This code results in an ambiguity

Re: [julia-users] Do threads in a threaded loop have their own scope?

2016-10-11 Thread Yichao Yu
On Tue, Oct 11, 2016 at 1:13 PM, Evan Fields wrote: > I'm unsure if "bit shared" is a technical term I should know, or if "bit > shared" is a smartphone typo for "not shared" which would describe my > understanding of normal loops, where it seems each iteration

Re: [julia-users] Do threads in a threaded loop have their own scope?

2016-10-11 Thread Yichao Yu
On Oct 11, 2016 12:34 PM, "Evan Fields" wrote: > > Let's say I have a type MyType and function f(mt::MyType) which is slow and stochastic. I have an object y::MyType, and I'd like to compute f(y) many times. > > If I write a loop like > fvals = Vector{Float64}(100) >

Re: [julia-users] Must we reinstall all packages after updating to v0.5?

2016-10-08 Thread Yichao Yu
ersion of julia will not delete the data for the older version because you can use multiple versions simultaneously. > > On Saturday, 8 October 2016 20:43:57 UTC+2, Yichao Yu wrote: >> >> On Sat, Oct 8, 2016 at 2:41 PM, Yichao Yu <yyc...@gmail.com> wrote: >> > On

Re: [julia-users] Must we reinstall all packages after updating to v0.5?

2016-10-08 Thread Yichao Yu
On Sat, Oct 8, 2016 at 2:41 PM, Yichao Yu <yyc1...@gmail.com> wrote: > On Sat, Oct 8, 2016 at 2:39 PM, <varun...@gmail.com> wrote: >> Hi, I'm not sure if anyone else has this problem but apparently, after >> updating to v0.5, I can no longer find the pac

Re: [julia-users] Must we reinstall all packages after updating to v0.5?

2016-10-08 Thread Yichao Yu
On Sat, Oct 8, 2016 at 2:39 PM, wrote: > Hi, I'm not sure if anyone else has this problem but apparently, after > updating to v0.5, I can no longer find the packages that I had previously This is expected since packages might use different code on different julia versions

Re: [julia-users] @testset in v0.4 testing?

2016-10-08 Thread Yichao Yu
On Sat, Oct 8, 2016 at 7:19 AM, Andreas Lobinger wrote: > Hello colleagues, > > it's quite nice to structure testing with @testset in v0.5 (and higher), but > it doesn't exist in 0.4. And it's not expected to be backported. > Could Compat be a place for this? Or just build

Re: [julia-users] help with syntax for Function-like objects for parametric types

2016-10-07 Thread Yichao Yu
On Fri, Oct 7, 2016 at 4:05 PM, Chris Stook wrote: > Calling objects of type T is only valid if N arguments are provided. What > is the correct syntax for this? > > immutable T{N} > t :: NTuple{N,Any} > end > > (x::T)(args...) = error("wrong number of arguments")

Re: [julia-users] Threads.@threads and throw ErrorException interaction

2016-10-07 Thread Yichao Yu
On Fri, Oct 7, 2016 at 4:02 PM, Diego Javier Zea wrote: > Hi, > I was starting to play with Threads.@threads and I noticed a strange > behaviour when the macro is used together with throw and ErrorException: > > | | |_| | | | (_| | | Version 0.5.0 (2016-09-19 18:14 UTC) >

Re: [julia-users] Indexing an Float64 scalar

2016-10-07 Thread Yichao Yu
On Fri, Oct 7, 2016 at 1:59 PM, Eduardo Lenz wrote: > Hi. > > What is exactly the point of a construction like > > " > julia> a = 33.33 > 33.33 > > julia> a[1] > 33.33 > " > be valid ? I think it should rise an error, but there is a > getindex(::Float64, ::Int64)

Re: [julia-users] Calling DLL function

2016-10-07 Thread Yichao Yu
on the line of a & 0xfff and (a >> 16) & 0xfff should do it. You need to adjust to the actual bits location of course. If you have never done anything with bits before, this might be useful in general. https://en.wikipedia.org/wiki/Bitwise_operation > > On Thursday, October 6, 2016 at 8:1

Re: [julia-users] Calling DLL function

2016-10-06 Thread Yichao Yu
On Thu, Oct 6, 2016 at 5:40 PM, Jérémy Béjanin wrote: > Thanks! this works perfectly. > > The pointer_to_array() function seems to be deprecated, however, do you know > how to use the suggested replacement, unsafe_wrap()? Yes. > > And if it's not too much to ask, I am

Re: [julia-users] call compiled Julia image from multiple threads in C++

2016-10-06 Thread Yichao Yu
On Thu, Oct 6, 2016 at 11:02 AM, Igor Cerovsky wrote: > Hello, > > Calling compiled Julia 0.5 code from C++ (MSVS15) from multiple threads a > code that follows fails. > > Consider following example under WIN using Julia 0.5: > #include > #include > #include "julia.h"

Re: [julia-users] What is the goal of -> with @doc macro and Julia 0.5

2016-10-06 Thread Yichao Yu
On Thu, Oct 6, 2016 at 2:19 AM, Sébastien Celles wrote: > Hello, > > In this SO question > http://stackoverflow.com/questions/36191766/metaprogramming-within-docstring-with-eval/36209841#36209841 > > the following code > > for (f, name) in ((:add, "addition"), (:sub,

  1   2   3   4   5   6   7   8   9   10   >