[julia-users] Re: kill asynchronous tasks

2016-10-19 Thread ggggg
https://github.com/JuliaLang/julia/issues/6283

[julia-users] Re: Idea: Julia Standard Libraries and Distributions

2016-09-14 Thread ggggg
One could imagine a metapackage where using StandardLibrary imports all the goodies (as Gabriel put it), and that wouldn't be too painful. Would it be possible to have it the other way around though, where all the goodies are imported unless you do something else like exclude StandardLibrary

[julia-users] Re: [HELP] Doubts in Julia Language with Strings.. I've condensed my doubts into one Simple Program

2016-08-24 Thread ggggg
I haven't worked in C, but my impression is that it doesn't really distinguish between a UInt8 and a Character. In Julia, you can convert your string to a Vector{UInt8} and you should be able to work like you are used to. This gist has one way to implement your algorithm:

Re: [julia-users] How to Manipulate each character in of a string using a for loop in Julia ?

2016-08-17 Thread ggggg
Isn't it a red herring to say that strings lack setindex because they are immutable? I think strings don't have setindex! because it is considered to be a bad API choice, at least partially because you can't do O(1) indexing for many string encodings. I can easily define a setindex! method*

[julia-users] Re: Tasks and STDIN

2016-07-26 Thread ggggg
You can do wait(@async myTask()) to keep it from exiting before the task completes. But it still doesn't work for some reason.

[julia-users] Re: [ANN] Measurements.jl v0.1.1: Error propagation library

2016-06-26 Thread ggggg
Hello, This looks very nice. I will use it next time I have a need. I took a brief look at the code, and I have one question. Why did you choose to "tag" your Measurement types with a random Float64, instead of an incrementing integer? > >

[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] how to learn about function arguments

2016-06-13 Thread ggggg
Hello, I've been thinking about writing a Julia package thats similar to lmfit , which provides a nice api for developing and exploring fitting models. I'll show you one of the key parts of the api, you create a Model from a function, and the model

[julia-users] Async file IO?

2016-05-16 Thread ggggg
Hello All, I think that Julia IO is built on libuv, and that libuv offers asynchronous IO to the filesystem. Is this exposed through the Julia API? I can't figure it out from the documentation. I did a simple test *julia> **tic(); t = @async read(open("filename"),UInt8,25); yield();

[julia-users] Re: using subscripts \_1, \_2, ... as field names

2016-05-11 Thread ggggg
I'm no macro expert, but I think one could parse the variable names in a macro to enable Tim Wheeler's as @subind Σ₁₁ to get Σ[1,1]

Re: [julia-users] promotion and conversion

2016-05-03 Thread ggggg
I ran into the same confusion the first time I tried following that section. Maybe adding something like "In most cases, you must ``import Base: convert`` or explicitly extend ``Base.convert``." to that section of the docs would help. Probably similar language should be added to promote_rule

[julia-users] Re: Here is a new one...

2015-11-02 Thread ggggg
I see the same thing when using matplotlib (via Julia OR python) on OSX when using a GTK backend.

Re: [julia-users] Julia and Object-Oriented Programming

2015-10-22 Thread ggggg
What is the other option here? It seemed like with the OO/Julia way you are complaining about you at least have working (but slow) code handling your new polynomial type. In a case where your new type doesn't work with "obtainCoefficient", it won't work with any of your other code either. You

[julia-users] Re: ANN: NullableArrays.jl package

2015-10-17 Thread ggggg
How does NullableArray{T,N} compare to Array{Nullable{T},N}?

Re: [julia-users] Re: The Julia Community Standards

2015-10-13 Thread ggggg
Like Tomas I fully support both the standards and the attempts at enforcement, and also didn't feel like further derailing another thread to mention that. But I wanted to reinforce his point that the number of silent supports is larger than it appears.

Re: [julia-users] Help reading structured binary data files

2015-09-18 Thread ggggg
This slightly different from your topic, but related. Numpy has a very nice interface for reading structured data that I've liked using. I felt like I would learn something if I tried to do similar things in Julia. For example import numpy as np # generate file to read dt =

[julia-users] Help me understand counterintuitive result with type delcaration

2015-09-16 Thread ggggg
I was playing around with type declarations and came across an counterintuitive result. I'm not sure if this is the intended behavior or not, but it certainly surprised me. Consider the functions *function f(x)* *y::Int* *y=x*2.0* *end* *function g(x)* *y::Int*

Re: [julia-users] Re: Help me understand counterintuitive result with type delcaration

2015-09-16 Thread ggggg
ail.com > > wrote: > > The return value of the function is value of the last expression > evaluated. For assignment, the right-hand side is always returned. So in > `f` you get the value x*2.0 returned which is 2.0. > > On Wednesday, September 16, 2015 at 3:41:22 PM UTC-

[julia-users] questions about coroutines

2015-06-30 Thread ggggg
I'm trying to understand coroutines for single threaded concurrency. I'm surprised that produce()/consume() and RemoteRef have no mechanism for type information, and as I understand it, are type unstable. One should therefore avoid using these in inner loops I guess? Should we expect this to

[julia-users] Re: questions about coroutines

2015-06-30 Thread ggggg
, 2015 at 10:20:36 AM UTC-6, g wrote: I'm trying to understand coroutines for single threaded concurrency. I'm surprised that produce()/consume() and RemoteRef have no mechanism for type information, and as I understand it, are type unstable. One should therefore avoid using these in inner

[julia-users] Re: Implementing an iterator which conditionally skips elements.

2015-05-01 Thread ggggg
Maybe look at dict.jl? https://github.com/JuliaLang/julia/blob/master/base/dict.jl There is a definition like: next(t::Dict, i) = ((t.keys[i],t.vals[i]), skip_deleted(t,i+1)) function skip_deleted(h::Dict, i) L = length(h.slots) while i=L !isslotfilled(h,i) i += 1 end return i end On Friday,

[julia-users] functions with the same name in different modules when you don't want to extend

2015-04-10 Thread ggggg
Say there are two unrelated modules A and B that both use the function name `foo`. What is the most convenient way to use both modules? Do you have to import one of them, so as not to have `foo` conflict or is there an easier way? module A foo(x::Int)=1 export foo end module B

[julia-users] Re: updating an array

2015-04-06 Thread ggggg
I suspect you want ## generate next filter order if i==1 a[i] = g else a[i-1:-1:1] = a[i-1:-1:1]-g*a[i-1:-1:1] # this is my problem area* end a is first assigned as a Vector{Float64} of length p. Then you did a=g which assigns a as a Float64 (this

[julia-users] Re: updating an array

2015-04-06 Thread ggggg
UTC-4, g wrote: I suspect you want ## generate next filter order if i==1 a[i] = g else a[i-1:-1:1] = a[i-1:-1:1]-g*a[i-1:-1:1] # this is my problem area* end a is first assigned as a Vector{Float64} of length p. Then you did a=g which

[julia-users] Re: Help: Too many open files -- How do I figure out which files are open?

2015-03-12 Thread ggggg
The other suggestions are good practice. If you are on linux the following commands will help you figure out which file or files you have open, and therefore where in your code to look: pidof julia lsof -p # is from previous command On Thursday, March 12, 2015 at 6:46:10 AM UTC-6,

[julia-users] Re: Block Matrices: problem enforcing parametric type constraints

2015-03-12 Thread ggggg
BlockMatrix only needs one type parameter to fully specify the type, so you should probably only use one type parameter. Like so: *type BlockMatrix{S} : AbstractMatrix{S}* *A::AbstractMatrix{S}* *B::AbstractMatrix{S}* *C::AbstractMatrix{S}* *

Re: [julia-users] Functions in degrees

2015-03-02 Thread ggggg
It's not really relevant to Julia, but there are many who would argue that there should be a base unit for angles. My personal favorite consequence of this choice is that Torque and Energy appear to have the same units. For example: Issue 10: the SI needs a base unit of angle ‘Angle’ is as

Re: [julia-users] Re: workflow recommendation/tutorial

2015-01-21 Thread ggggg
I do basically the same thing Tim described, but I use julia -L mymoduletests.jl when I start julia. -L executes the file, then drops to the REPL in state after execution. The slowest part about the process is usually loading PyPlot. On Wednesday, January 21, 2015 at 5:29:04 AM UTC-7, Tim

[julia-users] Re: Julia cannot compute factorial(21) while Octave can

2015-01-14 Thread ggggg
Is there a way to provide a suggestion with the error? It currently says this, *julia **factorial(21)* *ERROR: OverflowError()* * in factorial_lookup at combinatorics.jl:27* * in factorial at combinatorics.jl:35* Maybe it would be more useful if it said *julia **factorial(21)* *ERROR:

[julia-users] Re: Are some matrices marked as special?

2014-12-12 Thread ggggg
If the Array is anything other than normal, it should have a non-standard type. So the answer for your two examples is no, as you can see by creating them and looking at the type, which is simply Array{Float64,2}. There are however some special Array like types, such as I, which acts as an

Re: [julia-users] Selecting all items in array larger than a given number

2014-12-05 Thread ggggg
*julia **testarray2=testarray[testarray.0.1]* *2-element Array{Float64,1}:* * 0.2* * 0.3* Note the . which is the broadcasting version of

[julia-users] Are there julia versions of dynamic time warping and peak finding in noisy data?

2014-12-03 Thread ggggg
Hello, I'm interested in using dynamic time warping and an algorithm for peak finding in noisy data (like scipy.signal.find_peaks_cwt). I'm just wondering if there are any Julia implementations around, otherwise I'll probably just use PyCall for now to use existing python code.

[julia-users] Re: Julians in Colorado?

2014-11-06 Thread ggggg
Here is a link to the talk and my slides if anybody is interested: http://datascienceassn.org/content/2014-11-05-spark-gotchas-and-anti-patterns-julia-language It's nothing you haven't seen before, since I relied pretty heavily on Steven G Johnson's talk and materials. On Thursday, November

[julia-users] Re: Julians in Colorado?

2014-10-27 Thread ggggg
I'll be there, since I'm the one talking. It's nice to know I'll have at least a friendly face in the audience. I have to admit I'm surprised that I was asked to speak, but there are enough other talks available to draw from that I think I can do a reasonable job.

[julia-users] Re: Loading data just once

2014-10-09 Thread ggggg
I think you may want to try https://github.com/simonster/Memoize.jl I think it is essentially the same solution you are proposing, but somebody else did all the work.

[julia-users] Re: help debugging too many files open

2014-10-07 Thread ggggg
I tracked it down under ubuntu with the following commands pdiof julia lsof -p #fromprevoiucommand which lists not only the number of files open, but also the path to the files. Very useful. I tracked this down and was a bit surprised. My code was essentially doing the following julia f() =

[julia-users] help debugging too many files open

2014-10-06 Thread ggggg
I'm getting an error claiming I have too many files open. I've already gone through my code and tried to ensure every open is matched by a close, and continue to get the error, suggesting that I missed an open. Is there a way I can check how many files are open, so I can see where in my code

[julia-users] Re: Array Performance

2014-09-10 Thread ggggg
I think you want julia -L julia_arraytest.jl if you want the REPL to start in the state resulting from running the script. On Wednesday, September 10, 2014 10:00:13 AM UTC-6, Jimmie Houchin wrote: Hello, I am working on an app which will be doing analysis on a lot of numerical data. Julia

Re: [julia-users] Re: Strange Slicing Behaviour

2014-09-03 Thread ggggg
Would it be possible and/or worthwhile to allow indexing with dropped singleton dimensions with a period modified. eg a[1,:,:] works as now, returns an Array with 3 dimensions a.[1,:,:] returns an Array with 2 dimensions It sort of fits into the use of . as a modifier to represent broadcasting.

[julia-users] Re: REPL v0.3, matlab-like completion

2014-08-19 Thread ggggg
I couldn't find it via googling, but there is a page that documents this. Although the documentation would benefit from descriptions of how to use these shortcuts in windowed terminals (eg shift page-up works in the OSX terminal).

[julia-users] function version of

2014-08-18 Thread ggggg
Is there a named function that does what does, eg (a,b) == ab? I actually want a multi argument version like $(a,b,c...). Also is that the name of that function is not and is not overloadable? The same is not true of |. *julia **a = zeros(Bool,10);b=[randbool() for j=1:10];* *julia

Re: [julia-users] bit wrangling advice

2014-08-13 Thread ggggg
is not a catastrophically large. Also consider keeping everything in memory; with 100GB of RAM you could store an awful lot of selections. --Tim On Tuesday, August 05, 2014 12:01:58 PM g wrote: Hello, I have an application where I have a few hundred million events, and I'd like to make

Re: [julia-users] bit wrangling advice

2014-08-13 Thread ggggg
Let me clarify. Vector{Bool} works fine with JLD, it doesn't work well with extendible HDF5Datasets, which is what I actually want to do. On Wednesday, August 13, 2014 6:04:46 PM UTC-6, g wrote: It turns out Vector{Bool} does not work well with JLD. So I played around with BitArray

Re: [julia-users] Fast method dispatch depending on constant parameter value

2014-07-31 Thread ggggg
No you're right they're essentially identical. I must have skimmed over the last one. Sorry for the confusion.

[julia-users] Re: How to get text from PyObject matplotlib.text.Text object

2014-07-31 Thread ggggg
*labels[1][:get_text]()* Try the above. PyPlot hangs on my computer without drawing anything in it's window, so the text I received was just an empty string, but the corresponding function in python seemed to work.

[julia-users] Re: keyboard shortcuts for REPL

2014-07-30 Thread ggggg
I hadn't seen that page, very cool. Page-up, Page-down, home and end all seem to be consumed by the OSX terminal program. Page-up in particular reproduces behavior that I really liked in ipython, according to the docs anyway. Is there any guidance on how to setup a windowed terminal to allow

Re: [julia-users] Fast method dispatch depending on constant parameter value

2014-07-30 Thread ggggg
If the number is available when the type is constructed, you can use it to construct a different type based upon it's value. Does this do what you want? abstract BaseA immutable AP : BaseA a end immutable AN : BaseA a end A(x,y) = y0 ? AP(x) : AN(x) f(a::AP, x::Number) = x+a.a f(a::AN,

Re: [julia-users] keyboard shortcuts for REPL

2014-07-30 Thread ggggg
Thanks, that works. On Wednesday, July 30, 2014 3:04:40 PM UTC-6, Jameson wrote: Shift-page up, Shift-page down I think are usually mapped to page up/down without being consumed by OS X terminal On Wednesday, July 30, 2014, g galen...@gmail.com javascript: wrote: I hadn't seen

Re: [julia-users] Counting instances from an array that fulfill some inequality statements

2014-07-30 Thread ggggg
*sum([a0 b=0 for (a,b) in zip(countlist,countlist[2:end])])* Try that. I think it does what you want. You may also be interested in the . and .= operators.

[julia-users] Re: Bypass automatic printing of elements in show(io::IO,x::AbstractArray)

2014-07-29 Thread ggggg
I'll quote another ongoing thread Yes; Base is *implicitly* imported, meaning that you can *use* any function in Base without having to *explicitly* import it. However, in order to *extend* the function with new methods, you do need to import it *explicitly* (using a statement like import

Re: [julia-users] packages that depend on unregistered packages (also: pkg REQUIRE allow urls)?

2014-07-29 Thread ggggg
I'd also like to be able to require a URL. At the very least it will make for easier testing. But I think it will also simplify maintaining and using non-public packages.

[julia-users] a function for calling functions inside module

2014-07-29 Thread ggggg
I'm trying to write a small module that allows one to define a Step that describes operations on an HDF5 file. immutable Step func::String a_ins::(String...) #attribute inputs d_ins::(String...) #dataset inputs a_outs::(String...) #attribute outputs d_outs::(String...)

Re: [julia-users] a function for calling functions inside module

2014-07-29 Thread ggggg
` is evaluating the code inside the scope of `Bar`, which is what's causing your problem. -- Leah On Tue, Jul 29, 2014 at 3:58 PM, g galen...@gmail.com javascript: wrote: I'm trying to write a small module that allows one to define a Step that describes operations on an HDF5 file. immutable

Re: [julia-users] Re: how to properly nest modules in a package

2014-07-23 Thread ggggg
It makes sense now, thanks.

[julia-users] how to properly nest modules in a package

2014-07-22 Thread ggggg
Lets say I'm making a package P.jl. Inside P I define modules A, B and C all in separate files. I'd like to use C inside of A and B, and export a function from C from P. So right now B looks like include(C.jl) module B using C B body end And A looks like include(C.jl) module A using C A body

Re: [julia-users] Re: how to properly nest modules in a package

2014-07-22 Thread ggggg
Ok I see how that works, I wasn't aware of the ..C syntax. That solves the problem asked about, but I'm left with another question. Take for example module A module B foo()=4 export foo end foo() end That doesn't work, I get ERROR: foo not defined because foo is not actually in the A

[julia-users] Re: solving cubic equation numerically

2014-07-04 Thread ggggg
*Pkg.add(Polynomial)* https://github.com/vtjnash/Polynomial.jl has some documentation.

Re: [julia-users] question: why no inarg specification in Julia

2014-06-12 Thread ggggg
For the best performance users are advised to write functions such that the return type is stable. And the compiler reasons out the return type, so would it be possible to have a function like isstable(f::Function) that checks whether a method is actually type stable? Or

Re: [julia-users] do block semantics

2014-04-28 Thread ggggg
One difficulty I had with `do` is that its really hard to find in the docs if you don't have any idea what it is. Try googling it or searching for it in the docs, do is just really a common word so there is a lot of interference. Then it sort of looks like an if or while statement, so I tried