Perl 6 - the future is here, just unevenly distributed

IRC log for #pdl, 2013-03-14

| Channels | #pdl index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:22 MeierM joined #pdl
05:50 Meiermann joined #pdl
14:14 opkick joined #pdl
14:14 opkick [pdl01] run4flat pushed 5 new commits to master: http://git.io/0W9wKA
14:14 opkick pdl/master 13dc7e6 David Mertens: Fixed window-not-really-closed issue with the Prima demo
14:14 opkick pdl/master 202688b David Mertens: Stricter Prima detection and more informative fail message for Prima demo
14:14 opkick pdl/master 3260b26 Craig DeForest: Transform explicitly clears inplace flag (works around core bug that causes crashes)
14:14 opkick left #pdl
16:27 _vicash_ joined #pdl
16:28 _vicash_ run4flat: hi, vikas here. i am going to do the fixes as you have suggested.
16:32 run4flat _vicash_, fantastic
16:32 run4flat :-)
16:32 run4flat _vicash_++
16:39 _vicash_ run4flat: sorry.. was away for a bit
16:39 _vicash_ i am looking at the blessed and overload::Method() condition and not seeing why that is necessary
16:40 _vicash_ if we have a subref the ref($myfunc) will return CODE
16:40 _vicash_ so ref($myfunc) = ref(sub{}) should suffice
16:41 run4flat sure
16:41 run4flat but what if the user wants to track state somehow?
16:41 run4flat in that case they would provide an object instead
16:41 run4flat and we would want to make sure the object knew how to dereference
16:41 run4flat Otherwise, yeah, just checking for ref(sub{}) (or 'CODE') when we ask for ref($myfunc) would be sufficient
16:41 _vicash_ so in that case the user would define their own overload '&{}' then ?
16:42 run4flat yep
16:42 run4flat I don't know, maybe this is dumb
16:42 run4flat but it seems to allow for the most general solution
16:42 _vicash_ i think it is over complicated.. i would just use a closure
16:42 _vicash_ that way any objects can be passed as part of the closure
16:43 * run4flat ponders
16:43 run4flat My biggest concern is introspection
16:43 _vicash_ this wouldn't force the user to overload &{} .. i have never done that hence i am unaware about that feature though.. i just use closures
16:43 run4flat so, if you pass a closure around an object and the closure modifies the object, you introspect that object
16:43 run4flat no problem
16:44 _vicash_ i think maybe we shouldn't over-engineer.. if a requirement from a user comes up where they need that feature maybe it will take 5 minutes for you to add it
16:44 run4flat ok
16:44 run4flat yeah, I think this is much more appropriate for the binning stuff
16:44 run4flat oh, wait
16:44 run4flat question
16:44 _vicash_ if you send an object in a closure you can introspect it later because a reference to that object gets passed
16:45 run4flat but what if I want to investigate the properties of the tick label function?
16:45 run4flat if it is *always* a closure, I can't do that
16:45 run4flat oh never mind
16:45 _vicash_ what do you mean by introspect a tick label function ?
16:46 run4flat I don't have a use case in mind
16:46 run4flat I do for binning, thoug
16:46 run4flat so don't worry about it
16:46 _vicash_ ok
16:46 run4flat but this has been very helpful
16:46 run4flat now I know how to allow for binning objects for distribution plottin
16:46 run4flat right now it's all subrefs and/or closures there, too
16:47 run4flat but ideally you'd want to be able to ask a binning about its min or max
16:47 run4flat which you can't ask of a closure
16:47 _vicash_ but how would that affect a tick formatting ?
16:47 run4flat right, exactly, there is no property that you would care to ask about for tick formatting
16:47 _vicash_ the ticks are already calculated.. all we are doing is giving the user an option to pretty print the tick
16:48 run4flat Consider this, though.
16:48 run4flat I create a tick format generator that accepts arguments
16:48 run4flat you invoke that generator
16:48 run4flat but later want to retrieve the values you used to create the tick formatter
16:48 run4flat unless you store those in closed-over variables, you can't get at them
16:49 run4flat that's the thought
16:49 _vicash_ but that is assuming the user gives an object as opposed to a sub to the format_tick argument
16:49 run4flat sure, I know
16:49 _vicash_ why would they do that ?
16:49 run4flat Who knows?
16:50 run4flat I just figured it was an extra half-line for greater flexibility
16:50 _vicash_ i dont see a use case.. all the tick formatter will do is a simple sprintf type stuff for the tick which more likely is a PDL entry which is a basic data type and not a complex one
16:50 _vicash_ ok i will add it but not sure if it will solve the problem..
16:50 run4flat Oh, hmm, argument should always be a scalar, I think
16:51 run4flat :-)
16:51 run4flat _vicash_, you don't have to add it
16:51 run4flat we can wait until there's a need
16:51 run4flat remember, we'd have to *document* it, too
16:51 run4flat so keep it simple for now
16:51 run4flat :-)
16:51 _vicash_ ok cool
16:52 _vicash_ i will fix up and push my change then
16:52 run4flat awesome
16:52 run4flat I will take a look over them as soon as they hit
16:52 _vicash_ do u want me to issue a warning if the user has set format_tick to a non-subroutine object ?
16:55 run4flat ... non-subroutine thing, or non-subroutine object?
16:55 run4flat eh, croak
16:55 run4flat If they specified anything, the'll want to know it's wrong
16:56 _vicash_ ok
17:01 _vicash_ run4flat: hey, i pushed but do i need to update the pull request on github ?
17:04 run4flat I don't think so
17:04 run4flat I'll take a look
17:05 run4flat frickin beautiful
17:05 run4flat thanks, so much, _vicash_!
17:05 run4flat hey everyone, _vicash_ just added custom tick formatting to PDL::Graphics::Prima!
17:06 _vicash_ thanks run4flat. i am building a tool which does finance plotting.. and if there are other small features that are needed i shall add them and notify you
17:06 run4flat sounds great.
17:07 run4flat one thing that'll likely have to go in soon is custom scaling
17:07 run4flat right now there's just linear and logarithmic
17:07 _vicash_ run4flat: i have a basic perl question. if i use Moose do I need to use this overload::Method type things ? what does Moose not give me that i need the "overload" class ?
17:07 run4flat hmm, I'm not sure
17:07 run4flat jberger, ping
17:07 run4flat Moose just uses Perl OO under the hood
17:08 run4flat and if you want your object to overload function dereferencing, I think you'd still need to provide that
17:08 run4flat though, I'm really not sure
17:08 _vicash_ ok
17:08 _vicash_ well if i need it i will figure it out eventually.. there is always the camel book to understand stuff like this
17:08 run4flat yep
17:08 run4flat though the Camel book doesn't go into Moose
17:09 run4flat you haven't done operator overloading before?
17:09 _vicash_ yes agreed.. i meant for the overload
17:09 _vicash_ no i never needed it.. i do it in C++ all the time
17:09 _vicash_ but this i the first time i am building a serious GUI using Perl on Linux.. i have done it once with Perl's Win32 but that wasn't using PDL
17:09 run4flat oh, ok. That's where I learned about it, too. Operator overloading is very nicely done in C++
17:10 run4flat oh, sweet. So now its a Linux GUI with PDL?
17:10 _vicash_ yes.. Linux and Mac finance plotting GUI for a project
17:10 run4flat I can say, without a doubt, that you've picked the right tool for this one. :-)
17:10 _vicash_ yea initially i was using Gnuplot from C++
17:11 _vicash_ but with a large amount of data coming every 100ms for 3 hours or more Gnuplot would just crash
17:11 _vicash_ so i am using PDL because if astronomers can use it then my data is pocket change
17:11 run4flat hmm
17:11 * run4flat wonders if he plugged all the memory leaks
17:11 _vicash_ well Gnuplot has no C++ api
17:12 _vicash_ so i had to write temporary files and send gnuplot commands over a pipe to plot
17:12 run4flat oh sheesh
17:12 _vicash_ if the data got too large for some reason gnuplot randomly crashed
17:12 _vicash_ esp if i was doing multiple line plots on the same screen
17:12 run4flat Hmm
17:12 _vicash_ and i am on a 64-bit machine too..
17:13 _vicash_ interactive features are better on PDL plotting
17:13 _vicash_ i mean Prima
17:13 run4flat well, let me know if you run into problems. I've done some stress testing, but I haven't thrown a ton of data at it
17:14 _vicash_ ok cool.. we will definitely be stress testing Prima here esp the Graphics plotting
17:14 run4flat I suspect that you may need more direct data accessors, something I've meant to do but haven't gotten around to
17:14 _vicash_ well eventually maybe.. but until then it might not be necessary to do
17:14 run4flat hopefully not
17:14 run4flat I know of a number of potential performance issues with fairly quick fixes
17:15 run4flat that I've just never gotten around to
17:15 run4flat so let me know what you strike
17:15 _vicash_ ok.. well.. for now i will continue building my product… if i come across anything i will let you know
17:15 run4flat yep. hopefully it Just Works. :-)
17:16 _vicash_ i hope so too .. so far no problems have occurred
17:16 _vicash_ btw.. any idea how to show a splash screen using Prima ?
17:16 run4flat I saw something once...
17:16 _vicash_ i have searched all the docs but couldnt find anything for it
17:16 * run4flat roots around
17:17 run4flat Prima::StartupWindow, I think
17:18 run4flat Not sure if that's what you want, though
17:18 _vicash_ oh awesome.. i will try it out and see if that does the job
17:18 run4flat if not, you can create a Widget and force it to be drawn as soon as possible
17:19 _vicash_ yes i thought of that but the main application window loads too fast
17:19 run4flat It won't provide interaction, but you don't expect that of a banner, anyway
17:19 _vicash_ anyawy it is not essentiall ,just cosmetic for branding if an
17:19 run4flat yeah. Let me know if this doesn't work. I have some ideas I can explore that might be helpful
17:20 run4flat cool. Well, I should get back to work. Thanks so much for your contribution!
17:20 _vicash_ ok.. thanks for your tips too
17:20 _vicash_ i will lurk around
18:38 _vicash_ joined #pdl
22:57 Meiermann joined #pdl
23:10 _vicash_ run4flat; how does one plot a square-wave
23:11 _vicash_ i have a pdl that looks like [0.5, 1.0, 0.75, 1.25] and i want to plot it as a square wave .. how does one do that ?

| Channels | #pdl index | Today | | Search | Google Search | Plain-Text | summary