[julia-users] Re: readchomp, readlines friends on Windows

2014-03-11 Thread Ivar Nesje
Usually you should be using eachline instead of readlines, especially for large files, because they return an iterator and does not allocate strings for the individual lines, so that garbage collection can free the intermediary strings. kl. 04:19:25 UTC+1 tirsdag 11. mars 2014 skrev Peter

Re: [julia-users] Trouble getting Sundials.jl to work

2014-03-11 Thread Thomas Moore
OK, running push!(DL_LOAD_PATH, /usr/local/lib/) has improved the situation a little: now we get this error: ERROR: ccall: could not find function CVodeCreate in library libsundials_cvode in ode at /home/thomas/.julia/Sundials/src/Sundials.jl:250 At least the shared library is recognised

Re: [julia-users] addpath from Matlab?

2014-03-11 Thread Tim Holy
Do you mean, all you want is addpath(dirname) = push!(LOAD_PATH, dirname)? Or something different? --Tim On Tuesday, March 11, 2014 04:17:17 AM J Luis wrote: I've been here before too (and will come back) An addpath would be a far far simpler to use solution. Terça-feira, 11 de Março de

Re: [julia-users] Trouble getting Sundials.jl to work

2014-03-11 Thread Ivar Nesje
Your code works for me, so I think there is still a problem on your system configuration. The error is about the C function `CVodeCreate`, not the Julia function with the same name, and apparently Julia finds the sundials library, but it does not contain the function. Try to run

Re: [julia-users] RetType in ccall as a variable -- 'not defined'

2014-03-11 Thread Jameson Nash
The first three parameters to ccall are special and are eval'd at compile time. To get the effect you are looking for, declare the return type as Ptr{Void}, and then call `convert(ret_type, ptr)` On Tue, Mar 11, 2014 at 11:57 AM, J Luis jmfl...@gmail.com wrote: I want to parameterize the

[julia-users] GSOC 2014: Project Syntax Checker

2014-03-11 Thread Siddhant Jain
Hello everyone, This in regard to the 'Syntax Checker' project that has been mentioned on the ideas page. I really like the idea and would like to work more on it. I am currently working on a semester long project to develop a compiler independently and hence have an idea as to what goes into

Re: [julia-users] RetType in ccall as a variable -- 'not defined'

2014-03-11 Thread J Luis
Thanks, works beautifully. Terça-feira, 11 de Março de 2014 13:15:31 UTC, Jameson escreveu: The first three parameters to ccall are special and are eval'd at compile time. To get the effect you are looking for, declare the return type as Ptr{Void}, and then call `convert(ret_type, ptr)`

Re: [julia-users] addpath from Matlab?

2014-03-11 Thread J Luis
Do you mean, all you want is addpath(dirname) = push!(LOAD_PATH, dirname)? By itself it would be already useful (imagine when one do not know this solution and have to search the docs for it) Or something different? Precisely. What I was referring was a way to declare paths that

[julia-users] Re: Convert to/from integer from/to string (i2osp from PKCS#1)

2014-03-11 Thread Robert Feldt
At least I think I need a string (;)) since: 1. The input to a RSA encryption is typically a string to be encrypted. This string is converted to a large integer which is then encrypted. This large integer is then dumped to a string so that it can be transmitted, saved to file etc. 2. The PKCS

[julia-users] Re: Convert to/from integer from/to string (i2osp from PKCS#1)

2014-03-11 Thread andrew cooke
do these not do what you need (or form the basis for it)? julia convert(Vector{Uint8}, utf8(hello world)) 11-element Array{Uint8,1}: 0x68 0x65 0x6c 0x6c 0x6f 0x20 0x77 0x6f 0x72 0x6c 0x64 julia bytestring(convert(Vector{Uint8}, utf8(hello world))) hello world On Tuesday, 11 March

[julia-users] Re: Convert to/from integer from/to string (i2osp from PKCS#1)

2014-03-11 Thread Robert Feldt
Thanks Andrew, That is exactly the kind of obvious-in-retrospect type of solution I was hoping for. I can adapt this to my needs. Cheers, Robert Den tisdagen den 11:e mars 2014 kl. 16:10:53 UTC+1 skrev andrew cooke: do these not do what you need (or form the basis for it)? julia

[julia-users] Re: Convert to/from integer from/to string (i2osp from PKCS#1)

2014-03-11 Thread andrew cooke
no problem. don't forget the padding! On Tuesday, 11 March 2014 12:16:44 UTC-3, Robert Feldt wrote: Thanks Andrew, That is exactly the kind of obvious-in-retrospect type of solution I was hoping for. I can adapt this to my needs. Cheers, Robert Den tisdagen den 11:e mars 2014 kl.

[julia-users] Re: Convert to/from integer from/to string (i2osp from PKCS#1)

2014-03-11 Thread Robert Feldt
Yes, but the problem I had was rooted in: julia convert(UTF8String, Uint8[0x41,0x42, 128]) ERROR: invalid UTF-8 sequence in convert at utf8.jl:155 /Robert Den tisdagen den 11:e mars 2014 kl. 16:21:00 UTC+1 skrev andrew cooke: actually, it seems convert works both ways. julia

[julia-users] Re: Convert to/from integer from/to string (i2osp from PKCS#1)

2014-03-11 Thread andrew cooke
sorry, last line should be share the ENCRYPTED data, otherwise what i wrote is awfully confusing. On Tuesday, 11 March 2014 12:32:50 UTC-3, andrew cooke wrote: well that's because it's an invalid character sequence. if it started as a valid utf8 string, you won't see that or unencoding.

[julia-users] Re: Convert to/from integer from/to string (i2osp from PKCS#1)

2014-03-11 Thread Robert Feldt
Yes, I see where I went wrong now. I will base64 encode the uint8 array, pass that around and then reverse on the other side. Sorry for the noise, Robert Den tisdagen den 11:e mars 2014 kl. 16:32:50 UTC+1 skrev andrew cooke: well that's because it's an invalid character sequence. if it

[julia-users] Re: Convert to/from integer from/to string (i2osp from PKCS#1)

2014-03-11 Thread andrew cooke
no problem. really don't forget the padding. http://rdist.root.org/2009/10/06/why-rsa-encryption-padding-is-critical/ On Tuesday, 11 March 2014 12:37:34 UTC-3, Robert Feldt wrote: Yes, I see where I went wrong now. I will base64 encode the uint8 array, pass that around and then reverse on

Re: [julia-users] Packing and unpacking parameters

2014-03-11 Thread John Myles White
For now, I suspect the easiest way to do this is to switch back and forth between immutable types and vectors by using linear indexing in the fields of a type, then linear indexing within each field. Here’s a specific example of how a generic function might work: immutable Foo

[julia-users] Re: Convert to/from integer from/to string (i2osp from PKCS#1)

2014-03-11 Thread andrew cooke
actually, it seems convert works both ways. julia convert(UTF8String, [0x41,0x42]) AB On Tuesday, 11 March 2014 12:10:53 UTC-3, andrew cooke wrote: do these not do what you need (or form the basis for it)? julia convert(Vector{Uint8}, utf8(hello world)) 11-element Array{Uint8,1}:

Re: [julia-users] addpath from Matlab?

2014-03-11 Thread Ethan Anderes
Yep. This is what I was hoping for too. However, just to be clear I would want include(test0.jl) to work when the directory which contains test0.jl is in LOAD_PATH. Cheers, Ethan On Tuesday, March 11, 2014 7:43:47 AM UTC-7, J Luis wrote: Do you mean, all you want is addpath(dirname) =

Re: [julia-users] addpath from Matlab?

2014-03-11 Thread Kevin Squire
Maybe we should stop exporting include, so that people use require and LOAD_PATH is always searched? On Tuesday, March 11, 2014, Ethan Anderes ethanande...@gmail.com wrote: Yep. This is what I was hoping for too. However, just to be clear I would want include(test0.jl) to work when the

[julia-users] Windows CI for packages (and Julia itself, hopefully) with AppVeyor

2014-03-11 Thread Tony Kelman
I want to make a bit of an announcement for people who don't browse the Github issues list. I've been working on setting up continuous integration, a la Travis, but for Windows using AppVeyor -

[julia-users] Re: GSOC- 2014 Computer Visions using OpenCV

2014-03-11 Thread Siddha Ganju
I have given a thought to creating a Julia wrapper for MagickWand (Issue #69https://github.com/timholy/Images.jl/issues/69). In this context is there any available generator that can help me out? For either PythonMagickWand or MagickWand? I found Clang.jl that I can use as a ready reckoner for

[julia-users] Re: GSOC 2014: Project Syntax Checker

2014-03-11 Thread Mike Innes
Yes, as Stefan has pointed out, making your own lexer/parser is not likely to be the best way to approach this project (and perhaps we should make that more explicit). Your best bet here is to have a look at the existing Julia parser - get a feel for things, then think about improvements you

[julia-users] Re: Convert to/from integer from/to string (i2osp from PKCS#1)

2014-03-11 Thread Avik Sengupta
Does this work? julia a=abcdefgh abcdefgh julia reinterpret(Int64, a.data) 1-element Array{Int64,1}: 7523094288207667809 On Tuesday, 11 March 2014 16:07:35 UTC+5:30, Robert Feldt wrote: Implementing simple RSA crypto in pure Julia (not for actual sec-sensitive use) but for low-sec

[julia-users] Re: GSOC- 2014 Computer Visions using OpenCV

2014-03-11 Thread J Luis
Well, given that this thread is under the name of ... OpenCV, why not using OpenCV itself? The floodfill function does exactly that. Terça-feira, 11 de Março de 2014 18:06:46 UTC, Siddha Ganju escreveu: I have given a thought to creating a Julia wrapper for MagickWand (Issue # 69

[julia-users] make fails

2014-03-11 Thread Comer Duncan
I have been out of town for ten days and today did a git pull. I then did the usual make and got what appears to be a normal make except near the end I get the following spew: LINK src/support/libsupport.a CC src/flisp/flisp.o CC src/flisp/julia_extensions.o LINK

[julia-users] Re: Convert to/from integer from/to string (i2osp from PKCS#1)

2014-03-11 Thread Robert Feldt
Seems useful and I did not know about it. Strings in my case can be longer than 64 bits though but this is a useful building block. Thanks! Den tisdagen den 11:e mars 2014 kl. 20:13:05 UTC+1 skrev Avik Sengupta: Does this work? julia a=abcdefgh abcdefgh julia reinterpret(Int64, a.data)

[julia-users] Re: Windows CI for packages (and Julia itself, hopefully) with AppVeyor

2014-03-11 Thread Ivar Nesje
This is Great! There is an unfortunate correlation between being a open source contributor and not using the most popular operating system among users. You should post this to the julia-dev list. I would assume that fewer people skip posts on the lower traffic list, and when this is up and

[julia-users] Re: Convert to/from integer from/to string (i2osp from PKCS#1)

2014-03-11 Thread Ivar Nesje
Reinterpret works for any length stings. See that the return type is Array{Int,1}. Just be careful when using reinterpret because (I believe) you will get the native byte order (Litle endian/Big endian), and you should be careful to follow the specification of the algorithm/transport

Re: [julia-users] addpath from Matlab?

2014-03-11 Thread Mauro
This and related topics seem to crop up a lot, e.g. almost concurrently this discussion happened: https://groups.google.com/d/msg/julia-users/xbsdu8Ob4cw/2Vtyo9CFhYoJ And Kevin opened this issue to improve the documentation: https://github.com/JuliaLang/julia/issues/6082 It is a bit focused on

[julia-users] Re: GSOC- 2014 Computer Visions using OpenCV

2014-03-11 Thread Jake Bolewski
Siddha Ganju, If you would like to work on the OpenCV project I would stick to wrapping OpenCV. I don't think that this is a particularly good project for a beginner as it will invariably involve julia c interop, a c / c++ shim, knowledge of OpenCV data type internals, and julia code

[julia-users] trouble with pkg.build(Nettle)

2014-03-11 Thread Ivan Tan
Hi all, New to Julia and tried to install with the instructions from https://github.com/stevengj/julia-mit/blob/master/README.md but IPython kept crashing. There was an error during the building of IPython but I can't seem to find a way around it. Sorry guys I'm unfamiliar with this. Here's

[julia-users] Re: Windows CI for packages (and Julia itself, hopefully) with AppVeyor

2014-03-11 Thread Jake Bolewski
This is really great. As someone who has gone most of his life without using Windows, how easy is this to set up if you are not a knowledgeable window's developer? I'm thinking about sometimes hard to build library dependencies, like libgit2 or an opencl vendor implementation. I would try

[julia-users] PyCall Segmentation fault: 11

2014-03-11 Thread Ethan Anderes
Hi, Just complied julia and am getting a segmentation fault when trying to use PyCall. Should I file an issue with PyCall or am I doing something wrong here? Thanks. -Ethan julia Pkg.status() 1 required packages: - PyCall0.4.2 julia versioninfo() Julia Version

[julia-users] Re: PyCall Segmentation fault: 11

2014-03-11 Thread Jake Bolewski
This looks like it was fixed a couple hours ago, see https://github.com/JuliaLang/julia/issues/6097#issuecomment-37348594 Jake On Tuesday, March 11, 2014 5:16:19 PM UTC-4, Ethan Anderes wrote: Hi, Just complied julia and am getting a segmentation fault when trying to use PyCall. Should

Re: [julia-users] Re: GSOC- 2014 Computer Visions using OpenCV

2014-03-11 Thread Tim Holy
There already is a wrapper for MagickWand, we just don't use if for more than saving/loading images. MagickWand does not support multidimensional images well, so I'm quite hesitant to start relying on MagickWand for more than I/O. (I think OpenCV is better in this regard.) For this specific

Re: [julia-users] Packing and unpacking parameters

2014-03-11 Thread Cristóvão Duarte Sousa
Great approach John! I was not aware of the linear indexing of type fields, that opens a lot of possibilities. Thanks On Tue, Mar 11, 2014 at 3:51 PM, John Myles White johnmyleswh...@gmail.comwrote: For now, I suspect the easiest way to do this is to switch back and forth between immutable

[julia-users] Re: GSOC 2014: Project Syntax Checker

2014-03-11 Thread Knud Sørensen
Regarding warm-up task. You could take a look at the bugs found by coverity some time ago. https://groups.google.com/d/topic/julia-dev/Lw4GF34VGbE/discussion On Tuesday, 11 March 2014 14:33:23 UTC+1, Siddhant Jain wrote: Hello everyone, This in regard to the 'Syntax Checker' project that

Re: [julia-users] Converting a column of a DataFrame to a string

2014-03-11 Thread John Myles White
I'm not totally sure what you mean. A column of a DataFrame is a vector, so one natural way to convert the column to a string would be to join all of the entries using join: using DataFrames df = DataFrame(A = 1:10) join(df[:A], ::) Is that what you're looking for? -- John On Mar 11, 2014,

Re: [julia-users] trouble with pkg.build(Nettle)

2014-03-11 Thread Isaiah Norton
Hi, That file downloads fine for me, and I was able to install IJulia on a clean system several days ago. Could you try downloading it manually, to eliminate any local network issues? Also please send versioninfo(). On Tue, Mar 11, 2014 at 4:45 PM, Ivan Tan ivan@gmail.com wrote: Hi all,

Re: [julia-users] addpath from Matlab?

2014-03-11 Thread Jonathan Malmaud
It might be useful to add functionality equivalent to IPython's 'run' magic. From http://ipython.org/ipython-doc/dev/interactive/tutorial.html: Running and Editinghttp://ipython.org/ipython-doc/dev/interactive/tutorial.html#running-and-editing The %run magic command allows you to run any

[julia-users] Converting a column of a DataFrame to a string

2014-03-11 Thread Jason Solack
So this seems like silly question, but i'm looking to convert a column in a dataframe to a string and I don't see how to do that. Any help? Thank you! Jason

Re: [julia-users] Trouble getting Sundials.jl to work

2014-03-11 Thread Thomas Moore
I fear print(Sys.dlliist()) is not an option in julia. There's lots of other options (Sys,MACHINE, Sys.init, etc) but no Sys.dllist(). My Julia install is Version 0.3.0-prerelease+308 if that is relevant :) Also, nm /usr/local/lib/libsundials_cvode.so just gives me a long list like this:

Re: [julia-users] Re: GSOC- 2014 Computer Visions using OpenCV

2014-03-11 Thread J Luis
Will Kearney created an initial GDAL wrapper https://github.com/wkearn/GDAL.jl .GDAL is an extremely powerful library to read a lot of different formats, multi-bands included. It supports also (the lib) image resizing. Terça-feira, 11 de Março de 2014 22:14:20 UTC, Tim Holy escreveu: There

Re: [julia-users] Converting a column of a DataFrame to a string

2014-03-11 Thread Jason Solack
no, i'm sorry. I have a vector that's eltype is Float64, it has values that i'd like to replace with the words that describe their values. right now when assigning them i'm getting errors since it's type is Float and it needs to be string. so i'd like to convert the first column in the

[julia-users] Select and element from a tuple for each row in an array

2014-03-11 Thread Matthew Crews
I know there has to be a clever way to do this in Julia but I'm stumped. I have a 1d array of tuples and I want to extract the third element from each row of the array. Here is an example of what I'm working with: julia experArr 20-element Array{(Any,Any,Any),1}: (4000,0.97613,1.6e6)

Re: [julia-users] Select and element from a tuple for each row in an array

2014-03-11 Thread John Myles White
Here’s one way: A = { (4000,0.97613,1.6e6), (2000,0.97613,80.0), (8000,0.97613,3.2e6), (1000,0.97613,40.0) } Float64[row[3] for row in A] — John On Mar 11, 2014, at 9:34 PM, Matthew Crews matthewcr...@gmail.com wrote: (4000,0.97613,1.6e6) (2000,0.97613,80.0)

Re: [julia-users] Select and element from a tuple for each row in an array

2014-03-11 Thread John Myles White
Here’s one way: A = { (4000,0.97613,1.6e6), (2000,0.97613,80.0), (8000,0.97613,3.2e6), (1000,0.97613,40.0) } Float64[row[3] for row in A] — John On Mar 11, 2014, at 9:34 PM, Matthew Crews matthewcr...@gmail.com wrote: (4000,0.97613,1.6e6) (2000,0.97613,80.0)

Re: [julia-users] Converting a column of a DataFrame to a string

2014-03-11 Thread John Myles White
Here's one way to do that: UTF8String[string(x) for x in df[:A]] -- John On Mar 11, 2014, at 6:48 PM, Jason Solack jaysol...@gmail.com wrote: no, i'm sorry. I have a vector that's eltype is Float64, it has values that i'd like to replace with the words that describe their values. right now