Re: [julia-users] Very Odd Enum Behavior

2016-10-03 Thread Jacob Quinn
Because Suit is the **first** field to Card? i.e. you need push!(deck, Card(Suit(s), n)) -Jacob On Mon, Oct 3, 2016 at 9:55 PM, wrote: > Ran into this while writing a simple, contrived example for a tutorial. > Still working on it but I am baffled. Can anyone tell me why this is > happ

Re: [julia-users] Filtering DataFrame with a function

2016-10-12 Thread Jacob Quinn
I think the Julia ecosystem is evolving tremendously in this respect. I think originally, there were a lot of these "mammoth" packages that tried to provide everything and the kitchen sink. Unfortunately, this has led to package bloat, package inefficiencies in terms of load times and installation,

Re: [julia-users] Using SQLBulkOperations in ODBC.jl

2016-10-26 Thread Jacob Quinn
As long as your DB table is created correctly (i.e. correct types), you can do ODBC.load(dsn, "table_name", df) More docs here: http://juliadb.github.io/ODBC.jl/stable/#ODBC.load-1 On Wed, Oct 26, 2016 at 9:49 AM, Terry Seaward wrote: > Hi, > > How could one use the SQLBulkOperations functio

[julia-users] [ANN] DataStreams v0.1: Blog post + Package Release Notes

2016-10-27 Thread Jacob Quinn
Hey everyone, Just wanted to put out the announcement of the release of DataStreams v0.1. (it was actually tagged a few weeks ago, but I've been letting a few last things shake out before announcing). I've written up a blog post on the updates and release here: http://quinnj.github.io/datastre

Re: [julia-users] Question: Forcing readtable to create string type on import

2016-10-31 Thread Jacob Quinn
You could use CSV.jl: http://juliadata.github.io/CSV.jl/stable/ In this case, you'd do: df1 = CSV.read(file1; types=Dict(1=>String)) # assuming your account number is column # 1 df2 = CSV.read(file2; types=Dict(1=>String)) -Jacob On Mon, Oct 31, 2016 at 12:50 PM, LeAnthony Mathews wrote: > U

Re: [julia-users] Question: Forcing readtable to create string type on import

2016-11-03 Thread Jacob Quinn
LeAnthony, I'm wondering if you're on an old version of DataFrames? There haven't been any issues "show"-ing DataFrames with NullableArray columns for quite some time. You can check (and post back here) your current package versions by doing: Pkg.installed() You can also ensure you're on the lat

Re: [julia-users] Usage of @inbounds

2015-01-20 Thread Jacob Quinn
That all seems correct to me. -Jacob On Tue, Jan 20, 2015 at 9:36 AM, Nils Gudat wrote: > Just a quick clarification on the @inbounds macro: I've seen it used both > before and inside loops, like: > > @inbounds for i = 1:1000 > a = x[i] > b = z[i] > end > > inbounds for i = 1:1000 > @inbo

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

2015-01-22 Thread Jacob Quinn
Great points Ista. I think the main motivation in emulating CRAN is with respect to overall volume of functionality, but your points about too many overlapping or half-baked packages strike home as a former (and still occasional) R user. I think the efforts in the Julia package repository, METADAT

Re: [julia-users] benchmark with Julia 2x faster than C

2015-01-27 Thread Jacob Quinn
I'm not sure about using the `time()` function in the julia code. I believe it's resolution is system dependent, but microseconds at best. I think it's more common to use the `tic()` and `toq()` that use `time_ns()` internally for nanosecond resolution. Though you probably did that for easier C com

Re: [julia-users] Utility / purpose of Pair() in 0.4?

2015-02-04 Thread Jacob Quinn
Actually, Pairs *are* type specialized, as can be seen by their definition. # Pair immutable Pair{A,B} first::A second::B end const => = Pair Notice the {A,B} type parameters. The second `const => = Pair` in combination with `=>` being infix, allows for convenient Dict construction by

Re: [julia-users] Inconvenient DateTime construction?

2015-02-04 Thread Jacob Quinn
Yeah, this has come up a few times, so we should probably provide a better interface in the conversion functions ( http://julia.readthedocs.org/en/latest/stdlib/dates/#conversion-functions) Currently, you can do DateTime(Dates.UTM(6352421760)) to get what you want. -Jacob On Wed, Feb 4, 20

Re: [julia-users] Performance of DateTime?

2015-02-04 Thread Jacob Quinn
Hey Seth, I should probably add a little documentation on this, but you're basically going to want to take the same approach as the vectorized DateTime parsing function (see here: http://goo.gl/0z6jI8). Basically, you can create a `DateFormat` object once, and pass that to the `DateTime` function

Re: [julia-users] lines of code vs speed plot

2015-02-07 Thread Jacob Quinn
Was is the graph I posted? It compares several of the "Great Computer Shootout" benchmarks amongst top languages. On Sat, Feb 7, 2015 at 12:31 PM, Andreas Noack wrote: > Simon Danisch in > https://groups.google.com/forum/#!topic/julia-users/BYRAeQJuvTw > > 2015-02-07 14:26 GMT-05:00 Stefan Kar

Re: [julia-users] Performance of DateTime?

2015-02-07 Thread Jacob Quinn
Great to hear about the performance gains. I tried to push as much of the "parsing" work into the actual creation of the DateFormat object for this purpose. The vectorized versions use this performance trick, but like I said, I probably need to add a little documentation for cases like this. -Jaco

Re: [julia-users] Performance of DateTime?

2015-02-07 Thread Jacob Quinn
Docs added: https://github.com/JuliaLang/julia/commit/15c739ccbae9d7b42a876655df249607d500537f On Sat, Feb 7, 2015 at 8:45 PM, Jacob Quinn wrote: > Great to hear about the performance gains. I tried to push as much of the > "parsing" work into the actual creation of the DateF

Re: [julia-users] isa should be user friendlier

2015-02-17 Thread Jacob Quinn
That's because the typeof(Float32) == DataType, so isa(Float32,DataType) == true. On Tue, Feb 17, 2015 at 11:48 AM, J Luis wrote: > > > In this particular use case, you can use isa(eltype(x), Float32), which >> will work for both scalars and arrays. >> > > Checked it now and it would be good but

Re: [julia-users] How to prevent SQL injection in Julia?

2015-02-19 Thread Jacob Quinn
Those are great questions/ideas. I've been meaning to implement prepared statements for a while now, so I should probably just hunker down and do it as it's not that difficult. Having an escape function of sorts would be interesting as well. Feel free to open an issue on the repo and we can push th

Re: [julia-users] Preferred Julian equivalent of C enums?

2015-03-01 Thread Jacob Quinn
It's only about 100 LOC, so that's probably a good idea. The code has been tweaked a little here and there, so we may want to wait a bit until it settles a little more. -Jacob On Sun, Mar 1, 2015 at 9:06 AM, Uwe Fechner wrote: > Is there a way to use the new @enum macro in Julia 0.3 projects? >

Re: [julia-users] Printing of returned tuples in REPL

2015-03-03 Thread Jacob Quinn
It's actually https://github.com/JuliaLang/julia/issues/7434, a known LLVM issue. On Tue, Mar 3, 2015 at 7:49 AM, Kristoffer Carlsson wrote: > If you create a function that returns a tuple the printed output to the > REPL is wrong. > > julia> function foo() >return (1, 2, 3, 4) >

Re: [julia-users] Re: Any way to constrain a Function type by argument types?

2015-03-03 Thread Jacob Quinn
Not a way to do it currently, but it's been brought up before and there's even a recent PR: https://github.com/JuliaLang/julia/pull/10269 -Jacob On Tue, Mar 3, 2015 at 7:56 PM, Zenna Tavares wrote: > Not directly with the type system. > > It's a bit tricky conceptually because of the multiple d

Re: [julia-users] Dictionary prerformance

2015-03-09 Thread Jacob Quinn
http://docs.julialang.org/en/latest/stdlib/collections/#Base.sizehint! On Mon, Mar 9, 2015 at 7:34 PM, Dejan Miljkovic wrote: > I would like to initialize dictionary (String/String) with 4 million > key/value pairs. Insert performance varies dramatically. Fast first 200k > than slow around 300k.

Re: [julia-users] How can I convert a set to an array?

2015-03-11 Thread Jacob Quinn
a = IntSet([1,2,3]) a = [a...] On Wed, Mar 11, 2015 at 9:35 AM, Ali Rezaee wrote: > In Python I would do > > a = set([1,2]) > a = list(a) > > How can I do that in Julia? > > Thanks a lot in advance for your help >

Re: [julia-users] Time type

2015-03-13 Thread Jacob Quinn
There isn't, mainly because there hasn't seem to be much demand/use for it (plus the ever constrained dev effort required). I'm pretty sure I mocked something up at one point, but don't know if I have any code still lying around. Happy to help push this if there's enough interest. -Jacob On Fri,

Re: [julia-users] Time type

2015-03-13 Thread Jacob Quinn
values… I could certainly just format them as >> strings for now, I guess… I myself don’t have a use for it, I just want to >> make sure the package does something meaningful if it comes across a file >> with such a cell. >> >> >> >> *From:* julia-users@googl

Re: [julia-users] load a Julia dataframe from Microsoft SQL Server table

2015-03-17 Thread Jacob Quinn
Check out the https://github.com/quinnj/ODBC.jl package for connecting to DSN defined in your ODBC manager. On Tue, Mar 17, 2015 at 1:17 PM, Charles Brauer wrote: > Hi, > > I'm considering diving into Julia. However, all of my data is in a > Microsoft SQL Server database. > I would really apprec

Re: [julia-users] Re: Time type

2015-03-18 Thread Jacob Quinn
Here's 50 lines that implement the bulk of the functionality. Might be worth just throwing this in Base since it's so simple. (this is 0.4 compatible, you'll want to do just `using Dates` for 0.3) using Base.Dates immutable Time value::Millisecond end MS(x) = Millisecond(x) value(x::Time)

Re: [julia-users] Re: Some simple use cases for multi-threading

2015-03-18 Thread Jacob Quinn
+1 to Mike's suggestion. I've looked into incorporating his auto-complete functionality into Sublime-IJulia, but the lag/locking up is a deal killer. On Wed, Mar 18, 2015 at 4:35 PM, Mike Innes wrote: > In eval clients like Juno autocomplete locks up while evaluating, so > that's something I'm l

Re: [julia-users] Juno/Julia ODBC problem

2015-03-20 Thread Jacob Quinn
You might try using the `ODBC.advancedconnect()` function. It will typically pop up with a window to put the info in. On Fri, Mar 20, 2015 at 6:13 PM, Charles Brauer wrote: > Hello, > > I'm a new user trying to run Julia under the Juno IDE. > My environment is Windows 8.1 (x64) and Microsoft SQL

Re: [julia-users] list of keyword arguments

2015-03-24 Thread Jacob Quinn
There's an open issue: https://github.com/JuliaLang/julia/issues/2758 Feel free to voice your support for a fix! Squeaky issues get the grease. :) -Jacob On Tue, Mar 24, 2015 at 4:49 PM, Pooya wrote: > Is there a way to get a list of keyword arguments using the function name? > It does not sho

Re: [julia-users] Can Julia Import SAS Datasets or SAS Transport Files ?

2015-03-27 Thread Jacob Quinn
I used [this](http://support.sas.com/downloads/package.htm?pid=667) last fall when I needed to convert some SAS files. It's Windows only, but got the job done. On Fri, Mar 27, 2015 at 2:53 PM, jorttx wrote: > Is anyone working on the ability for Julia to import SAS datasets > (*.sas7bdat files)

[julia-users] Efficient Data Transfer via HTTPS

2015-03-29 Thread Jacob Quinn
So I'm building a program that does the following: * Have data stored either in a file (CSV or gzipped CSV) or a Julia structure (Array{T,2}, or other structures that support getindex(A,i,j)) * Need to do a POST request over HTTPS with "Content-Type: text/csv", and ideally always as "Content-Enc

Re: [julia-users] Julia stuck at large floating point number array from source code

2015-04-13 Thread Jacob Quinn
Can you share the script? It's hard to troubleshoot this kind of problem without seeing exactly what you're running. On Mon, Apr 13, 2015 at 9:37 PM, Siyi Deng wrote: > No, I'm copy and pasting the array, from a text editor to the REPL, and it > hangs there. > > On Monday, April 13, 2015 at 7:53

Re: [julia-users] Re: Naming convention

2015-04-27 Thread Jacob Quinn
Official Julia issue to deprecate *, ^: https://github.com/JuliaLang/julia/issues/11030 On Mon, Apr 27, 2015 at 10:19 AM, François Fayard wrote: > So let's forget about ~ as it is already used by DataFrames which is a > very important package. > > I just found that the project Coq is using ++ fo

Re: [julia-users] readtable produce wrong column name

2015-04-30 Thread Jacob Quinn
DataFrame column names must be valid Julia identifiers, so readtable does the conversion when reading data in. -Jacob On Thu, Apr 30, 2015 at 12:43 PM, Li Zhang wrote: > hi all, > > I first use writetable to write a dataframe to a csv file. some of the > column names are "(somename)", or "name

Re: [julia-users] Get GMT time

2015-05-04 Thread Jacob Quinn
Yeah, the second one is a little obscure, because of a couple of issues. -`UTC` isn't exported from the Dates module, so you'll have to use `Dates.UTC` -`UTC` is a *type* instead of a instance of a type, (that's what the ::Type{UTC} means) So the correct way to call this is now(Dates.UTC) On Mo

Re: [julia-users] Julia Web Development "Morsel" Package

2015-05-04 Thread Jacob Quinn
Might be GnuTLS.jl, on which Requests has a dependency on and loads a C library. On Mon, May 4, 2015 at 12:39 PM, George Thomas wrote: > Hi - > I get a server segmentation fault immediately as I connect to the server > via URL `localhost:8000/hello/name/` from a browser (firefox or chrome). I >

Re: [julia-users] Panel Data using DataFrame (or other method?)

2015-05-05 Thread Jacob Quinn
Remember, the world is your oyster! Take a stab at creating a package and sharing it! I'm sure you'd get some interest/feedback. -Jacob On Tue, May 5, 2015 at 10:53 AM, Nils Gudat wrote: > Hm, that's a shame - I was hoping for something better than pandas' panel > implementation in Julia, as I'

Re: [julia-users] storing @time

2015-05-07 Thread Jacob Quinn
http://docs.julialang.org/en/latest/stdlib/base/#Base.tic On Thu, May 7, 2015 at 1:00 PM, Edward Chen wrote: > To whom it may concern: > > I am interested in testing the performance of my code. > > I am familiar with using @elapsed in the following way: > > metric = Float64[] > push!(metric,@ela

Re: [julia-users] `include()` vs `require()`

2015-05-08 Thread Jacob Quinn
Also see the issue logged here: https://github.com/JuliaLang/julia/issues/8000 On Fri, May 8, 2015 at 2:19 PM, Stefan Karpinski wrote: > help?> reload > search: reload prevfloat parsefloat > > Base.reload(file::AbstractString) > >Like "require", except forces loading of files regardless of >

Re: [julia-users] how do we convert an array{Float64,1} in a Float64?

2015-05-15 Thread Jacob Quinn
You'll have to clarify what you're looking for; it's not really clear from your brief description. Perhaps sharing the code you're working with would be easier? -Jacob On Fri, May 15, 2015 at 3:18 PM, Lytu wrote: > Someone know how to convert an array{Float64,1} in a Float64? > Thank you >

Re: [julia-users] Best way in Julia to build a set of unique values?

2015-05-18 Thread Jacob Quinn
You could also take a look at JudyDicts.jl, which wrap the corresponding C library. Supposedly, it's one of the most highly optimized Dict implementations anywhere. I think the Julia package may need an update, however. https://github.com/tanmaykm/JudyDicts.jl -Jacob On Mon, May 18, 2015 at 4:07

Re: [julia-users] SharedArray definition and assignation of values. Is this behavior a bug?

2015-05-18 Thread Jacob Quinn
I'm actually just about to do another round of windows testing on #11280, so I'll test this out as well. Thanks for the report! -Jacob On Mon, May 18, 2015 at 6:27 PM, Sebastian Souyris < sebastian.souy...@gmail.com> wrote: > It seems that there is a bug when you define several SharedArray in on

Re: [julia-users] SharedArray definition and assignation of values. Is this behavior a bug?

2015-05-18 Thread Jacob Quinn
I'm not able to reproduce the above behavior with my latest changes to #11280, so that's a good sign! If you're feeling ambitious/able, feel free to give that PR a spin to see if it fixes it for you as well. -Jacob On Mon, May 18, 2015 at 8:55 PM, Jacob Quinn wrote: > I

Re: [julia-users] DataFrames' readtable very slow compared to R's read.csv when loading ~7.6M csv rows

2015-06-01 Thread Jacob Quinn
I've been meaning to clean some things up and properly release the functionality, but I have a new way to read in CSV files that beats anything else out there that I know of. To get the functionality, you'll need to be running 0.4 master, then do Pkg.add("SQLite") Pkg.checkout("SQLite","jq/updates

Re: [julia-users] DataFrames' readtable very slow compared to R's read.csv when loading ~7.6M csv rows

2015-06-01 Thread Jacob Quinn
rhead from DataFrames is not much. > > Thank you again! > > On Monday, June 1, 2015 at 1:06:50 PM UTC-4, Jacob Quinn wrote: >> >> I've been meaning to clean some things up and properly release the >> functionality, but I have a new way to read in CSV files that be

Re: [julia-users] IJulia: Swap shift-enter for enter?

2015-06-03 Thread Jacob Quinn
If you go into the "IJulia" package in your Sublime packages directory (there's a menu item to "Browse Packages", you'll fine keymapping files for each platform. Just find the one that says "shift+enter" and change it to "enter" and save. Done. -Jacob On Wed, Jun 3, 2015 at 12:56 AM, RecentConve

Re: [julia-users] DataFrames' readtable very slow compared to R's read.csv when loading ~7.6M csv rows

2015-06-05 Thread Jacob Quinn
lude, say, a bunch of delimiters. That is, what sort of parsing *does* > SQLite do, and when? > > On Monday, June 1, 2015 at 1:48:16 PM UTC-4, Jacob Quinn wrote: >> >> The biggest single advantage SQLite has is the ability to mmap a file and >> just tell SQLite which poin

Re: [julia-users] subtracting two uint8's results in a Uint64?

2015-06-17 Thread Jacob Quinn
This has been changed on 0.4. https://github.com/JuliaLang/julia/issues/3759 -Jacob On Wed, Jun 17, 2015 at 4:33 PM, Phil Tomson wrote: > Maybe this is expected, but it was a bit of a surprise to me: > > julia> function foo() > red::Uint8 = 0x33 > blue::Uint8 = 0x36

[julia-users] JuliaCon Hacking

2015-06-26 Thread Jacob Quinn
A few of us are hacking tonight at the Hyatt Regency hotel for JuliaCon. We're on the 2nd floor at the end of the hall in the "Aquarium" room if anyone wants to join us. -Jacob

Re: [julia-users] JuliaCon Hacking

2015-06-26 Thread Jacob Quinn
They actually just kicked us out for the night, so we're calling it a night. Looking forward to some more hacking tomorrow! -Jacob On Sat, Jun 27, 2015 at 1:11 AM, Scott Jones wrote: > Are you all still up hacking?

Re: [julia-users] how to determine if a particular method signature defined

2015-07-06 Thread Jacob Quinn
http://docs.julialang.org/en/latest/stdlib/base/#Base.applicable On Mon, Jul 6, 2015 at 11:25 AM, Simon Byrne wrote: > If I have a generic method foo, is there a way I can tell if a particular > signature has been defined? > > Note that I don't want method_exists (which simply determines if some

Re: [julia-users] Help to eliminate Calendar.jl dependence

2015-07-08 Thread Jacob Quinn
TimeZones.jl isn't quite ready for public consumption yet (enough public clamor will eventually get me to fix it up). How about the following? function calcSecondsEpochToMidnight(secondsSinceEpoch::Integer) utc = DateTime(Date(Dates.unix2datetime(secondsSinceEpoch))) adjustment = Dates.Se

Re: [julia-users] Re: Help to eliminate Calendar.jl dependence

2015-07-10 Thread Jacob Quinn
On Fri, Jul 10, 2015 at 8:11 AM, Tom Breloff wrote: > as Tom, Yes, the method I proposed won't work retroactively since the method for getting the current local offset from GMT is `now() - now(Dates.UTC)`. If you were to run that every second crossing over the daylight savings moment, you'd se

Re: [julia-users] Re: Too many packages?

2015-07-13 Thread Jacob Quinn
Note there's also an open issue for requiring a higher overall standard for officially registered packages in the JuliaLang/METADATA.jl package repository. It's a big issue with a lot of work required to get to the proposal, but it would lead to (hopefully) instilling more confidence in users knowi

Re: [julia-users] Re: MongoDB and Julia

2015-07-13 Thread Jacob Quinn
You may also try Pkg.add("ODBC") if you can find a working ODBC driver for mongo. I feel like I've heard of people going this route. -Jacob On Mon, Jul 13, 2015 at 9:23 AM, Kevin Liu wrote: > Hey Stefan, thanks for replying. I have not opened an issue on Github's > pzion/Mongo.jl. I will, and I

Re: [julia-users] Re: MongoDB and Julia

2015-07-13 Thread Jacob Quinn
; alternatives, but probably won't follow with ODBC. I appreciate the help. > > On Monday, July 13, 2015 at 4:02:25 PM UTC-3, Jacob Quinn wrote: >> >> You may also try Pkg.add("ODBC") if you can find a working ODBC driver >> for mongo. I feel like I've heard of p

Re: [julia-users] Pass an array of values to SQLite query

2015-08-04 Thread Jacob Quinn
You probably want something like query(db,"insert into tbl values ($(join(vals,',')))") to do a single row. Also note that the `create` and `append` methods are supplied to handle uploading "table"-like datastructures (i.e. anything that supports size(A) and getindex(A, i, j)). -Jacob On Tue,

Re: [julia-users] Re: Get time between two DateTime values in hours (and minutes if simple)

2015-08-15 Thread Jacob Quinn
Yeah, it's forthcoming. I left it out originally just to be conservative in code and function, but it's come up enough that we should add it in for TimePeriods. A good "up for grabs" kind of PR if anyone's feeling up for it. -Jacob On Sat, Aug 15, 2015 at 10:59 AM, Ian Butterworth wrote: > Than

Re: [julia-users] Inheriting from Real works, from AbstractFloat does not?

2015-08-24 Thread Jacob Quinn
When you subtype AbstractFloat, it's going to try to use the `grisu.jl` code to do the showing. The grisu code has all sorts of requirements to work, most of it semi-hard-coded for Float16, Float32, and Float64. Your best bet would probably be to define Base.show(io::IO, x::SubtypeAbsFloat) = show

[julia-users] Re: Dates and typemax error

2015-08-28 Thread Jacob Quinn
Hm...it's not entirely clear to me what we should do here. On the one hand, when you ask to have the typemax(Date) formatted, it's currently doing what you asked, "formatting the year with 4 digits". Because your year in this case is greater than 4 digits, that results in truncation, wh

Re: [julia-users] Re: Dates and typemax error

2015-08-31 Thread Jacob Quinn
Where yy is defined as the >>> two digit year. >>> >>> On Friday, August 28, 2015 at 11:51:14 AM UTC-4, Stefan Karpinski wrote: >>>> >>>> The safest option is probably to raise an error. >>>> >>>> On Fri, Aug 28, 2015 at 1

Re: [julia-users] Re: Recent developments in JuliaWeb

2015-09-06 Thread Jacob Quinn
The switch will happen automatically; no need to change any user code. We'll make the switch and tag a new release and next time you run Pkg.update() it'll download and install MbedTLS.jl. Sent from my iPhone > On Sep 6, 2015, at 5:45 PM, jock.law...@gmail.com wrote: > > Iain these are positiv

Re: [julia-users] Re: Convert datetime string that has AM/PM to datetime, without using Calendar.jl

2015-09-08 Thread Jacob Quinn
I'm not seeing the error on the latest master _ _ _ _(_)_ | A fresh approach to technical computing (_) | (_) (_)| Documentation: http://docs.julialang.org _ _ _| |_ __ _ | Type "?help" for help. | | | | | | |/ _` | | | | |_| | | | (_| | | Ve

Re: [julia-users] Re: META: What are the chances of moving this forum?

2015-09-09 Thread Jacob Quinn
I know I've heard chatter around about moving google groups to Discourse. I think people would generally be favorable, the problem is just having someone to own it, set it up, maintain, etc. I'm not even sure what the overhead for something like Discourse is vs. google groups. If someone feels stro

[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 x.obj=Ar

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 wrote: > sqrt[-3] > >

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 wrote: > In ODBC.jl, if you call advancedconnect() on Windows with no arguments, > it pops up the ODBC manager and lets

[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: https://news.ycomb

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 wrote: > Keno fixed a bug in JuliaParser.jl dealing utf8 character sizes. That > fix, along with l

Re: [julia-users] Can I use Int32 as default int type on x86-64 system?

2014-06-23 Thread Jacob Quinn
You could grab one of the 32-bit binaries to download and use. Would that work? Otherwise, if you're developing a library, if you do a ccall that expects an Int32, you just have to make sure you specify the argument types correctly adn the right calls to convert will be called automatically. ccall

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" wrote: > Actually that's not a bad idea; someone should st

Re: [julia-users] DataFrames.jl problem

2014-06-24 Thread Jacob Quinn
Looks like it's not actually failing, just giving warning of ambiguous methods. You should be ok using the package, but you may want to see if there's an issue already filed for DataFrames for this and if not, file one for them to fix the ambiguity. https://github.com/JuliaStats/DataFrames.jl/issu

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], test[:DayofMonth])

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 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) `[datetime(year,month,day) for (year,mo

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, alph

Re: [julia-users] metaprogramming example

2014-07-07 Thread Jacob Quinn
scatter(2, imag, 1, "orange") > @scatter(2, imag, 2, "blue") > > but i get `missing separator in tuple` 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

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 it's

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 wrote: > Hi guys, > > I have 2 short numpy-related questions. > > In numpy, if one can invert an arbitrary array *arr* along a given axis > u

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 wrote: > On Wed, Jul 23, 2014 at 9:38 AM, A

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 , *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 missin

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 wrote: > I tested 2 ways of constructing date array. Bu

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" wrote: > julia> VA > 3-element Array{ASCIIString,1}: > "A" >

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). http://www.autonlab.

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 wrote: > Dear all, > > By reading the docs, Int is an alias for either Int32 or Int64

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 wrote: > Might we see

Re: [julia-users] Re: JuliaLang questions posted on #StackOverflow by month from January 2012 to end of July 2014.

2014-08-02 Thread Jacob Quinn
I guess that's what happens when you get up to trying 6-7 different implementations for a fix! :) It's definitely exciting to see Julia taking off more and more. I think 0.3's release will be another huge boost going forward. On Fri, Aug 1, 2014 at 5:00 PM, Ivar Nesje wrote: > Unfortunately lot

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 wrote: > Thanks! > > > On 1 August 2014 14:04, Ivar Nesje wrote: > >> https://github.com/juliala

[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 , 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, 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 "Associative" abstract typ

Re: [julia-users] @inbounds is broken?

2014-08-04 Thread Jacob Quinn
Steve, `@inbounds` is certainly tricky because of the lack of documentation, which I think is slightly on purpose as this is meant to be for more advanced usage. The main insight to using `@inbounds` correctly is realizing that `@inbounds expression` returns the value `nothing`. That's why your f

Re: [julia-users] Getting IJulia to work on Windows

2014-08-04 Thread Jacob Quinn
I applaud your persistence!! Also take a look at the issue at IJulia here: https://github.com/JuliaLang/IJulia.jl/issues/199 Where discussion of distributing an ipython.exe for windows is (hopefully) imminent. That means when you do a Pkg.add("IJulia"), windows users at least would have a nicely p

Re: [julia-users] Re: @inbounds is broken?

2014-08-04 Thread Jacob Quinn
Steve, The error you're seeing is because `@inbounds elseif a[1] <= 0` is not a valid expression by itself. You still have to remember that `@inbounds` is a macro, so the next valid expression after `@inbounds` is passed as the argument to it. If you try to pass an incomplete expression (as in `el

Re: [julia-users] Re: @inbounds is broken?

2014-08-04 Thread Jacob Quinn
Steve, That indeed seems to be the case: check out the output of `@code_llvm` on the dummy functions I define below. LLVM bitcode can be a bit intimidating to parse at first, but if you compare the two, you'll see that one has branches for out of bounds and `foo2()` has `getelementptr inbounds` fo

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 definin

[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 , Pontus Stenetrop

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

2014-08-11 Thread Jacob Quinn
oting (or just don't up-vote) that would be >> good – otherwise it sets off the voting ring detector and bans the story. >> >> On Aug 11, 2014, at 8:59 AM, Johan Sigfrids >> wrote: >> >> Yay! I've been eagerly awaiting these. >> >> On Monday,

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)

  1   2   3   4   >