[julia-users] Re: multiple dispatch for operators

2016-10-07 Thread Sisyphuss
The multiplication maybe is not the best example. Actually, I wanted to say 
"addition".

I wanted that my operator `+` works for:
1) np.ndarray + np.ndarray
2) np.ndarray + LRmatrix
3) LRmatrix + np.ndarray
4) LRmatrix + LRmatrix

1) is a part of Numpy. 3) and 4) can be implemented by `LRmatrix.__add__`. 
However, 3) does not work because `np.ndarray.__add__` has higher priority 
than `LRmatrix.__radd__`.

In this case, it will be awkward to use an `add` function to wrap them.
 

On Saturday, October 8, 2016 at 8:35:19 AM UTC+2, Sisyphuss wrote:
>
> You mean:
> def mydot(A,B):
> if isinstance(A, np.ndarray) and isinstance(B, np.ndarray):
> return np.dot(A, B)
> else:
> # mycode
> ?
> Maybe you are right. Since I can't overload `np.dot`, maybe the neater way 
> is to write a higher level function and then delegate the work by 
> inspecting the type.
>
>
> On Friday, October 7, 2016 at 7:56:59 PM UTC+2, Gabriel Gellner wrote:
>>
>> Any reason to not just use a function? (like np.dot etc)
>>
>> My understanding is that in python '*' means elementwise multiplication, 
>> so even if you could monkeypatch numpys __mul__ method to do the right 
>> thing wouldn't you be changing the semantics?
>>
>> Gabriel
>>
>> On Friday, October 7, 2016 at 3:51:11 AM UTC-6, Sisyphuss wrote:
>>
>>> In Julia, we can do multiple dispatch for operators, that is the 
>>> interpreter can identify:
>>> float + integer
>>> integer + integer
>>> integer + float
>>> float + float
>>> as well as *user-defined* data structure.
>>>
>>> Recently, I am working on Python (I have no choice because Spark hasn't 
>>> yet a Julia binding). I intended to do the same thing -- multiplication -- 
>>> between a Numpy matrix and self-defined Low-rank matrix. Of course, I 
>>> defined the `__rmul__ ` method for Low-rank matrix. However, it seems to me 
>>> that the Numpy matrix intercepts the `*` operator as its `__mul__` method, 
>>> which expects the argument on the right side of `*` to be a scalar.
>>>
>>> I would like to know if there is anyway around?
>>>
>>>

[julia-users] Re: multiple dispatch for operators

2016-10-07 Thread Sisyphuss
You mean:
def mydot(A,B):
if isinstance(A, np.ndarray) and isinstance(B, np.ndarray):
return np.dot(A, B)
else:
# mycode
?
Maybe you are right. Since I can't overload `np.dot`, maybe the neater way 
is to write a higher level function and then delegate the work by 
inspecting the type.


On Friday, October 7, 2016 at 7:56:59 PM UTC+2, Gabriel Gellner wrote:
>
> Any reason to not just use a function? (like np.dot etc)
>
> My understanding is that in python '*' means elementwise multiplication, 
> so even if you could monkeypatch numpys __mul__ method to do the right 
> thing wouldn't you be changing the semantics?
>
> Gabriel
>
> On Friday, October 7, 2016 at 3:51:11 AM UTC-6, Sisyphuss wrote:
>
>> In Julia, we can do multiple dispatch for operators, that is the 
>> interpreter can identify:
>> float + integer
>> integer + integer
>> integer + float
>> float + float
>> as well as *user-defined* data structure.
>>
>> Recently, I am working on Python (I have no choice because Spark hasn't 
>> yet a Julia binding). I intended to do the same thing -- multiplication -- 
>> between a Numpy matrix and self-defined Low-rank matrix. Of course, I 
>> defined the `__rmul__ ` method for Low-rank matrix. However, it seems to me 
>> that the Numpy matrix intercepts the `*` operator as its `__mul__` method, 
>> which expects the argument on the right side of `*` to be a scalar.
>>
>> I would like to know if there is anyway around?
>>
>>

Re: [julia-users] Re: multiple dispatch for operators

2016-10-07 Thread Sisyphuss
No, no, no, I am expert of neither language. I sincerely want to learn the 
difference between these 2 languages. This will help me better understand 
both Python and Julia.


On Friday, October 7, 2016 at 9:41:43 PM UTC+2, Stefan Karpinski wrote:
>
> I think you're asking on the wrong list :P
>
> On Fri, Oct 7, 2016 at 1:56 PM, Gabriel Gellner  > wrote:
>
>> Any reason to not just use a function? (like np.dot etc)
>>
>> My understanding is that in python '*' means elementwise multiplication, 
>> so even if you could monkeypatch numpys __mul__ method to do the right 
>> thing wouldn't you be changing the semantics?
>>
>> Gabriel
>>
>> On Friday, October 7, 2016 at 3:51:11 AM UTC-6, Sisyphuss wrote:
>>
>>> In Julia, we can do multiple dispatch for operators, that is the 
>>> interpreter can identify:
>>> float + integer
>>> integer + integer
>>> integer + float
>>> float + float
>>> as well as *user-defined* data structure.
>>>
>>> Recently, I am working on Python (I have no choice because Spark hasn't 
>>> yet a Julia binding). I intended to do the same thing -- multiplication -- 
>>> between a Numpy matrix and self-defined Low-rank matrix. Of course, I 
>>> defined the `__rmul__ ` method for Low-rank matrix. However, it seems to me 
>>> that the Numpy matrix intercepts the `*` operator as its `__mul__` method, 
>>> which expects the argument on the right side of `*` to be a scalar.
>>>
>>> I would like to know if there is anyway around?
>>>
>>>
>

[julia-users] multiple dispatch for operators

2016-10-07 Thread Sisyphuss
In Julia, we can do multiple dispatch for operators, that is the 
interpreter can identify:
float + integer
integer + integer
integer + float
float + float
as well as *user-defined* data structure.

Recently, I am working on Python (I have no choice because Spark hasn't yet 
a Julia binding). I intended to do the same thing -- multiplication -- 
between a Numpy matrix and self-defined Low-rank matrix. Of course, I 
defined the `__rmul__ ` method for Low-rank matrix. However, it seems to me 
that the Numpy matrix intercepts the `*` operator as its `__mul__` method, 
which expects the argument on the right side of `*` to be a scalar.

I would like to know if there is anyway around?



[julia-users] Re: Julia Reference Card

2016-09-07 Thread Sisyphuss
There is no Section 3?


On Wednesday, September 7, 2016 at 12:04:29 AM UTC+2, john lynch wrote:
>
> Thanks for the compliment.  I have fixed it in the pdf and the associated 
> odt.
>


Re: [julia-users] Re: Can someone please update Winston?

2016-08-29 Thread Sisyphuss


On Monday, August 29, 2016 at 4:26:44 PM UTC+2, Daniel Carrera wrote:
>
> On 29 August 2016 at 16:07, Chris Rackauckas  > wrote:
>
>> That's exactly the reason why it's a good idea. The backends aren't 
>> swappable, but the code is. And for the most part that means you can just 
>> avoid the cons of any backend instead of having to fight against them. You 
>> could be making all of your plots with the PGFPlots backend for some 
>> publication, and then realize that you need a trisurf plot. You can just 
>> switch the backend and re-save your plots without actually writing new 
>> code, and now they can be all saved and matching in PyPlot.
>>
>
> Wait... doesn't your example imply that the code is *not* quite swappable? 
> If you start with PyPlot and use a trisurf plot, you cannot switch to 
> PGFPlots. I don't want to be too critical. I think Thomas knows that I'm 
> cheering for him from the benches. I totally agree that changing one line 
> from "pyplot()" to "gr()" is infinitely easier than learning GR.jl if you 
> know PyPlot.jl. The main reason I don't use Plots.jl is entirely a personal 
> preference regarding the API.
>

I think Tom may have a more primitive API underneath. If that's the case, 
someone may write a PyPlot-style API for Plots.jl.


Re: [julia-users] Re: A Very Simple Benchmark for Brutal-force Loops in Several Languages: revised, Julia is fast!

2016-08-01 Thread Sisyphuss
Julia is not as "mature" as VBA, which prevents "analysts" of large firms 
adopting it.

In addition, they will be happier to continue using global variables.



On Monday, August 1, 2016 at 8:14:37 AM UTC+2, Eric Forgy wrote:
>
> I mentioned to Prof. Edelman (only half jokingly) at an event in 
> Singapore, that we should add Excel/VBA to the list of benchmarks. 
>
> If I'm in a corporate setting and trying to sell Julia for some internal 
> project, the person making the call has probably never heard of any of the 
> languages in the Julia benchmark, but they have heard of Excel/VBA, so, as 
> silly as it may seem, I actually think it could go a long way for Julia 
> evangelists to see more comparisons to Excel/VBA.
>
> On Monday, August 1, 2016 at 1:45:24 AM UTC+8, hustf wrote:
>>
>> It is nice to have a little check on speed from time to time. I still use 
>> VBA for easy cooperation with less programming savvy colleguaes.
>>
>> Julia 1.17s.
>> VBA (excel alt + f11):12 s.
>>
>> This is a bit unfair to neolithic man Joel Spolsky since no optimization 
>> was performed:
>>
>> Sub benchmark()
>> nsamples = 100
>> Dim y() As Double
>> ReDim y(1 To nsamples)
>> x = y
>> For i = 1 To nsamples
>> x(i) = (i - 1) * 5 / (nsamples - 1)
>> Next
>> Debug.Print ("\nBrutal-force loops, 100 times:")
>> sngtime = Timer
>> For m = 1 To 100
>> For n = 1 To nsamples
>> y(n) = Cos(2 * x(n) + 5)
>> Next
>> Next
>> Debug.Print Timer - sngtime
>> End Sub
>>
>>

Re: [julia-users] ANN: steps towards 0.5.0 release [candidates]

2016-07-15 Thread Sisyphuss
It seems to me that it is the same terminology (RC) as *Battle for Wesnoth.*

On Friday, July 15, 2016 at 10:37:19 AM UTC+2, Scott Jones wrote:
>
> I agree, and it does seem there is a bit of a problem with the 
> nomenclature that the Julia team is using, which doesn't match industry 
> wide practice.
> At least the first Julia release candidate is really just a beta release 
> (i.e. after a feature freeze and branch off of current development), as it 
> is known that it isn't really ready for release,
> and that known bugs/regressions are still being worked on.
>
> Subsequent RCs may actually meet the definition of a release candidate.
>
> On Thursday, July 14, 2016 at 8:34:21 PM UTC+2, David Anthoff wrote:
>>
>> So what you intend to call "release candidate" is a feature complete 
>> build, with a list of known bugs that the core team still intends to fix 
>> before a 0.5.0 release? I.e. in fact the first "release candidate" will not 
>> be a candidate for a release, because of a known list of things that still 
>> need to be fixed? I don't understand why you wouldn't just call that a 
>> "beta", that seems the more common way to designate a build like that, 
>> seems to much better indicate what that build is. But if you do want to 
>> call it RC, then please make sure to communicate to the wider user group 
>> that this build is actually not one that you might declare finished. And 
>> then once you have a RC that is a true candidate for a release, please also 
>> let us know. For me as a user and package developer, I do want to know 
>> whether you think a given build is completely done or not. 
>>
>> I think the more important question though is, where are you tracking the 
>> bugs/regressions that need to be fixed before a 0.5.0 release (at whatever 
>> stage of the process)? 
>>
>> > -Original Message- 
>> > From: julia...@googlegroups.com [mailto:julia- 
>> > us...@googlegroups.com] On Behalf Of Keno Fischer 
>> > Sent: Thursday, July 14, 2016 11:18 AM 
>> > To: julia...@googlegroups.com 
>> > Subject: Re: [julia-users] ANN: steps towards 0.5.0 release 
>> [candidates] 
>> > 
>> > Anything that's not on the milestone right now will not be in the RC 
>> (other 
>> > than the cleanup tasks). 
>> > The RC is there so that people can start fixing packages against 0.5, 
>> without 
>> > having to worry about having to do it again once the release is out. 
>> We'll of 
>> > course continue cleaning up and working on performance regressions, but 
>> > we do need to work towards a release, so we can't block the RC on 
>> those. 
>> > 
>> > On Thu, Jul 14, 2016 at 2:14 PM, David Anthoff  
>> > wrote: 
>> > > This is fun ;) 
>> > > 
>> > > 
>> > > 
>> > > 7 “needs-tests” issues that haven’t been assigned to any milestone. 7 
>> > > “needs-docs” issue with no milestone assigned. 4 “heisebugs” with no 
>> > > milestone attached, one with a “priority” label. 
>> > > 
>> > > 
>> > > 
>> > > Just by looking at any of these it is not clear whether they have 
>> been 
>> > > triaged for 0.5.0, and if so, what the decision was. The main problem 
>> > > will all of these seems to be that it is unclear whether a) no one 
>> has 
>> > > decided about inclusion in 0.5.0 yet, or b) someone decided that this 
>> > > would not go into 0.5.0. I think the milestone suggestion below would 
>> > > allow a pretty easy management of that information. 
>> > > 
>> > > 
>> > > 
>> > > From: julia...@googlegroups.com 
>> > > [mailto:julia...@googlegroups.com] On Behalf Of David Anthoff 
>> > > Sent: Thursday, July 14, 2016 11:04 AM 
>> > > To: julia...@googlegroups.com 
>> > > Subject: RE: [julia-users] ANN: steps towards 0.5.0 release 
>> > > [candidates] 
>> > > 
>> > > 
>> > > 
>> > > There are also 82 bugs that have no milestone assigned. Have these 
>> all 
>> > > been triaged for 0.5.0 inclusion and it was decided that none of 
>> those 
>> > > need to be fixed for 0.5.0? If so, how is that recorded in the issue 
>> > > tracker? Might make sense to have another milestone named “post 
>> 0.5.0” 
>> > > that simply indicates that someone from the core team made sure an 
>> > > issue doesn’t have to be fixed for 0.5.0, but no other scheduling 
>> > > decision has been made about that issue. 
>> > > 
>> > > 
>> > > 
>> > > From: julia...@googlegroups.com 
>> > > [mailto:julia...@googlegroups.com] On Behalf Of David Anthoff 
>> > > Sent: Thursday, July 14, 2016 10:58 AM 
>> > > To: julia...@googlegroups.com 
>> > > Subject: RE: [julia-users] ANN: steps towards 0.5.0 release 
>> > > [candidates] 
>> > > 
>> > > 
>> > > 
>> > > +100 to having a release plan like this! 
>> > > 
>> > > 
>> > > 
>> > > There are 28 open regressions, I assume/hope those will be taken care 
>> > > of before RC1? I.e. after feature freeze, but before RC, right? 
>> > > 
>> > > 
>> > > 
>> > > There are 22 open issues assigned to the 0.5.x milestone. The 
>> > > description for that one says “Bugs to fix in the 0.5.0 or 0.5.x 
>> > > timeframe”. M

Re: [julia-users] JuliaCon schedule announced

2016-07-12 Thread Sisyphuss
I don't observe any trouble.

On Tuesday, July 12, 2016 at 3:16:10 AM UTC+2, Eric Forgy wrote:
>
> Anyone else having trouble watching Stefan's talk? It keeps stalling 
> (feels like I'm on a modem), but my connection is fairly decent
>
>
>
> 
>
> On Tuesday, July 12, 2016 at 7:47:40 AM UTC+8, Viral Shah wrote:
>>
>> Stefan's video is up now, as is Tim Holy's and pretty most of them.
>>
>> Julia 1.0
>> https://www.youtube.com/watch?v=5gXMpbY1kJY
>>
>> Arrays and Iteration
>> https://www.youtube.com/watch?v=fl0g9tHeghA
>>
>> -viral
>>
>> On Saturday, July 9, 2016 at 6:23:48 AM UTC-4, feza wrote:
>>>
>>> Patiently waiting on stefan's talk
>>>
>>> On Sunday, July 3, 2016 at 1:58:48 PM UTC-4, Viral Shah wrote:

 They will keep trickling in. We will announce widely when everything is 
 up. 

 -viral 


 > On 03-Jul-2016, at 9:25 AM, dnm  wrote: 
 > 
 > Will Stefan's talk and the other keynote be up? 
 > 
 > On Friday, July 1, 2016 at 12:36:19 AM UTC-4, Christian Peel wrote: 
 > A link: https://www.youtube.com/user/JuliaLanguage/videos 
 > 
 > On Thu, Jun 30, 2016 at 3:43 AM, Viral Shah  wrote: 
 > They have already started appearing. Hopefully by next week they will 
 all be up and we will announce then. 
 > 
 > -viral 
 > 
 > On Jun 28, 2016 11:44 AM, "mmh"  wrote: 
 > Hi Viral, we have an eta on when the talks will be up on youtube? 
 > 
 > On Wednesday, June 22, 2016 at 11:13:25 AM UTC-4, Viral Shah wrote: 
 > Live streaming was too expensive and we did not do it this year, but 
 we certainly want to next year. 
 > 
 > -viral 
 > 
 > On Jun 22, 2016 10:33 AM, "Gabriel Gellner"  
 wrote: 
 > For future conferences I would be super stoked to pay some fee to 
 have early access if that would help at all. Super stoked to see so many 
 of 
 these sweet talks! 
 > 
 > On Wednesday, June 22, 2016 at 6:49:43 AM UTC-7, Viral Shah wrote: 
 > Yes they will be and hopefully much sooner than last year. 
 > 
 > -viral 
 > 
 > On Jun 22, 2016 7:31 AM, "nuffe"  wrote: 
 > Will all the talks be posted on youtube, like last year? If so, do 
 you know when? Thank you (overseas enthusiast) 
 > 
 > On Thursday, June 9, 2016 at 11:34:18 PM UTC+2, Viral Shah wrote: 
 > The JuliaCon talks and workshop schedule has now been announced. 
 > 
 > http://juliacon.org/schedule.html 
 > 
 > Please buy your tickets if you have been procrastinating. We have 
 seen tickets going much faster this year, and waiting until the day before 
 is unlikely to work this year. Please also spread the message to your 
 friends and colleagues and relevant mailing lists. Here's the conference 
 poster for emailing and printing: 
 > 
 > http://juliacon.org/pdf/juliacon2016poster3.pdf 
 > 
 > -viral 
 > 
 > 
 > 
 > -- 
 > chris...@ieee.org 



[julia-users] Re: A Very Simple Benchmark for Brutal-force Loops in Several Languages: revised, Julia is fast!

2016-07-11 Thread Sisyphuss
It's surprising to see Python so slow and Matlab so fast.

 Python: maybe it will get much faster when using comprehension?
 Matlab: does the JIT compiler translate the loops to C?


On Monday, July 11, 2016 at 2:09:28 PM UTC+2, David Barton wrote:
>
> For reference, with Matlab 2016a: 4.97 sec; Julia 0.4.6: 2.76 sec; Python 
> 3.5.1: 166.76 sec.
>
> Note that there is a mistake in your Matlab code - zeros(n) returns an n 
> by n matrix of zeros (hence running out of memory). Instead you want 
> zeros(1, n) to get a vector.
>
> David
>
> On Monday, 11 July 2016 10:07:01 UTC+1, Zhong Pan wrote:
>>
>> Hi Andreas,
>>
>> Thanks for the comments.
>>
>> * If someone has a more recent Matlab it'll be interesting to try. The 
>> license is so expensive and I don't have access to newer version now.
>>
>> * Yes you are right, I also realized that I don't know how much the 
>> random number generator implementation difference would contribute. One 
>> thing to try is to leave out the random number generations. 
>>
>> I tried it and here's the result: Python 166.44 sec (107.4x, was 64.3x), 
>> Julia 2.56 sec (1.7x, was 0.8x), VC++ 1.55 sec (1.0x as reference), C#.NET 
>> 3.49 sec (2.3x, was 1.1x), Java 10.14 sec (6.5x, was 3.0x), and Matlab 7.75 
>> sec (5.0x, was 3.3x). Therefore, it seems VC++ improved the most by 
>> removing random number generations, and other languages just all look 
>> relatively 1.5 to 2.2 times more slower. Julia is still the fastest aside 
>> from VC++, and C#.NET is still not far behind.
>>
>> Cheers,
>> -Zhong
>>
>>
>> On Monday, July 11, 2016 at 3:27:30 AM UTC-5, Andreas Lobinger wrote:
>>>
>>> 2 small things:
>>>
>>> * a more recent Matlab should already be faster, especially in this loop 
>>> thing
>>> * random generators' runtime -depending on the complexity they spend- 
>>> really makes a difference.
>>>
>>>

[julia-users] Re: When Julia v1.0 will be released?

2016-07-08 Thread Sisyphuss
You should really double (if not triple) the time when estimating. This is 
a rule of thumb.

The technologies keep moving, and it is hard to tell whether Julia1.0 
milestone will include new features.

Even when Julia1.0 comes out, there are still issues on ecosystem and the 
documentation. 

BTW, the GSoC overlaps with the release of the new version. Won't it cause 
any problem?



[julia-users] Re: Drop element from tuple

2016-06-25 Thread Sisyphuss
Why not use `vector`?

On Friday, June 24, 2016 at 4:16:49 PM UTC+2, jw3126 wrote:
>
> I have a Tuple and I want to drop its ith element (e.g. construct a new 
> tuple with the same elements, except the ith is missing). For example
>
> (1,2,3,4) , 1 --> (2,3,4)
> (1,2,3,4) , 3 --> (1,2,4)
> (1,2,3,4) , 4 --> (1,2,3)
>
> How to do this?
>


Re: [julia-users] utils

2016-05-18 Thread Sisyphuss
Thanks! This is what I want!


On Saturday, May 14, 2016 at 11:13:10 PM UTC+2, Tom Breloff wrote:
>
> For lots of small, possibly unrelated and possibly hard to classify 
> functions, I'll typically put them in a file called utils.jl (utilities), 
> misc.jl (miscellaneous) or common.jl (methods shared across modules). It's 
> all roughly the same to me. 
>
> On Saturday, May 14, 2016, Sisyphuss > 
> wrote:
>
>> But what does "Utilities" mean?
>>
>> I plan to put all my small functions frequently used by all other pieces 
>> of code into a single file.
>> Is it the right file name for it?
>>
>>
>>
>> On Friday, May 13, 2016 at 7:11:45 PM UTC+2, Kristoffer Carlsson wrote:
>>>
>>> Utilities.
>>
>>

[julia-users] Re: utils

2016-05-14 Thread Sisyphuss
But what does "Utilities" mean?

I plan to put all my small functions frequently used by all other pieces of 
code into a single file.
Is it the right file name for it?



On Friday, May 13, 2016 at 7:11:45 PM UTC+2, Kristoffer Carlsson wrote:
>
> Utilities.



[julia-users] utils

2016-05-13 Thread Sisyphuss
In many repository, we can find a file naming "utils".

What does it stands for? Some small functions used frequently and 
everywhere?



[julia-users] Re: Julia Utopia: Share your tips and tricks to efficient coding in Julia

2016-05-13 Thread Sisyphuss
I use jupyter notebook in an aggressive way. I consider working in Atom 
when it releases its Linux portable version (at least without installing).

I use `print` and `@show`. But I find the format of `@show` for matrix is 
not very friendly. And I agree with Tamas. I also program with a very 
incremental way to avoid bug for large project.

I use `winston` to visualize my simulation result, because it's simple and 
already satisfies my needs. Tom's `Plots.jl` is also a good choice.

No for me.

I agree with Tamas, one great difficulty of using Julia is to refuse the 
temptation of over optimizing the code.


On Thursday, May 12, 2016 at 7:01:04 PM UTC+2, David Parks wrote:
>
> I'm a few weeks into Julia and excited and motivated to learn and be as 
> efficient as possible. I'm sure I'm not alone. I know my way around now, 
> but am I as efficient as I can be? 
>
> What haven't I tried? What haven't I seen? What haven't I asked?
>
> For those of you who have been around longer, could you share your advice 
> on efficient day-to-day development style?
>
> For example:
>
>- What IDE do you use? Are you using Atom? A combination of Atom and 
>the REPL? Something else?
>- How do you debug complex code efficiently? How do you debug other 
>peoples code efficiently?
>- Do you have a favorite way of visualizing your work?
>- Are there must have tools? packages? utilities?
>- Any simple day-to-day efficiency/advice you could share with others 
>who didn't yet know to ask.
>
>
>

Re: [julia-users] Re: Julia large project example.

2016-05-13 Thread Sisyphuss
In Debug.jl:
module Debug
include("AST.jl")using Debug.AST 
end

After the `include`, `AST` is already in `Debug.jl`'s global scope, why it 
needs to `using Debug.AST` instead of `using AST`? 


On Friday, May 13, 2016 at 12:25:43 AM UTC+2, Tim Holy wrote:
>
> It's been a while, but long ago I remember noticing that Debug.jl has a 
> more 
> fine-grained module structure. 
>
> Best, 
> --Tim 
>
> On Thursday, May 12, 2016 12:34:23 PM Ford Ox wrote: 
> > I did read those and it didn't make it much clearer to me. (Hell I 
> didn't 
> > even know what is coupling until this Thursday morning) 
> > That's why am I asking for example and possibly some page on this topic 
> in 
> > docs, since I have been programming in OO languages all my short 
> > programmers life and Julia comes with completely different approach. 
> > Some things from OO can be achieved by different approach, some things 
> > can't be achieved and shouldn't be even tried to. 
> > I don't want to reinvent the wheel. I don't wanna try make Julia OO. But 
> I 
> > want coupling / nicely distributed code into multiple files (that's why 
> OO 
> > exist in the first place right?). 
> > 
> > And I am sure that many people joining julia (especially with v1.0) will 
> be 
> > asking the same question. Therefore I would expect some official guide 
> at 
> > one visible place (which this thread is no more). 
> > 
> > Dne čtvrtek 12. května 2016 19:40:06 UTC+2 David Anthoff napsal(a): 
> > > Do a search for “encapsulation” in this google group and you’ll find 
> quite 
> > > a number of discussions on some of the design philosophies around this 
> > > topic, many from the julia devs. 
> > > 
> > > 
> > > 
> > > *From:* julia...@googlegroups.com  [mailto: 
> > > julia...@googlegroups.com ] *On Behalf Of *Ford Ox 
> > > *Sent:* Thursday, May 12, 2016 10:20 AM 
> > > *To:* julia-users > 
> > > *Subject:* [julia-users] Re: Julia large project example. 
> > > 
> > > 
> > > 
> > > I am sorry for those words. The idea of that sentence should have 
> been: 
> > > 
> > > "Your approach looks like a big no no. 
> > > Could julia devs share their idea of how should apple encapsulation 
> > > achieved? Since they are the one, who invented this language, they had 
> to 
> > > consider *encapsulation* many times already, so they should be the 
> very 
> > > first person who gives advice on this particular topic (since nobody 
> > > answered this topic well one comes to conclusion that they are also 
> the 
> > > only one who can answer it)." 
> > > 
> > > Thank you for your time and patience devoting to my questions. 
> > > 
> > > Dne čtvrtek 12. května 2016 18:52:22 UTC+2 Kristoffer Carlsson 
> napsal(a): 
> > > 
> > > I am pretty sure the Julia developers can speak for themselves. A more 
> > > humble approach would suit you well. 
>
>

Re: [julia-users] Re: Julia large project example.

2016-05-12 Thread Sisyphuss
I think what is missing in the docs is something like "package design 
guideline".


On Thursday, May 12, 2016 at 10:16:53 PM UTC+2, Scott Jones wrote:
>
> Very good advice - is anything like it already in the Julia docs?  If not, 
> it should be added, up near the beginning.
>
> On Thursday, May 12, 2016 at 4:10:22 PM UTC-4, Tom Breloff wrote:
>>
>> I find the most valuable thing to do when designing julia code is to 
>> focus purely on "verbs", not "nouns".  This means focusing on the action... 
>> NOT the object that is acting.  In julia, you can do fun stuff like:
>>
>> julia> type Car end
>>
>> julia> speed(::Car) = 60
>> speed (generic function with 1 method)
>>
>> julia> type Plane end
>>
>> julia> speed(::Plane) = 500
>> speed (generic function with 2 methods)
>>
>> julia> function move(pointA, pointB, tools...)
>>speeds = map(speed, tools)
>>idx = findmax(speeds)[2]
>>println("""I don't always go fast, but when I do, I prefer a 
>> $(lowercase(string(typeof(tools[idx].
>>   I am... the most interesting coder in the world.""")
>>end
>> move (generic function with 1 method)
>>
>> julia> move(1, 2, Car(), Plane())
>> I don't always go fast, but when I do, I prefer a plane.
>> I am... the most interesting coder in the world.
>>
>> julia> type Teleporter end
>>
>> julia> speed(::Teleporter) = Inf
>> speed (generic function with 3 methods)
>>
>> julia> move(1, 2, Car(), Plane(), Teleporter())
>> I don't always go fast, but when I do, I prefer a teleporter.
>> I am... the most interesting coder in the world.
>>
>> The point with this silly example is that, in OO, you would first start 
>> thinking about all the things that your transportation tools can do, and 
>> about heirarchies of "well, a plane is kind of like a car, and, well, kind 
>> of like a bird.  I know, I'll inherit from both!"  But really you should 
>> think about the important actions and attributes, and the hierarchy and 
>> interactions between objects will follow naturally. 
>>
>>
>> On Thursday, May 12, 2016 at 3:34:23 PM UTC-4, Ford Ox wrote:
>>>
>>> I did read those and it didn't make it much clearer to me. (Hell I 
>>> didn't even know what is coupling until this Thursday morning)
>>> That's why am I asking for example and possibly some page on this topic 
>>> in docs, since I have been programming in OO languages all my short 
>>> programmers life and Julia comes with completely different approach. 
>>> Some things from OO can be achieved by different approach, some things 
>>> can't be achieved and shouldn't be even tried to. 
>>> I don't want to reinvent the wheel. I don't wanna try make Julia OO. But 
>>> I want coupling / nicely distributed code into multiple files (that's why 
>>> OO exist in the first place right?).
>>>
>>> And I am sure that many people joining julia (especially with v1.0) will 
>>> be asking the same question. Therefore I would expect some official guide 
>>> at one visible place (which this thread is no more).
>>>
>>> Dne čtvrtek 12. května 2016 19:40:06 UTC+2 David Anthoff napsal(a):

 Do a search for “encapsulation” in this google group and you’ll find 
 quite a number of discussions on some of the design philosophies around 
 this topic, many from the julia devs.

  

 *From:* julia...@googlegroups.com [mailto:julia...@googlegroups.com] *On 
 Behalf Of *Ford Ox
 *Sent:* Thursday, May 12, 2016 10:20 AM
 *To:* julia-users 
 *Subject:* [julia-users] Re: Julia large project example.

  

 I am sorry for those words. The idea of that sentence should have been:

 "Your approach looks like a big no no. 
 Could julia devs share their idea of how should apple encapsulation 
 achieved? Since they are the one, who invented this language, they had to 
 consider *encapsulation* many times already, so they should be the 
 very first person who gives advice on this particular topic (since nobody 
 answered this topic well one comes to conclusion that they are also the 
 only one who can answer it)."

 Thank you for your time and patience devoting to my questions.

 Dne čtvrtek 12. května 2016 18:52:22 UTC+2 Kristoffer Carlsson 
 napsal(a):

 I am pretty sure the Julia developers can speak for themselves. A more 
 humble approach would suit you well.



Re: [julia-users] Re: Julia large project example.

2016-05-12 Thread Sisyphuss
This sure is valuable advice.

But I'm not sure whether in v1.0, it will be the same case.


On Thursday, May 12, 2016 at 10:10:22 PM UTC+2, Tom Breloff wrote:
>
> I find the most valuable thing to do when designing julia code is to focus 
> purely on "verbs", not "nouns".  This means focusing on the action... NOT 
> the object that is acting.  In julia, you can do fun stuff like:
>
> julia> type Car end
>
> julia> speed(::Car) = 60
> speed (generic function with 1 method)
>
> julia> type Plane end
>
> julia> speed(::Plane) = 500
> speed (generic function with 2 methods)
>
> julia> function move(pointA, pointB, tools...)
>speeds = map(speed, tools)
>idx = findmax(speeds)[2]
>println("""I don't always go fast, but when I do, I prefer a 
> $(lowercase(string(typeof(tools[idx].
>   I am... the most interesting coder in the world.""")
>end
> move (generic function with 1 method)
>
> julia> move(1, 2, Car(), Plane())
> I don't always go fast, but when I do, I prefer a plane.
> I am... the most interesting coder in the world.
>
> julia> type Teleporter end
>
> julia> speed(::Teleporter) = Inf
> speed (generic function with 3 methods)
>
> julia> move(1, 2, Car(), Plane(), Teleporter())
> I don't always go fast, but when I do, I prefer a teleporter.
> I am... the most interesting coder in the world.
>
> The point with this silly example is that, in OO, you would first start 
> thinking about all the things that your transportation tools can do, and 
> about heirarchies of "well, a plane is kind of like a car, and, well, kind 
> of like a bird.  I know, I'll inherit from both!"  But really you should 
> think about the important actions and attributes, and the hierarchy and 
> interactions between objects will follow naturally. 
>
>
> On Thursday, May 12, 2016 at 3:34:23 PM UTC-4, Ford Ox wrote:
>>
>> I did read those and it didn't make it much clearer to me. (Hell I didn't 
>> even know what is coupling until this Thursday morning)
>> That's why am I asking for example and possibly some page on this topic 
>> in docs, since I have been programming in OO languages all my short 
>> programmers life and Julia comes with completely different approach. 
>> Some things from OO can be achieved by different approach, some things 
>> can't be achieved and shouldn't be even tried to. 
>> I don't want to reinvent the wheel. I don't wanna try make Julia OO. But 
>> I want coupling / nicely distributed code into multiple files (that's why 
>> OO exist in the first place right?).
>>
>> And I am sure that many people joining julia (especially with v1.0) will 
>> be asking the same question. Therefore I would expect some official guide 
>> at one visible place (which this thread is no more).
>>
>> Dne čtvrtek 12. května 2016 19:40:06 UTC+2 David Anthoff napsal(a):
>>>
>>> Do a search for “encapsulation” in this google group and you’ll find 
>>> quite a number of discussions on some of the design philosophies around 
>>> this topic, many from the julia devs.
>>>
>>>  
>>>
>>> *From:* julia...@googlegroups.com [mailto:julia...@googlegroups.com] *On 
>>> Behalf Of *Ford Ox
>>> *Sent:* Thursday, May 12, 2016 10:20 AM
>>> *To:* julia-users 
>>> *Subject:* [julia-users] Re: Julia large project example.
>>>
>>>  
>>>
>>> I am sorry for those words. The idea of that sentence should have been:
>>>
>>> "Your approach looks like a big no no. 
>>> Could julia devs share their idea of how should apple encapsulation 
>>> achieved? Since they are the one, who invented this language, they had to 
>>> consider *encapsulation* many times already, so they should be the very 
>>> first person who gives advice on this particular topic (since nobody 
>>> answered this topic well one comes to conclusion that they are also the 
>>> only one who can answer it)."
>>>
>>> Thank you for your time and patience devoting to my questions.
>>>
>>> Dne čtvrtek 12. května 2016 18:52:22 UTC+2 Kristoffer Carlsson napsal(a):
>>>
>>> I am pretty sure the Julia developers can speak for themselves. A more 
>>> humble approach would suit you well.
>>>
>>>

[julia-users] Re: Julia large project example.

2016-05-12 Thread Sisyphuss
I have tried to use Julia module as static class. According to my 
experience, it is doable. You cannot have two modules of the same names 
though. When it comes to your example, it means you can't have two apples 
(this apple and that apple). 

I am afraid you should use immutable Apple type.
immutable Apple
  s::float64
  t::float64
  Apple(a,b) = s > 0 ? new(a,b) : error("size should be positive")
end

Apple()= Apple(rand(),rand())
size(x::Apple) = x.s
taste(x::Apple) = x.t

a = Apple()
size(a)
taste(a)



On Thursday, May 12, 2016 at 4:26:50 PM UTC+2, Ford Ox wrote:
>
> I have checked julia git, but some questions still remain.
>
> Should I use module as class substitution? (Every global variable in 
> module is encapsulated. Same for function unless one uses export). 
> In that case where is my constructor?
>
> In OO languages you know exactly what methods every object has (in IDE you 
> can use CTRL+Space). How can I do that, or should I need to do that in 
> julia?
>
> Let's say I create a module called Apple, with methods taste() and size(), 
> and somebody wants to use that module. Methods taste() and size() are 
> obviously just getters for variables that are somehow stored in Apple 
> module. The user should be never able to change size and taste of apple by 
> himself, those values will be randomly set when constructor is called.
> How do I encapsulate those two variables? Where do I store those two 
> variables (If I store them in type, user must be able to pass that type 
> into Apple methods, thus he can just do AppleType.size  = 6). How do I call 
> constructor if variables are not stored in type?
> Note: I don't want to have immutable AppleType!
>


[julia-users] Re: [ANN] Book: Julia High Performance

2016-05-11 Thread Sisyphuss
I notice the book cost 31.18 euros. Has the discounted period been past?

BTW, when Julia upgrades to v0.5, v0.6,..., v1.0, is this book still valid?



On Tuesday, May 3, 2016 at 1:17:57 AM UTC+2, Avik Sengupta wrote:
>
> Just wanted to let you know about the new book discussing the design and 
> development of high performance julia code. It discusses the tools you can 
> use to analyse the performance of your code, and ways to make it go faster, 
> using the full power of Julia's compiler.  Hope this is useful for some. 
>
> https://www.packtpub.com/application-development/julia-high-performance
>
> Regards
> -
> Avik
>
> (Incidentally, all the ebooks from the publisher are being discounted for 
> the next day or so)
>


[julia-users] Re: [ANN] Spark.jl - Julia interface to Apache Spark

2016-04-15 Thread Sisyphuss
Starred it.


On Friday, April 15, 2016 at 12:00:17 AM UTC+2, Andrei Zh wrote:
>
> Spark.jl provides Julia bindings for Apache Spark - by far the most 
> popular computational framework in Hadoop ecosystem. Find it at:
>  
>
> https://github.com/dfdx/Spark.jl
>
>
> There's still *a lot* of work to do (Spark API is *huge*), but Spark.jl 
> already supports: 
>
>- map and reduce functions, as well as map_partitions, 
>map_partitions_with_index, count, collect and others;
>- text files on local disk and HDFS (and theoretically and 
>Hadoop-compatible file system);
>- local, Standalone and Mesos masters (YARN is quite different, though 
>I work hard to add it as well);
>- adding custom JARs and other files
>
> See Roadmap  for detailed 
> status and nearest plans.
>
> Since Spark's API is so wide and it's hard to prioritize, *I heavily 
> encourage users to submit bugs and feature requests*. Fill free to open 
> new issues or add +1 to push a feature. And as usual, bug reports and pull 
> requests are welcome too. 
>
> *Question to the community:* should this package be transferred to some 
> Julia organization (e.g. JuliaParallel) to make it easier to discover? 
>


[julia-users] Re: Mathematical Computing course in Julia

2016-04-15 Thread Sisyphuss
The doc of Julia is far from helpful.
Most time, you should try it to learn what it actually does.


On Friday, April 15, 2016 at 4:21:41 AM UTC+2, Sheehan Olver wrote:
>
>
> When the course is over I'll give a description of any issues encountered 
> using Julia for teaching.  At the moment there are two big ones: the error 
> messages are hard for students to parse, and the documentation is 
> incomplete.  An example of the latter that came up is 
>
> *help?> **reshape*
>
> search: *reshape* p*r*omot*e*_*shape*
>
>
>   reshape(A, dims)
>
>
>   Create an array with the same data as the given array, but with 
> different dimensions. An
>
>   implementation for a particular type of array may choose whether the 
> data is copied or
>
>   shared.
>
>
>
> It is not clear at all that dims means two (or more) numbers.
>
> On Friday, April 15, 2016 at 12:17:40 PM UTC+10, Sheehan Olver wrote:
>>
>>
>>
>> I'm currently lecturing the course MATH3076/3976 Mathematical Computing 
>> at U. Sydney in Julia, and thought that others may be interested in the 
>> resources I've provided:
>>
>> http://www.maths.usyd.edu.au/u/olver/teaching/MATH3976/
>>
>> The lecture notes and labs are all Jupyter notebooks.  I've also included 
>> a "cheat sheet" of Julia commands used in the course
>>
>>
>> http://nbviewer.jupyter.org/url/www.maths.usyd.edu.au/u/olver/teaching/MATH3976/cheatsheet.ipynb
>>
>> The course is ongoing (it's about half through) and will continue to take 
>> shape, but any feedback is of course welcome!
>>
>>
>> Sheehan Olver
>>
>

[julia-users] Re: diagm for an (n x 1) Array{T, 2}

2016-04-08 Thread Sisyphuss
IMHO, It would also make sense to extend `diagm` to (n x 1 x 1), (n x 1 x 1 
x 1), (1 x n x 1) ... arrays. 

But, if we check the dimension in the function body, it may decrease the 
performance (IMHO).

Note that you can always write `diagm(vec(a))` to transform it to a vector.




On Friday, April 8, 2016 at 6:59:37 AM UTC+2, SrAceves wrote:
>
> Wouldn't it make sense to extend diagm to accept (n x 1) Array{T, 2}?
>


[julia-users] Re: How to initialize a Matrix{T}?

2016-04-08 Thread Sisyphuss
I have a related question:

How to initialize an array of fixed shape except one dimension, such as `m 
* n * 0`. 
And I would like to dynamically increase the last dimension later.


[julia-users] Re: What is the correct way to use the type alias Vector and Matrix in multiple dispatch?

2016-04-06 Thread Sisyphuss
You may want to apply `@vectorize_1arg` macro to `hello`.

http://docs.julialang.org/en/release-0.4/manual/arrays/

On Wednesday, April 6, 2016 at 10:23:16 PM UTC+2, Po Choi wrote:
>
>
> hello(A::Matrix) = 1
> hello(A::Vector{Matrix}) = 2
> A = randn(3,3);
> AA = [randn(3,3) for k in 1:4];
> hello(A)
> hello(AA)
>
> The output has method error.
> julia> hello(A)
> 1
>
> julia> hello(AA)
> ERROR: MethodError: `hello` has no method matching 
> hello(::Array{Array{Float64,2},1})
>
>
> If I write down the types explicitly,
> hi(A::Array{Float64,2}) = 1
> hi(A::Array{Array{Float64,2},1}) = 2
> A = randn(3,3);
> AA = [randn(3,3) for k in 1:4];
> hi(A)
> hi(AA)
> The output is what I expect.
> julia> hi(A)
> 1
>
> julia> hi(AA)
> 2
>
> Am I using Vector and Matrix in a wrong way?
>


Re: [julia-users] constructor & function have different promotion rules?

2016-04-05 Thread Sisyphuss
Yes, I guess.

call(TT, 1, 2)

call(TT, 'a', 'b')




On Tuesday, April 5, 2016 at 4:19:05 PM UTC+2, FANG Colin wrote:
>
> methods(TT)
>
>  call(::Type{TT}, x::Float64, y::Float64) at In[22]:2
>  call(::Type{TT}, x, y) at In[22]:2  
>  call{T}(::Type{T}, arg) at essentials.jl:56 
>  call{T}(::Type{T}, args...) at essentials.jl:57
>
>
> So I guess the rule is applied in  call(::Type{TT}, x, y)
>
> What does it do? Does it try to convert(Float64, x) & convert(Float64, y)? 
> I.e does it always try to convert each argument to the type of the field 
> defined in the type?
>
> On 5 April 2016 at 15:11, Yichao Yu > 
> wrote:
>
>> On Tue, Apr 5, 2016 at 10:09 AM, FANG Colin > > wrote:
>> > Sorry if this has been discussed somewhere as I am unable to find the
>> > relative post.
>> >
>> > immutable TT
>> > x::Float64
>> > y::Float64
>> > end
>> >
>> > function tt(x::Float64, y::Float64)
>> > x + y
>> >
>> > end
>> > tt(1,2) # doesn't work
>> > TT(1,2) # works
>>
>> There are automatic constructors defined with conversion not promotion.
>> See `methods(TT)`
>>
>> >
>> > What rule applies here for TT(1,2)?
>>
>
>

[julia-users] Re: constructor & function have different promotion rules?

2016-04-05 Thread Sisyphuss
Your `tt` only works for `Float64`: `tt(1.0 , 2.0)` works.
To make your code generic, remove the type specification. 


On Tuesday, April 5, 2016 at 4:09:18 PM UTC+2, FANG Colin wrote:
>
> Sorry if this has been discussed somewhere as I am unable to find the 
> relative post.
>
> immutable TT
> x::Float64
> y::Float64
> end
>
> function tt(x::Float64, y::Float64)
> x + y
>
> end
> tt(1,2) # doesn't work
> TT(1,2) # works
>
> What rule applies here for TT(1,2)?
>


[julia-users] Re: Julia is a great idea, but it disqualifies itself for a big portion of its potential consumers

2016-04-02 Thread Sisyphuss
Didn't numpy's `transpose()` function make your life hard?


[julia-users] Re: [ANN] ScikitLearn.jl

2016-03-18 Thread Sisyphuss
Cool!

On Friday, March 18, 2016 at 5:11:47 PM UTC+1, Cedric St-Jean wrote:
>
> I'm happy to announce ScikitLearn.jl 
>  and ScikitLearnBase.jl 
> : a library pair that 
> brings the scikit-learn interface to Julia. 
>
>
> *Highlights*
>
>- Around 150 machine learning and statistical models accessed through 
>a uniform interface
>- Pipelines and FeatureUnions
>- Cross-validation
>- Model selection (hyperparameter tuning)
>- Feature extraction (text processing, one hot encoding, etc.)
>
> Check out the documentation 
> , quick start guide 
>  and example 
> gallery 
> .
>
>
> ScikitLearn.jl uses PyCall.jl for Python models, but the "glue" (eg. 
> Pipelines) was translated to make it possible to implement models in Julia. 
> For instance, one might pipeline a factor analysis model from Python into a 
> deep learning model written in Julia, and use grid search to optimize its 
> hyperparameters. 
>
>
> Any Julia type that implements the scikit-learn interface 
>  can be used with this 
> framework. If you have any issue supporting the interface for your library, 
> ping me @cstjean.
>
>
> Best,
>
> Cédric St-Jean
>


Re: [julia-users] Re: What to read to understand finishing v0.5?

2016-03-10 Thread Sisyphuss
I am monitoring the milestone constantly. I find the percentage does grow: 
27% -> 28% -> 33%

On Wednesday, March 9, 2016 at 7:36:10 PM UTC+1, David Anthoff wrote:
>
> At some point in the summer there was communication from the core team 
> that v0.5 would be a short release cycle that was all about the 
> arraypocalypse theme. My sense is that this original plan is off the table, 
> and that (as John said) there is no new time plan to replace the original 
> one, or at least none has been communicated from the core at this point. 
> Take this info with a grain of salt, I’m largely reading tea-leaves here :)
>
>  
>
> *From:* julia...@googlegroups.com  [mailto:
> julia...@googlegroups.com ] *On Behalf Of *John Myles White
> *Sent:* Wednesday, March 9, 2016 10:17 AM
> *To:* julia-users >
> *Subject:* [julia-users] Re: What to read to understand finishing v0.5?
>
>  
>
> I think it's fair to say that the reason your questions aren't already 
> answered by GitHub is because there's no one who's made an executive 
> decision about the answers to those questions.
>
>  
>
>  -- John
>
> On Wednesday, March 9, 2016 at 4:44:28 AM UTC-8, Andreas Lobinger wrote:
>
> Hello colleagues,
>
> i need a bigger picture of the status of v0.5, dates, timelines, missing 
> features, missing testing, expected closing. Just go to github and select 
> the v0.5 milestone gives me a diverse picture.
>
> Wishing ahappy day,
> Andreas
>
>

[julia-users] Re: Plotsly

2016-03-10 Thread Sisyphuss
Maybe because it is not registered. Try `Pkg.clone()`.


On Thursday, March 10, 2016 at 7:22:42 AM UTC+1, Christoph Ortner wrote:
>
>
> Pkg.add("Plots")
>
> seems to be broken? 
>
>
> julia> Pkg.add("Plots")
> fatal: Not a git repository (or any of the parent directories): .git
>


[julia-users] Re: a excellent Julia IDE, JuliaDT

2016-03-10 Thread Sisyphuss
This can be a choice for those who have no root permission 

On Tuesday, March 8, 2016 at 2:56:39 PM UTC+1, Liye zhang wrote:
>
> If you are trying to find an IDE for Julia which is as convenient as PyDev 
> for python, or RStudio for R, you can test JuliaDT. Thanks for the 
> authors' excellent work!
>
> https://github.com/JuliaComputing/JuliaDT/releases/tag/v0.0.1 
>
> More about this software,
> http://juliacomputing.com/blog/2016/02/06/Eclipse-JuliaDT.html
>


Re: [julia-users] Acessing raw binary data

2016-03-06 Thread Sisyphuss
You may also want to use `bitrand()`, `bitbroadcast()` and so on.

On Thursday, March 3, 2016 at 4:39:11 PM UTC+1, Stefan Karpinski wrote:
>
> Could you use BitVectors? They store boolean vectors using one bit per 
> boolean.
>
> On Thu, Mar 3, 2016 at 8:29 AM, Christina Lee  > wrote:
>
>>
>>
>> I'm interested in looking at how to perform exact diagonalization of 
>> various quantum states in Julia.
>>
>> This problem is often memory limited, but the states can often be 
>> represented by strings of 0 and 1 (binary format).  Not only that, but 
>> various binary operations, and converting to other bases come in handy for 
>> solving the problem.  
>>
>> I can just work with array's of Int8, but binary would give a great boost 
>> if possible,
>>
>
>

[julia-users] Re: ANN: JuMP 0.12 released

2016-02-28 Thread Sisyphuss
Given that JuMP and Convex.jl are both AMLs, I always don't understand the 
difference between them.


On Saturday, February 27, 2016 at 11:14:16 PM UTC+1, Miles Lubin wrote:
>
> The JuMP team is happy to announce the release of JuMP 0.12.
>
> This release features a complete rewrite of JuMP's automatic 
> differentiation functionality, which is the largest change in JuMP's 
> nonlinear optimization support since JuMP 0.5. Most of the changes are 
> under the hood, but as previously announced 
>  there are 
> a couple of syntax changes:
> - The first parameter to @defNLExpr *and* @defExpr should now be the 
> model object. All linear and nonlinear subexpressions are now attached to 
> their corresponding model.
> - If solving a sequence of nonlinear models, you should now use nonlinear 
> parameters instead of Julia's variable binding rules.
>
> Many nonlinear models should see performance improvements in JuMP 0.12, 
> let us know if you observe otherwise.
>
> We also now support user-defined functions 
>  
> and *automatic differentiation of user-defined functions*. This is quite 
> a significant new feature which allows users to integrate (almost) 
> arbitrary code as a nonlinear function within JuMP expressions, thanks to 
> ForwardDiff.jl . We're 
> looking forward to seeing how this feature can be used in practice; please 
> give us feedback on the syntax and any rough edges you run into.
>
> Other changes include:
> - Changed syntax for iterating over AffExpr objects
> - Stopping the solver from within a callback now causes the solver to 
> return :UserLimit instead of throwing an error.
> - getDual() now works for conic problems (thanks to Emre Yamangil)
>
> Given the large number of changes, bugs are possible. Please let us know 
> of any incorrect or confusing behavior.
>
> Miles, Iain, and Joey
>


[julia-users] Re: [ANN] GLVisualize

2016-02-27 Thread Sisyphuss
It's just fantastic! I wonder if it will be the Matplotlib of Julia

On Friday, February 26, 2016 at 11:11:02 PM UTC+1, Simon Danisch wrote:
>
> Hi
>
> this is the first release of GLVisualize.jl 
> , a 2D/3D visualization 
> library completely written in Julia and OpenGL.
>
> You can find some crude documentation on glvisualize.com 
> .
> I hope to improve the examples and the documentation in the coming weeks.
> The biggest problem for most people right now will be a slightly flaky 
> camera and missing guides and labels.
> This is being worked on! If someone beats me to the guide/axis creation, 
> I'd be very happy. This could be a fun project to get started with 
> GLVisualize.
> Please feel free to open any issue concerning missing documentation, 
> discrepancies  and 
> bugs!
>
> Relation to GLPlot :
> GLPlot is now a thin wrapper for GLVisualize with a focus on plotting. 
> Since I concentrated mostly on finishing GLVisualize, it's a reeally thin 
> wrapper. 
> It basically just forwards all calls to GLVisualize, and adds a 
> boundingbox around the objects. 
> In the future, it should offer some basic UI, automatic creation of 
> axis/labels, screenshots and an alternative API that is more familiar to 
> people that are coming from other plotting libraries (e.g. functions like 
> surf, contourf, patches).
> If anyone has specific plans on how this could look like don't hesitate to 
> open issues and PR's!
>
> Outlook:
> I'd like to make GLVisualize more independent of the rendering backend by 
> using some backend agnostic geometry 
>  
> representation.
> This will make it easier to integrate backends like FireRender 
> , WebGL, Vulkan 
>  (why Vulkan 
> ), 
> or some text based backends like PDF/SVG.
>
> Furthermore, I'd like to improve the performance and interaction 
> possibilities.
>
> I have to thank the Julia Group for supporting me :) It's a pleasure to be 
> a part of the Julia community!
>
> I'm looking forward to the great visualizations you'll create!
>
> Best,
> Simon Danisch
>


[julia-users] Just a noob question: why are some test-failing PR merged?

2016-02-23 Thread Sisyphuss


I had a glance at the closed PRs at the GitHub.

I found that some PRs didn't pass any/all tests (av,ci), but they still got 
merged. For example, this one 


So I wonder why


Re: [julia-users] A scope bug?

2016-02-22 Thread Sisyphuss
I made a mistake. 
Sorry for the noise. 

On Monday, February 22, 2016 at 1:27:20 PM UTC+1, Yichao Yu wrote:
>
> On Mon, Feb 22, 2016 at 5:59 AM, Sisyphuss  > wrote: 
> > I have the following PageRank code: 
> > n = 5 
> > adj = Float64[0 0 1 1 0; 
> >   0 0 1 0 0; 
> >   0 1 0 0 0; 
> >   1 0 1 0 1; 
> >   0 1 1 0 0] 
> > adj ./= sum(adj,2) 
> > 
> > pageRank = ones(Float64,n) 
> > N = 1 
> > for t = 1:N 
> >   temp = zeros(n) 
> >   for j = 1:n 
> > temp[j] = 0.15 + 0.85 * vecdot(pageRank,adj[:,j]) 
> > pageRank = copy(temp) # this line should have been put below, but 
> isn't 
> > harmful here either 
>
> I'm not sure about the algorithm but putting this line here vs below 
> are obviously difference since it is used one line above in the loop. 
>
> >   end 
> >   # pageRank = copy(temp) 
> > end 
> > 
> > pageRank 
> > 
> > 5-element Array{Float64,1}: 
> >  0.43 
> >  0.15 
> >  0.461667 
> >  0.334167 
> >  0.244681 
> > 
> > 
> > However, the correct result should be 
> > 
> > 5-element Array{Float64,1}: 
> >  0.43 
> >  1.425 
> >  2.1 
> >  0.575 
> >  0.43 
> > 
> > if the `pageRank = copy(temp)` is placed in the right place. 
> > 
> > This makes the 2nd and 3rd item do not converge when N is large enough. 
> > 
> > Is it a bug? Or am I missing something? 
> > 
>


[julia-users] A scope bug?

2016-02-22 Thread Sisyphuss
I have the following PageRank code:
n = 5
adj = Float64[0 0 1 1 0;
  0 0 1 0 0;
  0 1 0 0 0;
  1 0 1 0 1;
  0 1 1 0 0]
adj ./= sum(adj,2)

pageRank = ones(Float64,n)
N = 1
for t = 1:N
  temp = zeros(n)
  for j = 1:n
temp[j] = 0.15 + 0.85 * vecdot(pageRank,adj[:,j])
pageRank = copy(temp) # this line should have been put below, but isn't 
harmful here either
  end
  # pageRank = copy(temp)
end

pageRank

5-element Array{Float64,1}:
 0.43
 0.15
 0.461667
 0.334167
 0.244681


However, the correct result should be

5-element Array{Float64,1}:
 0.43
 1.425   
 2.1 
 0.575   
 0.43

if the `pageRank = copy(temp)` is placed in the right place.

This makes the 2nd and 3rd item do not converge when N is large enough.

Is it a bug? Or am I missing something?



[julia-users] Re: Google Summer of Code 2016 - Ideas Page

2016-02-11 Thread Sisyphuss
Since Atom will be the canonical IDE for Julia, maybe the project juliette 
can be removed from that list.


On Thursday, February 11, 2016 at 4:49:19 AM UTC+1, Shashi Gowda wrote:
>
> Hi all,
>
> I have merged the previous ideas pages (2015, 2014) into a canonical one 
> https://julialang.org/soc/ideas-page (and set up the appropriate 
> redirects)
>
> Please add your Summer of Code ideas and edit previous ones here 
> https://github.com/JuliaLang/julialang.github.com/edit/master/soc/ideas-page.md
>
> Let us also try and keep this page updated all year round so that ideas 
> get carried over to the next summer.
>
> Julia will be applying for GSoC 2016. The organization application 
> deadline is on 19th, it will be nice to have a high quality ideas page by 
> then.
>
> Thank you
>


[julia-users] Julia on Ubuntu tablet M10

2016-02-11 Thread Sisyphuss


Canonical and Bq are going to launch a tablet running Ubuntu this year.

Is Julia able to run on that platform ?


[julia-users] Re: citing Julia

2016-02-05 Thread Sisyphuss
Large packages often offer this information in their Github "readme.md"


On Friday, February 5, 2016 at 7:58:39 AM UTC+1, kleinsplash wrote:
>
> How about citing a specific package? 
>
> On Wednesday, 17 July 2013 03:13:24 UTC+2, georgiana wrote:
>>
>> Is there a suggested way to cite Julia if used for a publication?
>>  
>> Georgiana
>>
>

Re: [julia-users] Juno IDE

2016-02-02 Thread Sisyphuss
I didn't know that, since I use Winston, a light-weighted plotting package 
which already satisfies my need.

I think getting the foundations really right is more important than adding 
other plotting packages. 

For now, I can always use LT, and wait for Julia version 0.5 to checkout 
Atom.

I think by then the Plotly package will also become mature.


On Tuesday, February 2, 2016 at 7:22:23 PM UTC+1, Mike Innes wrote:
>
> Currently we do support Gadfly
>
> On Tue, 2 Feb 2016 at 18:19 Sisyphuss > 
> wrote:
>
>> The multimedia support, specifically, the image support is the only 
>> remaining issue that hold me back from Atom.
>>
>>>
>>>
>>> 4) We want to support different workflows as well as we can. The Atom 
>>> work includes a repl which is going to get a lot nicer over the next couple 
>>> weeks. If there are any other obvious missing features, you're welcome to 
>>> mention them.
>>>
>>>>
>>>>

Re: [julia-users] Juno IDE

2016-02-02 Thread Sisyphuss
The multimedia support, specifically, the image support is the only 
remaining issue that hold me back from Atom.

>
>
> 4) We want to support different workflows as well as we can. The Atom work 
> includes a repl which is going to get a lot nicer over the next couple 
> weeks. If there are any other obvious missing features, you're welcome to 
> mention them.
>
>>
>>

[julia-users] Re: Juno IDE

2016-02-02 Thread Sisyphuss
I infer that you are using a Juno/Julia bundle. For this purpose, you may 
prefer downloading it from here 
.

Or you can also install Julia and Juno separately like Arch by following 
this manual . 

Juno isn't very mature yet. We should be patient before it becomes a 
full-fledged IDE.



On Tuesday, February 2, 2016 at 6:23:08 AM UTC+1, David Blake wrote:
>
> Hi guys, some help please.
>
> A while back I downloaded and installed Julia Studio and wrote 10-20 
> little programs in it.  I found it quite good but now it's been 
> discontinued of course.
>
> So I'm looking at Juno, but man I find it hard to use.  I've read a bit on 
> here about it, but I still feel like I have no idea what I'm doing.  I'd 
> very much appreciate some help with this:
>
> These are pretty basic questions, so please don't flame me.  I'm on 
> Windows 10, 64 bit.
>
> 1) Every time I start Juno, it tells me a new binary version of LightTable 
> (LT) is available and do I want to download it.  It doesn't sort of update 
> automatically, just opens a link to the download site for LT.  So then I'm 
> unclear as to what to do, I can download the LT binary but then what?  I 
> have Juno, which is on top of LT, how to upgrade the underlying LT 
> version?  Or should I just not worry about it?
>
> 2) Also, how would I upgrade the underlying Julia language to the latest 
> version please?  In another site, I saw how to use versioninfo, it shows 
> 3.10.
>
> 3) There seem to be very few commands available via the menu, but lots and 
> lots via Ctrl-space.  I find this quite different to most IDEs.  Is this 
> just the way LT works? And just a matter of getting used to it?  If so, I'm 
> OK with that.
>
> 4) The workflow pattern I normally like to use with other languages like 
> Python is to write my code in scripts and then run from a console, 
> preferably all within an IDE.  So I use Spyder for Python and find it very 
> good.  I'd like to use Juno the same way.  As opposed to say having a text 
> editor open to code in, and a separate console window to run files from 
> etc.  Do people use Juno like this? i.e. like a standalone thing?
>
> Any help appreciated.
>
>

[julia-users] Julia version mismatch

2016-01-29 Thread Sisyphuss
I have this problem:

When I type
Julia --version

it shows that I am in 0.4.2-pre

But when I enter the Julia REPL,
I am in 0.4.4-pre+24





[julia-users] Re: Julia Benchmarks Feedback

2016-01-27 Thread Sisyphuss
In the Matmul benchmark, "Julia Native" ranks 1st. 
What is Julia Native?


On Wednesday, January 27, 2016 at 7:02:51 AM UTC+1, Nitin Arora wrote:
>
> Check out this thread. There seems to be discussion on this matter 
> already. Looks like the code used for these benchmarks was not well 
> optimized for Julia and looks they are including Julia startup time and JIT 
> compilation.
>
> https://groups.google.com/d/topic/julia-users/4AgBccftrps/discussion
>
> and 
>
> https://github.com/JuliaLang/julia/issues/14808#event-527206420
>
>
> On Tuesday, January 26, 2016 at 8:07:54 PM UTC-8, George wrote:
>>
>> I was surprised to se the results on the following benchmarks:
>> https://github.com/kostya/benchmarks
>>
>> Some benchmarks of different languages 
>> Brainfuck
>>
>> Brainfuck 
>> bench.b
>> LanguageTime,sMemory, Mb
>> Nim Clang 3.21 0.7
>> Felix 4.07 1.3
>> Nim Gcc 4.52 0.6
>> Java 4.94 147.6
>> C++ 5.08 1.1
>> Rust 5.46 4.9
>> Scala 5.90 116.3
>> D 6.57 1.0
>> D Ldc 6.61 0.9
>> Crystal 6.97 1.3
>> Go 7.29 1.3
>> Javascript Node 8.74 15.0
>> D Gdc 8.87 1.0
>> Julia 9.25 59.0
>> Javascript V8 9.41 8.1
>> Go Gcc 13.60 10.0
>> Python Pypy 13.94 55.4
>> Javascript Jx 17.14 11.0
>> C# Mono 18.08 15.4
>> OOC 48.86 1.3
>> Ruby JRuby 87.05 124.1
>> Ruby Topaz 112.91 36.0
>> Ruby JRuby9K 160.15 297.2
>> Ruby 226.86 8.0
>> Tcl 262.20 2.7
>> Python 452.44 4.9
>> Ruby Rbx 472.08 45.0
>> Python3 480.78 5.5 mandel.b
>>
>> Mandel in Brainfuck 
>> 
>> LanguageTime,sMemory, Mb
>> Nim Clang 28.96 1.0
>> Felix 40.06 3.7
>> D Ldc 43.30 0.9
>> D 45.29 1.2
>> Rust 46.34 4.9
>> Crystal 48.62 1.3
>> Nim Gcc 50.45 0.9
>> Go 52.56 7.6
>> Java 55.14 69.9
>> Cpp 56.63 1.1
>> Scala 64.37 126.4
>> D Gdc 70.12 1.5
>> Go Gcc 85.67 10.7
>> Javascript Node 92.65 15.8
>> Julia 94.33 56.9
>> ...
>
>

[julia-users] Re: Lies... and then benchmarks...

2016-01-26 Thread Sisyphuss
Yeah, this is Jeff's Femato !

On Wednesday, January 27, 2016 at 12:57:49 AM UTC+1, Ismael Venegas 
Castelló wrote:
>
> That is just one implementation of scheme among many, try:
>
> julia --lisp
>
> ;-)
>
> El martes, 26 de enero de 2016, 17:49:00 (UTC-6), Sisyphuss escribió:
>>
>> Didn't imagine that the Scheme is called "gauche" in Ubuntu...
>>
>> P.S. "gauche" is a French word, which means "left"
>>
>>
>>
>> On Wednesday, January 27, 2016 at 12:24:14 AM UTC+1, Ismael Venegas 
>> Castelló wrote:
>>>
>>> I wondered the same first time I saw quine-relay! ...Yusuke is genius :D
>>>
>>> * https://github.com/mame/quine-relay
>>>
>>> El martes, 26 de enero de 2016, 16:49:29 (UTC-6), Sisyphuss escribió:
>>>>
>>>> I didn't know that a man can learn so many languages... is he a genius? 
>>>>
>>>>
>>>> On Tuesday, January 26, 2016 at 11:39:00 PM UTC+1, Ismael Venegas 
>>>> Castelló wrote:
>>>>>
>>>>> @ylluminate <https://github.com/ylluminate> looking at the structure 
>>>>> of the Julia programs, I can only see @kostya 
>>>>> <https://github.com/kostya> is timing both Julia startup, the JIT and 
>>>>> the code at the same time, which is wrong
>>>>>
>>>>>- https://github.com/kostya/benchmarks/blob/master/base64/test.jl
>>>>>- 
>>>>>https://github.com/kostya/benchmarks/blob/master/base64/run.sh#L25-L26
>>>>>
>>>>> Let's continue this discussion at julia-users:
>>>>>
>>>>>- https://groups.google.com/forum/#!topic/julia-users/4AgBccftrps
>>>>>
>>>>>
>>>>> El martes, 26 de enero de 2016, 16:36:22 (UTC-6), Ismael Venegas 
>>>>> Castelló escribió:
>>>>>>
>>>>>> Continues: 
>>>>>> https://github.com/JuliaLang/julia/issues/14808#event-527206420
>>>>>>
>>>>>

[julia-users] Re: Lies... and then benchmarks...

2016-01-26 Thread Sisyphuss
Didn't imagine that the Scheme is called "gauche" in Ubuntu...

P.S. "gauche" is a French word, which means "left"



On Wednesday, January 27, 2016 at 12:24:14 AM UTC+1, Ismael Venegas 
Castelló wrote:
>
> I wondered the same first time I saw quine-relay! ...Yusuke is genius :D
>
> * https://github.com/mame/quine-relay
>
> El martes, 26 de enero de 2016, 16:49:29 (UTC-6), Sisyphuss escribió:
>>
>> I didn't know that a man can learn so many languages... is he a genius? 
>>
>>
>> On Tuesday, January 26, 2016 at 11:39:00 PM UTC+1, Ismael Venegas 
>> Castelló wrote:
>>>
>>> @ylluminate <https://github.com/ylluminate> looking at the structure of 
>>> the Julia programs, I can only see @kostya <https://github.com/kostya> is 
>>> timing both Julia startup, the JIT and the code at the same time, which is 
>>> wrong
>>>
>>>- https://github.com/kostya/benchmarks/blob/master/base64/test.jl
>>>- 
>>>https://github.com/kostya/benchmarks/blob/master/base64/run.sh#L25-L26
>>>
>>> Let's continue this discussion at julia-users:
>>>
>>>- https://groups.google.com/forum/#!topic/julia-users/4AgBccftrps
>>>
>>>
>>> El martes, 26 de enero de 2016, 16:36:22 (UTC-6), Ismael Venegas 
>>> Castelló escribió:
>>>>
>>>> Continues: 
>>>> https://github.com/JuliaLang/julia/issues/14808#event-527206420
>>>>
>>>

[julia-users] Re: Lies... and then benchmarks...

2016-01-26 Thread Sisyphuss
See what I find :"yes, i am bad at julia, pr please how to better code in 
it. or i can remove the tests with julia."
Ref: https://github.com/kostya/benchmarks/issues/9



On Wednesday, January 27, 2016 at 12:24:14 AM UTC+1, Ismael Venegas 
Castelló wrote:
>
> I wondered the same first time I saw quine-relay! ...Yusuke is genius :D
>
> * https://github.com/mame/quine-relay
>
> El martes, 26 de enero de 2016, 16:49:29 (UTC-6), Sisyphuss escribió:
>>
>> I didn't know that a man can learn so many languages... is he a genius? 
>>
>>
>> On Tuesday, January 26, 2016 at 11:39:00 PM UTC+1, Ismael Venegas 
>> Castelló wrote:
>>>
>>> @ylluminate <https://github.com/ylluminate> looking at the structure of 
>>> the Julia programs, I can only see @kostya <https://github.com/kostya> is 
>>> timing both Julia startup, the JIT and the code at the same time, which is 
>>> wrong
>>>
>>>- https://github.com/kostya/benchmarks/blob/master/base64/test.jl
>>>- 
>>>https://github.com/kostya/benchmarks/blob/master/base64/run.sh#L25-L26
>>>
>>> Let's continue this discussion at julia-users:
>>>
>>>- https://groups.google.com/forum/#!topic/julia-users/4AgBccftrps
>>>
>>>
>>> El martes, 26 de enero de 2016, 16:36:22 (UTC-6), Ismael Venegas 
>>> Castelló escribió:
>>>>
>>>> Continues: 
>>>> https://github.com/JuliaLang/julia/issues/14808#event-527206420
>>>>
>>>

[julia-users] Re: Lies... and then benchmarks...

2016-01-26 Thread Sisyphuss
I didn't know that a man can learn so many languages... is he a genius? 


On Tuesday, January 26, 2016 at 11:39:00 PM UTC+1, Ismael Venegas Castelló 
wrote:
>
> @ylluminate  looking at the structure of 
> the Julia programs, I can only see @kostya  is 
> timing both Julia startup, the JIT and the code at the same time, which is 
> wrong
>
>- https://github.com/kostya/benchmarks/blob/master/base64/test.jl
>- 
>https://github.com/kostya/benchmarks/blob/master/base64/run.sh#L25-L26
>
> Let's continue this discussion at julia-users:
>
>- https://groups.google.com/forum/#!topic/julia-users/4AgBccftrps
>
>
> El martes, 26 de enero de 2016, 16:36:22 (UTC-6), Ismael Venegas Castelló 
> escribió:
>>
>> Continues: 
>> https://github.com/JuliaLang/julia/issues/14808#event-527206420
>>
>

Re: [julia-users] Nested functions cause type instability?

2016-01-26 Thread Sisyphuss
Hope that when this is all finished, there could be a blog explaining this 
new feature, which solves the closure problem!

On Tuesday, January 26, 2016 at 7:29:23 PM UTC+1, Stefan Karpinski wrote:
>
> Currently, yes. This will change very soon.
>
> On Tue, Jan 26, 2016 at 1:24 PM, Sisyphuss  > wrote:
>
>> I have the following code:
>>
>> function factorial(n)
>>   function fact_iter(product, counter, max_count)
>> if counter > max_count
>>   product
>> else
>>   fact_iter(product * counter, counter + one(counter), max_count)
>> end
>>   end
>>
>>   fact_iter(one(n),one(n),n)
>> end
>>
>> By `@code_warntype factorial(10)`, it is "end::Any", which means type 
>> instable.
>>
>> However, if I move the definition of `fact_iter` outside, it will get 
>> "end::Int64", which means type stable.
>>
>
>

[julia-users] Tail call optimization

2016-01-26 Thread Sisyphuss


I wrote 3 versions of factorial: by recursion, by iteration, by for-loop

rec_factorial(n) = n == one(n) ? one(n) : n * rec_factorial(n-1)

function iter_factorial(n)
  fact_iter(one(n),one(n),n)
end

function fact_iter(product, counter, max_count)
  if counter > max_count
product
  else
fact_iter(product * counter, counter + one(counter), max_count)
  end
end

function myfactorial(n)
  product = one(n)
  for i = one(n):n
product *= i
  end
  product
end

Then I timed it:
@timeit rec_factorial(1)   # 28.84 µs
@timeit iter_factorial(1)  # 24.15 µs
@timeit myfactorial(1) #  8.06 µs
This result is robust.

Now, the question is how to explain tis result:
1) why version 2 is slightly faster than version 1?
2) why version 3 is mush faster than the other 2? Has the tail call 
optimization really worked here?


[julia-users] Nested functions cause type instability?

2016-01-26 Thread Sisyphuss
I have the following code:

function factorial(n)
  function fact_iter(product, counter, max_count)
if counter > max_count
  product
else
  fact_iter(product * counter, counter + one(counter), max_count)
end
  end

  fact_iter(one(n),one(n),n)
end

By `@code_warntype factorial(10)`, it is "end::Any", which means type 
instable.

However, if I move the definition of `fact_iter` outside, it will get 
"end::Int64", which means type stable.


[julia-users] Re: a good IDE for Julia ? (Julia Studio does not work with Julia v 0.3.0)

2016-01-26 Thread Sisyphuss
Wait for Juno/Atom and use Juno/LT for now.

Ref: http://junolab.org/docs/install-manual.html


On Saturday, January 23, 2016 at 9:11:49 PM UTC+1, PattiMichelle wrote:
>
> Eclipse isn't terribly user-friendly for noobs like me - has anyone been 
> able to get liclipse to point to their Juila install?  If so, can you share?
>
> Thanks!!
>


[julia-users] Re: ANN: Julia v0.4.3 released

2016-01-26 Thread Sisyphuss
Because Juno IDE is developed and maintained by another organization 
Junolab.
If you would like to use the latest version of Julia inside Juno, you could 
"install it from LightTable" by following the instructions here 
.

On Sunday, January 24, 2016 at 11:10:38 AM UTC+1, hustf wrote:
>
> The Julia + Juno Ide Windows 64 bundles are still version 0.4.2.
>
>
>
> torsdag 14. januar 2016 19.27.48 UTC+1 skrev Tony Kelman følgende:
>>
>> Hello all! The latest bugfix release of the Julia 0.4.x line has been 
>> released. Binaries are available from the usual place 
>> , and as is typical with such things, 
>> please report all issues to either the issue tracker 
>> , or email the julia-users 
>> list. (If you reply to this message on julia-users, please do not cc 
>> julia-news which is intended to be low-volume.)
>>
>> This is a bugfix release, see this commit log 
>>  for the 
>> list of bugs fixed between 0.4.2 and 0.4.3. Bugfix backports to the 0.4.x 
>> line will be continuing with a target of one point release per month. If 
>> you are a package author and want to rely on functionality that did not 
>> work in earlier 0.4.x releases but does work in 0.4.3 in your package, 
>> please be sure to change the minimum julia version in your REQUIRE file to 
>> 0.4.3 accordingly. If you're not sure about this, you can test your package 
>> specifically against older 0.4.x releases on Travis and/or locally.
>>
>> These are recommended upgrades for anyone using previous releases, and 
>> should act as drop-in replacements. If you find any regressions relative to 
>> previous releases, please let us know.
>>
>> -Tony
>>
>>

[julia-users] Re: Sort function

2016-01-20 Thread Sisyphuss
>From the error information, the comparison of Array is not implemented yet.


On Wednesday, January 20, 2016 at 4:48:40 PM UTC+1, Ted Fujimoto wrote:
>
> Hi,
>
> In Python, we have this:
>
> >>> sorted([(1, [2,3]), (1,[2,1])])
> [(1, [2, 1]), (1, [2, 3])]
>
> In Julia, this produces a MethodError:
>
> julia> sort([(1, [2,3]), (1,[2,1])])
> ERROR: MethodError: `isless` has no method matching 
> isless(::Array{Int64,1}, ::Array{Int64,1})
>  in isless at tuple.jl:113
>  in sort! at sort.jl:221
>  in sort! at sort.jl:310
>  in sort! at sort.jl:402
>  in sort at sort.jl:413
>
> Is this desirable? Should this be submitted as an issue?
>
> Thanks.
>
>
>

[julia-users] Difference between Juno/LT & Juno/Atom

2016-01-14 Thread Sisyphuss
LightTable is built on Electron which itself is the shell of Atom.

So LightTable could be seen as an IDE sister of Atom.

So Juno/LT & Juno/Atom is basically the same thing.

Is there any nuance? Or what's the future? 


[julia-users] Difference between Juno/LT & Juno/Atom

2016-01-14 Thread Sisyphuss
LightTable is built on Electron which itself is the shell of Atom.

So LightTable could be seen as an IDE sister of Atom.

So Juno/LT & Juno/Atom is basically the same thing.

Is there any nuance? Or what's the future? 


[julia-users] Re: Pre-ANN: JuliaJS.jl

2016-01-08 Thread Sisyphuss
@Eric, thanks for your explanation in the other post, and sorry for the 
late response (I was in China). 


[julia-users] Re: Atom inline evaluation shortcut

2015-12-12 Thread Sisyphuss
Thanks !

On Saturday, December 12, 2015 at 7:40:06 PM UTC+1, randm...@gmail.com 
wrote:
>
> Shift-Enter for evaling and jumping to the next executable block of code 
> hasn't been implemented yet in Juno/Atom. See 
> https://github.com/JunoLab/atom-julia-client/issues/24 and its dependency 
> https://github.com/JunoLab/atom-julia-client/issues/9 .
>
> Am Samstag, 12. Dezember 2015 14:37:34 UTC+1 schrieb Sisyphuss:
>>
>> After experience, this command evaluates all codes.
>> Furthermore, it doesn't put the feedback inline.
>>
>> On Saturday, December 12, 2015 at 2:31:25 PM UTC+1, Eric Forgy wrote:
>>>
>>> Try Cntrl + Shift + Enter
>>
>>

[julia-users] Re: Pre-ANN: PlotlyJS.jl

2015-12-12 Thread Sisyphuss
Hello Eric, 

As I know, Atom does not implement the plot yet.

Does it mean that if I use Plotly.jl, I can plot in my Atom editor?

Best regards,


On Monday, November 23, 2015 at 5:47:38 PM UTC+1, Eric Forgy wrote:
>
> Hi everyone,
>
>
> In this post 
>  
> from last Wednesday, Hans-Peter pointed out that plotly.js was made open 
> source (  https://plot.ly/javascript/open-source-announcement/ ).
>
>
> Anyway, I tried my hands at writing a wrapper for the JS API. There 
> already exists Plotly.jl, but that is an API to interact with the company's 
> server requiring login info, etc. With the opening of the JS API, the 
> interaction between Julia and Plotly can be much simpler, I think.
>
>
> In the other post, I mused that it should be straightforward to hook up 
> Plotly.js with Juno, so here is a snapshot:
>
>
>
> 
>
>
> To make it interactive, I used WebSockets.jl. One neat artifact of that is 
> you can stream the charts to multiple connections. 
>
>
> Here is a silly video demo of me controlling 4 browsers (only 3 are 
> visible) including an iPhone from Juno: 
> https://www.youtube.com/watch?v=mWDyyfVNqP0
>
>
> The same concept should work with Vega.jl in Juno.
>
>
> I call this a "Pre-announcement", because it is not really ready for the 
> wild yet, but it is far enough that if some friendlies would like to have a 
> look and help me get it in shape, that would be more than welcome.
>
>
> Currently, I am struggling a bit to get the paths correct. If I "git 
> clone" it and run it from the REPL, then I can make it work, but if I 
> "Pkg.clone" it, the path to the html containing the scripts is wrong. 
>
>
> Here are the lines in question:
>
>
> # res = Response(open(readall,Pkg.dir("Plotly","src","web","plotly.html")))
> res = Response(open(readall,"web/plotly.html"))
>
> When run from the REPL (after CD'ing to the directory), the code will find 
> plotly.html. But if I Pkg.clone, it can't find it. It seems to find it when 
> I use the commented Pkg.dir, but then that doesn't work when I'm trying to 
> test before committing to Github and Pkg.checkout etc. Any ideas?
>
> Anyway, this has been kind of fun and if others can help improve it, that 
> would be a great learning experience for me.
>
> Best regards,
> Eric
>


[julia-users] Re: Atom inline evaluation shortcut

2015-12-12 Thread Sisyphuss
After experience, this command evaluates all codes.
Furthermore, it doesn't put the feedback inline.

On Saturday, December 12, 2015 at 2:31:25 PM UTC+1, Eric Forgy wrote:
>
> Try Cntrl + Shift + Enter



[julia-users] Re: Atom inline evaluation shortcut

2015-12-12 Thread Sisyphuss
Update: after renaming the file as *.jl , Ctrl+Enter works, but Shift+Enter 
not.

On Saturday, December 12, 2015 at 1:23:44 PM UTC+1, Sisyphuss wrote:
>
>
>
> In Notebook and Juno/LT, to evaluate a code, one can use Ctrl+Enter or 
> Shift+Enter.
> Then, what is the correspondent shortcut for Atom?
>


[julia-users] Atom inline evaluation shortcut

2015-12-12 Thread Sisyphuss


In Notebook and Juno/LT, to evaluate a code, one can use Ctrl+Enter or 
Shift+Enter.
Then, what is the correspondent shortcut for Atom?


[julia-users] Re: Adding 1 to an Array{Array{Int64,1},1}

2015-12-07 Thread Sisyphuss
Have you tried doing it in a function?


On Saturday, December 5, 2015 at 2:16:12 AM UTC+1, Chris wrote:
>
> I am confused about the following:
>
> julia> a = [[1,1] for i = 1:5]
> 5-element Array{Array{Int64,1},1}:
>  [1,1]
>  [1,1]
>  [1,1]
>  [1,1]
>  [1,1]
>
> julia> a + 1
> 5-element Array{Any,1}:
>  [2,2]
>  [2,2]
>  [2,2]
>  [2,2]
>  [2,2]
>
> Specifically, why does the type change from Array{Array{Int64,1},1} to 
> Array{Any,1}, and what can I do to keep it as Array{Array{Int64,1},1}?
>
> Thanks,
> Chris
>


[julia-users] Re: Array of matrices

2015-12-07 Thread Sisyphuss
[Matrix{Float64}() for i = 1:5]
works too.


On Sunday, December 6, 2015 at 3:25:53 AM UTC+1, Eric Forgy wrote:
>
> Close :)
>
> You can try:
>
> julia> x = [Matrix() for i=1:5]
> 5-element Array{Array{Any,2},1}:
>  0x0 Array{Any,2}
>  0x0 Array{Any,2}
>  0x0 Array{Any,2}
>  0x0 Array{Any,2}
>  0x0 Array{Any,2}
>
> Also:
>
> julia> x = [rand(i,i) for i=1:5]
> 5-element Array{Array{Float64,2},1}:
>  1x1 Array{Float64,2}:
>  0.518641 
> 
> 
>   
>  2x2 Array{Float64,2}:
>  0.219756  0.753237
>  0.294669  0.718687   
> 
>   
>
>  3x3 Array{Float64,2}:
>  0.951481  0.114902  0.632999
>  0.934798  0.528655  0.759751
>  0.695776  0.013846  0.568784 
> 
>   
>
>  4x4 Array{Float64,2}:
>  0.0338033  0.999119  0.914414  0.114614
>  0.947484   0.16535   0.512054  0.115579
>  0.135501   0.317845  0.832064  0.16373
>  0.365693   0.879762  0.313289  0.0339317 
>   
>
>  5x5 Array{Float64,2}:
>  0.181271   0.68545   0.749937   0.116528  0.193043
>  0.545848   0.787693  0.793377   0.405328  0.797003
>  0.0121521  0.476136  0.0411077  0.200597  0.496779
>  0.503430.32037   0.455482   0.260218  0.308114
>  0.855837   0.471426  0.723162   0.591161  0.128503
>
>
>
> On Sunday, December 6, 2015 at 10:21:13 AM UTC+8, Lex wrote:
>>
>> Hi 
>>
>> I am not sure how to create an array of fixed size which may store 
>> matrices of different dimensions for later applying algebraic operations. 
>> Any help is appreciated.
>> Some of the things I tried:
>>
>> x = [Matrix{} for i=1:5]
>>
>>
>> x = [Any for i=1:5]
>> for i in 1:5
>>   x[i] = Any
>> end
>>
>>
>>
>>
>>

[julia-users] Re: Anyone going to NIPS (Montreal) this week?

2015-12-07 Thread Sisyphuss
Article rejected :(

On Sunday, December 6, 2015 at 10:04:02 PM UTC+1, Cedric St-Jean wrote:
>
> It would be nice to gather for a beer and see what everyone uses Julia for 
> in the field of machine learning.
>


[julia-users] Re: Julia career advice question (x-post r/julia)

2015-12-01 Thread Sisyphuss

>
>
> With these languages, working through good, focused, tutorials is worth 
> the investment of time.  
>

Any recommendation?  


[julia-users] Re: Need help building Julia on Ubuntu 14.04

2015-11-29 Thread Sisyphuss
My suggestion is not to build it from scratch, because the building process 
is quite long.


On Saturday, November 28, 2015 at 6:19:28 PM UTC+1, Ajay Kumar wrote:
>
> Dear all
>
> I am trying to build Julia with more than one processor on my PC.
> I am working on an Ubuntu 14.04 OS by using VMWare.
>
> I am following the instructions as mentioned in
> https://github.com/JuliaLang/julia
>
> I am not sure of what they mean by  saying be sure to configure your 
> system with the appropriate proxy settings
> 2. After running 
>
> git checkout release-0.4 
> I get the following error
> fatal: Not a git repository (or any of the parent directories): .git
>
> Could someone suggest my next steps.
>
>

[julia-users] Re: Why does Julia include an older version of git in it?

2015-11-28 Thread Sisyphuss
Related:
https://groups.google.com/forum/?fromgroups=#!topic/julia-users/LBb08MDWu4U


On Saturday, November 28, 2015 at 10:28:29 AM UTC+1, Arin Basu wrote:
>
> Hi All,
>
> As I wrote earlier, yesterday I offered a workshop on introducing Julia at 
> my university. After the workshop, one of the attendees asked me this 
> question:
>
> " It turns out that Julia version 0.4.1 has git packaged with it:
>
> *shell> **which git*
> /Applications/Julia-0.4.1.app/Contents/Resources/julia/libexec/git-core/git
>
> *shell> **git --version*
> git version 1.8.5.6
>
> And from the terminal command line:
>
> jm500:~ 
> $/Applications/Julia-0.4.1.app/Contents/Resources/julia/libexec/git-core/git 
> --version
> git version 1.8.5.6
>
> Either a mistake, which I’d think unlikely, or there is a deliberate use 
> of an old version of git?"
>
> What may be the reason of including an older version of git in Julia? 
> Would greatly appreciate if you can provide some words to the wise.
>
> Best,
> Arin
>


[julia-users] Re: (1.0π) ≠ π

2015-11-27 Thread Sisyphuss
I think you should begin with comparing two Floats with `abs(a-b)
>
>
> This really surprised me:
>
> *julia> **(1.0π) ≠ π*
>
> *true*
>
>
> I guess π is treated as infinite precision until it becomes a float?  
>


[julia-users] Re: Linear combination of matrices using repmat: Matlab vs Julia

2015-11-24 Thread Sisyphuss

On Tuesday, November 24, 2015 at 4:56:26 PM UTC+1, Tony Kelman wrote:
>
> Are you running matlab single threaded? Instead of storing a 3 dimensional 
> array and doing indexing and reshape, in Julia you'd be better off storing 
> an array of matrices.


I just realize this two weeks ago. 


[julia-users] Re: Pre-ANN: PlotlyJS.jl

2015-11-23 Thread Sisyphuss
So the following package is no longer useful?

https://github.com/plotly/Plotly.jl


Re: [julia-users] `(,a) = (1,2)` returns an error

2015-11-23 Thread Sisyphuss


On Monday, November 23, 2015 at 6:44:58 PM UTC+1, Yichao Yu wrote:
>
> > I have a function that returns a tuple. 
> > But I only want the second value of this tuple. 
> > So I tried `(,a) =f()`. But it does not work. 
> > 
> > I'd like to is there any syntax which works? 
> > Note `(a,) = (1,2)` does work. 
>
> I don't think it's too useful you can just do `a = f()[2]` or `_, a = 
> f()` 
>
In the second example, it will overwrite `_`. 


[julia-users] Re: `(,a) = (1,2)` returns an error

2015-11-23 Thread Sisyphuss
OK, so if I have a function which returns a tuple (a,b,c,d), 
but I only want the 2nd and 4th value, the most concise way is

(x,y) = f()[[2;4]]



[julia-users] `(,a) = (1,2)` returns an error

2015-11-23 Thread Sisyphuss


I have a function that returns a tuple. 
But I only want the second value of this tuple.
So I tried `(,a) =f()`. But it does not work.

I'd like to is there any syntax which works?
Note `(a,) = (1,2)` does work.


Re: [julia-users] Assigning variables

2015-11-23 Thread Sisyphuss
I knew it.

On Monday, November 23, 2015 at 4:25:37 PM UTC+1, Stefan Karpinski wrote:
>
> You have a bunch of values indexed by an integer. That's what arrays are 
> for.
>
> On Mon, Nov 23, 2015 at 10:11 AM, Sisyphuss  > wrote:
>
>> Maybe metaprogramming?
>>
>>
>> On Sunday, November 22, 2015 at 8:52:24 PM UTC+1, Stefan Karpinski wrote:
>>>
>>> Not really. An array is much better for this.
>>>
>>> On Sun, Nov 22, 2015 at 2:28 PM, digxx  wrote:
>>>
>>>> Manually I can do:
>>>> arr1=...
>>>> arr2=...
>>>> arr3=...
>>>> and so on
>>>> If I have a loop over i can i construct in each loop a new variable 
>>>> symbolically like this:
>>>> arr*string(i)=... ?
>>>>
>>>>
>>>
>

Re: [julia-users] Re: Define an objective function type

2015-11-23 Thread Sisyphuss
Another inconvenience of your solution is that: if you have N objective 
functions, you will have to define N types and cannot use loop. However, in 
my solution, I only need to construct an array of objective functions (as 
objects).


On Sunday, November 22, 2015 at 2:20:30 PM UTC+1, Sisyphuss wrote:
>
> I was waiting for someone others to comment on it. But since no one did 
> it, I'll try it.
>
> Your solution is just fine for personal use. But imagine that you are 
> making an application working on ObjectiveFunction. For your clients to 
> profit from your application, they should inherit a concrete type from your 
> abstract ObjectiveFunction. However, ObjectiveFunction gives no information 
> about how to construct a concrete subtype. All your clients know is that 
> they can use a "fancy call". All in all, for your clients, they have to 
> have knowledge of inheritance (a beginner won't be able to do it) and 
> perfect information of interface (should provide a detailed manual).
>
> Instead, my solution is more direct and flexible, Everyone looking into 
> the definition knows that all it needs is two functions. I can further use 
> constructor to regulate the initialization. Moreover, my object can work 
> with your type: `myObjectiveFunction.f = yourObjectiveFunction` and 
> `myObjectiveFunction.g = @D yourObjectiveFunction`.
>
>
>

Re: [julia-users] Assigning variables

2015-11-23 Thread Sisyphuss
Maybe metaprogramming?


On Sunday, November 22, 2015 at 8:52:24 PM UTC+1, Stefan Karpinski wrote:
>
> Not really. An array is much better for this.
>
> On Sun, Nov 22, 2015 at 2:28 PM, digxx 
> > wrote:
>
>> Manually I can do:
>> arr1=...
>> arr2=...
>> arr3=...
>> and so on
>> If I have a loop over i can i construct in each loop a new variable 
>> symbolically like this:
>> arr*string(i)=... ?
>>
>>
>

Re: [julia-users] type conversion

2015-11-23 Thread Sisyphuss
On Sunday, November 22, 2015 at 11:22:07 PM UTC+1, Milan Bouchet-Valat 
wrote:
>
> Le dimanche 22 novembre 2015 à 14:08 -0800, Martin Kuzma a écrit : 
> > 
> > 
> > Hi, i am new to Julia and i am little bit confused about type 
> > conversion. 
> > In the docs is written following: 
> > 
> > When appended to a variable in a statement context, the :: operator 
> > means something a bit different: it declares the variable to always 
> > have the specified type, like a type declaration in a statically 
> > -typed language such as C. Every value assigned to the variable will 
> > be converted to the declared type using convert() 
> > 
> > So I tried a little experiment. 
> > 
> > a::Array{Cdouble, 2} = [1 2 3;4 5 6] #this throws ERROR: TypeError: 
> > typeassert: expected Array{Float64,2}, got Array{Int64,2} 
> >  in eval at ./boot.jl:263 
> > 
> > experiment no. 2: 
> > convert(Array{Cdouble,2}, [1 2 3;4 5 6]) # this outputs 2x3 
> > Array{Float64,2}: 
> >  1.0  2.0  3.0 
> >  4.0  5.0  6.0 
> > So the conversion works.. I thought, that the conversion will be 
> > automatic, but it isn't. What am I getting wrong? 
> This works only inside of a function, not directly at the REPL. Maybe 
> the docs could be clarified. 
>
> To be precise, only on local (not global) scope.  


[julia-users] Re: JuliaBox disconnects after several hours of use (or non-use)

2015-11-23 Thread Sisyphuss
If he has many cells, it won't be convenient to copy-paste. 
But Juliabox autosaves every several minutes, which already largely prevent 
the lost of code (at least for my speed of coding).


On Monday, November 23, 2015 at 8:23:50 AM UTC+1, Patrick Kofod Mogensen 
wrote:
>
> I know this is not a solution to the problem, but what do you mean by 
> "lost code" ? Couldn't you just copy the text in the browser to a local 
> editor?
>
> On Monday, November 23, 2015 at 6:09:45 AM UTC+1, Thomas Moore wrote:
>>
>> I've been really enjoying using JuliaBox for some simulations related to 
>> my PhD work. The fact that I can work on my code *anywhere* - in the 
>> office, the library, at home - with no worries about which version of Julia 
>> I'm using is fantastic! 
>>
>> However, I've noticed that JuliaBox often disconnects after it's been 
>> running for several hours - this seems to happen even if it's being used 
>> the entire time. Unfortunately, this can result in lost code (as saving is 
>> impossible) and some frustration.
>>
>> I realise that JuliaBox is not being hosted by Julia itself, but would 
>> there be any way we could work to getting remove this issue?
>>
>> Thanks
>>
>

[julia-users] Re: Simple Quesiton about svd() function

2015-11-23 Thread Sisyphuss
If `x` is an eigenvector, then `-x` is also an eigenvector (and with the 
same norm).


On Monday, November 23, 2015 at 3:58:31 AM UTC+1, Michael Bullman wrote:
>
> Hi All, 
>
> I have a pretty easy question about how/why the svd() behaves how it does. 
>
> Why are my U and V matrices always a factor of -1 from the textbook 
> examples? I'm just getting my feet wet with all this, so I wanted to check 
> what the function returns vs what the textbook says the answers would be, 
> and it looks like it's always off by negative one. 
>
> julia> A = [1 2 ; 2 2; 2 1]
> 3x2 Array{Int64,2}:
>  1  2
>  2  2
>  2  1
>
> julia> U, s, V = svd(A, thin=false)
> (
> 3x3 Array{Float64,2}:
>  -0.514496   0.707107   0.485071
>  -0.685994   0.0   -0.727607
>  -0.514496  -0.707107   0.485071,
>
> [4.123105625617661,0.],
> 2x2 Array{Float64,2}:
>  -0.707107  -0.707107
>  -0.707107   0.707107)
>
>
> text book shows the 1,1 entry of U to be 
> julia> 3/sqrt(34)
> 0.5144957554275265
>
> without a negtive sign. really just all the negative signs are reversed. 
> source: http://www.math.iit.edu/~fass/477577_Chapter_2.pdf
>
> 2nd example:
> julia> A = [3 2 -2 ; 2 3 -2]
> 2x3 Array{Int64,2}:
>  3  2  -2
>  2  3  -2
>
> julia> U, s, V = svd(A, thin=false)
> (
> 2x2 Array{Float64,2}:
>  -0.707107  -0.707107
>  -0.707107   0.707107,
>
> [5.744562646538029,1.0],
> 3x3 Array{Float64,2}:
>  -0.615457  -0.707107 0.348155
>  -0.615457   0.707107 0.348155
>   0.492366   5.55112e-17  0.870388)
>
> which is U and V are negative
> http://www.d.umn.edu/~mhampton/m4326svd_example.pdf
>
> So did I just get back luck with example problems? I feel like it's 
> probably just a difference in convention or something, but figured I would 
> ask for a definitive answer. Thank you for any help
>
>

Re: [julia-users] Best way to pass many arguments to functions

2015-11-23 Thread Sisyphuss


On Monday, November 23, 2015 at 2:46:12 PM UTC+1, Milan Bouchet-Valat wrote:
>
> Le lundi 23 novembre 2015 à 05:32 -0800, Maxim Berman a écrit : 
> > Hello, 
> > 
> > In Matlab, people often use structures to pass around arguments 
> > between functions, for example problem instances. This allows some 
> > flexibility in the development, since I don't have to think of all 
> > variables that I need and their types, and new objects can be easily 
> > added to existing structs 
> > 
> > In Julia, I tend to use Dicts to replicate this behavior, to pass 
> > around options and helper structures to my functions. I don't think 
> > this is recommended since it doesn't allow functions to specialize on 
> > the type of objects contained in the Dict. 
> > 
> > Should I use custom types instead? If some fields can be of different 
> > types, should I use an abstract type for my options and then use 
> > different subtypes ? This seems a bit too complicated... On the other 
> > hand, writing down all arguments in functions without using Dicts or 
> > custom types can be tedious when they are a lot of variables... 
> > 
> > Thanks for your advice. 
> I'd say yes, use custom types and parameterize them on the types of the 
> fields that have no fixed type. 
>
> Also, using abstract types in function signatures cannot hurt, and it's 
> only a pair of lines to add, so I'm not sure you're referring to that 
> when you say "complicated". Maybe you could give us a short example? 
>
> By "complicated", I think he referred to constructor functions. 

Btw, isn't the keyword argument a good alternative solution? I'm no sure 
whether Julia multipatches the keyword argument type.
 


[julia-users] Re: export @enum type should also export its values

2015-11-22 Thread Sisyphuss
I plan to add a sentence to the doc: If ``FRUIT`` is defined in a module 
``Food``, its instances should be refered as ``Food.apple`` for example 
instead of ``FRUIT.apple``.

But I don't know how to do it. Maybe someone could do it instead of me.


On Sunday, November 22, 2015 at 12:21:53 PM UTC+1, Sisyphuss wrote:
>
> Sorry, just found that one can use `tmp.orange` to refer the value.
>
>

[julia-users] Re: export @enum type should also export its values

2015-11-22 Thread Sisyphuss
Sorry, just found that one can use `tmp.orange` to refer the value.



On Sunday, November 22, 2015 at 12:12:56 PM UTC+1, Sisyphuss wrote:
>
> Let's see this example:
> ```
> module tmp
>
> export FRUIT, f, apple
>
> @enum FRUIT apple=1 orange=2 kiwi=3
>
> f(x::FRUIT) = "I'm a FRUIT with value: $(Int(x))"
>
> end
> ```
>
> f(apple) works fine
> f(orange) doesn't work
> f(FRUIT.apple) doesn't work either. 
>
> An enumerate type is of no use, if can't use its values. 
> Therefore, export an enumerate type should implicitly export its values.
>


[julia-users] export @enum type should also export its values

2015-11-22 Thread Sisyphuss
Let's see this example:
```
module tmp

export FRUIT, f, apple

@enum FRUIT apple=1 orange=2 kiwi=3

f(x::FRUIT) = "I'm a FRUIT with value: $(Int(x))"

end
```

f(apple) works fine
f(orange) doesn't work
f(FRUIT.apple) doesn't work either. 

An enumerate type is of no use, if can't use its values. 
Therefore, export an enumerate type should implicitly export its values.


Re: [julia-users] Re: norm() is faster than maxabs()

2015-11-19 Thread Sisyphuss
norm() is even faster than maximum()  !


On Wednesday, November 18, 2015 at 8:49:59 PM UTC+1, Tim Holy wrote:
>
> Note also that: 
>
> function mynorm(x) 
>   s = zero(x[1]^2) 
>   @inbounds @simd for I in eachindex(x) 
>   s += x[I]^2 
>   end 
>   sqrt(s) 
>   end 
>
> does get SIMDed. So the difference is almost surely vectorization. 
>
> --Tim 
>
>
> On Wednesday, November 18, 2015 01:38:38 PM Tim Holy wrote: 
> > On Wednesday, November 18, 2015 02:30:01 PM Stefan Karpinski wrote: 
> > > Those numbers don't include any compilation (the allocations are too 
> low). 
> > > I'm seeing a similar thing. They're just implemented in really 
> different 
> > > ways. maxabs uses mapreduce, which seems to be a chronic source of 
> > > less-than-optimal performance. 
> > 
> > Not the problem: 
> > 
> > julia> function mymaxabs(x) 
> >s = abs(x[1]) 
> >@inbounds @simd for I in eachindex(x) 
> >s = max(s, abs(x[I])) 
> >end 
> >s 
> >end 
> > mymaxabs (generic function with 1 method) 
> > 
> > julia> x = randn(10); 
> > 
> > # warmup suppressed 
> > 
> > julia> @time maxabs(x) 
> >   0.000425 seconds (5 allocations: 176 bytes) 
> > 4.513240114499124 
> > 
> > julia> @time mymaxabs(x) 
> >   0.000642 seconds (5 allocations: 176 bytes) 
> > 4.513240114499124 
> > 
> > 
> > (It doesn't actually get SIMDed, though.) 
> > 
> > I'm not entirely surprised. Multiplication is fast, and with 10^5 
> elements 
> > the sqrt should not be the bottleneck. 
> > 
> > --Tim 
> > 
> > > On Wed, Nov 18, 2015 at 2:12 PM, Benjamin Deonovic  > 
> > > 
> > > wrote: 
> > > > Does norm use maxabs? If so this could be due to maxabs getting 
> > > > compiled. 
> > > > try running both of the timed statements a second time. 
> > > > 
> > > > On Wednesday, November 18, 2015 at 10:41:48 AM UTC-6, Sisyphuss 
> wrote: 
> > > >> Interesting phenomenon: norm() is faster than maxabs() 
> > > >> 
> > > >> x = randn(10) 
> > > >> @time maxabs(x) 
> > > >> @time norm(x) 
> > > >> 
> > > >> 
> > > >> 0.000108 seconds (5 allocations: 176 bytes) 
> > > >> 0.40 seconds (5 allocations: 176 bytes) 
> > > >> 
> > > >> I have thought the contrary, for norm() requires N square and 1 
> square 
> > > >> root; maxabs() requires 2N change of sign bit and N comparison. 
>
>

[julia-users] Re: Arbitrary Vector literal nesting

2015-11-18 Thread Sisyphuss
Not to disappoint you, but 0.5 is scheduled for early February 2016, and 
actually won't happen before April. 


On Wednesday, November 18, 2015 at 6:46:14 PM UTC+1, vis...@stanford.edu 
wrote:
>
> Awesome, I see that 0.5 is scheduled for early December. Looking forward 
> to having this fixed.
>
> On Wednesday, November 18, 2015 at 9:37:37 AM UTC-8, Josh Langsfeld wrote:
>>
>> Should also mention that even when ["1", ["1","2","3"]] returns a two 
>> element Vector{Any}, the inner array will still get inferred to be 
>> Vector{ASCIIString} unless you add the Any prefix.
>>
>> On Wednesday, November 18, 2015 at 12:30:28 PM UTC-5, Josh Langsfeld 
>> wrote:
>>>
>>> Your conclusion is correct. The final switch should happen pretty soon 
>>> on 0.5 master. Until then, the work-around is to prefix all your brackets 
>>> with 'Any', including the inner arrays.
>>>
>>> On Wednesday, November 18, 2015 at 12:20:15 PM UTC-5, 
>>> vis...@stanford.edu wrote:

 Hi everyone,

 Julia seems cool! Vector literals have me completely stumped though. A 
 little help? 
 What is going on here?

 ["1","1"] => ASCIIString["1","1"] 
 ["1",["1"]] => ASCIIString["1","1"] + "WARNING: [a,b] concatenation is 
 deprecated; use [a;b] instead"
 ["1",Any["1"]] => ASCIIString["1","1"] + "WARNING: [a,b] concatenation 
 is deprecated; use [a;b] instead"
 Any["1",["1"]] => Any["1", ASCIIString["1"]] # not what I want, the 
 second array should be general purpose a la python

 Basically I just want general heterogeneous lists like python.

 I read about the  {} syntax somewhere which does exactly what I want, 
 but I keep getting deprecation warnings, so I'd rather not poke that 
 dragon.
 It seems based on the fact that ["1",["1"]] generates a deprecated 
 warning about behaving wrong, and {"1",{"1"}} is completely deprecated 
 syntax that at some point, ["1",["1"]] should do what I want it to, but 
 this feature has somehow been only half migrated over?

 Help!

 Vishesh

>>>

[julia-users] norm() is faster than maxabs()

2015-11-18 Thread Sisyphuss
Interesting phenomenon: norm() is faster than maxabs()

x = randn(10)
@time maxabs(x)
@time norm(x)


0.000108 seconds (5 allocations: 176 bytes) 
0.40 seconds (5 allocations: 176 bytes)

I have thought the contrary, for norm() requires N square and 1 square 
root; maxabs() requires 2N change of sign bit and N comparison.


[julia-users] Re: Define an objective function type

2015-11-18 Thread Sisyphuss
Thanks. So the first question is solved.

On Wednesday, November 18, 2015 at 9:42:26 AM UTC+1, Eric Forgy wrote:
>
> Try "Function"?
>
> julia> f(x) = x^2
> f (generic function with 1 method)
>
> julia> typeof(f)
> Function
>
>
> On Wednesday, November 18, 2015 at 4:05:43 PM UTC+8, Sisyphuss wrote:
>>
>> Hello, everyone, 
>>
>> I'd like to construct a type which contains some functions that I would 
>> like to give value later (as attributes of instance).
>> I define this type as:
>> ```
>> type Objective
>> f::Any
>> g::Any
>> end
>> ```
>> where `f` is the objective function and `g` is the derivative.
>>
>> My question is: 
>> 1) instead of define them as `Any`, is there any other more specific type?
>> 2) is there any better design pattern?
>>
>

[julia-users] Re: Define an objective function type

2015-11-18 Thread Sisyphuss


On Wednesday, November 18, 2015 at 2:53:02 PM UTC+1, Christoph Ortner wrote:
>
> Not quite answering your question, but here is how I like to do this:
>
> abstract ObjectiveFunction
> type MyOF <: ObjectiveFunction
>params
> end
>
> function evaluate(f::ObjectiveFunction, x)
>  . ..
> end
>
> Here, I think it should be `evaluate(f::MyOF,x)`
 

> function evaluate_grad(f::ObjectiveFunction, x)
>. . . 
> end
>
> Then, to get nice syntax, I add do the following:
>
> import Base.call
> @inline call(pp::ObjectiveFunction, varargs...) = evaluate(pp, varargs...)
> @inline call(pp::ObjectiveFunction, ::Type{Val{:D}}, varargs...) = 
> evaluate_grad(pp, varargs...)
> macro D(fsig::Expr)
> @assert fsig.head == :call
> insert!(fsig.args, 2, Val{:D})
> for n = 1:length(fsig.args)
> fsig.args[n] = esc(fsig.args[n])
> end
> return fsig
> end
>
> The result is that I can now call objective functions as follows:
>
> # construct objective
> of = MyOF(params)
> # evaluate objective fun
> F = of(x)
> # evaluate its gradient
> DF = @D of(x)
>
> I had some fun cooking this up - I'd love hear what people think.
>
> Christoph
>
>
>
>
>
>
>

[julia-users] Define an objective function type

2015-11-18 Thread Sisyphuss
Hello, everyone, 

I'd like to construct a type which contains some functions that I would 
like to give value later (as attributes of instance).
I define this type as:
```
type Objective
f::Any
g::Any
end
```
where `f` is the objective function and `g` is the derivative.

My question is: 
1) instead of define them as `Any`, is there any other more specific type?
2) is there any better design pattern?


[julia-users] Re: Creating a stable version of Julia + Packages for a semester long course?

2015-11-16 Thread Sisyphuss
Run a JuliaBox server?

On Monday, November 16, 2015 at 9:05:38 AM UTC+1, Sheehan Olver wrote:
>
> Another requirement is that the packages are shared across users, to save 
> disk space.  Gadfly + PyPlot + IJulia (with Conda.jl version of Jupyter) 
> takes over 750MB.   Does .julia need to be writable?  If not, I guess both 
> options are still possible.
>
> On Monday, November 16, 2015 at 2:05:45 PM UTC+11, Sheehan Olver wrote:
>>
>>
>> I'm trying to figure out the "best" way to create a stable version of 
>> Julia + Gadfly + PyPlot + IJulia (+ other packages?) for a semester long 
>> course.  I don't want to have the students run Pkg.add(...)/Pkg.update(), 
>> as packages have a tendency to occasionally break on updates, and it's a 
>> headache dealing with this during the lecture.
>>
>> Two possible solutions I can think of of are:
>>
>> 1)  Prebake a .julia folder that contains all the necessary resources, 
>> with a script to reset in case the students break it with Pkg.update().
>> 2)  Use system image
>>
>> http://docs.julialang.org/en/release-0.4/devdocs/sysimg/
>>
>> that includes all the necessary packages.   It's not really clear how to 
>> do this from the documentation, though.   I'm also not sure how that would 
>> interact with Pkg.update() though, so probably instructions to delete 
>> .julia would also need to be given.
>>
>>
>> Any other options I'm missing?  If 2 is recommended, any tutorial how to 
>> do this?
>>
>

[julia-users] Re: Google releases TensorFlow as open source

2015-11-12 Thread Sisyphuss
Good to know that.


On Wednesday, November 11, 2015 at 12:18:07 PM UTC+1, Viral Shah wrote:
>
> I think TensorFlow.jl is a great idea. Also their distributed computation 
> framework is also the kind that we want to have in Julia.
>
> I have created JuliaML. Send me email if you want to be part of it, and I 
> will make you an owner. Perhaps we can even move some of the JuliaStats ML 
> projects to JuliaML.
>
> -viral
>
> On Wednesday, November 11, 2015 at 11:27:21 AM UTC+5:30, Valentin Churavy 
> wrote:
>>
>> It fits in the same niche that Mocha.jl and MXNet.jl are filling right 
>> now. MXNet is a ML library that shares many of the same design ideas of 
>> TensorFlow and has great Julia support https://github.com/dmlc/MXNet.jl
>>
>>
>> On Wednesday, 11 November 2015 01:04:00 UTC+9, Randy Zwitch wrote:
>>>
>>> For me, the bigger question is how does TensorFlow fit in/fill in gaps 
>>> in currently available Julia libraries? I'm not saying that someone who is 
>>> sufficiently interested shouldn't wrap the library, but it'd be great to 
>>> identify what major gaps remain in ML for Julia and figure out if 
>>> TensorFlow is the right way to proceed. 
>>>
>>> We're certainly nowhere near the R duplication problem yet, but 
>>> certainly we're already repeating ourselves in many areas.
>>>
>>> On Monday, November 9, 2015 at 4:02:36 PM UTC-5, Phil Tomson wrote:

 Google has released it's deep learning library called TensorFlow as 
 open source code:

 https://github.com/tensorflow/tensorflow

 They include Python bindings, Any ideas about how easy/difficult it 
 would be to create Julia bindings?

 Phil

>>>

[julia-users] Re: Clsing IJulia in a neat way

2015-11-03 Thread Sisyphuss
I encountered similar problem on my Ubuntu.


On Tuesday, November 3, 2015 at 11:24:02 AM UTC+1, Ferran Mazzanti wrote:
>
> Dear all,
>
> I use IJulia from time to time. To do that I open the julia REPL in the 
> terminal, issue 
>
> using IJulia
> notebook()
>
> ..and the web browser opens and I am ready to go. But when I want to 
> finish  the IJulia session,
> I dont see a 'close' button in the file manager of Jupyter, so I have to 
> close the tab (or browser) where I'm
> working. Then the REPL gets stuck, so I have to do Ctrl+C and quit form 
> julia.
> A very unconfortable way of proceeding... and it leaves the memory of my 
> Linux Mint box full of garbage,
> to the point that it can swallow 12+Gb of my RAM.
>
> Now I'm sure there are better ways to proceed... but how? 
>
> Best regards and thanks,
>
> Ferran.
>


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

2015-11-01 Thread Sisyphuss
http://dl.acm.org/citation.cfm?id=2228301

On Saturday, October 31, 2015 at 5:18:01 PM UTC+1, Jey Kottalam wrote:
>
> Could you please define "streams of RDDs"?
>
> On Sat, Oct 31, 2015 at 12:59 AM, > 
> wrote:
>
>> Is there any implementation with streams of RDDs for Julia ? 
>>
>>
>> On Monday, April 20, 2015 at 11:54:10 AM UTC-7, wil...@gmail.com wrote:
>>>
>>> Unfortunately, Spark.jl is an incorrect RDD implementation. Instead of 
>>> creating transformations as independent abstraction operations with a lazy 
>>> evaluation, the package has all transformations immediately executed upon 
>>> their call. This is completely undermines whole purpose of RDD as 
>>> fault-tolerant parallel data structure.
>>>
>>> On Saturday, April 18, 2015 at 4:04:23 AM UTC-4, Tanmay K. Mohapatra 
>>> wrote:

 There was some attempt made towards a pure Julia RDD in Spark.jl (
 https://github.com/d9w/Spark.jl).
 We also have DistributedArrays (
 https://github.com/JuliaParallel/DistributedArrays.jl), Blocks (
 https://github.com/JuliaParallel/Blocks.jl) and (
 https://github.com/JuliaStats/DataFrames.jl).

 I wonder if it is possible to leverage any of these for a pure Julia 
 RDD.
 And MachineLearning.jl 
 
  or 
 something similar could probably be the equivalent of MLib.


 On Friday, April 17, 2015 at 9:24:03 PM UTC+5:30, wil...@gmail.com 
 wrote:
>
> Of course, a Spark data access infrastructure is unbeatable, due to 
> mature JVM-based libraries for accessing various data sources and formats 
> (avro, parquet, hdfs). That includes SQL support as well. But, look at 
> Python and R bindings, these are just facades for JVM calls. MLLib is 
> written in Scala, Streaming API as well, and then all this called from 
> Python or R, all data transformations happen on JVM level. It would be 
> more 
> efficient write code in Scala then use any non-JVM bindings. Think of 
> overhead for RPC and data serialization over huge volumes of data needed 
> to 
> be processed and you'll understand why Dpark exists. BTW, machine 
> learning 
> libraries in JVM, good luck. It only works because of large computational 
> resources used, but even that has its limits.
>
> On Thursday, April 16, 2015 at 6:29:58 PM UTC-4, Andrei Zh wrote:
>>
>> Julia bindings for Spark would provide much more than just RDD, they 
>> will give us access to multiple big data components for streaming, 
>> machine 
>> learning, SQL capabilities and much more. 
>>
>> On Friday, April 17, 2015 at 12:54:32 AM UTC+3, wil...@gmail.com 
>> wrote:
>>>
>>> However, I wonder, how hard it would be to implement RDD in Julia? 
>>> It looks straight forward from a RDD paper 
>>>  how 
>>> to implement it. It is a robust abstraction that can be used in any 
>>> parallel computation.
>>>
>>> On Thursday, April 16, 2015 at 3:32:32 AM UTC-4, Steven Sagaert 
>>> wrote:

 yes that's a solid approach. For my personal julia - java 
 integrations I also run the JVM in a separate process.

 On Wednesday, April 15, 2015 at 9:30:28 PM UTC+2, wil...@gmail.com 
 wrote:
>
> 1) simply wrap the Spark java API via JavaCall. This is the low 
>> level approach. BTW I've experimented with javaCall and found it was 
>> unstable & also lacking functionality (e.g. there's no way to 
>> shutdown the 
>> jvm or create a pool of JVM analogous to DB connections) so that 
>> might need 
>> some work before trying the Spark integration.
>>
>
> Using JavaCall is not an option, especially when JVM became 
> close-sourced, see https://github.com/aviks/JavaCall.jl/issues/7.
>
> Python bindings are done through Py4J, which is RPC to JVM. If you 
> look at the sparkR , 
> it is done in a same way. sparkR uses a RPC interface to communicate 
> with a 
> Netty-based Spark JVM backend that translates R calls into JVM calls, 
> keeps 
> SparkContext on a JVM side, and ships serialized data to/from R.
>
> So it is just a matter of writing Julia RPC to JVM and wrapping 
> necessary Spark methods in a Julia friendly way. 
>

>

[julia-users] Doubts pass-by-sharing

2015-10-28 Thread Sisyphuss
I want quite the opposite behavior. I do want `f` to be updated every time `a` 
is changed.
The question is: is it always true in any circumstance? 

Re: [julia-users] Re: Code runs 500 times slower under 0.4.0

2015-10-25 Thread Sisyphuss
It's interesting. It's like a virtual machine, but maybe smaller than it.


On Sunday, October 25, 2015 at 12:23:24 AM UTC+2, Stefan Karpinski wrote:
>
> ReproZip is a pretty awesome language-agnostic tool for easy 
> reproducibility:
>
> https://vida-nyu.github.io/reprozip/
>
> On Sat, Oct 24, 2015 at 9:27 AM, Tamas Papp  > wrote:
>
>> On Fri, Oct 23 2015, Kris De Meyer > 
>> wrote:
>>
>> > I know that all of these problems are solvable, but that's not the 
>> point I
>> > am trying to make. All of these issues take time that keep me away from
>> > writing the software that I am hired to write in a limited number of 
>> days,
>> > and my employers may not be interested in the reasons for why I can't 
>> get
>> > it to work on time. Please also note that when in the midst of a crisis 
>> and
>> > up against deadlines, I (and probably other users in similar situations)
>> > may not have time to file bug reports, and not even have the time to 
>> note
>> > down how I fixed or circumvented a certain problem.
>>
>> If your project is time critical and you absolutely cannot deal with any
>> breakage, just make a snapshot of everything as is and don't upgrade
>> anything until you are sure you have time to deal with bugs. If you need
>> to upgrade (eg because a bug fix just came out which you need), use
>> version control carefully so you can roll back to the previous state, or
>> backport the fix if necessary.
>>
>> Some languages have developed special tools for this --- eg for R, check
>> out Packrat: https://rstudio.github.io/packrat/ I am not aware of
>> anything similar for Julia, so you may have to do that manually.
>>
>> If you cannot implement any of the solutions above for some reason, you
>> may just have to accept that languages/environments under development
>> and critical projects just don't mix.
>>
>> Also, there is little point in telling people you don't have time to
>> file bug reports or make your workarounds known when using an open
>> source project. Open source projects thrive on user contributions (bug
>> reports count too), and that's pretty much the only way to make things
>> move forward.
>>
>> Best,
>>
>> Tamas
>>
>
>

[julia-users] Re: good textbook for Julia software engineering?

2015-10-23 Thread Sisyphuss


On Thursday, October 22, 2015 at 6:26:29 PM UTC+2, Cedric St-Jean wrote:
>
>
> On Thursday, October 22, 2015 at 11:33:39 AM UTC-4, Sisyphuss wrote:
>>
>> I have some idea in the previous post. But it seems that they are just 
>> ignored...
>>
>
> Not to derail this thread, but FWIW, I liked your OOP equivalences, and it 
> made me consider writing shorter, focused modules.
>  
>

Thanks, Cedric, that sounds perfect. 


  1   2   3   >