[julia-users] Re: Change bold text in REPL to normal

2016-02-08 Thread Nitin Arora
+1, i am looking for a solution here as well. On Monday, February 8, 2016 at 12:10:28 AM UTC-8, cormu...@mac.com wrote: > > I'm trying to improve the appearance of text in my Julia REPL. According > to this PR (https://github.com/JuliaLang/julia/pull/11250) (which sadly > seems to have ground

[julia-users] Re: leaky if semantics

2016-02-08 Thread Benjamin Deonovic
If you keep reading from the link you gave: The variable relation is declared inside the if block, but used outside. However, when depending on this behavior, make sure all possible code paths define a value for the variable. The following change to the above function results in a runtime

[julia-users] Latest master: make command fails

2016-02-08 Thread Lutfullah Tomak
Hi All After 'git pull' or new 'git clone', 'make full-source-dist' or 'make -C deps getall' fails with make[1]: *** No rule to make target '/path/to/julia/deps/srccache/libunwind-1.1-julia.tar.gz', needed by 'get-unwind'. Stop. make[1]: *** Waiting for unfinished jobs Do I have to get

Re: [julia-users] Memory allocation free array slices ?

2016-02-08 Thread mschauer
A further possibility is to work with vector of FixedSizeArrays (a julia package). You can cast a dxn array to an n-array of immutable d-FixedSizeVectors (they have the same memory layout) and then access the columns directly using stack allocation (just the same as you would work with a

Re: [julia-users] leaky if semantics

2016-02-08 Thread FQ
did you mean to write 'i==2' instead of 'x==2' in the second if statement? Am 08.02.2016 um 12:41 schrieb David van Leeuwen: > Hello, > > According > to > http://docs.julialang.org/en/release-0.4/manual/control-flow/#man-conditional-evaluation > variables > in if blocks do not introduce

Re: [julia-users] associating outer constructors with different names with a type

2016-02-08 Thread Uri Patish
Hi Stefan, Toivo. Thanks for joining the discussion. Toivo you are on point. Having though more on the matter, I think the right to describe the sitution is a s follows. Suppose we have two immutable types whose data layout is exactly the same, their behavior is exactly the same, and the only

[julia-users] Re: leaky if semantics

2016-02-08 Thread elextr
The x is not kept between iterations of the for see http://docs.julialang.org/en/release-0.4/manual/variables-and-scoping/#for-loops-and-comprehensions On Monday, February 8, 2016 at 9:41:40 PM UTC+10, David van Leeuwen wrote: > > Hello, > > According to >

[julia-users] Re: Nullable{Date}

2016-02-08 Thread 'Greg Plowman' via julia-users
If only Nullables can be null, could we formally define this? isnull(x::Nullable) = x.isnull # already defined in nullable.jl isnull(x) = false # extra definition for everything else > isnull( lp15 ) --> true > isnull( lp16 ) --> MethodError: `isnull` has no method

[julia-users] Nullable{Date}

2016-02-08 Thread Michael Landis
I'm so confused I thought this would be cool: isLeapYr(yr::Int64) = yr % 400 == 0 || (yr % 4 == 0 && yr % 100 != 0) LeapDay(yr) = isLeapYr(yr) ? Date(yr,2,29) : Nullable{Date}() lp15 = LeapDay(2015) --> Nullable{Date}() lp16 = LeapDay(2016) --> 2016-02-29 no surprises there, but when I

[julia-users] Re: Nullable{Date}

2016-02-08 Thread Christopher Alexander
I really like that construction! On Monday, February 8, 2016 at 10:49:41 PM UTC-5, Greg Plowman wrote: > > If only Nullables can be null, could we formally define this? > > isnull(x::Nullable) = x.isnull # already defined in nullable.jl > isnull(x) = false # extra definition

Re: [julia-users] Re: Nullable{Date}

2016-02-08 Thread Michael Landis
Why can't there be a base type upon which all others are based (perhaps by default)? The base class could handle the Nullable situation and everything else would magically inherit that capability. Making a union of a NULL and the actual type is pretty painful for the programmer. Weren't we

[julia-users] Re: Nullable{Date}

2016-02-08 Thread Christopher Alexander
For a null date, I usually just use Date() (Dates.Date()), which returns Jan 1, 0001. Also, you know that there is already a method to check whether or not a year is a leap year right? Dates.isleapyear(y), returns a Bool. http://docs.julialang.org/en/release-0.4/manual/dates/ On Monday,

Re: [julia-users] Nullable{Date}

2016-02-08 Thread Michael Landis
Thanks Erik. Much appreciated... On Mon, Feb 8, 2016 at 7:11 PM, Erik Schnetter wrote: > You need to write > > LeapDay(yr) = isLeapYr(yr) ? Nullable(Date(yr,2,29)) : Nullable{Date}() > > so that the return value is always a Nullable{Date}. > > -erik > > On Mon, Feb 8, 2016

Re: [julia-users] Nullable{Date}

2016-02-08 Thread Michael Landis
I know there's a language theorist out there that thinks having typed Nullables confers some sort of linguistic purity, but I think it's a royal pain. Every function needs to know whether Nullable is possible from all of it's callers? What you gain in semantic purity, you pay for in the

Re: [julia-users] Re: Nullable{Date}

2016-02-08 Thread Jacob Quinn
The problem with that proposition is that it introduces type instability. i.e. the user would be tempted to write code like Michael's original example like LeapDay(yr) = isLeapYr(yr) ? Date(yr,2,29) : Nullable{Date}() where the function `LeapDay` can actually return two different, distinct

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

2016-02-08 Thread Jameson
Calling the ANSI version doesn't preclude the possibility of getting UTF16 data back. In particular, that would be code page 1200 (utf16le) or 1201 (utf16be) for Microsoft Windows. MSDN is inconsistent in their usage of A and whether it means ANSI, OEM, localized-locale, or

Re: [julia-users] Re: Nullable{Date}

2016-02-08 Thread Michael Landis
ah, cool. Missed that. Thanks. The pain in returning a Nullable{Date} is that now I have to unpack it for things like dayofyear(). Nullable introduces a rat's nest of unnecessary complications. On Mon, Feb 8, 2016 at 7:35 PM, Christopher Alexander wrote: > For a null

Re: [julia-users] Re: Nullable{Date}

2016-02-08 Thread Kevin Squire
To be fair, writing code like this is perfectly fine, if you're not concerned about performance (in the area of code that this is written in). I find for my own code that I'll typically write something in a clean but possibly inefficient way, and the profile and optimize where I find bottlenecks.

Re: [julia-users] Nullable{Date}

2016-02-08 Thread Erik Schnetter
You need to write LeapDay(yr) = isLeapYr(yr) ? Nullable(Date(yr,2,29)) : Nullable{Date}() so that the return value is always a Nullable{Date}. -erik On Mon, Feb 8, 2016 at 10:08 PM, Michael Landis wrote: > I'm so confused > > I thought this would be cool: >

Re: [julia-users] Latest master: make command fails

2016-02-08 Thread Yichao Yu
Should be fixed by https://github.com/JuliaLang/julia/pull/14965 now. On Mon, Feb 8, 2016 at 7:18 AM, Lutfullah Tomak wrote: > Hi All > After 'git pull' or new 'git clone', 'make full-source-dist' or 'make -C > deps getall' > fails with > > make[1]: *** No rule to make

Re: [julia-users] Latest master: make command fails

2016-02-08 Thread Lutfullah Tomak
Thanks Yichao, it works now.

Re: [julia-users] Julia version mismatch

2016-02-08 Thread Zheng Wendell
After `make cleanall`, the problem is solved. Thanks! @Mauro

[julia-users] RingArrays.jl - A sliding window into a larger array

2016-02-08 Thread Samuel Massinon
RingArrays is a way to access a large dataset in incremental chucks to limit the amount of memory you need. You would use a RingArray when you are wanting to work with a massive dataset like an array. https://github.com/invenia/RingArrays.jl

[julia-users] Re: Eclipse plugin for Julia

2016-02-08 Thread Harold C.
Dear Viral, Julia is absolutely splendid but the available IDEs… not so much. While I'm optimistic about the evolving Atom-based Juno, I've been wondering if there's any chance of cooperation with RStudio developers. Could it be adapted for Julia? Despite Qt and little customisation features

Re: [julia-users] How to debug Pkg "failed to connect" issue?

2016-02-08 Thread Yichao Yu
On Mon, Feb 8, 2016 at 12:53 PM, Arch Robison wrote: > How do I go about debugging why the Julia package manager can't connect to > Github? I've tried the usual firewall workarounds (see below). Either of > the following works fine: > > git clone

[julia-users] How to debug Pkg "failed to connect" issue?

2016-02-08 Thread Arch Robison
How do I go about debugging why the Julia package manager can't connect to Github? I've tried the usual firewall workarounds (see below). Either of the following works fine: git clone https://github.com/JuliaLang/METADATA.jl git clone git://github.com/JuliaLang/METADATA.jl But within Julia,

[julia-users] Re: Eclipse plugin for Julia

2016-02-08 Thread Oleg Mikulchenko
Congratulations, Viral! And thank you very much - people really need it. For me it is like a deal-maker, now I can go back to Julia, even accepting some rough edges in Eclipse plugin. Oleg

Re: [julia-users] Re: Eclipse plugin for Julia

2016-02-08 Thread Stefan Karpinski
On Mon, Feb 8, 2016 at 1:39 PM, Oleg Mikulchenko wrote: > And thank you very much - people really need it. For me it is like a > deal-maker, now I can go back to Julia, even accepting some rough edges in > Eclipse plugin. Glad it helps! If you find encounter issues with

Re: [julia-users] Re: Announcing "Persist": Evaluating Julia expressions in the background

2016-02-08 Thread Erik Schnetter
On Thu, Feb 4, 2016 at 12:33 PM, cdm wrote: > > any thoughts on how this relates to threading / multi-threading and > parallelisation ... ? By design, this starts a new instance of Julia. Multi-threading within the submitted job will work just fine. The new job can also

Re: [julia-users] Re: Announcing "Persist": Evaluating Julia expressions in the background

2016-02-08 Thread Erik Schnetter
On Wed, Feb 3, 2016 at 9:04 PM, William Patterson wrote: > Hi Eric, > I think this package is great. It increases code readability and provides > functionality otherwise unavailable in Julia and other languages. > > I do have one question though: How do I set slurm parameters such

Re: [julia-users] Re: Announcing "Persist": Evaluating Julia expressions in the background

2016-02-08 Thread Erik Schnetter
Nitin If you have used Persist and found it useful, then I'd be happy if you could let me know which parts worked and which parts didn't work, or caused problems. Thanks, -erik On Thu, Feb 4, 2016 at 6:07 PM, Nitin Arora wrote: > Thank you ! This will help my workflow a

[julia-users] julia build fails on arm

2016-02-08 Thread Lutfullah Tomak
I tried to build julia master on arm but build fails while linking libjulia.so Fail message reads as LINK usr/bin/julia /path/to/julia/usr/lib/libjulia.so: undefined reference to `__register_frame' /path/to/julia/usr/lib/libjulia.so: undefined reference to `__deregister_frame' collect2:

[julia-users] julia build fails on arm

2016-02-08 Thread Lutfullah Tomak
I think there is a pull request now for this at https://github.com/JuliaLang/julia/pull/14996 Sorry for the noise.

[julia-users] log the result to @code_warntype to a file

2016-02-08 Thread ben
Is there a convenient way to do this? If not, what is the inconvenient way? I managed to log to a file by redirecting stdout ~~~ rdstdout, wrstdout = redirect_stdout() @code_warntype(myuglyfunction()) filename=string(Int(Dates.datetime2unix(now(*"-type-stability.log" file=open(filename,"w")

Re: [julia-users] log the result to @code_warntype to a file

2016-02-08 Thread ben
Thanks for the pointer. Unfortunately, I saw this function but I was not able to figure out what the second argument should be Sorry about this. Can you give me a minimal working example, for instance the equivalent of `@code_warntype 2+2`? On Monday, February 8, 2016 at 6:21:59 PM UTC-5,

Re: [julia-users] julia build fails on arm

2016-02-08 Thread Yichao Yu
On Mon, Feb 8, 2016 at 7:23 PM, Lutfullah Tomak wrote: > I think there is a pull request now for this at > > https://github.com/JuliaLang/julia/pull/14996 Yep, this is the failure that PR fixes. > > Sorry for the noise.

Re: [julia-users] log the result to @code_warntype to a file

2016-02-08 Thread ben
Thank you!