Re: [julia-users] Why is julia interpreting what's inside a string?

2015-09-06 Thread Leah Hanson
Julia has some special characters it recognizes inside string. For example, `$` lets you interpolate Julia variables or expressions inside a string. To get a string that represents what you've literally typed in, you need to add a backslash before the backslash and dollar sign characters. The backs

Re: [julia-users] what are "hard" and "soft" bindings?

2015-07-07 Thread Leah Hanson
I think his summary in #11031 is accurate, and the reason given directly in the reply is the reason for using/importall to be different. Issue #8000 is a discussion of ways to change/simplify the syntax. I'll take a stab at rephrasing the different in case that helps. There is only one difference,

Re: [julia-users] Re: Call function from a string with its name

2015-07-03 Thread Leah Hanson
You want to pass the symbol into the macro or convert before the quote block: ~~~julia macro create_function(name::String) n = symbol(name) return quote (x) -> ($n)(x) + 7 end end ~~~ Or you can just add some parens: ~~~julia macro create_function(name::String) return quo

Re: [julia-users] Broken links on Julia frontpage

2015-06-27 Thread Leah Hanson
Hey, Thanks for noticing this problem. Do you think you could make a pull request with those changes? The github repo is here: https://github.com/JuliaLang/julialang.github.com I think you'll just need to edit index.md: https://github.com/JuliaLang/julialang.github.com/blob/master/index.md -- L

[julia-users] YOW! Julia Talk

2015-03-23 Thread Leah Hanson
ist, so I don't know how useful this talk would be here. Link: https://yow.eventer.com/yow-2014-1222/how-julia-goes-faster-by-leah-hanson-1694 If you notice any inaccuracies in the talk, please let me know. (Or if there's something not covered in the talk that's important to Julia's performance.) Best, Leah

Re: [julia-users] Does TypeCheck specify which methods failed ?

2015-01-14 Thread Leah Hanson
Hi, Yes, the method signatures should print out between the call the checkreturntypes and the "The total number..." line. Currently, it often prints out a lot of unnecessary new lines, so you may need to scroll up. If you don't see that output at all, please file an issue on the TypeCheck.jl gith

[julia-users] Example of a Package Install Breaking

2014-12-27 Thread Leah Hanson
I'm working on a book chapter about using the Julia package manager. One example I want to include is debugging a broken package install. I'm currently expecting to focus on a problem caused by binary installs, since that seems to be the mostly likely cause of a Pkg.add failing. However, it's hard

Re: [julia-users] Re: do I misunderstand zip, or is it not referentially transparent?

2014-12-25 Thread Leah Hanson
Ronald, could you open up a fresh Julia REPL and try your code example there? I'm not sure how it would happen with this example, but sometimes when people find unreproducible problems it's caused by a previous definition in their REPL. -- Leah On Wed, Dec 24, 2014 at 4:24 PM Steven G. Johnson wr

Re: [julia-users] Re: home page content

2014-12-09 Thread Leah Hanson
Seeing code examples of a type and a couple of functions that use it would probably give a good idea of what the code looks like. The JuMP seems exciting enough to highlight both as a package and a use of macros. I don't know if you want to encourage different styles, but seeing examples of Python

Re: [julia-users] Re: parametrized type weirdness? or Julia bug?

2014-10-07 Thread Leah Hanson
You need to fully specify TDict when using it's constructor: ~~~ julia> module testnestparam2 immutable Token{S,T} m::S t::T end typealias TDict{K,D} Token{Dict{K,D}, Int} function makeADict() a = TDict{Int64,String}([1=>"a",2=>"c"],

Re: [julia-users] Re: a good IDE for Julia ? (Julia Studio does not work with Julia v 0.3.0)

2014-09-30 Thread Leah Hanson
Maybe you could start a new julia-users thread, and post the code and the error message so we can help? It's hard to make specific recommendations without seeing the code/error. -- Leah On Tue, Sep 30, 2014 at 9:27 AM, Ján Dolinský wrote: > Hello guys, > > Indeed, www.junolab.org makes me want

Re: [julia-users] Legend for layers with specified colors in Gadfly

2014-09-28 Thread Leah Hanson
It don't know if you'll like it better, but here's another way to get the same effect using Gadfly. The `Scale.discrete_color_manual` controls the colors used by the scale. ~~~ using Gadfly, DataFrames # populate the data in the format from your example x1 = [1:10]; y1=[12:21] x2 = [1:10]; y2 = [

Re: [julia-users] Re: Pretty Printing of Results

2014-09-24 Thread Leah Hanson
Hey Don, Have you considered putting your CoefTable function in a Julia package somewhere? I'm not sure whether there's an existing one that would be appropriate, but this looks like a useful bit of code that could go in a library. -- Leah On Wed, Sep 24, 2014 at 7:49 PM, Donald Lacombe wrote:

Re: [julia-users] Strange vector operation

2014-09-24 Thread Leah Hanson
No comment on the rest, but the element-wise division operator is `./`, which does work: ~~~ julia> x1 = [1.0, 1, 1]; julia> 1.0 ./ x1 3-element Array{Float64,1}: 1.0 1.0 1.0 ~~~ -- Leah On Wed, Sep 24, 2014 at 5:17 PM, Hans W Borchers wrote: > I have been updated to version 0.4 though I s

Re: [julia-users] Re: windows 7: cut&paste, window width&position, etc

2014-09-23 Thread Leah Hanson
The display of Julia REPL colors is controlled by the settings of the terminal; Julia says "this text is blue" and the terminal/command prompt decides what that means. I know you can change the terminal color preferences on Linux; I don't know how to do that on Windows. -- Leah On Tue, Sep 23, 20

Re: [julia-users] Re: a good IDE for Julia ? (Julia Studio does not work with Julia v 0.3.0)

2014-09-19 Thread Leah Hanson
When I've wanted a Julia IDE, I've used LightTable with the Julia plugin. I liked it when I used it, and there's been active development since then. LightTable: http://www.lighttable.com/ Julia plugin: https://github.com/one-more-minute/Juno-LT On Fri, Sep 19, 2014 at 6:25 AM, Ján Dolinský wrot

Re: [julia-users] Example of how to write line by line to a CSV file in Julia?

2014-09-16 Thread Leah Hanson
Is this what you're looking for? ~~~ julia> csvfile = open("ysavetuple.csv","w") IOStream() julia> write(csvfile,"ColName A, ColName B, ColName C\n") 32 julia> foo(i) = tuple(rand(Int,3)...) foo (generic function with 1 method) julia> for i = 1:20 y1,y2,y3 = foo(i) ysavetuple

Re: [julia-users] Re: Module Includes Problem

2014-09-16 Thread Leah Hanson
Great! I'm glad it works. :) As Ivar said, you should keep in mind the difference between `require` and `include`. Defaulting to using `include` inside module definitions should avoid this kind of problem in the future. On Mon, Sep 15, 2014 at 3:35 PM, Ivar Nesje wrote: > If dirlist.jl declares

Re: [julia-users] Re: Module Includes Problem

2014-09-16 Thread Leah Hanson
1) Have you tried changing the `require("dirlist.jl")` inside module Aerodyne to `include("dirlist.jl")`? If so, what happened? 2) If that didn't work, does dirlist.jl define any modules? -- Leah On Tue, Sep 16, 2014 at 4:46 AM, RecentConvert wrote: > My .juliarc.jl file has three sections: th

Re: [julia-users] Does Julia have something similar to Python's documentation string?

2014-09-15 Thread Leah Hanson
The @doc macro lets you do things that the doc_str can't: 1) Attach to the following method/function/etc. The string just sits there; the macro can do the work to put the string into the documentation. (the doc_str wouldn't be able to see the context around the string it's parsing) 2) Add a metada

Re: [julia-users] Copy a BigFloat?

2014-09-13 Thread Leah Hanson
Do you mean independent for the purposes of editing, or just specifically for the equality operators? copy and deepcopy both work for editing purposes: ~~~ julia> a=with_bigfloat_precision(()->BigFloat("0.1"),64) 1.0001e-01 with 64 bits of precision julia> z=copy(a) 1.

Re: [julia-users] Re: Benchmark julia is 10x slower than fortran. Should I be happy?

2014-09-13 Thread Leah Hanson
Lint.jl is also good for checking that, depending on how much time you want to spend learning to read the output of code_typed. On Sat, Sep 13, 2014 at 3:27 PM, Elliot Saba wrote: > A good way to track down performance issues like this is to use > @code_typed to output the typed code in your fun

Re: [julia-users] Re: dispatch based on expression head

2014-09-13 Thread Leah Hanson
I would expect the Expr type to be abstract, with different concrete subtypes for each current value of head. Each value of head indicates a specific structure in args, and this can just be reflected in the definition of the subtypes. (Then you can dispatch on Expr type, use "subtypes(Expr)" to see

Re: [julia-users] Re: Image acquisition

2014-09-12 Thread Leah Hanson
I just wanted to say that I copied the code from Simon's gist, and once I had all the packages installed, it was really exciting to see video from the webcam via Julia. :) -- Leah On Fri, Sep 12, 2014 at 12:19 PM, Simon Danisch wrote: > GStreamer has some shaders for the conversion: > > http://

Re: [julia-users] how to push!(::DataFrame,::DataFrameRow) or append!(::DataFrame,::DataFrameRow) ?

2014-09-12 Thread Leah Hanson
quot;hi"| 0.703943 | | 4 | "there" | 0.269876 | ~~~ Does this work for you? -- Leah On Fri, Sep 12, 2014 at 8:54 AM, Florian Oswald wrote: > yeah I wasn't very clear in that example. i really need to append one row > at a time. > > On 12 September 2014 14:

Re: [julia-users] how to push!(::DataFrame,::DataFrameRow) or append!(::DataFrame,::DataFrameRow) ?

2014-09-12 Thread Leah Hanson
Have you tried append!(df2,df)? ~~~ julia> using DataFrames julia> df = DataFrame(a=["hi","there"],x = rand(2)) 2x2 DataFrame |---|-|--| | Row # | a | x| | 1 | "hi"| 0.862957 | | 2 | "there" | 0.101378 | julia> df2 = DataFrame(a=["oh","yeah"],x

Re: [julia-users] Help needed with creating Julia package

2014-09-11 Thread Leah Hanson
Does your Nemo.jl contain ~~~ module Nemo end ~~~ ? On Thu, Sep 11, 2014 at 5:56 PM, Bill Hart wrote: > OK, I can build Nemo. But how do I load modules from Nemo now that it is > installed and built. > > For example "using Nemo", "using Rings", "using Fields" all fail, > complaining that it c

Re: [julia-users] Does Julia have something similar to Python's documentation string?

2014-09-11 Thread Leah Hanson
Oh, I missed that. That's totally the approach I would take, and I don't really see it as a problem to use a separate channel to document the documentation functions/macros. It seems like a messiness related more to bootstrapping (documenting using the system you're writing) rather than a design pr

Re: [julia-users] Does Julia have something similar to Python's documentation string?

2014-09-11 Thread Leah Hanson
Could you manually add the `@doc` documentation to the _METDATA_ object? The macro edits a variable, which you should be able to do outside the macro as well, right? -- Leah On Thu, Sep 11, 2014 at 4:28 PM, Michael Hatherly wrote: > I am committed to continuing work on this, though other work c

Re: [julia-users] Re: What wrong , help ;0

2014-09-11 Thread Leah Hanson
do you have a variable named p2? On Thu, Sep 11, 2014 at 3:12 PM, Paul Analyst wrote: > julia> efy > 4x1 Array{Int64,2}: > 1 > 7 > 8 > 10 > > W dniu 2014-09-11 o 20:27, Jake Bolewski pisze: > > what is efy? Your example is not reproducible. > > On Thursday, September 11, 2014 2:22:31 PM

Re: [julia-users] Does Julia have something similar to Python's documentation string?

2014-09-11 Thread Leah Hanson
If I understand correctly, Docile.jl is a macro-based implementation of SGJ's suggestion, right? So if we're in agreement about non-comment-based documentation, we could start using that now, and later switch from "@doc" to the keyword "doc" when it's implemented. Are any packages documented with

Re: [julia-users] Help needed with creating Julia package

2014-09-10 Thread Leah Hanson
1) You can try looking at other packages to see the structure. Code goes is `src/` (and you'll need a `Nemo.jl` in there that will be what Julia runs when you say `using Nemo`). Tests go in the `tests` folder; you should have a file `runtests.jl` in there that runs the tests for your package (if y

Re: [julia-users] Passing an expression to a macro

2014-09-09 Thread Leah Hanson
So, currently, your @my macro is evaluating the arguments in the macro context (vs. returning them to be evaluated in the calling context. ~~~ julia> macro my2(exp) quote for i in $exp.args println("the arg is ", i)

Re: [julia-users] Re: Adding Julia package to METADATA.jl

2014-09-05 Thread Leah Hanson
If you run `Pkg.register("YourPkgName")` at the Julia REPL, it will generate that folder for you (complete with the commit hashes). Does that work for you? On Fri, Sep 5, 2014 at 9:06 AM, Samuel S. Watson wrote: > OK, that's a fair point. What I should have said is that my interpretation > of

[julia-users] Reading sideways CSV file into a DataFrame

2014-09-03 Thread Leah Hanson
So, assuming you have a CSV file that looks like this: ~~~ Column One,2,3,4 Column Two,2,5,7 Column Three,1,9,8 ~~~ But each line has a lot more numbers in it. I would like to read it into a DataFrame, where the DataFrame would understand it as: ~~~ Column One, Column Two, Column Three 2,2,1 3,5

Re: [julia-users] trouble after updating Julia

2014-09-03 Thread Leah Hanson
Hey Andrea, You didn't do anything wrong. I think there's a bug in the Makefile that makes things sometimes break, which is unfortunate. -- Leah On Wed, Sep 3, 2014 at 10:06 AM, Andrea Vigliotti < andrea.viglio...@gmail.com> wrote: > Hi all, > > I could compile Julia correctly again after > >

Re: [julia-users] List of useful macros for beginners?

2014-08-31 Thread Leah Hanson
@show and @which are two other common ones. There are examples of how to use them in this blog post: http://www.juliabloggers.com/julia-helps/ (<- I wrote this blog post.) Are you looking for examples of macros you would want to use or examples of macros to help you write your own macros? -- Leah

Re: [julia-users] Julia for general scripting and automation?

2014-08-29 Thread Leah Hanson
I really like Julia's API for starting/controlling subprocesses better than the ones I've used in Python. (This is purely personal opinion, and is like skewed by having a better understanding of what I was doing when I used Julia.) Both of them can do the same things, so it's mostly a matter of whi

Re: [julia-users] Does Julia have something similar to Python's documentation string?

2014-08-28 Thread Leah Hanson
ml.inria.fr/pub/docs/manual-ocaml-400/manual029.html > > -- John > > > On Aug 27, 2014, at 3:06 PM, Leah Hanson wrote: > > I like OCaml's approach, which uses comments above functions/etc, and has > a neat plugin system to output them in various formats. > > O

Re: [julia-users] Does Julia have something similar to Python's documentation string?

2014-08-27 Thread Leah Hanson
I like OCaml's approach, which uses comments above functions/etc, and has a neat plugin system to output them in various formats. On Wednesday, August 27, 2014, John Myles White wrote: > Ok, thanks for clarifying. I also like the idea of strategically placed > comments as automatic documentation

Re: [julia-users] Re: How to require the current master of pacakge

2014-08-19 Thread Leah Hanson
That should work. :) -- Leah On Tue, Aug 19, 2014 at 12:28 PM, Spencer Lyon wrote: > That's what I thought. I'm happy to do that > > To do this I just need to do > > `Pkg.tag("PDMats")` > > Then push that commit to my fork of METADATA and submit a PR, right? > > > On Tuesday, August 19, 2014 1

Re: [julia-users] Multiple dispatch issue: cat() and a custom abstract array

2014-08-04 Thread Leah Hanson
Have you tried `import Base.cat` or naming your methods `function Base.cat(...`? The first example on this page of the manual, specifically the `Base.show` part, is relevant: http://docs.julialang.org/en/release-0.2/manual/modules/?highlight=import -- Leah On Mon, Aug 4, 2014 at 3:10 PM, Michae

Re: [julia-users] Re: Gadfly histogram woes

2014-08-03 Thread Leah Hanson
What version of Gadfly are you using? (You can find out using `Pkg.status`.) You could try running `Pkg.update` to see if you can get a newer version. If this isn't fixed by getting a newer version, then this is clearly a bug and you should file an issue on Github here: https://github.com/dcjones/

Re: [julia-users] Best way to eliminate parameters from a parametric type

2014-08-02 Thread Leah Hanson
T{P1,P2,P3} is a family of types; each member specifies all three type parameters. There are no "super type" relationships within the family of T types; they are just all members of the same family (think "set") of types. Could you explain what you're trying to achieve? I don't think that making a

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

2014-07-30 Thread Leah Hanson
Your problem is with the first index (`i == 1`). You can't check if the previous element is < 0. You could adjust your range (the `1:length(outputarray)`) to only run through elements for which your if-condition makes sense. -- Leah On Wed, Jul 30, 2014 at 5:12 PM, wrote: > I'm a bit stuck on

Re: [julia-users] [newb] confused about constructors

2014-07-30 Thread Leah Hanson
I think this is what you want: ~~~ type FIR{in_t, coef_t} in::Vector{in_t} coef::Vector{coef_t} FIR(in::Vector{in_t}, coef::Vector{coef_t}) = new(zeros(in_t, size (in)), coef) end ~~~ In your defition of the inner constructor, you end with `x.coef = coef_`,

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

2014-07-29 Thread Leah Hanson
In general, you should avoid using `eval`. Is there a reason you don't want to pass in a function and make it `func::Function` in your type? Your `eval` inside module `Bar` is evaluating the code inside the scope of `Bar`, which is what's causing your problem. -- Leah On Tue, Jul 29, 2014 at 3:

Re: [julia-users] Re: [Gadfly] How do I put layers inside a facet/subplot?

2014-07-28 Thread Leah Hanson
efinitely should be an option to relabel those. I'll make a note to > do that. > > > On Friday, July 25, 2014 9:19:14 PM UTC-7, Leah Hanson wrote: > >> Thank you! That makes sense. I can add a new column to group by to put >> sets of points on the right lines. &

Re: [julia-users] Creation of custom iterators.

2014-07-27 Thread Leah Hanson
You need to either `import Base.start` or implement a function named `Base.start` instead of `start`. That change will make your `start` function extend the one from Base with new methods, rather than being a separate function that happens to be named `start`. (This is a super common confusion.) -

Re: [julia-users] Re: [Gadfly] How do I put layers inside a facet/subplot?

2014-07-25 Thread Leah Hanson
oint, free_y_axis=true), > Scale.discrete_color_manual("purple", "orange")) > > > > On Friday, July 25, 2014 2:56:43 PM UTC-7, Leah Hanson wrote: > >> Yay! Thank you. That does make things a lot easier. I think I'm better >> understanding how

Re: [julia-users] Re: [Gadfly] How do I put layers inside a facet/subplot?

2014-07-25 Thread Leah Hanson
reen" | 3| 9.0 | > | 16| thing2 | 1.0 | "blue" | 1| 1.0 | > | 17| thing2 | 0.2 | "blue" | 2| 2.0 | > | 18| thing2 | 0.1 | "blue" | 3| 3.0 | > > With which the plot can be simplified to: > > plot(melt(t, [:_type, :rank, :spe

Re: [julia-users] Re: [Gadfly] How do I put layers inside a facet/subplot?

2014-07-25 Thread Leah Hanson
=:thing1,color=:_type), > > layer(Geom.subplot_grid(Geom.point),ygroup=:_type,x=:rank,y=:thing2,color=:_type), > Scale.discrete_color_manual("red", "green", "blue")) > > > On Friday, July 25, 2014 10:51:14 AM UTC-7, Leah Hanson wrote: > >> Thank, t

Re: [julia-users] Re: [Gadfly] How do I put layers inside a facet/subplot?

2014-07-25 Thread Leah Hanson
l 25, 2014 at 12:34 PM, Johan Sigfrids wrote: > I think you might have to put the Geom.subplot_grid inside the layers. > > > On Friday, July 25, 2014 7:37:48 PM UTC+3, Leah Hanson wrote: >> >> I am trying to make a relatively complicated graph in Gadfly, and am >> st

Re: [julia-users] A couple tuple questions

2014-07-25 Thread Leah Hanson
1) it returns an iterator, not a set of arrays >>> 2) the iterator yields tuples, not arrays >>> >>> julia> zip(tuplearray) >>> Zip{(Array{(Int64,Int64,Int64),1},)}(([(1,2,3),(10,20,30),( >>> 100,200,300)],)) >>> >>> julia>

[julia-users] [Gadfly] How do I put layers inside a facet/subplot?

2014-07-25 Thread Leah Hanson
I am trying to make a relatively complicated graph in Gadfly, and am struggling. This is some sample data with the same structure as my data. ~~~ julia> t = readtable("testdata.csv") 9x5 DataFrame |---|-|--|---||| | Row # | _type | rank | speed | thing1 | thin

Re: [julia-users] bug found in a for loop, some help needed

2014-07-25 Thread Leah Hanson
It sounds like the error message is asking you to open a github issue here: https://github.com/julialang/julia/issues?milestone=7&state=open . Seeing an error message that asks you to report an error (where the error is coming from the compiler, and not a message you added yourself) usually means t

Re: [julia-users] A couple tuple questions

2014-07-24 Thread Leah Hanson
a) Your second option works for me: ~~~ julia> testtuple = (1,2,3) (1,2,3) julia> testvar = 4 4 julia> tuple(testtuple...,testvar) (1,2,3,4) ~~~ b) I'm not sure what the cleanest code for your example would be, but here's one possibility: ~~~ julia> tuplearray = [(1,2,3),(10,20,30),(100,200,300

Re: [julia-users] Equivalent for Python 'pass' statement in Julia

2014-07-22 Thread Leah Hanson
Because Julia has begin-end blocks, you can just use an empty block. Here are some examples of what I mean: ~~~ function foo() end ~~~ ~~~ if true elseif false else end ~~~ ~~~ for i=1:10 end ~~~ Does that do what you wanted? -- Leah On Tue, Jul 22, 2014 at 3:44 PM, wrote: > Hi, > > Pytho

[julia-users] Static Analysis in Julia talk

2014-07-21 Thread Leah Hanson
I've spoken twice about TypeCheck.jl in the past couple of weeks (at JuliaCon and Midwest.io). The Midwest.io talk has been posted: https://www.youtube.com/watch?v=mL1Ow03G8tk&feature=youtu.be Because Midwest.io is a general programming conference, there's background on Julia before we get into th

Re: [julia-users] String from a substring

2014-07-21 Thread Leah Hanson
SubString is a subtype of String, so any function accepting a String should accept a SubString. What function are you calling where this doesn't work? -- Leah On Mon, Jul 21, 2014 at 11:13 AM, Ben Ward wrote: > This is probably a simple question, I've done a string splitting operation > with s

Re: [julia-users] Re: Sorting behavior

2014-07-21 Thread Leah Hanson
nted as help when you get a MethodError. > > See also https://github.com/JuliaLang/julia/issues/7512. > > Ivar > > kl. 16:03:46 UTC+2 mandag 21. juli 2014 skrev Leah Hanson følgende: >> >> I agree that the `["a" "b" "c"]` vs `["a&quo

Re: [julia-users] Re: Sorting behavior

2014-07-21 Thread Leah Hanson
I agree that the `["a" "b" "c"]` vs `["a", "b", "c"]` syntax is something likely to catch new-to-Julia users. I have personally watched people struggle with that. Programmers familiar with other languages take a bit to understand the vectors vs row-matrixes thing, when they were just expecting a li

Re: [julia-users] Generating optimized code for an instance of a composite type. Possible?

2014-07-20 Thread Leah Hanson
Have you considered using type parameters to indicate the symmetry of the filter object? That would allow you to use multiple dispatch to make a separate method for each kind of symmetry. -- Leah On Sun, Jul 20, 2014 at 10:03 AM, Jay Kickliter wrote: > I'm writing some polyphase resampling > <

Re: [julia-users] Background Knowledge needed to Start working with/learning Julia?

2014-07-18 Thread Leah Hanson
I agree with what John said. Additionally, as you have more specific questions that you get stuck on, please ask this mailing list. The manual is certainly incomplete; I went to look relevant section to direct you to, but the section on Networking & Streams is very networking focused. I have a gi

Re: [julia-users] [newb] namespaces?

2014-07-17 Thread Leah Hanson
Packages are each in their own module, which are namespaces. Because generic functions "own" all their scattered methods, there is less of a need to hide functions with the same name inside different namespaces in Julia. Could you be more specific about what you're concerned could happen? (for ex

Re: [julia-users] Re: my first julia function

2014-07-16 Thread Leah Hanson
Help data is hand-written; if no one has documented a function yet, then it just tells you how many methods there are. `methods(sumabs2)` would show you the method signatures. If you want to add to the help documentation, you can edit this file: https://github.com/JuliaLang/julia/blob/master/doc/h

Re: [julia-users] Re: websockets D3 and Julia

2014-07-14 Thread Leah Hanson
If you're looking for the server-side Julia websockets package, this is it: https://github.com/JuliaLang/WebSockets.jl Gadfly.jl can generate SVG files; you could probably send those across a websock and using Javascript to insert them into the page. I'm not especially experienced in web-stuff, so

Re: [julia-users] Re: essay on the history of programming languages

2014-07-13 Thread Leah Hanson
>> This is a restricted presentation that can only be viewed by Strange Loop >> 2013 attendees! >> > Which is odd, because I didn't attend in the first place. > > > On Sunday, 13 July 2014 17:24:22 UTC+2, Leah Hanson wrote: > >> Looks like it will be next mon

Re: [julia-users] Re: essay on the history of programming languages

2014-07-13 Thread Leah Hanson
Looks like it will be next month: http://www.infoq.com/presentations/julia-dispatch?utm_source=infoq&utm_medium=QCon_EarlyAccessVideos&utm_campaign=StrangeLoop2013 On Sun, Jul 13, 2014 at 4:57 AM, Job van der Zwan wrote: > By the way, is video for the Strange Loop presentation linked near the e

Re: [julia-users] Canonical way of reading STDIN

2014-07-12 Thread Leah Hanson
Those look pretty reasonable to me. :) Thanks for contributing to the documentation. -- Leah On Sat, Jul 12, 2014 at 11:21 AM, Matthew Wood wrote: > I didn't find any examples in the docs for processing STDIN for more than > one read. I'm happy to contribute an example, but I wanted to make s

Re: [julia-users] how use find ?

2014-07-12 Thread Leah Hanson
The problem is that `a .> 5` is a BitArray, not a function. ~~~ julia> a = rand(10) * 10 10-element Array{Float64,1}: 5.5408 5.52724 2.87541 1.59491 0.278013 1.56604 8.29388 8.27159 0.737642 7.40957 julia> find(x->x>5,a) 5-element Array{Int64,1}: 1 2 7 8 10 ~~~ When you call `

Re: [julia-users] Re: ANN: Gumbo.jl (HTML parsing library)

2014-07-09 Thread Leah Hanson
This might be what you're looking for: https://github.com/Keno/URIParser.jl -- Leah On Wed, Jul 9, 2014 at 10:15 AM, Yuuki Soho wrote: > I've used it a little bit and it's very nice, great job! > > Just a related question, is there something to deal with html links > currently in Julia, parsin

[julia-users] The Meaning of `const`

2014-07-08 Thread Leah Hanson
The only reference I can find in the manual to the `const` keyword is in the performance section [1]. Well, that and the `isconst` function[2]. This seems like it would be worth documenting, especially since it behaves significantly differently than the const that I remember from Java or C++, whic

Re: [julia-users] What's the scope for includes?

2014-07-06 Thread Leah Hanson
I'm not sure why it behaves differently inside the while loop, but I'm also not sure how you can tell, since the function foo is already defined? Maybe you could explain what your goal is. `include` basically pastes the included file at the call site. Why are you re-including the same file multipl

Re: [julia-users] Re: Lowering the (mostly social/psychological) barriers to sharing packages?

2014-07-01 Thread Leah Hanson
I think the ease of `Pkg.clone` for packages that aren't yet ready for metadata is the biggest argument against an "extra metadata" thing. Especially since `Pkg.clone` already handles reading the REQUIRE file in the repo. Maybe the thing to do is to advertise the steps to have people try your code

Re: [julia-users] how to call extern c function in julia?

2014-07-01 Thread Leah Hanson
You can model your C-struct type with a Julia type. Each field of the Julia type should have a type annotation (Cint, etc) and be in the same order as the C-struct. Here's an example of Julia code wrapping a C library: https://github.com/JuliaLang/HttpParser.jl/blob/master/src/HttpParser.jl I thi

Re: [julia-users] Reflection for function argument types

2014-06-29 Thread Leah Hanson
This is the PR: https://github.com/JuliaLang/julia/pull/7287 I've been told they're waiting to release 0.3 before merging it. There are two methods; code_typed(Function) depends on code_typed(Method), but not the other way around. -- Leah On Sun, Jun 29, 2014 at 7:56 PM, Elliot Saba wrote: >

Re: [julia-users] Re: Reflection for function argument types

2014-06-29 Thread Leah Hanson
So, you can also get code_typed of a Method of a Function. I have a PR to make code_typed walk the methods of a Function (and also accept a Method object), rather than requiring you to write the signature. Would either of those work for you? -- Leah On Sun, Jun 29, 2014 at 4:03 PM, Elliot Saba

Re: [julia-users] Reflection for function argument types

2014-06-29 Thread Leah Hanson
So, you're trying to do this before/without actually having the method definition evaluate? (These things are readily available from code_typed's output, but you'd (I think) need to define the method first.) -- Leah On Sun, Jun 29, 2014 at 3:21 PM, Elliot Saba wrote: > I'm having trouble figur

Re: [julia-users] ANN: TermWin.jl - a basic ncurses data navigation tool

2014-06-27 Thread Leah Hanson
That looks really cool. I'm going to have to play with this next time I work on TypeCheck! :) -- Leah On Thu, Jun 26, 2014 at 3:52 AM, Tony Fong wrote: > Well, one thing leads to another. With Lint.jl, I have been dumping Expr > and looking up its structure. > > Wouldn't it be great if I can b

[julia-users] A Question About `display`

2014-06-20 Thread Leah Hanson
My code calls `display` on a bunch of values (of a type I define). Most of these values chose not to display anything; only a few of them are meant to print anything at all. However, running the code currently generates a lot of extra new lines for the non-printing values. This is the main functio

Re: [julia-users] Test for a warning

2014-06-20 Thread Leah Hanson
~~~ errormsg = @with_out_str begin ... code ... end ~~~ should put the error message into errormsg. -- Leah On Fri, Jun 20, 2014 at 4:29 PM, Laszlo Hars wrote: > I am confused: I can change all the "out"s to "err"s, but what variable > will contain the error message to be inspected? The err

Re: [julia-users] Call for Unicode julia source examples

2014-06-20 Thread Leah Hanson
It's a bit silly, but it does have a unicode-named macro: https://github.com/danluu/funarg -- Leah On Fri, Jun 20, 2014 at 10:24 AM, Jake Bolewski wrote: > Thanks Jacob. I should note that I'm already testing all packages in > METADATA. > > > On Friday, June 20, 2014 11:17:06 AM UTC-4, Jacob

Re: [julia-users] Re: uncurried functions are ok... if you know what you are doing

2014-06-19 Thread Leah Hanson
You could also split that into multiple lines if readability is your goal: ~~~ sum(map(first,filter(x->x[1]!=x[2] && x[2]<=n && d[x[2]]==x[1],enumerate(d ~~~ becomes: ~~~ filtered = filter(enumerate(d)) do x x[1]!=x[2] && x[2]<=n && d[x[2]]==x[1] #expand to readability as desired end final

Re: [julia-users] Pass Keyword Argument Dictionary

2014-06-18 Thread Leah Hanson
Using the same print_args, here's a revised arg_collector: julia> function arg_collector(;kwargs...) # do some operation on args print_args(;kwargs...) #always print args end arg_collector (generic function with 1 method) julia> arg_collector(x=5, y=6, z=7) x 5

Re: [julia-users] Re: Project organization and CLI

2014-06-16 Thread Leah Hanson
before ngrams is included & run. -- Leah On Mon, Jun 16, 2014 at 12:31 PM, TR NS wrote: > On Monday, June 16, 2014 12:56:29 PM UTC-4, Leah Hanson wrote: >> >> `include` is like copy-pasting the code from the included file into the >> spot where you called include. >

Re: [julia-users] Re: Project organization and CLI

2014-06-16 Thread Leah Hanson
`include` is like copy-pasting the code from the included file into the spot where you called include. You shouldn't have `module Corpus` in ngrams.jl. -- Leah On Mon, Jun 16, 2014 at 11:53 AM, TR NS wrote: > Made a modicum of progress. I am not sure why, but it stopped hanging, and > now I g

Re: [julia-users] Assigning variables in other modules vs. assigning to fields of types from other modules

2014-06-10 Thread Leah Hanson
I would guess that the difference is that `MyMod.b = 7.6` changes the value that the variable is bound to, where `MyMod.a.val = 4.5` modifies the value of the variable. This subtle difference is similar to a function that takes and Int and an Array being able to make externally visible modification

Re: [julia-users] Type inheritance in Julia

2014-05-30 Thread Leah Hanson
Many people follow the google group by subscribing via email. This means that removing a post doesn't help: it's already been sent out. -- Leah On Fri, May 30, 2014 at 6:03 PM, wrote: > But I removed the first one within 5 minutes! I'm sorry about that, and > even more because the post is long

Re: [julia-users] What's with the Nothing type?

2014-05-23 Thread Leah Hanson
Functions return the value that the final expression in them evaluated to. function foo(x) x +=2 5 end # => always returns 5 function bar(x) # blah blah ... println("hello world") end # => always returns nothing, because that's what println returns -- Leah On Fri, May 23, 2014 at 5:00

Re: [julia-users] Shameless plug for DotPlot.jl - plots in your terminal

2014-05-22 Thread Leah Hanson
Maybe something like TextPlot would be a good merged name? It conveys what the package does (text plots) rather than how it does it (Braille characters). Having a more complete plotting package for the terminal would move towards having a way to make `plot` just work when you start up a Julia REPL

Re: [julia-users] Re: Problem with Composite type definition

2014-05-20 Thread Leah Hanson
You don't need the {T} on the constructor; being inside the type definition gives you access to that T. Your call to the constructor needs to have the type parameter explicitly. The type parameter here indicates which type you want to create. ~~~ MyType{Float64}(zeros(Float64, 5), ["param"=>2.0])

Re: [julia-users] Converting python code to julia

2014-05-20 Thread Leah Hanson
I don't know much about Julia's math libraries, so I'll leave that for someone else. In Julia, types are just data and functions use multiple dispatch to select which values they work with. For example, a Python class A with methods foo(self, x, y) and bar(self, z) would become: ~~~ type A #pr

Re: [julia-users] Re: Why do macros use the @ sign?

2014-05-20 Thread Leah Hanson
A macro has different rules from function calls, which are reflected in it's different calling syntax. Macros have more power to affect your code in strange ways; a macro's arguments may not get run (if the macro doesn't use them), a macro could change the value of local variables not involved in c

Re: [julia-users] Re: GSOC 3D Visualizations plotting API - Make a wish!

2014-05-19 Thread Leah Hanson
I'd like an interface that would make it relatively easy to implement something like this: http://ubietylab.net/ubigraph/ I've run into (and had friends run into) problems visualization (directed) graphs with thousands to hundreds of thousands of nodes. Ubigraph, linked above, tended to crash at c

Re: [julia-users] linear algebra speed comparisons with MATLAB

2014-05-18 Thread Leah Hanson
There are instructions in the Julia README and on Intel's website for running Julia with MKL: https://github.com/JuliaLang/julia#intel-math-kernel-libraries https://software.intel.com/en-us/articles/julia-with-intel-mkl-for-improved-performance -- Leah On Sun, May 18, 2014 at 3:59 PM, Thomas Co

Re: [julia-users] references in sets

2014-05-12 Thread Leah Hanson
The difference between those two lines is that "x" is a variable binding, "x.a" is a reference inside "x". If the value that the variable"x" is bound to is shared (as when you put it in a set), then modifying "x.a" will modify that everywhere because it modifies the value x is bound to. "x = new" b

[julia-users] Trouble with Type Parameters

2014-05-11 Thread Leah Hanson
I'm playing with defining Linked Lists in Julia. The version I'm struggling with involves having a type parameter on the node and list, that indicates the type of the data in the list. These are the types: ~~~ type List{T} head::Union(Node{T},Nothing) end type Node{T} data::T next::Union

Re: [julia-users] difference between inside and outside constructors

2014-05-08 Thread Leah Hanson
The main thing is that an inner constructor replaces the default constructor. AA(1,2) # this will work. BB(1,2) # this will throw an error You should also be able to see this in the output for "methods(AA)" and "methods(BB)". -- Leah On Thu, May 8, 2014 at 5:51 PM, cnbiz850 wrote: > Would

Re: [julia-users] array with different column types

2014-05-08 Thread Leah Hanson
The version without @eval is better. You shouldn't use @eval if you don't have to; it should be faster without it. -- Leah On Thu, May 8, 2014 at 2:42 PM, 'Stéphane Laurent' via julia-users < julia-users@googlegroups.com> wrote: > Actually I'm rather using the followig function allowing to remo

  1   2   >