Re: [julia-users] Optional Arguments for Do-Block Syntax for Functions

2016-11-11 Thread Adrian Salceanu
Got it, thanks vineri, 11 noiembrie 2016, 19:11:28 UTC+1, Stefan Karpinski a scris: > > You can use a name like _ but otherwise, no, there's no way to do this. > > On Fri, Nov 11, 2016 at 11:46 AM, Adrian Salceanu <adrian@gmail.com > > wrote: > >> I love

[julia-users] Optional Arguments for Do-Block Syntax for Functions

2016-11-11 Thread Adrian Salceanu
I love the block syntax for functions as it provides great readability and I'm using it heavily as a design pattern to enclose code behind authorization or caching. For example: function article_edit(params::Dict{Symbol,Any}; a::Article = Article()) with_authorization(:edit,

Re: [julia-users] using or import a specific package version

2016-11-07 Thread Adrian Salceanu
I have used DeclarativePackages (https://github.com/rened/DeclarativePackages.jl) - it's quite all right. Also, a while ago I've stumbled onto Playground (https://github.com/Rory-Finnegan/Playground.jl) but I haven't tried it myself. sâmbătă, 5 noiembrie 2016, 15:09:50 UTC+2, Steven G.

[julia-users] Re: Webapp Deployment

2016-11-01 Thread Adrian Salceanu
n github with this, suspect it's something > on my end. What would be the appropriate channel for me to get some help on > this? > > On Tuesday, November 1, 2016 at 1:10:18 AM UTC-5, Adrian Salceanu wrote: >> >> Sounds like the answer is https://github.com/shash

[julia-users] Re: Webapp Deployment

2016-11-01 Thread Adrian Salceanu
Sounds like the answer is https://github.com/shashi/Escher.jl It was built exactly for your use case and it's actually inspired by Elm marți, 1 noiembrie 2016, 06:08:01 UTC+2, Reuben Brooks a scris: > > Context: I love julia, and I've never built any kind of webapp. Most of my > programming

[julia-users] Re: eval in current scope

2016-09-27 Thread Adrian Salceanu
Yichao, not long ago I had a similar question (it was in the context of building a templating system), you were very kind and point me in the right direction. So I kept digging. Marius, sorry for piggy backing on your question, but I'm curious about some code that seems to do the trick. I'm

Re: [julia-users] Julia's current state of web-programming

2016-09-22 Thread Adrian Salceanu
Escher is pretty cool, but it’s more about data interactions and visualizations (dashboards?), rather than building full featured web apps and products. I’m working on Genie: https://github.com/essenciary/Genie.jl a full stack MVC web framework for Julia, in the spirit of Rails or Django. It now

[julia-users] Re: Complex parallel computing implementation

2016-09-12 Thread Adrian Salceanu
Dagger.jl> to > set up a DAG of computations you need performed? > > On Monday, September 12, 2016 at 5:04:26 PM UTC-4, Adrian Salceanu wrote: >> >> This is a random example of an error - not really sure how to debug this, >> seems to crash within the Postgres l

[julia-users] Re: Complex parallel computing implementation

2016-09-12 Thread Adrian Salceanu
/Projects/jinnie/genie.jl, in expression starting on line 16 luni, 12 septembrie 2016, 23:01:51 UTC+2, Adrian Salceanu a scris: > > I was wondering if anybody can point me towards a tutorial or a large code > base using parallel computing. Everything that is discussed so far in the > do

[julia-users] Complex parallel computing implementation

2016-09-12 Thread Adrian Salceanu
I was wondering if anybody can point me towards a tutorial or a large code base using parallel computing. Everything that is discussed so far in the docs and books is super simple - take a function, run it in parallel, the end. To explain, I'm working on a full stack MVC web framework - so

[julia-users] Re: "WARNING: replacing module" when invoking function with @everywhere - but module not available otherwise

2016-09-09 Thread Adrian Salceanu
; . > > On Friday, September 9, 2016 at 10:04:53 AM UTC-7, Adrian Salceanu wrote: >> >> Hi, >> >> I'm fumbling around with a little script with the end goal of running >> HttpServer handlers on multiple ports, in parallel, with each handler on a >&

[julia-users] "WARNING: replacing module" when invoking function with @everywhere - but module not available otherwise

2016-09-09 Thread Adrian Salceanu
Hi, I'm fumbling around with a little script with the end goal of running HttpServer handlers on multiple ports, in parallel, with each handler on a separate worker. The code looks like this: # parallel_http.jl using HttpServer function serve(port::Int) http = HttpHandler() do

[julia-users] Re: basic question on structuring modules

2016-09-09 Thread Adrian Salceanu
If you don't want to use a module you will have to explicitly include the file using include(path::AbstractString) And the content of the file will be evaluated in the current context (providing mixin behavior). That should be OK for very short scripts / apps. For anything bigger you should

[julia-users] Re: basic question on structuring modules

2016-09-09 Thread Adrian Salceanu
By convention, module names should be PascalCase. Thus, you'll end up with # Foo.jl module Foo function foo() end end Julia being case sensitive, there will be no name clashes. vineri, 9 septembrie 2016, 15:29:48 UTC+2, Neal Becker a scris: > > Let's say I have a simple module which

[julia-users] Re: Questions regarding Julia for general purpose programming (strings, modules, dispatch, inheritance)

2016-08-24 Thread Adrian Salceanu
That's what I thought too Steven, thanks for confirming it. Can't find any updates re `String` though, still talks about `AbstractString`... miercuri, 24 august 2016, 15:29:56 UTC+2, Steven G. Johnson a scris: > > > > On Wednesday, August 24, 2016 at 8:52:37 AM UTC-4, Adrian Sa

[julia-users] Re: Questions regarding Julia for general purpose programming (strings, modules, dispatch, inheritance)

2016-08-24 Thread Adrian Salceanu
Is the documentation available anywhere for 0.5? miercuri, 24 august 2016, 14:01:44 UTC+2, Steven G. Johnson a scris: > > > > On Wednesday, August 24, 2016 at 5:18:05 AM UTC-4, Adrian Salceanu wrote: >> >> a. ASCIIStrings vs UTF8Strings. >> > > That di

[julia-users] Re: Questions regarding Julia for general purpose programming (strings, modules, dispatch, inheritance)

2016-08-24 Thread Adrian Salceanu
:18:05 AM UTC-4, Adrian Salceanu wrote: >> >> a. ASCIIStrings vs UTF8Strings. >> > > That distinction is going away in Julia 0.5; there is just one type, > String. > > b. indexing into UTF8 strings. Can bite if you're not careful, but Julia >> pr

[julia-users] Re: Questions regarding Julia for general purpose programming (strings, modules, dispatch, inheritance)

2016-08-24 Thread Adrian Salceanu
Hi, A bit of context first. I'm working on building a full stack web framework in the tradition of Rails and Django (https://github.com/essenciary/Genie.jl). And not only that I use Julia for general purpose programming, I also come from a completely different background, doing almost

Re: [julia-users] Help please: how to expand dictionary into (local ?) variables with the same name as the keys and the corresponding values

2016-08-16 Thread Adrian Salceanu
Yes, absolutely, thanks so much! marți, 16 august 2016, 10:58:39 UTC+2, Mauro a scris: > > On Tue, 2016-08-16 at 10:29, Adrian Salceanu <adrian@gmail.com > > wrote: > > Oh, I see - I thought "global" meant "not explicitly enclosed in a > module"

Re: [julia-users] Help please: how to expand dictionary into (local ?) variables with the same name as the keys and the corresponding values

2016-08-16 Thread Adrian Salceanu
Oh, I see - I thought "global" meant "not explicitly enclosed in a module". But then yes, I get your point since that's automatically included in "Main" which is just a module like any other. marți, 16 august 2016, 10:18:57 UTC+2, Mauro a scris: > > On Tue,

Re: [julia-users] Help please: how to expand dictionary into (local ?) variables with the same name as the keys and the corresponding values

2016-08-16 Thread Adrian Salceanu
le of the parsing function I output "current_module()" and I get "Render", why is it global? Thanks Adrian, more confused about Julia than ever before marți, 16 august 2016, 01:19:14 UTC+2, Yichao Yu a scris: > > > > On Tue, Aug 16, 2016 at 4:37 AM, Adrian Salc

Re: [julia-users] Help please: how to expand dictionary into (local ?) variables with the same name as the keys and the corresponding values

2016-08-15 Thread Adrian Salceanu
Ah, of course! I don't know why I missed that, I was stuck looking for something that would be line aware, in the line of quote blocks. luni, 15 august 2016, 23:02:58 UTC+2, Stefan Karpinski a scris: > > On Mon, Aug 15, 2016 at 4:53 PM, Adrian Salceanu <adrian@gmail.com

Re: [julia-users] Help please: how to expand dictionary into (local ?) variables with the same name as the keys and the corresponding values

2016-08-15 Thread Adrian Salceanu
module other than Main (currently doing this into a dedicated Render module) would that be ok? luni, 15 august 2016, 16:25:03 UTC+2, Yichao Yu a scris: > > > > On Sun, Aug 14, 2016 at 11:33 PM, Adrian Salceanu <adrian@gmail.com > > wrote: > >> Huhm... so re >

Re: [julia-users] Help please: how to expand dictionary into (local ?) variables with the same name as the keys and the corresponding values

2016-08-15 Thread Adrian Salceanu
a function. >>> The function is quoted. The function arguments `var` and `val` are inserted >>> into that function, forming an assignment. Thus `var` better be an >>> identifier (or something else that can be on the left of an assignment >>> operator), and `val` c

Re: [julia-users] Help please: how to expand dictionary into (local ?) variables with the same name as the keys and the corresponding values

2016-08-15 Thread Adrian Salceanu
in the global scope? luni, 15 august 2016, 16:23:37 UTC+2, Yichao Yu a scris: > > > > On Sun, Aug 14, 2016 at 11:13 PM, Adrian Salceanu <adrian@gmail.com > > wrote: > >> Thanks >> >> Maybe I wasn't clear enough - otherwise, can you please elaborate, I

Re: [julia-users] Help please: how to expand dictionary into (local ?) variables with the same name as the keys and the corresponding values

2016-08-15 Thread Adrian Salceanu
Here is the code for the examples: https://github.com/essenciary/ejl/blob/master/2.jl luni, 15 august 2016, 10:20:18 UTC+2, Adrian Salceanu a scris: > > Erik, thank you very much. > > In a few lines, here is the use case (for a standard MVC web app): > > 1. the user defines

Re: [julia-users] Help please: how to expand dictionary into (local ?) variables with the same name as the keys and the corresponding values

2016-08-15 Thread Adrian Salceanu
ms like it does exactly what you're > asking for... > > On Sunday, August 14, 2016 at 3:13:37 AM UTC-7, Adrian Salceanu wrote: >> >> Variables contained in a module and then parsed Julia code included >> within a function using include_string(). >> >> Any obvious per

Re: [julia-users] Help please: how to expand dictionary into (local ?) variables with the same name as the keys and the corresponding values

2016-08-15 Thread Adrian Salceanu
define this function `f` only once. Julia does not > allow changing functions. If you want to create many different functions, > you would use anonymous functions instead. > > Having said this -- it's not clear that this is indeed the right way to > address your problem;

Re: [julia-users] Help please: how to expand dictionary into (local ?) variables with the same name as the keys and the corresponding values

2016-08-14 Thread Adrian Salceanu
one. But then I think you're right, the code is included / eval'd in Main - so it's not really like include(), which provides for mixin behavior? :-O duminică, 14 august 2016, 17:13:28 UTC+2, Adrian Salceanu a scris: > > Thanks > > Maybe I wasn't clear enough - otherwise, can you p

Re: [julia-users] Help please: how to expand dictionary into (local ?) variables with the same name as the keys and the corresponding values

2016-08-14 Thread Adrian Salceanu
PHP or ASP, when not being chased by tigers (or something around that age). duminică, 14 august 2016, 15:01:47 UTC+2, Yichao Yu a scris: > > > > On Sun, Aug 14, 2016 at 6:13 PM, Adrian Salceanu <adrian@gmail.com > > wrote: > >> Variables contained in a module

Re: [julia-users] Help please: how to expand dictionary into (local ?) variables with the same name as the keys and the corresponding values

2016-08-14 Thread Adrian Salceanu
Variables contained in a module and then parsed Julia code included within a function using include_string(). Any obvious performance issues with this approach? duminică, 14 august 2016, 12:11:06 UTC+2, Adrian Salceanu a scris: > > OK, actually, that's not nearly half as bad. Var

Re: [julia-users] Help please: how to expand dictionary into (local ?) variables with the same name as the keys and the corresponding values

2016-08-14 Thread Adrian Salceanu
; Hello from me, ... <: else :> Hola <: end %> %= _.couñtry == "España" ? "Olé" : "Aye" moo """ include_string(join(tpl_data, "\n")) join(output, "\n") end render_template() |> println Hello from me, ...

Re: [julia-users] Help please: how to expand dictionary into (local ?) variables with the same name as the keys and the corresponding values

2016-08-14 Thread Adrian Salceanu
+ 3) > > julia> eval(MetaProgTools.populateexpression(q, Dict("x"=>1, "y"=>2))) > 6 > > On Saturday, August 13, 2016 at 3:07:38 AM UTC-6, Adrian Salceanu wrote: >> >> Thanks, but I don't know what the dict contains, it is user defined. > >

Re: [julia-users] Help please: how to expand dictionary into (local ?) variables with the same name as the keys and the corresponding values

2016-08-14 Thread Adrian Salceanu
d blocks. But I'm hoping include_string() will do the trick (must test though). sâmbătă, 13 august 2016, 15:20:01 UTC+2, Yichao Yu a scris: > > > > On Sat, Aug 13, 2016 at 8:06 PM, Adrian Salceanu <adrian@gmail.com > > wrote: > >> That's pretty difficult as my

Re: [julia-users] Help please: how to expand dictionary into (local ?) variables with the same name as the keys and the corresponding values

2016-08-13 Thread Adrian Salceanu
UTC+2, Yichao Yu a scris: > > > > On Sat, Aug 13, 2016 at 7:13 PM, Adrian Salceanu <adrian@gmail.com > > wrote: > >> Thanks >> >> It's for a templating engine. The user creates the document (a string) >> which contains interpol

Re: [julia-users] Help please: how to expand dictionary into (local ?) variables with the same name as the keys and the corresponding values

2016-08-13 Thread Adrian Salceanu
Thanks It's for a templating engine. The user creates the document (a string) which contains interpolated variables placeholders and markup. When the template is rendered, the placeholders must be replaced with the corresponding values from the dict. The lines in the template are eval-ed and

[julia-users] Help please: how to expand dictionary into (local ?) variables with the same name as the keys and the corresponding values

2016-08-13 Thread Adrian Salceanu
Hi, This seems to be a recurring question per my googlings, but still I could not find a satisfactory answer. I'm looking for a generic way of doing this: render_template(template_content, Dict(:greeting => "Hello", :greeted => "World", :other => Dict("foo" => 1))) where function

Re: [julia-users] How to debug segmentation fault?

2016-08-09 Thread Adrian Salceanu
han me on this, but I know there's > a good section in the manual to help you get started: > http://docs.julialang.org/en/latest/devdocs/C/ > > -Jacob > > On Tue, Aug 9, 2016 at 9:53 AM, Adrian Salceanu <adrian@gmail.com > > wrote: > >> I ran into an issue whe

[julia-users] How to debug segmentation fault?

2016-08-09 Thread Adrian Salceanu
I ran into an issue where apparently at random I get segmentation faults - how can I find out what exactly is causing the problem? Here is the dump: signal (11): Segmentation fault: 11 julia_call_23669 at (unknown line) disposable_instance at

[julia-users] Re: ANN: New Julia Packages website

2016-07-18 Thread Adrian Salceanu
we keep is having a mechanism for uploading > automated nightly results from PackageEvaluator, building the pulse page > http://pkg.julialang.org/pulse.html, etc. > > > On Wednesday, July 13, 2016 at 2:13:25 AM UTC-7, Adrian Salceanu wrote: >> >> Thanks Mosè! :) >> >&

[julia-users] Re: ANN: New Julia Packages website

2016-07-13 Thread Adrian Salceanu
Thanks Mosè! :) I think Tony's idea is the best way to go about it. This website is more of a temporary patch as searching in pkg.julialang is inefficient (just browser search with little context and then if something looks interesting you have to open the repo, look around, get back, etc).

[julia-users] Re: ANN: New Julia Packages website

2016-07-08 Thread Adrian Salceanu
I've now added a chat for Genie.jl :) vineri, 8 iulie 2016, 17:03:35 UTC+2, Adrian Salceanu a scris: > > Thanks Eric! > > Yeah, the Rust package is pretty cool, I've stumbled onto it myself > earlier :-O > > Genie.jl, thanks! It's still early but I'm super hyped by th

[julia-users] Re: ANN: New Julia Packages website

2016-07-08 Thread Adrian Salceanu
Thanks Eric! Yeah, the Rust package is pretty cool, I've stumbled onto it myself earlier :-O Genie.jl, thanks! It's still early but I'm super hyped by the way it comes out! Yeah, I'm on Gitter, on JuliaLang and JuliaLangEs. A vineri, 8 iulie 2016, 16:49:03 UTC+2, Eric Forgy a scris: > >

[julia-users] ANN: New Julia Packages website

2016-07-08 Thread Adrian Salceanu
I've setup an early version of a Julia packages website, for your package discovery pleasure: http://genieframework.com/packages Fair warning, this is a test case website for Genie.jl, the full stack web framework I'm working on - and 90% of my focus was on building the actual framework and

[julia-users] Re: Function that accepts AbstractString does not accept UTF8String? Help :-ss

2016-07-07 Thread Adrian Salceanu
And this works perfectly well too indeed, render{T<:AbstractString}(p::Dict{T}) I didn't realize the type of the value can be omitted, pretty cool! joi, 7 iulie 2016, 19:01:55 UTC+2, Adrian Salceanu a scris: > > Thanks Steven, > > It works perfectly fine like this: > >

[julia-users] Re: Function that accepts AbstractString does not accept UTF8String? Help :-ss

2016-07-07 Thread Adrian Salceanu
Thanks Steven, It works perfectly fine like this: julia> function foo{T<:AbstractString, U<:Any}(p::Dict{T, U}) @show p end foo (generic function with 2 methods) julia> foo(Dict("abc" => 123)) p = Dict("abc"=>123) Dict{ASCIIString,Int64} with 1 entry: "abc" => 123 Still

[julia-users] Re: Function that accepts AbstractString does not accept UTF8String? Help :-ss

2016-07-07 Thread Adrian Salceanu
Plus, per the example, the function does not take an AbstractString directly (my bad, bad subject) - but a Dict{AbstractString,Any} joi, 7 iulie 2016, 18:43:31 UTC+2, Adrian Salceanu a scris: > > Thanks Steven, > > That makes sense and I was thinking about the same thing... &g

[julia-users] Re: Function that accepts AbstractString does not accept UTF8String? Help :-ss

2016-07-07 Thread Adrian Salceanu
Thanks Steven, That makes sense and I was thinking about the same thing... But what I don't get is, why has it worked till now and it still works on my Ubuntu server, but no longer works on my Mac? joi, 7 iulie 2016, 18:36:57 UTC+2, Steven G. Johnson a scris: > > You want > >

[julia-users] Function that accepts AbstractString does not accept UTF8String? Help :-ss

2016-07-07 Thread Adrian Salceanu
Hi, I really don't know what to make of this? Am I missing something? Any help greatly appreciated. I have this function: function render(p::Dict{AbstractString,Any}) and I call it sending it Dict{UTF8String,Any}("search"=>Dict{UTF8String,Any}("rank"=>0.094717, "headline"=>"**web**

[julia-users] Re: Parametric constructor of concrete type accepting all subtypes of an(other) abstract type?

2016-06-10 Thread Adrian Salceanu
LFoo{T}( model_name, bar) vineri, 10 iunie 2016, 20:21:18 UTC+2, Adrian Salceanu a scris: > > Hi, > > I don't know how to code this, any help appreciated. > > I want to have a concrete type that has a field referencing any of the > subtypes of an(other) abstract type. How would I w

[julia-users] Re: Parametric constructor of concrete type accepting all subtypes of an(other) abstract type?

2016-06-10 Thread Adrian Salceanu
::Bool SQLFoo(T; bar = true) = new(model_name, bar) end Is this possible? vineri, 10 iunie 2016, 20:21:18 UTC+2, Adrian Salceanu a scris: > > Hi, > > I don't know how to code this, any help appreciated. > > I want to have a concrete type that has a field referencing any of the

[julia-users] Parametric constructor of concrete type accepting all subtypes of an(other) abstract type?

2016-06-10 Thread Adrian Salceanu
Hi, I don't know how to code this, any help appreciated. I want to have a concrete type that has a field referencing any of the subtypes of an(other) abstract type. How would I write that? This is one of my many attempts: type SQLFoo{T <: AbstractModel} model_name::Type{T}

[julia-users] Re: ANN: PkgSearch - a REPL utility for package discovery

2016-06-05 Thread Adrian Salceanu
Thanks for the feedback, happy to contribute. vineri, 3 iunie 2016, 22:40:50 UTC+2, Adrian Salceanu a scris: > > Hi, > > I have released PkgSearch, a small REPL utility for package discovery. > > Package discovery seemed to be a recurring issue, with many related >

[julia-users] Re: ANN: PkgSearch - a REPL utility for package discovery

2016-06-04 Thread Adrian Salceanu
Hi, thanks very much for the feedback, much appreciated. 1. good point, haven't considered that as package names don't have spaces. But nonetheless, a search with spaces should definitely be all right. I fixed the issue and pushed on GitHub - it now considers whitespace as a keyword

[julia-users] ANN: PkgSearch - a REPL utility for package discovery

2016-06-03 Thread Adrian Salceanu
Hi, I have released PkgSearch, a small REPL utility for package discovery. Package discovery seemed to be a recurring issue, with many related questions - and I can still remember how difficult was for me too, when I started. So it might be a useful tool. I've been using it for a few days

[julia-users] Re: Ubuntu bug? Executing .jl files via shebang does nothing on Ubuntu 16.04 x64

2016-05-19 Thread Adrian Salceanu
OK, I figured out what causes the problem. It seems that on linux it does not like the --color=yes Removed that and it works as expected. Cheers! joi, 19 mai 2016, 19:48:04 UTC+2, Adrian Salceanu a scris: > > Hi, > > There seems to be a problem with executing .jl scripts on

[julia-users] Ubuntu bug? Executing .jl files via shebang does nothing on Ubuntu 16.04 x64

2016-05-19 Thread Adrian Salceanu
Hi, There seems to be a problem with executing .jl scripts on Ubuntu 16.04 x64 Take this simple program in exec_text.jl #!/usr/bin/env julia --color=yes println("all good!") On Mac OS: $ ./exec_test.jl all good! On Ubuntu it just hangs $ ./exec_test.jl [=> never returns, does nothing]

[julia-users] Re: [ANN] Book: Julia High Performance

2016-05-11 Thread Adrian Salceanu
I quite enjoy it - nicely written, to the subject, makes for a very pleasant read. Also, nice to see that Packt has recently had a Julia offer of the day, including the 4 books on Julia they're published. They're all very good. I'm considering writing a book on web development with Julia -

Re: [julia-users] Why does julia use END for block end?

2016-05-06 Thread Adrian Salceanu
> julia> x == 4 && "hello" > false > > julia> x == 5 && "world" > "world" > > Best, > --Tim > > On Friday, May 06, 2016 12:12:28 PM Adrian Salceanu wrote: > > The only place where I find the "end

Re: [julia-users] Why does julia use END for block end?

2016-05-06 Thread Adrian Salceanu
That's a good point, with the parenthesis it does work as expected in case of an assignment, thanks! vineri, 6 mai 2016, 22:31:42 UTC+2, Yichao Yu a scris: > > On Fri, May 6, 2016 at 3:12 PM, Adrian Salceanu > <adrian@gmail.com > wrote: > > The only place

Re: [julia-users] Why does julia use END for block end?

2016-05-06 Thread Adrian Salceanu
The only place where I find the "end" requirement annoying is for one line IF statements. When you have a short one liner, the "end" part just does not feel right. It would be nice if the "end" could be left out for one liners. Even PHP allows one to skip the accolades in such cases. If

Re: [julia-users] programminjuliahelp

2016-04-01 Thread Adrian Salceanu
Sure, like the Error says, "UndefVarError: x not defined”  Julia does not know what x and y are you talking about when you reference them in the if statement.  You need to declare them and provide their values (or declare them and get the values later from somewhere, input or database):  x =

[julia-users] Re: Almost at 500 packages!

2016-03-30 Thread Adrian Salceanu
6 at 5:55:16 AM UTC-4, Adrian Salceanu wrote: >> >> I begun working on such a tool a few weeks ago. >> >> A) It goes over the METADATA (https://github.com/JuliaLang/METADATA.jl) >> for all the registered packages and then B) uses the GitHub API to get the >>

[julia-users] Re: Almost at 500 packages!

2016-03-30 Thread Adrian Salceanu
I begun working on such a tool a few weeks ago. A) It goes over the METADATA (https://github.com/JuliaLang/METADATA.jl) for all the registered packages and then B) uses the GitHub API to get the README and additional stats (contributions, stars, followers, etc). Planning on C) exposing this

[julia-users] Run julia with -L and pass args to the loaded file

2016-03-11 Thread Adrian Salceanu
Is it possible to use $> julia -L filename.jl --env=test and pass the additional args to the script, rather than to julia? I tried using various combinations, with and without -- but to no avail. -L seems to always gobble everything following it. $> julia -L filename.jl --env=test ERROR:

Re: [julia-users] Parametric types... types?!

2016-03-05 Thread Adrian Salceanu
sâmbătă, 5 martie 2016, 22:59:33 UTC+1, Milan Bouchet-Valat a scris: > > Le samedi 05 mars 2016 à 13:42 -0800, Adrian Salceanu a écrit : > > Gentleman, I stumbled onto this one in my code, and despite trying > > all the possible combinations I could think of, no dice.

[julia-users] Parametric types... types?!

2016-03-05 Thread Adrian Salceanu
Gentleman, I stumbled onto this one in my code, and despite trying all the possible combinations I could think of, no dice. I have this simple type hierarchy: abstract Model type Package <: Model type Repo <: Model The Model type is an ORM and it defines a series of methods that operate on

[julia-users] Re: Globally enable / disable @time execution

2016-02-29 Thread Adrian Salceanu
Thanks Lutfullah - I see, makes sense. It's the hygienic macros, right? Good idea, I'll experiment with macroexpand and the 2 versions of code ;) luni, 29 februarie 2016, 12:37:03 UTC+1, Lutfullah Tomak a scris: > > Hi Adrian, I think macros always evaluated in parse time. AFAICT, While a >

[julia-users] Re: Globally enable / disable @time execution

2016-02-29 Thread Adrian Salceanu
If I'm not too cheeky, can you please explain the solution? With Kristoffer's code I was running into an UndefVarError - which is something I usually run into with my macros too. In this scenario, the local variables from the scope where the macro was called are not available to the ??? (macro

[julia-users] Re: Globally enable / disable @time execution

2016-02-28 Thread Adrian Salceanu
Indeed, I was now trying to debug Kristoffer's solution myself, as using the macro was throwing an UndefVarError This works perfectly, many thanks! duminică, 28 februarie 2016, 16:31:31 UTC+1, Toivo Henningsson a scris: > > I think you want to change the first case to > > macro devtime(ex) >

[julia-users] Re: Globally enable / disable @time execution

2016-02-28 Thread Adrian Salceanu
; end > > And then use @devtime instead of @time > > On Sunday, February 28, 2016 at 4:03:23 PM UTC+1, Adrian Salceanu wrote: >> >> I have an application that runs in 2 environments, DEV and PROD. While >> running in DEV I'd like to see @time information for different e

[julia-users] Globally enable / disable @time execution

2016-02-28 Thread Adrian Salceanu
I have an application that runs in 2 environments, DEV and PROD. While running in DEV I'd like to see @time information for different expressions. But not in PROD. Any ideas about how can this be done so that I don't end up littering my code with conditionals, such as: if DEV @time expr

[julia-users] Re: Polymorphic functions definition

2016-02-27 Thread Adrian Salceanu
Thanks, I managed to figure it out by re-re-re-reading the docs. I was suspecting that the answer will be about parametric types. function df_to_m{T<:Jinnie.Jinnie_Model}(df::DataFrames.DataFrame, m::T) # works! sâmbătă, 27 februarie 2016, 09:31:23 UTC+1, Adrian Salceanu a scris: >

[julia-users] Re: Polymorphic functions definition

2016-02-27 Thread Adrian Salceanu
Still not sure though how to go about using the actual types as params, rather than an instance of that type. sâmbătă, 27 februarie 2016, 14:56:47 UTC+1, Adrian Salceanu a scris: > > Thanks, I managed to figure it out by re-re-re-reading the docs. I was > suspecting that t

[julia-users] Re: Polymorphic functions definition

2016-02-27 Thread Adrian Salceanu
ing) but it's unexpected coming from OOP where you get polymorphism out of the box (subtypes can be used instead of the parent type, without needing anything else). sâmbătă, 27 februarie 2016, 09:31:23 UTC+1, Adrian Salceanu a scris: > > Hi, > > I stumbled upon an issue in my code and I can

[julia-users] Polymorphic functions definition

2016-02-27 Thread Adrian Salceanu
Hi, I stumbled upon an issue in my code and I can't quite figure out the behavior. Any hints would be much appreciated, thanks in advance. So, I have a function: function df_to_m(df::DataFrames.DataFrame, m::Jinnie_Model) It iterates over each row of the df DataFrame and instantiates the

Re: [julia-users] Re: How to run a detached command and return execution to the parent script?

2016-01-24 Thread Adrian Salceanu
Cheers! sâmbătă, 23 ianuarie 2016, 19:01:24 UTC+1, Stefan Karpinski a scris: > > Great! I'm glad you got it sorted out. > > On Fri, Jan 22, 2016 at 6:24 PM, Adrian Salceanu <adrian@gmail.com > > wrote: > >> No no, It's perfectly fine, it was my

[julia-users] Re: How to run a detached command and return execution to the parent script?

2016-01-22 Thread Adrian Salceanu
L vineri, 22 ianuarie 2016, 22:06:01 UTC+1, Adrian Salceanu a scris: > > Hi, > > I'm hammering at a web app and I'm trying to setup functionality to > monitor the file system for changes and restart/reload the server > automatically so the changes are picked up (I'm using Mux

[julia-users] How to run a detached command and return execution to the parent script?

2016-01-22 Thread Adrian Salceanu
Hi, I'm hammering at a web app and I'm trying to setup functionality to monitor the file system for changes and restart/reload the server automatically so the changes are picked up (I'm using Mux which uses HttpServer). The approach I have in mind is: 1. have a startup script which is run

[julia-users] Re: How to run a detached command and return execution to the parent script?

2016-01-22 Thread Adrian Salceanu
Oh! The ruby analogy made me think about actually spawning the detached command! Which produced the desired effect! julia> @spawn run(detach(`ping www.google.com`)) vineri, 22 ianuarie 2016, 22:29:27 UTC+1, Adrian Salceanu a scris: > > I guess what I'm looking for is the equivalent

Re: [julia-users] Re: How to run a detached command and return execution to the parent script?

2016-01-22 Thread Adrian Salceanu
ent process, you can use @async: > > > > julia> t = @async (sleep(5); rand()) > > Task (runnable) @0x000112d746a0 > > > > julia> wait(t) > > 0.14543742643271207 > > > > > > On Fri, Jan 22, 2016 at 4:33 PM, Adrian Salceanu <adr

Re: [julia-users] Re: How to run a detached command and return execution to the parent script?

2016-01-22 Thread Adrian Salceanu
" work in the current process, you can use @async: > > julia> t = @async (sleep(5); rand()) > Task (runnable) @0x000112d746a0 > > julia> wait(t) > 0.14543742643271207 > > > On Fri, Jan 22, 2016 at 4:33 PM, Adrian Salceanu <adrian@gmail.com

Re: [julia-users] Re: How to run a detached command and return execution to the parent script?

2016-01-22 Thread Adrian Salceanu
Oh, @async has worked actually! It correctly run the command, but the startup script itself was finishing and exiting immediately after. Thank you very much Stefan and Erik! vineri, 22 ianuarie 2016, 23:26:23 UTC+1, Adrian Salceanu a scris: > > Thanks! > > @async works perfect

Re: [julia-users] Re: How to run a detached command and return execution to the parent script?

2016-01-22 Thread Adrian Salceanu
543742643271207 > > > On Fri, Jan 22, 2016 at 4:33 PM, Adrian Salceanu <adrian@gmail.com > > wrote: > >> Oh! The ruby analogy made me think about actually spawning the detached >> command! Which produced the desired effect! >> >> julia> @spawn run

Re: [julia-users] Re: How to run a detached command and return execution to the parent script?

2016-01-22 Thread Adrian Salceanu
:06:13 UTC+1, Stefan Karpinski a scris: > > The shell works with processes, Julia has tasks where are not the same > thing... > > On Fri, Jan 22, 2016 at 5:49 PM, Adrian Salceanu <adrian@gmail.com > > wrote: > >> The problem seems to that HttpServer can not run

[julia-users] Pipe operator and functions with multiple arguments

2015-12-29 Thread Adrian Salceanu
I'm a bit puzzled by the behavior of the pipe operator when feeding values to functions expecting multiple arguments. Basically it doesn't seem to work at all. Am I missing something? Ex: julia> function show_off(x, y) println(x) println(y) end show_off (generic function

Re: [julia-users] Multiple submodules inside a main module, with each submodule in one file

2015-12-29 Thread Adrian Salceanu
include("fi_2.jl") > end > > $ cat fi_1.jl > module M1 > foo()="I'm foo" > end > > $ cat fi_2.jl > module M2 >foo()="I'm foo too" > end > > $ julia -q > julia> include("fi_0.jl") > M0 >

[julia-users] Multiple submodules inside a main module, with each submodule in one file

2015-12-29 Thread Adrian Salceanu
Hi! I'm trying to figure out how to split a module across multiple files. Or better put, to have multiple submodules inside a main module, with each submodule in one file. However, I always end up with the latest file overwriting the module code previously imported (last submodule overwrites

[julia-users] Re: Pipe operator and functions with multiple arguments

2015-12-29 Thread Adrian Salceanu
links to several other similar discussions at GitHub), since I also just > expected it to work: > > * https://github.com/JuliaLang/julia/pull/14476 > > You can see my solution (and other peoples solutions) there and decide > whether to use it or not yourself. > > > >

Re: [julia-users] Multiple submodules inside a main module, with each submodule in one file

2015-12-29 Thread Adrian Salceanu
> On Tue, Dec 29, 2015 at 5:16 PM, Adrian Salceanu <adrian@gmail.com > > wrote: > >> Thanks Adrian - that's a nice way to do it, much appreciated. >> >> If I'm not wrong, it's similar to what the manual says when it mentions >> mixi

[julia-users] Re: Pipe operator and functions with multiple arguments

2015-12-29 Thread Adrian Salceanu
se it you can put the method definition > in you ~/.juliarc.jl configuration file. > > > > El martes, 29 de diciembre de 2015, 11:02:09 (UTC-6), Adrian Salceanu > escribió: >> >> I'm a bit puzzled by the behavior of the pipe operator when feeding >> value