[julia-users] [ANN] ConnectionPools.jl

2016-04-14 Thread jock . lawrie
Hi all, Introducing ConnectionPools.jl , a package for managing database connection pools. Currently only Redis connections have been tested. I'll add tests for other databases on an as-needed basis. As always, thoughts/criticisms/suggestions

Re: [julia-users] Re: [ANN] LoggedDicts.jl

2016-04-06 Thread jock . lawrie
The existing support for Dict is flexible enough, but point taken - it could be nice. As an example, suppose the Associative of interest is a PriorityQueue. Then we can: using LoggedDicts using Base.Collections ld = LoggedDict("myld", "mydict.log") set!(ld, "pq", PriorityQueue()) set!(ld,

[julia-users] Re: [ANN] LoggedDicts.jl

2016-04-06 Thread jock . lawrie
Do you have any specific use cases in mind? I'd rather keep it simple and add features only when there's a compelling use case. On Thursday, April 7, 2016 at 8:46:33 AM UTC+10, Cedric St-Jean wrote: > > Neat! Could you support Logged{Dict}? Then it would work with any > associative

[julia-users] [ANN] LoggedDicts.jl

2016-04-06 Thread jock . lawrie
Hi there, Introducing LoggedDicts.jl . A LoggedDict is simply a Dict for which every write is logged to a user-defined output. Handy as a light-weight, intra-process data store in applications/scripts that do not require high write frequency

Re: [julia-users] Defining part of a function outside its module

2016-04-02 Thread jock . lawrie
Great, thanks Mauro, most helpful. On Friday, April 1, 2016 at 4:09:30 PM UTC+11, Mauro wrote: > > Maybe like so: > > julia> module Myfunc > export f > f(x) = g(x) * g(x) > function g end >end > > julia> using Myfunc > > julia> f(4) > ERROR:

[julia-users] Defining part of a function outside its module

2016-03-31 Thread jock . lawrie
Hi all, This works: f(x) = g(x) * g(x) g(x) = x + 1 f(2)# 9 That is, f(x) isn't fully defined until g is defined. But if f(x) is in a module it doesn't work: module myfunc export f f(x) = g(x) * g(x) end using myfunc g(x) = x + 1 f(2) # ERROR: UndefVarError: g not defined That is,

Re: [julia-users] Re: Nothing conditional operator

2016-03-20 Thread jock . lawrie
Redis.jl returns nothing when requesting a the value of a key that doesn't exist: using Redis conn = RedisConnection() r = get(conn, "non_existent_key") disconnect(conn) r == nothing# true On Sunday, March 20, 2016 at 1:31:30 AM UTC+11, Milan Bouchet-Valat wrote: > > For now I don't know

[julia-users] Re: Seeking mentors for JuliaWeb Projects for GSoC 2016.

2016-03-15 Thread jock . lawrie
Hi Sarvjeet, To make contact try opening an issue in the JuliaWeb Roadmap. Cheers, Jock On Wednesday, March 16, 2016 at 8:17:32 AM UTC+11, Sarvjeet singh ghotra wrote: > > Hi everyone! > > I am Sarvjeet Singh, a pre-final year B.Tech student at

[julia-users] Re: Sessions in Escher

2016-03-03 Thread jock . lawrie
Hi Leonardo, I'm not an Escher user, but I use SecureSessions.jl when building web apps with plain HttpServer.jl. If this is a little over the top then the source code should be helpful for implementing a simpler scheme. Hope this helps, Jock

[julia-users] Re: How to have many arguments in a Jump.jl nonlinear model?

2016-02-29 Thread jock . lawrie
OK, thanks Miles. I'll head to Optim.jl. Is there an intention to implement this functionality? Suggestion for julia-opt is noted, thanks again. On Tuesday, March 1, 2016 at 12:24:05 PM UTC+11, Miles Lubin wrote: > > There's no syntax for this at the moment, it's a known issue. The problem > is

[julia-users] How to have many arguments in a Jump.jl nonlinear model?

2016-02-29 Thread jock . lawrie
Hi there, I have a nonlinear varargs function f(x...) that I'd like to maximize. That is, the function is defined as follows: function f(x...) # do stuff here result end With a small number of arguments, for example 2, I can write the following and get the correct result:

[julia-users] How to use a variable for filename in @Logging.configure?

2016-01-21 Thread jock . lawrie
Hi all, I am using Logging.jl as follows: @Logging.configure(filename = "path/to/repo/mylogfile.log", level = INFO) This works fine. However I would like to set the log file name as a global variable (const my_log_file = "path/to/repo/mylogfile.log") and then call a script that includes the

Re: [julia-users] Favorite intro tutorials?

2015-12-15 Thread jock . lawrie
1. Learn the basics of syntax quickly in 10 minutes . 2. Depending on your reason for learning Julia, one of: a) Translate an existing script into Julia. Translating Python scripts is particularly instructive because the syntax is similar. b)

[julia-users] ANN: SecureSessions.jl

2015-11-25 Thread jock . lawrie
Hi all, I'm pleased to release a beta version of SecureSessions.jl . It's a first attempt at providing secure sessions for web apps written in Julia. The README describes the functionality, the API and links to some examples. The key message at

[julia-users] Re: Inconsistent behaviour of round()

2015-10-27 Thread jock . lawrie
Great, thanks Lex. The documentation for round is "round x to the nearest integer", which seems to be a mathematical definition that isn't quite equivalent to the IEEE spec. The docs ought to mention rounding to the

[julia-users] Inconsistent behaviour of round()

2015-10-27 Thread jock . lawrie
Hi there, I'm using Julia 0.4.0. round(4.5) gives 4.0, i.e. it rounds down. round(5.5) gives 6.0, i.e. it rounds up. Any ideas why this is the case? Cheers, Jock

[julia-users] Proposed change to HttpServer.handle signature

2015-09-28 Thread jock . lawrie
Hi all, There has been some discussion here about changing the signature of HttpHandler.handle from f(req, res) to f(req). The purpose is to make the functionality of an application clearer. That is, an application is a function that

[julia-users] Serving static files in a Julia web app

2015-03-12 Thread jock . lawrie
Hi all, I am building a bare bones web app https://bitbucket.org/jocklawrie/skeleton-webapp.jl for displaying data with interactive charts. The app currently serves static files from root/static/xxx/filename, where xxx is, for example, css or js. It does this via:

[julia-users] Re: webpy equivalent

2015-03-12 Thread jock . lawrie
Yep, clone it. Also, note the updated README - it gives a crash course in web app development (as I understand it, which may be flawed) aimed at data scientists who have never built a web app before. Hope it helps. On Friday, November 1, 2013 at 3:00:25 AM UTC+11, Jonathan Malmaud wrote:

[julia-users] Re: RFC: JuliaWeb Roadmap + Call for Contributors

2015-03-12 Thread jock . lawrie
Hi Avik, I've updated the README to explain web app development as I understand it (which may be flawed). It is aimed at data scientists who have never built a web app before. It falls short of explicitly explaining the stack APIs but should enable readers to follow what's happening anyway, as

[julia-users] Re: webpy equivalent

2015-03-11 Thread jock . lawrie
Hi Jonathan, Uncanny timing. Here https://bitbucket.org/jocklawrie/skeleton-webapp.jl is an example of Julia working with the Mustache.jl package which I posted just a couple of hours before your post. It works fine but is not nearly as mature as webpy. Hope you find it helpful. Cheers, Jock

[julia-users] Re: RFC: JuliaWeb Roadmap + Call for Contributors

2015-03-11 Thread jock . lawrie
Hi all, Here https://bitbucket.org/jocklawrie/skeleton-webapp.jl is a bare bones application that fetches some data, runs a model and produces some pretty charts. I'll flesh this out over the next few months, including documentation aimed at data scientists (I'm a statistician not a web