Re: [julia-users] Finding the size of a file in mb

2014-04-10 Thread Andrew Tulloch
Not sure if it's the canonical method, but Julia has a wrapper for the `stat` system call (http://en.wikipedia.org/wiki/Stat_(system_call)), so you can just do ``` stat(filename).size ``` to get the file size in bytes. See https://gist.github.com/ajtulloch/10434524 for an example. On Fri, Apr

Re: [julia-users] Finding the size of a file in mb

2014-04-10 Thread Ivar Nesje
Note that hard disc manufacturers use 1000^2 (it makes disks look bigger), and Apple has followed their example in OSX.

Re: [julia-users] Finding the size of a file in mb

2014-04-10 Thread Jason Solack
thank you! On Thursday, April 10, 2014 10:34:32 PM UTC-4, Elliot Saba wrote: > > filesize() gives a file's size in bytes, divide that by (1024^2) and > you're good to go. > -E > > > On Thu, Apr 10, 2014 at 5:06 PM, Jason Solack > > wrote: > >> Hello all! >> >> I am wondering if there is a way to

Re: [julia-users] Finding the size of a file in mb

2014-04-10 Thread Elliot Saba
filesize() gives a file's size in bytes, divide that by (1024^2) and you're good to go. -E On Thu, Apr 10, 2014 at 5:06 PM, Jason Solack wrote: > Hello all! > > I am wondering if there is a way to find the size a file in megabytes. > I'm going to be outputting a lot of data and i'd like to mon

[julia-users] Finding the size of a file in mb

2014-04-10 Thread Jason Solack
Hello all! I am wondering if there is a way to find the size a file in megabytes. I'm going to be outputting a lot of data and i'd like to monitor the size of my output file and create a new file once it hits a certain size. Thanks in advance Jason

Re: [julia-users] Re: bit-twiddling micro benchmark

2014-04-10 Thread Pierre-Yves Gérardy
Unless you pad it with the license itself ;-). Seriously, I believe that such short snippets are considered fair use. https://www.gnu.org/licenses/gpl-faq.html#GPLFairUse On Friday, April 11, 2014 1:50:31 AM UTC+2, Mike Nolta wrote: > > Probably a bad idea to post GPL code snippets to this list.

Re: [julia-users] Re: bit-twiddling micro benchmark

2014-04-10 Thread Mike Nolta
Probably a bad idea to post GPL code snippets to this list. -Mike On Thu, Apr 10, 2014 at 7:25 PM, Laszlo Hars wrote: > Btw, I think this is the standard CRC32 written in Julia (without the 4-byte > trick, or data conversion or padding), based on the GNU Radio implementation > ~~~ > module CRC32

[julia-users] Re: bit-twiddling micro benchmark

2014-04-10 Thread Laszlo Hars
Btw, I think this is the standard CRC32 written in Julia (without the 4-byte trick, or data conversion or padding), based on the GNU Radio implementation ~~~ module CRC32 ### export crc32 const t = uint32([0x,0x04C11DB7,0x09823B6E,0

Re: [julia-users] Re: bit-twiddling micro benchmark

2014-04-10 Thread andrew cooke
huh. i had forgotten about this. i'll try four tables. it shouldn't be that hard to add (although there's going to be extra book-keeping - it's not an obvious gain to me). cheers, andrew On Thursday, 10 April 2014 19:08:21 UTC-3, Chris Foster wrote: > > On Fri, Apr 11, 2014 at 6:44 AM, Laszl

[julia-users] Re: Julia and Emacs shell-mode

2014-04-10 Thread El suisse
Hi, sorry for the newbie question: in https://github.com/emacs-ess/ESS/wiki/Julia Instalation (setq inferior-julia-program-name "/path/to/julia/julia-release-basic") wath path is this? "/path/to/julia/julia-release-basic" I run Julia in Ubuntu 12.04 64bits thanks in advance El viernes

Re: [julia-users] Re: bit-twiddling micro benchmark

2014-04-10 Thread Chris Foster
On Fri, Apr 11, 2014 at 6:44 AM, Laszlo Hars wrote: > note that the running time does not change with a partial loop unroll, like > this: > ~~~ > function signed_loop{D<:Unsigned, A<:Unsigned}(::Type{D}, r::A, data, > table::Vector{A}) > local j = 0 > for i = 1 : div(length(data),20) >

[julia-users] Re: bit-twiddling micro benchmark

2014-04-10 Thread Laszlo Hars
...and adding @inbounds begin ... end around the r-update instruction block actually slows things down

[julia-users] Re: bit-twiddling micro benchmark

2014-04-10 Thread Laszlo Hars
note that the running time does not change with a partial loop unroll, like this: ~~~ function signed_loop{D<:Unsigned, A<:Unsigned}(::Type{D}, r::A, data, table::Vector{A}) local j = 0 for i = 1 : div(length(data),20) r = (r >>> 8) $ table[1 + (data[j+=1]$convert(D,r))]

Re: [julia-users] Re: bit-twiddling micro benchmark

2014-04-10 Thread Tim Holy
Check out Cartesian's @nexprs macro. Docs are in the package, but the functionality is now in Base. That said, when @simd applies it should be even better. --Tim On Thursday, April 10, 2014 07:26:47 AM Mike Innes wrote: > To be fair, the simplest implementation being the fastest isn't > *necess

Re: [julia-users] Re: emacs IJulia notebook?

2014-04-10 Thread Stefan Karpinski
Ah, that's great. This seems like it should be a much better way to use Julia from emacs. On Thu, Apr 10, 2014 at 4:19 PM, James Porter wrote: > Confirmed that it works provided you give ein the correct port. Syntax > highlighting and tab behavior is obviously wonky but you can make new > cells,

[julia-users] Re: emacs IJulia notebook?

2014-04-10 Thread James Porter
Confirmed that it works provided you give ein the correct port. Syntax highlighting and tab behavior is obviously wonky but you can make new cells, execute code, etc. just fine. —James P.S. this is awesome :D On Thursday, April 10, 2014 1:32:33 PM UTC-5, Steven G. Johnson wrote: > > If it is j

Re: [julia-users] Re: Non-GPL Julia?

2014-04-10 Thread Mike Nolta
On Thu, Apr 10, 2014 at 2:29 PM, Simon Kornblith wrote: > I'm not a lawyer either, but I don't think this is any more problematic than > the current situation with inclusion of Rmath etc. The combined work is GPL > (or LGPL, once we get rid of the GPL parts), but the vast majority of the > source

[julia-users] Re: Non-GPL Julia?

2014-04-10 Thread Tobias Knopp
I think it helps to distinguish in the license discussion build dependencies and runtime dependencies. As far as I can see: - Core Julia, which consists of libjulia (statically linking libuv and llvm) and the repl, are MIT licensed - Base Julia has some GPL dependencies. But to get rid of them on

[julia-users] Re: bit-twiddling micro benchmark

2014-04-10 Thread Laszlo Hars
I tried to simplify the inner loop to: ~~~ for word::D in data remainder = (remainder >>> word_size) end ~~~ It still took more than half the time of the original (with table indexing and two XORs) in my Win7-x64 machine. It shows that not much speed-ups with the real operations c

[julia-users] Re: Non-GPL Julia?

2014-04-10 Thread Tobias Knopp
should be fairly easy to use fftpack which has single and double precision and is ok from the license. Am Donnerstag, 10. April 2014 21:10:25 UTC+2 schrieb Jay Kickliter: > > Thanks to everyone for the information. I guess it's fair to say a non-GPL > version is feasible and likely in the future

[julia-users] Re: Non-GPL Julia?

2014-04-10 Thread Jay Kickliter
Thanks to everyone for the information. I guess it's fair to say a non-GPL version is feasible and likely in the future. I love the language myself and would continue using it myself regardless, but I wanted to clear this up before I start evangelizing it at work. I'm interested to hear more ab

[julia-users] Re: emacs IJulia notebook?

2014-04-10 Thread Steven G. Johnson
If it is just connecting to the IPython notebook HTTP server, the only difference it should have to deal with is that IJulia uses a different default port (8998) than IPython (). You could try ipython notebook --port --profile julia On Thursday, April 10, 2014 11:36:36 AM UTC-4, Andr

Re: [julia-users] Re: Non-GPL Julia?

2014-04-10 Thread Simon Kornblith
I'm not a lawyer either, but I don't think this is any more problematic than the current situation with inclusion of Rmath etc. The combined work is GPL (or LGPL, once we get rid of the GPL parts), but the vast majority of the source files are (also) MIT. This seems fine since MIT gives all of

Re: [julia-users] Re: Non-GPL Julia?

2014-04-10 Thread Jason Grout
On 4/10/14, 12:31, Mike Nolta wrote: On Thu, Apr 10, 2014 at 11:07 AM, Tony Kelman wrote: MPFR and GMP are LGPL, which is not quite as problematic or viral. Some of SuiteSparse is GPL, parts of it are LGPL, and at least one file of the Julia code in base for sparse matrices that is based on pa

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

2014-04-10 Thread harven
Le jeudi 10 avril 2014 19:45:04 UTC+2, Jacob Quinn a écrit : > > You *could* use setdiff, it depends on what you're working with (e.g. a > range of integers) > I am working with general collections. but then I can define findnot(a,b) = setdiff(1:length(a), findin(a,b)) which seems to work as I

[julia-users] Re: Creating a tuple in C and returning it to Julia

2014-04-10 Thread Dominique Orban
Ok, I found embedding.c. Allocating Julia arrays as given in the example there works. In Julia, I specify the return type of the C function as Any, and I get a nice tuple. On Thursday, April 10, 2014 12:30:18 AM UTC-7, Dominique Orban wrote: > > Thanks for the suggestions. Changing the return t

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)) O

[julia-users] Re: complement to findin

2014-04-10 Thread harven
Le jeudi 10 avril 2014 17:19:12 UTC+2, Tony Kelman a écrit : > > help> setdiff > > well, findin returns the positions of the elements, not the elements themselves. This is quite different. julia> findin("honolulu","ou")' 1x4 Array{Int64,2}: 2 4 6 8 julia> intersect("honolulu","ou")' 1x4 A

Re: [julia-users] Re: Non-GPL Julia?

2014-04-10 Thread Mike Nolta
On Thu, Apr 10, 2014 at 11:07 AM, Tony Kelman wrote: > MPFR and GMP are LGPL, which is not quite as problematic or viral. > > Some of SuiteSparse is GPL, parts of it are LGPL, and at least one file of > the Julia code in base for sparse matrices that is based on parts of > SuiteSparse is also LGPL

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

[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: Is it wrong to think of Julia as a Lisp that uses m-expressions?

2014-04-10 Thread Andrew Dabrowski
I'm neither a Julia nor even a competent programmer, but since no one else has responded I'll take a shot at it. I think that might be fair description of Mathematica, but not of Julia. Julia is very much a multi-paradigm language, it's not pure enough in any sense to be considered a member of

Re: [julia-users] Re: Talk on Julia at Northwestern University next Wednesday

2014-04-10 Thread Douglas Bates
Source for slides are at github.com/dmbates/slides/2014-04-09-Evanston An HTML version based on ioslides.js is at http://www.stat.wisc.edu/~bates/2014-04-09-Evanston.html ('f' to toggle fullscreen, 'w' to toggle widescreen). I'm not sure why but the figures seem to be missing in that HTML fi

Re: [julia-users] linalg build error

2014-04-10 Thread Andreas Noack Jensen
No. It is just warnings and Julia works fine. An issue has been opened. Den torsdag den 10. april 2014 skrev Andrew Dabrowski : > On the latest pull I'm getting this build error: > > $ make > CC src/jltypes.o > CC src/gf.o > FLISP src/julia_flisp.boot > FLISP src/julia_flisp.boot.

[julia-users] linalg build error

2014-04-10 Thread Andrew Dabrowski
On the latest pull I'm getting this build error: $ make CC src/jltypes.o CC src/gf.o FLISP src/julia_flisp.boot FLISP src/julia_flisp.boot.inc CC src/ast.o CC src/builtins.o CC src/module.o CC src/codegen.o CC src/interpreter.o CC src/alloc.o CC src/dll

Re: [julia-users] Re: How to use GLPK.exact ?

2014-04-10 Thread Joey Huchette
Either approach should work in principle (pycddlib vs. cddlib), but I suspect that the Python wrapper is higher-level, and will be easier to use from Julia. For reference, here's a snippet of how you might calculate the extreme points as rationals, calling pycddlib from Julia (adapted from code

[julia-users] Re: emacs IJulia notebook?

2014-04-10 Thread Andrew Dabrowski
I tried both the ein and ipython emacs packages but wasn't able to connect Julia (Python works fine). If you'd like I could try it again and post the error messages. On Thursday, April 10, 2014 11:15:04 AM UTC-4, Stefan Karpinski wrote: > > Does anyone have any experience using Emacs IPython >

[julia-users] Re: Implementing Gillespie's Stochastic Simulation Algorithm

2014-04-10 Thread David P. Sanders
El jueves, 10 de abril de 2014 10:19:14 UTC-5, David P. Sanders escribió: > > > > El miércoles, 9 de abril de 2014 03:40:40 UTC-5, Simon Frost escribió: >> >> Dear All, >> >> I'm implementing Gillespie's direct method for stochastic simulation: >> >> http://en.wikipedia.org/wiki/Gillespie_algorit

[julia-users] Re: complement to findin

2014-04-10 Thread Tony Kelman
help> setdiff INFO: Loading help data... Base.setdiff(s1, s2) Construct the set of elements in "s1" but not "s2". Maintains order with arrays. Note that both arguments must be collections, and both will be iterated over. In particular, "setdiff(set,element)" where "element" is a potent

[julia-users] Re: Implementing Gillespie's Stochastic Simulation Algorithm

2014-04-10 Thread David P. Sanders
El miércoles, 9 de abril de 2014 03:40:40 UTC-5, Simon Frost escribió: > > Dear All, > > I'm implementing Gillespie's direct method for stochastic simulation: > > http://en.wikipedia.org/wiki/Gillespie_algorithm > > I'm loosely following the API for the now-orphaned R package GillespieSSA: > > ht

[julia-users] complement to findin

2014-04-10 Thread harven
findin(*a*, *b*) returns the indices of elements in collection a that appear in collection b.Is there a "notfindin" function that returns the indices of elements in collection a that do not appear in collection b? If not, what do you think of the idea of adding a keyword argument to switch to

[julia-users] emacs IJulia notebook?

2014-04-10 Thread Stefan Karpinski
Does anyone have any experience using Emacs IPython Notebookbut with IJulia?

Re: [julia-users] Re: Non-GPL Julia?

2014-04-10 Thread Tony Kelman
MPFR and GMP are LGPL, which is not quite as problematic or viral. Some of SuiteSparse is GPL, parts of it are LGPL, and at least one file of the Julia code in base for sparse matrices that is based on parts of SuiteSparse is also LGPL. On Thursday, April 10, 2014 7:18:45 AM UTC-7, Jake Bolews

Re: [julia-users] Re: bit-twiddling micro benchmark

2014-04-10 Thread Jake Bolewski
It's not able to vectorize the loop, at least on my computer when I tested it. On Thursday, April 10, 2014 10:44:44 AM UTC-4, Mike Innes wrote: > > Ah, nice > On 10 Apr 2014 15:39, "Isaiah Norton" > > wrote: > >> See @simd: https://github.com/JuliaLang/julia/pull/5355 >> >> >> On Thu, Apr 10, 20

Re: [julia-users] Re: bit-twiddling micro benchmark

2014-04-10 Thread Mike Innes
Ah, nice On 10 Apr 2014 15:39, "Isaiah Norton" wrote: > See @simd: https://github.com/JuliaLang/julia/pull/5355 > > > On Thu, Apr 10, 2014 at 10:26 AM, Mike Innes wrote: > >> To be fair, the simplest implementation being the fastest isn't >> *necessarily* to Julia's credit, since it may also mean

Re: [julia-users] Re: bit-twiddling micro benchmark

2014-04-10 Thread Isaiah Norton
See @simd: https://github.com/JuliaLang/julia/pull/5355 On Thu, Apr 10, 2014 at 10:26 AM, Mike Innes wrote: > To be fair, the simplest implementation being the fastest isn't > *necessarily* to Julia's credit, since it may also mean that Julia can > only optimise the simplest code. Not saying th

[julia-users] Re: bit-twiddling micro benchmark

2014-04-10 Thread Mike Innes
To be fair, the simplest implementation being the fastest isn't *necessarily* to Julia's credit, since it may also mean that Julia can only optimise the simplest code. Not saying that's the case here, but it's worth looking at it from that angle. Chris' point gives me an idea for an @unroll mac

Re: [julia-users] Re: Non-GPL Julia?

2014-04-10 Thread Jake Bolewski
Are there any more liberally licensed libraries that get close to the functionality in MPFR, I know that there are some non-GPL BigInt implementations out there although I don't think any match GMP's performance. On Thursday, April 10, 2014 10:13:20 AM UTC-4, Stefan Karpinski wrote: > > There's

Re: [julia-users] Re: Non-GPL Julia?

2014-04-10 Thread Stefan Karpinski
There's been a lot of talk about turning various bits of functionality like GMP, MPFR, FFTW and such into packages that simply happen to be pre-loaded by default, making it easy to get a much more spare basic Julia version. This will definitely happen over the summer. Note that OpenBLAS is BSD-lice

[julia-users] Re: Non-GPL Julia?

2014-04-10 Thread Ivar Nesje
See also DISTRIBUTING.md. Any discussion should probably be summarized there. kl. 16:05:10 UTC+2 torsdag 10. april 2014 skrev Jake Bolewski følgende: > > As readline is now removed I think GMP (BigInt's) and MPFR (arbitrary > pre

Re: [julia-users] Re: Non-GPL Julia?

2014-04-10 Thread Isaiah Norton
Rmath too, but I think that is on the way out. All of the licenses are linked here: https://github.com/JuliaLang/julia/blob/master/LICENSE.md On Thu, Apr 10, 2014 at 10:05 AM, Jake Bolewski wrote: > As readline is now removed I think GMP (BigInt's) and MPFR (arbitrary > precision floating points

[julia-users] Re: Non-GPL Julia?

2014-04-10 Thread Jake Bolewski
As readline is now removed I think GMP (BigInt's) and MPFR (arbitrary precision floating points) are the only GNU ibraries left if you are able to use MKL and don't require FFTW. Steven also working on a branch where he provides FFT support in pure julia. Best, Jake On Thursday, April 10, 20

[julia-users] Non-GPL Julia?

2014-04-10 Thread Jay Kickliter
There are bits and pieces in Github issues and posts, but can post a definitive list of what needs to be replaced/removed to make Julia non GPL? Will any functionality be missing? From what I understand I can use MKL for some stuff. I've read that MKL has the ability to mimic FFTW, but will Jul

[julia-users] Re: Events.jl

2014-04-10 Thread Simon Danisch
Thanks Elliot, I thought the readme might have been enough as a starting point, but I see, that my post doesn't encourage anyone to put time into this. The readme shows how to use the event system and I'd like to know, if this is a good design for an event system. I wouldn't trust my judgment t

Re: [julia-users] bit-twiddling micro benchmark

2014-04-10 Thread Chris Foster
Is it the zlib implementation in the function crc32() you're comparing to? Taking a peek in the zlib source, it looks like they do a fair bit of manual loop unrolling and also process the CRC 4 bytes at a time. Given those differences, the speed difference might not be so surprising. On Thu, Apr

[julia-users] Re: Online Database + IDE for Julia

2014-04-10 Thread Mike Innes
It would definitely be good to have something like clojuredocs.org. You could include the docs for functions in all packages and Base, make everything searchable. If you could build meaningful connections between packages, even better. But – and please forgive me if I've missed the point here –

[julia-users] Selectively read text columns into vectors?

2014-04-10 Thread Cameron McBride
Greetings, Does this exist somewhere in base and/or DataFrames: the ability to read only selected columns from some text input? Ideally, you could have each output vector of a different type (Float64, Int, etc.). (So it differs from readdlm() in philosophy.) A minimal implementation is below a

Re: [julia-users] Re: How to use GLPK.exact ?

2014-04-10 Thread Stéphane Laurent
Again, thank you for all these answers. Sorry Carlo, I missed the double slash in your previous answer. It would be a good opportunity for me to call Python in order to train my skills in Python in addition to Julia. But why do you suggest me to call pycddlib with PyCall rather than calling cd

Re: [julia-users] Re: How to use GLPK.exact ?

2014-04-10 Thread Stéphane Laurent
Again, thank you for all these answers. Sorry Carlo, I missed the double slash in your previous answer. It would be a good opportunity for me to call Python in order to train my skills in Python in addition to Julia. But what do you suggest me to call pycddlib with PyCall rather than calling c

[julia-users] Re: Online Database + IDE for Julia

2014-04-10 Thread Simon Danisch
"Announced by me" is a big word here, but thanks to Kevin the correct link found its way to this post! =) Sorry about the confusion, we still try to figure out how to get things across on the mailing list! And its quite a complex topic, so it's a bit difficult to get a good summary across, with

Re: [julia-users] Re: How to use GLPK.exact ?

2014-04-10 Thread Carlo Baldassi
> There was a Julia age during which BigInt(3)/BigInt(28) was equal to the > BigRational 3/28, why this feature has been removed ? > I don't think that command ever worked like that actually; in order to get Rational values, you need to use a double-slash "//" in stead of a single slash: big(3)

Re: [julia-users] Re: How to use GLPK.exact ?

2014-04-10 Thread Tony Kelman
Unless I'm blind and just can't find one, it appears there is not yet a solid high-dimensional computational geometry package for Julia, like cddlib or the Multi-Parametric Toolbox for Matlab. I imagine a wrapper around cddlib would be fairly easy to write (perhaps even autogenerated), or you c

Re: [julia-users] Re: How to use GLPK.exact ?

2014-04-10 Thread Miles Lubin
> By the way for another problem I need to get the vertices of the > polyhedron defined by the linear constraints, as with the cddlib library, > do you know how I could get that ? > Enumerating vertices requires a very different algorithm from optimizing over polyhedra. The best way to do thi

[julia-users] Re: Creating a tuple in C and returning it to Julia

2014-04-10 Thread Dominique Orban
Thanks for the suggestions. Changing the return type results in complaints from Julia: ERROR: error compiling anonymous: in anonymous: ccall: missing return type or ERROR: error compiling anonymous: error interpreting ccall return type:type cannot be constructed Using a single variable nam

[julia-users] Re: Creating a tuple in C and returning it to Julia

2014-04-10 Thread Tobias Knopp
Hi, this is more a guess but could you try changing the return type in ccall to NTuple{3,Ptr{Any}}? Or maybe just Tuple. Further you could try using on the left hand site only a single variable name, i.e. tup = = ccall((:my_c_function, "mylib"), Tuple, ()) Am Donnerstag, 10. April 2014 09:15:30

[julia-users] Creating a tuple in C and returning it to Julia

2014-04-10 Thread Dominique Orban
My use case is a C function that creates a sparse matrix in triplet form (rows, cols, vals). What's the appropriate way to return this to Julia? I've tried the following, thinking that Julia accepts C pointers as return values, so why not tuples of C pointers: jl_value_t *my_c_function(void) {