Re: [julia-users] Faster sub-strings

2014-06-11 Thread Jacob Quinn
I can't remember what I've read/heard with regards to the String overhaul, but I know there's also been talk about overhauling tuples so they can act like fixed size immutable arrays. Those might be a good candidate for internal string representation, though I imagine there are other

Re: [julia-users] Re: How to create a copy of a function but with less arguments?

2014-06-04 Thread Jacob Quinn
It's still an open issue: https://github.com/JuliaLang/julia/issues/1864, though there have been talks on how to improve. -Jacob On Wed, Jun 4, 2014 at 8:10 AM, Mauro mauro...@runbox.com wrote: Is that a fact? That would be sad, since it would mean that a functional style suffers a

Re: [julia-users] Realistic Medium-Long Term Hopes for Julia Speed vs Fortran

2014-06-03 Thread Jacob Quinn
There was also this PR by Steven Johnson where the use of a macro/meta-programming capabilities allowed for a Julia version that beat out 2 other well-known C implementations (in Matlab and SciPy). This point is crucial to me as I think over a longer-term horizon. Sure performance is king and

Re: [julia-users] A[]: Accessing array with empty index

2014-05-30 Thread Jacob Quinn
a[] is rewritten as `getindex(a)`, which has a definition in array.jl#244 getindex(a::Array) = arrayref(a,1) -Jacob On Fri, May 30, 2014 at 5:05 PM, Carlos Becker carlosbec...@gmail.com wrote: My apologies if this is something that was addressed before, I didn't find it. Why does

Re: [julia-users] MATLAB v. Julia - why different results?

2014-05-29 Thread Jacob Quinn
Weird. I get the same output as Matlab. In [84]: function smooth(Xin,k,s) Xout = zeros(size(Xin,1),1) for z = -s:s Xout = Xout + Xin[:,k+z]*binomial(2*s,s+z) end Xout = Xout/2^(2*s) return Xout end Out [84]: smooth (generic function with 1 method) In [85]: X =

Re: [julia-users] Re: Call for Date/DateTime strings to parse

2014-05-29 Thread Jacob Quinn
: 2014-05-28T16:46:04Z. I'm very much looking forward to the new Dates.jl. Thanks Jacob! On Wednesday, May 28, 2014 10:38:11 AM UTC-4, Jacob Quinn wrote: I'm doing a round of improvements for Date and DateTime parsing/formatting and I'd love to make the test coverage much more robust. I've

[julia-users] Call for Date/DateTime strings to parse

2014-05-28 Thread Jacob Quinn
I'm doing a round of improvements for Date and DateTime parsing/formatting and I'd love to make the test coverage much more robust. I've built the tests around many common cases already, but I'd love to see any more esoteric or possibly tricky cases to make sure the code holds. A great example

[julia-users] Best way to validate a function?

2014-05-27 Thread Jacob Quinn
I'm thinking there's probably a better way to do this. For some date-related stuff, I have a method that needs to take an inclusion function as an argument and I'm wondering what the best way to validate that the user has supplied a correctly formed inclusion function. The requirements are

Re: [julia-users] Best way to validate a function?

2014-05-27 Thread Jacob Quinn
), but there haven't been any attempts to write the necessary code AFAIK On Tue, May 27, 2014 at 6:33 PM, Jacob Quinn karbar...@gmail.com wrote: I'm thinking there's probably a better way to do this. For some date-related stuff, I have a method that needs to take an inclusion function as an argument

Re: [julia-users] Importing Datetime data with microsecond fidelity

2014-05-10 Thread Jacob Quinn
Andre, Sounds like a good solution. As for the new release; the functionality will be possible, meaning you could *create* a DateTime (or Timestamp) with microsecond precision, but as of now, there's no other functionality except perhaps equality and comparison (i.e. no arithmetic, conversions,

Re: [julia-users] Importing Datetime data with microsecond fidelity

2014-05-08 Thread Jacob Quinn
Hey Andre, Unfortunately there's nothing currently that would make this very easy. I'm actually in the middle of a big rewrite of the Datetime.jl package that will, among other things, include the possibility of handling something like this, but it's at least a few weeks away of anything

Re: [julia-users] Need help with DateTime formatting on DataFrame array

2014-05-06 Thread Jacob Quinn
There's actually not much support in Datetime.jl for formatting/parsing DateTimes (just regular Dates). (A rewrite of the package is nearing completion as Dates.jl with much more solid support for formatting/parsing). In this case, I would suggest leveraging Postgres own formatting tools:

Re: [julia-users] Need help with DateTime formatting on DataFrame array

2014-05-06 Thread Jacob Quinn
| 2014-05-05 11:59:52 | On Tuesday, May 6, 2014 6:38:33 PM UTC-7, Jacob Quinn wrote: There's actually not much support in Datetime.jl for formatting/parsing DateTimes (just regular Dates). (A rewrite of the package is nearing completion as Dates.jl with much more solid support

Re: [julia-users] How does one import standard Julia packages

2014-05-02 Thread Jacob Quinn
Check out the chapter about packages: http://docs.julialang.org/en/latest/manual/packages/ You need to install the package first. Pkg.add(Iterators) On Fri, May 2, 2014 at 5:34 PM, John Myles White johnmyleswh...@gmail.comwrote: Iterators isn't in Base. You need to install it through the

Re: [julia-users] How does one import standard Julia packages

2014-05-02 Thread Jacob Quinn
? On Saturday, May 3, 2014 3:34:45 AM UTC+6, Jacob Quinn wrote: Check out the chapter about packages: http://docs. julialang.org/en/latest/manual/packages/ You need to install the package first. Pkg.add(Iterators) On Fri, May 2, 2014 at 5:34 PM, John Myles White johnmyl...@gmail.comwrote: Iterators

Re: [julia-users] Initialize dict of dicts with = syntax

2014-05-01 Thread Jacob Quinn
I've always kind of wanted {} for initializing a Dict, a la Python. Is there really any difference between Any[] and {}? Do we really need {} for Any arrays? I think it would be much easier if square brackets [] were always array-type things, and {} were Dict things. -Jacob On Thu, May 1, 2014

Re: [julia-users] Re: Array/Cell - a useful distinction, or not?

2014-04-30 Thread Jacob Quinn
function frob(x::Array) isleaftype(eltype(x)) || error(Homogeneous array required')? Though, IMO, this is all a non-issue in my experience. Just specifying frob{T:Real}(x::Vector{T}) gets you exactly what you want--the ability to have JIT generate fast, efficient code for a range of types that

Re: [julia-users] Re: Array/Cell - a useful distinction, or not?

2014-04-30 Thread Jacob Quinn
3:46:54 PM UTC+1, Jacob Quinn wrote: function frob(x::Array) isleaftype(eltype(x)) || error(Homogeneous array required')? Though, IMO, this is all a non-issue in my experience. Just specifying frob{T:Real}(x::Vector{T}) gets you exactly what you want--the ability to have JIT generate fast

Re: [julia-users] Re: Array/Cell - a useful distinction, or not?

2014-04-30 Thread Jacob Quinn
: On Wednesday, April 30, 2014 4:51:13 PM UTC+1, Jacob Quinn wrote: I was just trying to share some of my own experience with Julia from having used it for the last two years, not be dismissive or condescending. That this hasn't been a show-stopper for some 300+ packages now, IMO, *is* a valid point

Re: [julia-users] Re: Array/Cell - a useful distinction, or not?

2014-04-29 Thread Jacob Quinn
In my experience, I can think of a single time when having an array of a specific abstract type was useful (how multiple Period arithmetic is handled: https://github.com/karbarcca/Dates.jl/blob/master/src/periods.jl#L88). Almost always, I'm concentrating on making sure Arrays I work with are of a

Re: [julia-users] Re: Array/Cell - a useful distinction, or not?

2014-04-29 Thread Jacob Quinn
Excellent points Tomas. I think this would be particularly helpful for those coming from Java. Perhaps some of your comments could be worked into the manual or FAQ somewhere. -Jacob On Tue, Apr 29, 2014 at 2:43 PM, Tomas Lycken tomas.lyc...@gmail.comwrote: Yet another point of view -

Re: [julia-users] Re: Multiple dispatch, same argument type, different return type

2014-04-20 Thread Jacob Quinn
Stefan's comment was actually very close to my line of thinking in designing Datetime.jl (which needs to be officially deprecated soon). After looking through several other libraries/languages of Date implementations, my conclusion is that most end up using an Interval type vs. using Period

Re: [julia-users] Re: counts([1,2,2,3]) works on MAC but not on WIN64?

2014-04-18 Thread Jacob Quinn
Ah. What's the output of Pkg.status() on both systems then? It may be an issue of different versions of the Stats package (there has also been some package renaming since 0.2, so it may be StatsBase) -Jacob On Fri, Apr 18, 2014 at 10:50 AM, gdeloscampos gdeloscam...@gmail.comwrote:

Re: [julia-users] two vectors , how indexes of second vector assign to first vector ?

2014-04-18 Thread Jacob Quinn
In [414]: a = ['e','c','c','d','a','c','d','a','c','d','d'] Out [414]: 11-element Array{Char,1}: 'e' 'c' 'c' 'd' 'a' 'c' 'd' 'a' 'c' 'd' 'd' In [415]: b = ['e','a','c','b','d'] Out [415]: 5-element Array{Char,1}: 'e' 'a' 'c' 'b' 'd' In [416]: indexin(a,b) Out [416]:

[julia-users] Am I using ord/heappush! right?

2014-04-10 Thread Jacob Quinn
I thought this would work, but it seems that when I insert items in ascending order (and the heap is supposed to be descending), my heap is getting messed up. Is something wrong with my `ord` function? In [448]: matches = (String,Float64)[] Out [448]: 0-element Array{(String,Float64),1} In

[julia-users] Re: Am I using ord/heappush! right?

2014-04-10 Thread Jacob Quinn
I wonder if this has to do with the fact that heappush! assumes heap-order, but isn't taking into account my Reverse ordering in ord? -Jacob On Thursday, April 10, 2014 12:51:19 PM UTC-4, Jacob Quinn wrote: I thought this would work, but it seems that when I insert items in ascending order

Re: [julia-users] Re: complement to findin

2014-04-10 Thread Jacob Quinn
You *could* use setdiff, it depends on what you're working with (e.g. a range of integers) In [24]: a = [1:10] Out [24]: 10-element Array{Int64,1}: 1 2 3 4 5 6 7 8 9 10 In [25]: b = [2,6,9] Out [25]: 3-element Array{Int64,1}: 2 6 9 In [26]: setdiff(1:10,findin(a,b))

Re: [julia-users] Re: Pretty sure Dict (dictionary) is slow

2014-04-01 Thread Jacob Quinn
Actually opening an issue is the best way to make sure this gets addressed: https://github.com/JuliaLang/julia/issues?state=open On Tue, Apr 1, 2014 at 11:44 AM, Freddy Chua freddy...@gmail.com wrote: Alright, these are my timings are disabling gc before disabling gc each for loop takes

Re: [julia-users] Byte Order

2014-03-26 Thread Jacob Quinn
Is this http://docs.julialang.org/en/latest/stdlib/base/#Base.ntoh what you're looking for? On Wed, Mar 26, 2014 at 2:43 PM, Stephen Chisholm sbchish...@gmail.comwrote: Is there currently a way to specify network byte order when calling... ? read(io_stream, Uint16)

Re: [julia-users] Fastest method to create a matrix of random integers

2014-03-24 Thread Jacob Quinn
How about In [186]: @time rand(-1:2:1,1,1); elapsed time: 2.29940616 seconds (80224 bytes allocated) No need for an extra function. This uses a range from -1 to 1 with a step size of 2 so you only get those two numbers. -Jacob On Mon, Mar 24, 2014 at 7:21 PM, David P. Sanders

Re: [julia-users] Re: how to determine a variable is a number

2014-03-23 Thread Jacob Quinn
Yes, sorry, my example should have been In [17]: x = 1 Out [17]: 1 In [18]: typeof(x) : Real Out [18]: true On Sun, Mar 23, 2014 at 9:48 PM, j verzani jverz...@gmail.com wrote: try `isa(x, Type)` On Sunday, March 23, 2014 9:44:55 PM UTC-4, K leo wrote: Use to determine something

Re: [julia-users] Simple speed test

2014-03-22 Thread Jacob Quinn
Yes, please see the big, bold first heading of the Performance Tips section of the manual: http://docs.julialang.org/en/latest/manual/performance-tips/ -Jacob On Sat, Mar 22, 2014 at 5:18 PM, John Myles White johnmyleswh...@gmail.comwrote: Is this in the global scope? -- John On Mar 22,

Re: [julia-users] Re: Not fun

2014-03-21 Thread Jacob Quinn
Thanks to Ivar and Stefan for the great explanations. I think often we hear don't do this, don't do that, but it's great to hear some good anecdotes and reasoning. Also excited to see the improvements in Strings under the hood. -Jacob On Fri, Mar 21, 2014 at 11:37 AM, Stefan Karpinski

Re: [julia-users] Array of images

2014-03-21 Thread Jacob Quinn
Actually, you can create an empty array and append (though in Julia vernacular, it's push!). a = Image[] for image in images push!(a, image) end Or something along those lines. -Jacob On Fri, Mar 21, 2014 at 2:07 PM, Paulo Castro p.oliveira.cas...@gmail.comwrote: Hi, I am starting

Re: [julia-users] Re: The then keyword

2014-03-21 Thread Jacob Quinn
What would return from the statement if it were false? nothing? Like if I use it assigning a variable? I definitely see the attraction as a one liner though. -Jacob On Mar 21, 2014 9:52 PM, Chris Foster chris...@gmail.com wrote: On Sat, Mar 22, 2014 at 9:23 AM, Stefan Karpinski

Re: [julia-users] Re: The then keyword

2014-03-20 Thread Jacob Quinn
I agree. I've never liked python's do_stuff() if i == 1. It's too disconcerting to parse what's going on and then have to backtrack and think about the condition that came afterwards. I've found the i == 1 do_stuff() has become really natural after only using it a few times. -Jacob On Thu, Mar

Re: [julia-users] case sensitivity option

2014-03-19 Thread Jacob Quinn
Mark, If you spend more time with Julia, I think you'll find that case sensitivity actually *helps* in learning the language. Most notably, Julia follows the convention of using proper-cased identifiers for modules and types, while using all lower-case for function/method identifiers. This aids

Re: [julia-users] Re: [First post] What IDE everyone uses?

2014-03-17 Thread Jacob Quinn
Feel free to check out the Sublime-IJulia project to run julia from within Sublime through the IJulia backend. https://github.com/karbarcca/Sublime-IJulia -Jacob On Mon, Mar 17, 2014 at 7:40 AM, THIRUMALA KIRAN thirumala.ki...@gmail.comwrote: I use Sublime Text.

Re: [julia-users] ODBC errors

2014-03-12 Thread Jacob Quinn
Are you using Julia v0.2? (You can check by running versioninfo()). I thought I had updated support for v0.2, but it seems like some other packages are having trouble. Checkouting the master of a package isn't going to work if you don't have an update to date Julia. If possible, I'd really

Re: [julia-users] ODBC errors

2014-03-12 Thread Jacob Quinn
12, 2014 at 12:23 PM, svakSha svak...@gmail.com wrote: Hello Jacob, On Wed, Mar 12, 2014 at 3:18 PM, Jacob Quinn quinn.jac...@gmail.com wrote: Are you using Julia v0.2? (You can check by running versioninfo()). I thought I had updated support for v0.2, but it seems like some other packages

Re: [julia-users] Printing to console the instantiated objects and their type

2014-03-10 Thread Jacob Quinn
whos() will get you started at least. -Jacob On Mon, Mar 10, 2014 at 8:18 PM, Matthew Crews matthewcr...@gmail.comwrote: I've been watching Julia since the Channel 9 video at Lang.NEXT and I've been wanting to jump to develop my algorithms in it for some time but one thing that holds me

Re: [julia-users] The multi-dispach is dispaching me

2014-03-10 Thread Jacob Quinn
Not sure, but my guess would be that C_NULL is not being accepted as a Ptr{Culonglong} or Ptr{Cdouble} since it's type is Ptr{Void} (or Ptr{None}). You can either remove those type annotations or just use Ptr as the type annotation to test this theory. -Jacob On Mon, Mar 10, 2014 at 8:20 PM, J

Re: [julia-users] how to undefine variable in composite types

2014-03-08 Thread Jacob Quinn
Actually, there's a lot of people coming to realize this is one of the smartest *non-features *of Julia. I recently read an interesting answer on quora to the question, What is the worst mistake ever made in computer science and programming that proved to be painful for programmers for years?,

Re: [julia-users] Re: Typo in local variable name not detected

2014-03-07 Thread Jacob Quinn
I could see something like this in https://github.com/astrieanna/TypeCheck.jl, but I don't know about forcing it on everyone. Particularly with the interactive approach to Julia, I'm adding/removing/changing variable names all the time while prototyping code and if there were warnings every time I

Re: [julia-users] Fortran-formatted files

2014-03-07 Thread Jacob Quinn
Have you checked out `readdlm`? It's flexibility has grown over time and serves most of my needs. http://docs.julialang.org/en/latest/stdlib/base/#Base.readdlm -Jacob On Fri, Mar 7, 2014 at 4:17 PM, Gabor g...@szfki.hu wrote: Sorry, I was not clear enough. Of course it is just a simple

Re: [julia-users] Appending information to a file to create a log

2014-03-05 Thread Jacob Quinn
You need to open the file in append mode. See here: http://docs.julialang.org/en/latest/stdlib/base/#Base.open open(file,a) do x writecsv(x,data) end Then write to it, I believe using writecsv or writedlm work fine on open files, but I can't confirm write now; otherwise, you'll need to use

Re: [julia-users] Re: Running a Julia script line by line

2014-03-04 Thread Jacob Quinn
: Plugin_host.exe The program can't start because libgcc_s_seh-1.dll is missing from your computer. Try reinstalling the program to fix the error. Any idea why i might be getting that error? Ps. i'm on a windows 7 machine! On Friday, February 28, 2014 9:00:48 AM UTC-5, Jacob Quinn wrote: Feel free

[julia-users] New `dev` branch in Datetime.jl; Dates module

2014-02-28 Thread Jacob Quinn
While the merging of DateTime functionality into Base is simmering, I've finally got around to making the rewrite more broadly available. You can see the latest DateTime functionality by running: Pkg.add(Datetime) Pkg.checkout(Datetime,dev) include(Pkg.dir() * /Datetime/src/Dates.jl) using

Re: [julia-users] Error: Index not defined issuing simple queries to Amazon Redshift

2014-02-26 Thread Jacob Quinn
Indeed. I've been meaning to try and update this soon. For now, doing Pkg.pin(DataFrames,v0.5) works for me. -Jacob On Wed, Feb 26, 2014 at 7:43 PM, John Myles White johnmyleswh...@gmail.comwrote: ODBC is probably expecting to interact with an older version of DataFrames when Index was

Re: [julia-users] Julia and SQL Server

2014-02-11 Thread Jacob Quinn
Hey Marcia, Feel free to check out the ODBC.jl package, which provides generic ODBC access to all kinds of DBMS (you just need the ODBC driver for your DB). https://github.com/karbarcca/ODBC.jl Happy to help troubleshoot, get things set up. -Jacob On Tue, Feb 11, 2014 at 9:23 AM, Marcia

Re: [julia-users] Sublime-IJulia Official Debut

2014-02-07 Thread Jacob Quinn
Ok, I just pushed changes for this. The behavior, as now noted in the README is: Using Sublime-IJulia * Commands can be entered directly in the IJulia console view, pressing `shift+enter` to execute. * A newline can be entered without executing the command by typing `Enter` for

[julia-users] Sublime-IJulia Official Debut

2014-02-06 Thread Jacob Quinn
I'm grateful for those who have patiently hacked through the platform issues in getting this working, but I think we're finally out of alpha and into beta mode! https://github.com/karbarcca/Sublime-IJulia For those who don't know, this is the official successor to the Sublime-Julia

Re: [julia-users] Re: Functions in degrees

2014-02-04 Thread Jacob Quinn
As someone who doesn't have to work with the functions very often or deal with degrees/radians conversions, I actually have found it convenient to have the sind functions. It saves me time from having to remember what the conversion is or make my code uglier littered with degrees2radians()

Re: [julia-users] Creating Tuples from arrays

2014-01-30 Thread Jacob Quinn
There already is the tuple function, so you don't really need your own. In [7]: tuple([1,2,3]...) Out [7]: (1,2,3) On Thu, Jan 30, 2014 at 10:33 AM, John Myles White johnmyleswh...@gmail.com wrote: Nope, this is the standard way to convert between tuples and arrays. Usually, if you

Re: [julia-users] Matlab versus Julia for loop timing

2014-01-29 Thread Jacob Quinn
Are you wrapping your code in a function? If not, it's going to slow the code down a lot because it's in global scope and variable type checking will be happening all over the place. Check out the performance tips page in the Julia manual for other ideas:

Re: [julia-users] Finalize a Ptr{Void}

2014-01-28 Thread Jacob Quinn
A typealias doesn't get you enough here. (It's really just a nickname for another type). What you need is to create a new type that wraps a Ptr{Void}, type PGconn ptr::Ptr{Void} end On Tue, Jan 28, 2014 at 3:32 AM, Maurizio De Santis desantis.mauri...@gmail.com wrote: Hello, I'm studying

Re: [julia-users] Error: no method display(DataFrame)

2014-01-23 Thread Jacob Quinn
Sounds like this also might be a version issue. Can you confirm what versions of Julia, DataFrames, and ODBC you're using? And just for kicks, what frontend are you using? (e.g. IJulia, terminal, etc) On Thu, Jan 23, 2014 at 11:24 AM, John Myles White johnmyleswh...@gmail.com wrote: Since

[julia-users] Using code_ functions with keyword arguments?

2013-12-20 Thread Jacob Quinn
I couldn't find any documentation on this. How can you check out functions with keyword arguments? -Jacob

[julia-users] Type Parameter Tags, Constructor Generators, and Lazy Loading, oh my!

2013-12-19 Thread Jacob Quinn
I've been playing around with some code that uses abstract types as parameter tags (think Ptr{Void}, Ptr{Int64}, etc.), and more recently using a hierarchy of abstract tag types. The other hurdle in what I'm trying to do is the use of external data files that need to be loaded and used in the

<    1   2   3