[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

[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

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

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] 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] 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] 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()

[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] 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

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] 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

[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] 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

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: 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] 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] 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] 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] 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] 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: 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] 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] 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: 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] 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] 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] 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

[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: 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]:

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: 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: 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] 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] 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] 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] 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] 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,

[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

[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

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

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] 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] 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] 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] what is the deal with !

2014-06-12 Thread Jacob Quinn
It's mentioned here in the Some general notes section, but if you have suggestions of other places it should be mentioned, I'm sure it wouldn't hurt! http://docs.julialang.org/en/latest/stdlib/base/#introduction -Jacob On Thu, Jun 12, 2014 at 9:53 PM, cnbiz850 cnbiz...@gmail.com wrote: Can't

Re: [julia-users] Error in using package

2014-06-15 Thread Jacob Quinn
Looks like there's some kind of package dependency error going on. You're best bet is filing and issue with the package owner: https://github.com/cgroll/TimeData.jl/issues Otherwise, it looks like it's trying to find the DataFrames package. Have you done Pkg.add(DataFrames) using DataFrames

Re: [julia-users] support for '?' suffix on functions that return boolean types.

2014-06-15 Thread Jacob Quinn
Yeah, I feel kind of torn on this on. On the one hand, I've kind of grown used to the `is...` method naming convention and it has nice discoverability properties (tab-completion) and isn't generally too awkward (though double s's are sometimes weird `issubset` `issubtype`, and it took me a while

[julia-users] Re: Type variables acting differently when accessed through an array

2014-06-18 Thread Jacob Quinn
Issue filed: https://github.com/JuliaLang/julia/issues/7302 On Tuesday, June 17, 2014 2:37:59 PM UTC-4, Jack Holland wrote: Does anyone have an explanation for why a type variable (e.g. Uint64) acts differently when accessed in an array (e.g. [Uint64]) than by itself? Here's some sample

Re: [julia-users] Self-referential type array

2014-06-18 Thread Jacob Quinn
obj::Array{SelfRef,0} # The 2nd parameter to Array is the dimension, so you're declaring obj to be a zero-dimensional array; you probably want obj::Array{SelfRef,1} Similarly with: x.obj =Array(x,0) the 1st argument to Array is the *type* of Array you want to create, so this should be

Re: [julia-users] MethodError(getindex,(sqrt,837))

2014-06-18 Thread Jacob Quinn
To call a function, you use parenthesis, not square brackets, so you want sqrt(-3) This however will throw a DomainError, since the argument is negative. You may have to clarify what you're actually after here. -Jacob On Wed, Jun 18, 2014 at 1:14 PM, alex ortin ortina...@gmail.com wrote:

Re: [julia-users] ODBC.jl: Getting connection string syntax back

2014-06-19 Thread Jacob Quinn
Hmmm..I believe there is a way to do this. Would you mind opening an issue about it and I'll put it on my todo list? -Jacob On Thu, Jun 19, 2014 at 12:39 PM, Randy Zwitch randy.zwi...@fuqua.duke.edu wrote: In ODBC.jl, if you call advancedconnect() on Windows with no arguments, it pops up

[julia-users] [Blog Post] A little fun with meta-programming

2014-06-20 Thread Jacob Quinn
Hey all, Thought I needed to jump on the Julia blogging train now that http://www.juliabloggers.com/ is live, so feel free to check out my first post! Blog post: http://quinnj.github.io/2014/06/19/data-structures-as-code-the-joys-of-meta-programming/index.html Hacker News:

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

2014-06-20 Thread Jacob Quinn
Nothing that crazy, but Distributions.jl utilizes some unicode: https://github.com/JuliaStats/Distributions.jl/blob/master/src/univariate/normal.jl On Fri, Jun 20, 2014 at 11:13 AM, Jake Bolewski jakebolew...@gmail.com wrote: Keno fixed a bug in JuliaParser.jl dealing utf8 character sizes.

Re: [julia-users] Re: 100 Julia exercises

2014-06-23 Thread Jacob Quinn
Feel free to check out (and contribute!) to https://github.com/quinnj/Rosetta-Julia. I started it when I first got involved with julia and it's got a fair number of examples and exercises. -Jacob On Jun 23, 2014 5:52 PM, Alireza Nejati alireza@gmail.com wrote: Actually that's not a bad

Re: [julia-users] Question about surprising behavior of zip/using multiple columns in data frame

2014-07-01 Thread Jacob Quinn
You could say test[:start_date] = [datetime(value...) for value in zip(test[:Year], test[:Month], test[:DayofMonth])] Or I think the following is what you were originally after test[:start_date] = [datetime(year,month,day) for (year,month,day) in zip(test[:Year], test[:Month],

Re: [julia-users] Question about surprising behavior of zip/using multiple columns in data frame

2014-07-01 Thread Jacob Quinn
jinx Isaiah :) On Tue, Jul 1, 2014 at 9:51 PM, Isaiah Norton isaiah.nor...@gmail.com wrote: Regarding this: I was somewhat surprised that I had to reference the fields in the tuple by position there are two ways to do it: 1) `value...` will splat the arguments 2)

Re: [julia-users] metaprogramming example

2014-07-07 Thread Jacob Quinn
I'm not sure I quite understand your example (your `i` variable is never used?), but macros just take zero or more expression/symbol arguments and return expressions, so you could easily do. macro orangeaxes() :(*axes[1][:scatter](kx, real([OnePump.λ1(0., momx, np) for momx in kx]), s=15,

Re: [julia-users] metaprogramming example

2014-07-07 Thread Jacob Quinn
` when I define the macro. Any clues why that might be? On Monday, July 7, 2014 3:40:58 PM UTC+2, Jacob Quinn wrote: I'm not sure I quite understand your example (your `i` variable is never used?), but macros just take zero or more expression/symbol arguments and return expressions, so you

Re: [julia-users] Re: Need help on Sublime-IJulia install on Windows, Julia 0.3.0-prerelease

2014-07-11 Thread Jacob Quinn
Sorry for not responding earlier, I've been pretty tied up this week. Glad you got it figured out! The two main things I've discovered with this problem is some kind of incompatibility between stdc++.dll's (what ZMQ expects, and what Sublime uses? Or what Sublime uses and what Juila uses?), or

Re: [julia-users] Append! resulting in #undef elements. Intended behavior?

2014-07-17 Thread Jacob Quinn
Hi Jan, You have your syntax a little mixed up. The usage of: Type[] actually declares an empty array with element type of `Type`. So you're first line: x = Array[] is actually creating an array of arrays. Likewise, you're seeing the error in Array[1] Because you're trying to put an Int[1]

Re: [julia-users] numpy equivalent functionality

2014-07-23 Thread Jacob Quinn
Check out `clamp` for your second question: http://docs.julialang.org/en/latest/stdlib/base/#Base.clamp On Wed, Jul 23, 2014 at 10:07 AM, Andrei Berceanu andreiberce...@gmail.com wrote: Hi guys, I have 2 short numpy-related questions. In numpy, if one can invert an arbitrary array *arr*

Re: [julia-users] Re: Help needed, running slow

2014-07-23 Thread Jacob Quinn
There's https://github.com/JuliaLang/julia/issues/524 https://github.com/JuliaLang/julia/issues/964 And Jeff has mentioned it in his compiler list: https://github.com/JuliaLang/julia/issues/3440 -Jacob On Wed, Jul 23, 2014 at 1:18 PM, Kevin Squire kevin.squ...@gmail.com wrote: On Wed, Jul

Re: [julia-users] @test_approx_eq results in stack overflow for custom immutable type

2014-07-23 Thread Jacob Quinn
Very close! There were actually some changes recently to hashing in general that make it a bit easier to get this working (although undocumented https://github.com/JuliaLang/julia/issues/6833, *cough*, Stefan Karpinski, *cough*). Here are the only changes I made to get `@test_approx_eq` working:

Re: [julia-users] Re: @test_approx_eq results in stack overflow for custom immutable type

2014-07-23 Thread Jacob Quinn
I think what would really be helpful here are explicit interfaces. There's an open issue about it: https://github.com/JuliaLang/julia/issues/6975 In a world with interfaces, you would have been told at some point (either inheriting from number or calling certain methods), that your type was

Re: [julia-users] confusion about Date comprehension types

2014-07-24 Thread Jacob Quinn
Odd that this wouldn't get the right type automatically, but I've fixed this in Dates.jl. If you have already added the Dates.jl package, you can just do a Pkg.update() to get the changes. -Jacob On Thu, Jul 24, 2014 at 6:45 PM, cnbiz850 cnbiz...@gmail.com wrote: I tested 2 ways of

Re: [julia-users] string array concatenates with a string not working?

2014-07-24 Thread Jacob Quinn
* only concatenates two Strings, here you have an Array of strings and a string. You could call join() on your array first or use push!(VA,T) if you want to add an element to the VA array. -Jacob On Jul 24, 2014 11:14 PM, cnbiz850 cnbiz...@gmail.com wrote: julia VA 3-element

Re: [julia-users] Semi-OT: Finding optimal k in k-means

2014-07-28 Thread Jacob Quinn
This probably isn't very helpful currently, but I've been meaning to try to do a `kd-tree` implementation that allows for fast clustering for up to 7-10 dimensions. (there's also ad-trees for categorical data that has even better performance gains over traditional algorithms).

Re: [julia-users] Numerical types and machine word size

2014-07-29 Thread Jacob Quinn
See answers to the same question here: https://groups.google.com/forum/#!searchin/julia-users/Float$20Float32$20Float$2064/julia-users/1tDvMbfCUEE/BJCu0-S7OawJ On Tue, Jul 29, 2014 at 11:19 AM, Júlio Hoffimann julio.hoffim...@gmail.com wrote: Dear all, By reading the docs, Int is an alias

Re: [julia-users] Roadmap for 0.4?

2014-07-29 Thread Jacob Quinn
You can also take a look at specific github issues that have been marked 0.4: https://github.com/JuliaLang/julia/milestones/0.4 It may take another trip to Boston, but I'm also pulling for the Dates module in 0.4! -Jacob On Tue, Jul 29, 2014 at 12:51 PM, John Myles White

Re: [julia-users] Re: What's new in Julia 3.0?

2014-08-02 Thread Jacob Quinn
Do note that the imminent release is **0.3**, not *3.0*. There's been a little confusion around about Julia's versioning, so just thought I'd clarify. On Fri, Aug 1, 2014 at 8:35 AM, Daniel Carrera dcarr...@gmail.com wrote: Thanks! On 1 August 2014 14:04, Ivar Nesje iva...@gmail.com wrote:

[julia-users] [ANN] SuffixArrays.jl

2014-08-02 Thread Jacob Quinn
Hey all, I finally got around to playing around with a suffix array implementation and wanted to share. It's a pure julia port of sais https://sites.google.com/site/yuta256/sais, by Yuta Mori and while not the bleeding edge fastest suffix array sorting algorithm out there, I personally think

Re: [julia-users] why no abstract 'set' type?

2014-08-02 Thread Jacob Quinn
See https://github.com/JuliaLang/julia/issues/5533 On Aug 2, 2014 9:51 PM, vava...@uwaterloo.ca wrote: Dear Julia Colleagues, I'm writing a balanced-tree library in Julia. Balanced trees can be used to implement a sort-order dictionary, which is a particular implementation of the

Re: [julia-users] export within a macro

2014-08-11 Thread Jacob Quinn
I think you just need to remove the eval() from your macro. Macros should always return Expr (expression) objects, and not be in the business of eval-ing things. -Jacob On Mon, Aug 11, 2014 at 7:16 AM, Philippe Maincon philippe.main...@gmail.com wrote: Hi, Within a module, I am defining a

[julia-users] JuliaCon Opening Session Videos Posted!

2014-08-11 Thread Jacob Quinn
Hey all, Gather round and here the tales of a wonderous new language, presented by Tim Holy https://www.youtube.com/watch?v=FA-1B_amwt8list=PLP8iPy9hna6TSRouJfvobfxkZFYiPSvPdindex=1, Pontus Stenetrop https://www.youtube.com/watch?v=OrFxjE44COclist=PLP8iPy9hna6TSRouJfvobfxkZFYiPSvPdindex=2,

Re: [julia-users] Re: JuliaCon Opening Session Videos Posted!

2014-08-11 Thread Jacob Quinn
the story. On Aug 11, 2014, at 8:59 AM, Johan Sigfrids johan.sigfr...@gmail.com wrote: Yay! I've been eagerly awaiting these. On Monday, August 11, 2014 2:53:18 PM UTC+3, Jacob Quinn wrote: Hey all, Gather round and here the tales of a wonderous new language, presented by Tim Holy

Re: [julia-users] How to find the indices of the unique rows in a matrix

2014-08-11 Thread Jacob Quinn
There's an open issue about it here: https://github.com/JuliaLang/julia/issues/1845 I've also played around with a simple version based on a Set: function uniqueind(C) out = Int[] seen = Set{eltype(C)}() for i = 1:length(C) @inbounds x = C[i] if !in(x, seen)

Re: [julia-users] JuliaCon Opening Session Videos Posted!

2014-08-12 Thread Jacob Quinn
. On 11 August 2014 20:53, Jacob Quinn karbar...@gmail.com wrote: Gather round and here the tales of a wonderous new language, presented by Tim Holy, Pontus Stenetrop, and Arch Robison. Just to nip this one in the bud, it is Stenetorp, not Stenetrop or Sterntorp [1] (I like the last one

Re: [julia-users] Create matrix from a comprehension with row/col-returning function?

2014-08-13 Thread Jacob Quinn
It is possible to create matrices from comprehensions directly: In [4]: [i+j for i=0:1, j=1:2] Out [4]: 2x2 Array{Int64,2}: 1 2 2 3 Otherwise, in your case: In [10]: [f()[i] for i=1:2, j = 1:3] Out [10]: 2x3 Array{Float64,2}: 3.0 3.0 3.0 5.0 5.0 5.0 But that calls `f()` on every

Re: [julia-users] Create matrix from a comprehension with row/col-returning function?

2014-08-13 Thread Jacob Quinn
Ah, I see. Yeah, at least I'm not aware of how to do that with a comprehension. You can unroll what a comprehension does and do it like: z = zeros(3,2) for i = 1:3 z[i,:] = f() end It seems like it would be convenient to support syntax like: [f()... for i = 1:3] but you might need a way

Re: [julia-users] JuliaCon Opening Session Videos Posted!

2014-08-14 Thread Jacob Quinn
The videos for the Optimization Session from JuliaCon 2014 have been posted. Enjoy! http://julialang.org/blog/2014/08/juliacon-opt-session/ -Jacob On Tue, Aug 12, 2014 at 7:01 AM, Jacob Quinn quinn.jac...@gmail.com wrote: Yes, very sorry Pontus. Luckily I used your trick for the youtube

Re: [julia-users] From array of Char to String

2014-08-19 Thread Jacob Quinn
Try join() On Tue, Aug 19, 2014 at 8:04 AM, Ning Yin yin@gmail.com wrote: Hi Julia users, I was trying to convert an array of char's to string, and I've noticed functions such as string or CharString, but non of these seem to work for my case: Julia console: == julia a

Re: [julia-users] What's new in 0.3?

2014-08-25 Thread Jacob Quinn
See this issue: https://github.com/JuliaLang/julia/issues/7867 and the discussion in https://github.com/JuliaLang/julia/issues/5778 for information on the change. -Jacob On Sat, Aug 23, 2014 at 9:02 AM, Ed Scheinerman edward.scheiner...@gmail.com wrote: Is there a document describing new

Re: [julia-users] Re: Can this magic square function be further optimized?

2014-08-26 Thread Jacob Quinn
I know numpy has multi-threading in a bunch of their vectorized functions. On Tue, Aug 26, 2014 at 11:46 AM, Iain Dunning iaindunn...@gmail.com wrote: Is it possible that PyPy is multithreading something? I struggle to believe its so much faster - although I'd believe it if it was about the

Re: [julia-users] Could not spawn `start /min python -c print('test')`

2014-08-26 Thread Jacob Quinn
Daniel, You can get it to work by running run(`cmd /c start /min ipython`) For any command I've wanted to run, I always just prefix it with cmd /c to get the behavior of the command line. -Jacob On Tue, Aug 26, 2014 at 4:09 PM, Daniel Høegh dhoeg...@gmail.com wrote: It just feel very

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

2014-09-05 Thread Jacob Quinn
wasn't the right thing to do... I don't think I'd say that. It's essentially what Pkg.publish() is doing underneath anyway (or tries to do). The steps he listed are actually how I bump packages all the time, since I've had troubles with Pkg.publish() as well. -Jacob On Fri, Sep 5, 2014 at 9:36

  1   2   3   >