Re: [julia-users] How to enter a file using gallium?

2016-11-22 Thread chobbes158
That's a good stopgap, if there's better options. Thanks!! On Monday, November 21, 2016 at 8:19:50 PM UTC, Isaiah wrote: > > If breakpoints aren't working, I would suggest to your push object(s) of > interest into a global Vector{Any} and then debug with `@enter`. > > On Mon, Nov 21, 2016 at

Re: [julia-users] How to enter a file using gallium?

2016-11-21 Thread chobbes158
Well, if A is a complicated object/structure, it'll be almost impossible to first make up an A and call @enter function_to_debug(A). On Monday, November 21, 2016 at 2:32:16 PM UTC, Isaiah wrote: > > Any other means without resorting to breakpoints?? > > > Use `@enter function_to_debug( ... )`

Re: [julia-users] How to enter a file using gallium?

2016-11-21 Thread chobbes158
Bump up for the following question: Suppose I have the following code where the variable A is defined multiple times and after each definition it is used by the same function function_to_debug. How can I step in function_to_debug with the first definition/instantiation of A? A = ...

Re: [julia-users] How to enter a file using gallium?

2016-11-19 Thread chobbes158
Thanks for the comments on my second question. I missed the acute prepended before 'stuff'. On Saturday, November 19, 2016 at 3:14:13 PM UTC, Michele Zaffalon wrote: > > I don't know the answer to the first question. > > For the second, you should check >

Re: [julia-users] How to enter a file using gallium?

2016-11-19 Thread chobbes158
Thanks! It now works for me. Two more quick questions: 1. Suppose I have the following code where the variable A is defined multiple times and after each definition it is used by the same function function_to_debug. How can I step in function_to_debug with the first definition/instantiation of

Re: [julia-users] How to enter a file using gallium?

2016-11-19 Thread chobbes158
Thanks for the comments. I tried what you suggested by adding @enter at the beginning of a line where a function is called. But an error was thrown. julia> include("/home/calvin/Documents/git/codes/fc.jl/examples/test.jl") ERROR: LoadError: AssertionError: isa(arg,Expr) && arg.head == :call in

[julia-users] How to enter a file using gallium?

2016-11-18 Thread chobbes158
Hi there, I'm totally new to the new debuggers. What I'm aiming at is to go through a file (it's a file calling other packages and functions therein.) line by line, just like in matlab. The first step is to step in the file using gallium. I know how to traverse a function in terminal using

Re: [julia-users] A foolproof question about ylim

2016-07-22 Thread chobbes158
Terrific! As a stranger to python, I've never thought that get and set methods are using the same keyword. Thanks! On Friday, July 22, 2016 at 12:09:17 AM UTC+1, Yichao Yu wrote: > > On Thu, Jul 21, 2016 at 7:03 PM, > wrote: > > > > > > How can I get ylim when using

[julia-users] A foolproof question about ylim

2016-07-21 Thread chobbes158
How can I get ylim when using PyPlot? I tried all the suggestions I found on stackoverflow. None of them works, e.g. get_ylim(). Here is the error: ERROR: LoadError: UndefVarError: get_ylim not defined Can anyone give me an example of getting the current ylim? Thanks!!

Re: [julia-users] How to profile a module?

2016-07-07 Thread chobbes158
Thanks for reminding `copy(Profile.fetch())`. I totally forgot it. Thanks! On Thursday, July 7, 2016 at 4:28:02 PM UTC+1, Isaiah wrote: > > > http://docs.julialang.org/en/latest/manual/profile/#accumulation-and-clearing > > If you want to save results from a single session, use `savedprof = >

Re: [julia-users] How to profile a module?

2016-07-07 Thread chobbes158
Thanks. Can I do profiling on B.g() and A.f() simultaneously? For example, import A, B @profile p = B.g() @profile A.f(p) Then when I do `Profile.print()`, which `Profile` is it? The profile data for B.g() or A.f(p)? Is there a way to store the data separately into two different Profile

Re: [julia-users] How to profile a module?

2016-07-07 Thread chobbes158
Do you mean that in the test file I do something like this? import A, B p = B.g() @profile A.f(p) On Thursday, July 7, 2016 at 1:22:24 PM UTC+1, Isaiah wrote: > > Profile the calls to B.g and A.f separately. > > On Thursday, July 7, 2016, wrote: > >> Bump up. >> >

Re: [julia-users] Re: How to profile a module?

2016-07-07 Thread chobbes158
Bump up.

Re: [julia-users] Re: How to profile a module?

2016-07-07 Thread chobbes158
Bump up. On Tuesday, July 5, 2016 at 6:46:58 PM UTC+1, chobb...@gmail.com wrote: > > Thanks, Tim. The reason I can't run specific lines from the test file is > that the test needs to call module B first to get something which will be > passed as argument to a function in module A and it is this

Re: [julia-users] Re: How to profile a module?

2016-07-05 Thread chobbes158
Thanks, Tim. The reason I can't run specific lines from the test file is that the test needs to call module B first to get something which will be passed as argument to a function in module A and it is this function that I'm testing. Here is what it looks like: Module A: module A import B

Re: [julia-users] Re: How to profile a module?

2016-07-05 Thread chobbes158
Tim, Thanks. The problem is this: I wrote a module A and made a test to test module A. But both of module A and the test itself need to call another module B frequently. I want to see how A is calling B and don't care how the test is calling B. That's why I want to separate the profiling of

[julia-users] Re: How to profile a module?

2016-07-05 Thread chobbes158
Bump up. On Monday, July 4, 2016 at 4:33:53 PM UTC+1, chobb...@gmail.com wrote: > > I want to profile a module which is tested by a test. Following the > documentation ( > http://docs.julialang.org/en/release-0.4/manual/profile/#options-for-controlling-the-display-of-profile-results), > > I

[julia-users] How to profile a module?

2016-07-04 Thread chobbes158
I want to profile a module which is tested by a test. Following the documentation (http://docs.julialang.org/en/release-0.4/manual/profile/#options-for-controlling-the-display-of-profile-results), I know how to profile them (module + test) together: @profile include("test.jl") But I have no

Re: [julia-users] Re: a compilation question

2016-07-04 Thread chobbes158
Cedric, Thanks for the tips!! Also thanks for reminding the use of `import` versus `using`. I think that's why reload doesn't work for me, as I stuck to `using`. Calvin On Sunday, July 3, 2016 at 10:21:42 PM UTC+1, Cedric St-Jean wrote: > > It doesn't work all the time for me either, but in

[julia-users] Re: a compilation question

2016-07-03 Thread chobbes158
I just found that `reload()` sometimes doesn't work at all. I `reloaded` a module that I modified. But I still see the same results as before the package was modified. Btw, this module is a local module, not a package installed via `Pkg.add()`. What might be a possible cause? Another question:

[julia-users] Re: a compilation question

2016-07-03 Thread chobbes158
Yaakov, Thanks a lot for suggesting `Pkg.test`. It's truly one of the most efficient ways to reload what is necessary smartly. Thanks! On Sunday, July 3, 2016 at 11:02:28 AM UTC+1, Yaakov Borstein wrote: > > I have found that writing your code using a test first pattern ends up > being the

[julia-users] Re: a compilation question

2016-07-02 Thread chobbes158
Thanks very much for the reply! `reload` is absolutely what I'm screaming for. BTW, isn't `Autoreload` only useful for Ijulia users? On Saturday, July 2, 2016 at 3:18:04 AM UTC+1, Cedric St-Jean wrote: > > I don't have a great solution to this, but this is what I do... > > 1. I think that

[julia-users] Re: a compilation question

2016-07-01 Thread chobbes158
Bump up..

[julia-users] a compilation question

2016-06-30 Thread chobbes158
This is an entry-level question. So bear me please. I am writing a package which uses three other packages, say A, B, C. Each time I made any change in A or B or C, I had to workspace() and re-ran. This is usually very time consuming. 1. Is there anyway to only clear the compilation of the

[julia-users] Re: Fast vector element-wise multiplication

2016-06-20 Thread chobbes158
Thanks for the confirmation! Yes, I need more tests to see what the best practice is for my particular problem. On Monday, June 20, 2016 at 3:05:31 PM UTC+1, Chris Rackauckas wrote: > > Most likely. I would also time it with and without @simd at your problem > size. For some reason I've had

[julia-users] Re: Fast vector element-wise multiplication

2016-06-20 Thread chobbes158
Thanks! I'm still using v0.4.5. In this case, is the code I highlighted above still the best choice for doing the job? On Monday, June 20, 2016 at 1:57:25 PM UTC+1, Chris Rackauckas wrote: > > I think that for medium size (but not large) arrays in v0.5 you may want > to use @threads from the

[julia-users] Re: Fast vector element-wise multiplication

2016-06-20 Thread chobbes158
I have the same question regarding how to calculate the entry-wise vector product and find this thread. As a novice, I wonder if the following code snippet is still the standard for entry-wise vector multiplication that one should stick to in practice? Thanks! @fastmath @inbounds @simd for

[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] upgrade/downgrade between Array{Float64,1} and Array{Float64,2}

2016-05-15 Thread chobbes158
Thanks for the explanation!! That's exactly what I need at the moment, though I clearly know that unpredictable return type could be dangerous. Many thanks. On Sunday, May 15, 2016 at 9:07:12 PM UTC+1, Kristoffer Carlsson wrote: > > It is possible but seems like something undesirable because

Re: [julia-users] upgrade/downgrade between Array{Float64,1} and Array{Float64,2}

2016-05-15 Thread chobbes158
Thanks for the pointer for reshape. Sorry that I failed to make my question clear enough. In fact, I wonder if there is a function which can _automatically_ recast a single-column Array{T,2} to an Array{T,1} and do nothing if this Array{T,2} has multiple rows. On Sunday, May 15, 2016 at

[julia-users] upgrade/downgrade between Array{Float64,1} and Array{Float64,2}

2016-05-15 Thread chobbes158
Here is rookie question, which I have tried to find a similar question and answer in the history of this group, but failed. Please bear me. Since Julia distinguishes between Array{Float64,1} and Array{Float64,2}, even there is only one column in an Array{Float64,2}. Therefore, the type of

[julia-users] Re: How to use Debug.jl in Atom?

2016-05-11 Thread chobbes158
I'm a newbie as well. But as far as I know Debug.jl is already a yesterday's tool. You need to switch to Gallium and ASTInterpreter one day anyway. See the discussion in the following thread: https://groups.google.com/forum/#!topic/julia-users/NEQmWBKZPbE On Wednesday, May 11, 2016 at 9:27:31

Re: [julia-users] How to display the value of a variable in the title of a plot?

2016-05-09 Thread chobbes158
Steven - Sorry. I just saw your last reply. Thanks for the hints. `close("all")` works absolutely superbly. But Qt backend is far beyond my universe. Thanks again! On Friday, May 6, 2016 at 6:17:12 PM UTC+1, Steven G. Johnson wrote: > > > > On Friday, May 6, 2016 at 12:55:45 PM UTC-4,

Re: [julia-users] How to display the value of a variable in the title of a plot?

2016-05-06 Thread chobbes158
Tom and Steven, Thanks the hints!! Still, how could I show all current figures by command? That is something like 'shg' in Matlab. Also, is there a command to close all current figures, i.e. a counterpart of 'clf' in Matlab? Thanks! On Friday, May 6, 2016 at 4:50:12 PM UTC+1, Steven G.

[julia-users] How to display the value of a variable in the title of a plot?

2016-05-06 Thread chobbes158
I tried my best to search answers to my following quick questions in this group and PyPlot's site, though I trust that my questions are just very basic ones: 1. How to display the value of a variable in the title of a plot? In matlab, I do the following to show the value of pi in the title:

[julia-users] @edit could not determine location of method definition

2016-04-27 Thread chobbes158
Most of time, when I call @which, I'm usually returned with a dispatch/method and its location information, like this: @which Domain(-1.1,5.2) call{T<:Number}(::Type{BasicDecomposition.Domain{T}}, a::T<:Number, b::T<: Number) at /home/calvin/Documents/git/DomainDecomposition.jl/src/wedge.jl:61

[julia-users] How to print out the expression of a simple function

2016-04-26 Thread chobbes158
I wonder how to print the expression of a function, e.g. x.^2 for the following example. julia> f(x) = x.^2 f (generic function with 1 method) julia> f f (generic function with 1 method) If it is not possible for the expression of a function as simple as the above to be printed, is there a

Re: [julia-users] Re: Arrow Keys when debugging

2016-04-26 Thread chobbes158
I'm thrilled. It worked! Thanks for the hint! On Tuesday, April 26, 2016 at 2:46:42 PM UTC+1, Scott T wrote: > > Try setting > > ENV["EDITOR"] = "atom" > > in .juliarc. This works for me on a linux system but you may need a > different command name to launch atom on mac or windows. > > > On

Re: [julia-users] Re: Arrow Keys when debugging

2016-04-26 Thread chobbes158
I know @which, but not @edit. Thanks! Btw, I have a hard time setting the default editor for Julia, following the suggestion in the following thread. https://groups.google.com/forum/#!searchin/julia-users/default$20editor/julia-users/00OlSKal6uY/7XjDuNnPMUAJ Could you let me know the exact

Re: [julia-users] Re: Arrow Keys when debugging

2016-04-25 Thread chobbes158
Many thanks! On Monday, April 25, 2016 at 10:39:08 PM UTC+1, Stefan Karpinski wrote: > > Yes, to all of the above. > > On Mon, Apr 25, 2016 at 5:34 PM, wrote: > >> Thanks a lot for the info. >> >> 1. I've been using Matlab debugger and gdb for fortran for many years. >>

Re: [julia-users] Re: Arrow Keys when debugging

2016-04-25 Thread chobbes158
Thanks a lot for the info. 1. I've been using Matlab debugger and gdb for fortran for many years. Will Gallium and AST Interpreter for Julia v5.0 give a comparable user experience? For example, I'm used to use debugger to step a code from line 1 through the end. Will Gallium and ASTI allow me

[julia-users] Re: Do I have to workspace() when a new breakpoint is introduced?

2016-04-25 Thread chobbes158
Yes, this is all about Debug.jl and has nothing to do with Gallium. On Monday, April 25, 2016 at 4:03:37 PM UTC+1, Steven G. Johnson wrote: > > > > On Monday, April 25, 2016 at 7:23:06 AM UTC-4, Hans-Peter wrote: >> >> I think it's a bit too early for general debugger consumption (especially

[julia-users] Re: Arrow Keys when debugging

2016-04-25 Thread chobbes158
Thanks for the reference. I quickly scanned the Readmes of Gallium and ASTInterpreter and found that they're probably too brief to start with. Is there a more complete documentation or tutorial? What is the relation between Gallium and AST Interpreter? BTW, do I have to wait until the release

[julia-users] Re: Do I have to workspace() when a new breakpoint is introduced?

2016-04-25 Thread chobbes158
Thanks for the tips. It actually doesn't work, at least not on my machine. I try to reload the module in which new breakpoints are added and they're, again, ignored. Reloading the debugger doesn't help too. Thanks anyway. On Monday, April 25, 2016 at 12:23:06 PM UTC+1, Hans-Peter wrote: >

[julia-users] Re: Arrow Keys when debugging

2016-04-25 Thread chobbes158
Thanks. I'm using the Julia Debugger https://github.com/toivoh/Debug.jl in a bash terminal. Are there any other debuggers? I thought this is the only one and the de facto official Julia debugger. Thanks. On Monday, April 25, 2016 at 2:52:17 PM UTC+1, Steven G. Johnson wrote: > > What

[julia-users] Do I have to workspace() when a new breakpoint is introduced?

2016-04-25 Thread chobbes158
It seems to me that I have to clear everything in the workspace by workspace() if I want to introduce new breakpoints or remove existing breakpoints when debugging. Otherwise, the debugger simply ignore all my changes for debugging. But it takes huge amount of time when a lot of packages

[julia-users] Arrow Keys when debugging

2016-04-25 Thread chobbes158
I'm new to Julia. So bear me if the question is naive. I'm wont to use up and down arrow keys to echo my previous commands and left and right keys to move in and out of a pair of parentheses I intentionally close first for adding contains. I found I can't do these when using Julia Debugger.