Camelia, the Perl 6 bug

IRC log for #mojo, 2013-07-02

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

All times shown according to UTC.

Time Nick Message
00:00 egopro joined #mojo
00:04 asarch joined #mojo
00:16 Moataz-E joined #mojo
00:26 btyler joined #mojo
00:47 shmuel joined #mojo
01:06 gtodd joined #mojo
01:13 jberger p/
01:13 jberger haha
01:13 jberger o/
01:36 sri \p
01:48 btyler joined #mojo
01:51 d4rkie joined #mojo
01:55 * jberger is catching up on all things perl (thank goodness)
01:55 jberger http://www.nntp.perl.org/group/perl.​perl5.porters/2013/06/msg203763.html # looks cool
01:57 Meiermann joined #mojo
02:49 sri jberger: i think it looks odd without arrows :) push @y, $x->{foo}[0]@*
02:50 sri even though i guess it would be push @y, $x->{foo}[0]->@* in the end
02:52 jberger hmmmm, indeed
02:53 jberger I was very enthusiastic about the implicit deref, then now I avoid it, perhaps something like this is more what I wanted
02:54 sri i like this kinda stuff too
02:54 sri would also like perl6-ish pipeline operators
02:55 sri my @y = @x ==> map { $_++ } ==> grep { $_ > 1 };
02:57 sri elixir has a nice version of it too
02:59 jberger I'm starting to wonder if there is more and more reality to "Perl 5 is becoming Perl 6"
02:59 jberger obviously there are near-term limitations, but even those are seeming to be improving
03:00 sri it's pretty much the only way perl5 can evolve
03:00 sri we have no language designer anymore
03:00 jberger right
03:00 jberger :'(
03:00 sri http://joearms.github.io/2013/​05/31/a-week-with-elixir.html # see section on pipe operator
03:00 jberger stevan might be the closest thing we have
03:01 sri that blog post was written by the creator of erlang btw. :)
03:01 jberger actually, the dots pragma, and its subsequent reason for demise, suggests that perhaps the way forward for Perl 5 is mutable grammars :-D
03:01 sri which is a perl6 feature -.-
03:02 jberger now what does that sound like :-P
03:05 whitebook joined #mojo
03:06 jberger skimming that post I see the author likes sigils, me too!
03:06 * jberger has been using far too much python ($work) lately
03:32 yakubori joined #mojo
03:32 whitebook joined #mojo
03:35 Dandre joined #mojo
03:47 dimuls joined #mojo
03:48 dimuls hi guys
03:48 dimuls i have questions about hypnotoad. Can some one help me?
03:50 preflex_ joined #mojo
04:17 dimuls ping
04:40 shmuel dimuls: what is the question?
05:04 dimuls are workers have shared memory?
05:04 dimuls shmuel,
05:07 shmuel ALL GLORY TO THE HYPNOTOAD!
05:07 shmuel hypnotoad is a preforking server.
05:08 shmuel so I think that workers does not have shared data.
05:09 dimuls do workers share websocket clients?
05:09 Meiermann joined #mojo
05:16 shmuel how can you share clients?
05:18 shmuel the manager gives the workers connections as they come, and each worker gets and talks with his own clients.
05:18 shmuel as much as I understand, of course.
05:18 shmuel if you need more qualified answer, we can try and ping some people here.
05:19 shmuel jberger?
05:25 abra joined #mojo
05:25 Britzel_ joined #mojo
05:26 abra_ joined #mojo
05:31 arman joined #mojo
05:47 arpadszasz joined #mojo
05:50 shmuel sri ?
05:51 Britzel joined #mojo
06:07 egopro joined #mojo
06:17 Vandal joined #mojo
06:18 basiliscos joined #mojo
06:20 aleksey_ joined #mojo
06:21 marty joined #mojo
06:22 egopro joined #mojo
06:30 suy joined #mojo
06:38 amirite joined #mojo
06:45 yakudza joined #mojo
06:59 dod joined #mojo
07:13 amirite_ joined #mojo
07:16 dod joined #mojo
07:25 rem_lex|pivo joined #mojo
07:32 trone joined #mojo
07:33 cosmincx joined #mojo
08:06 abra_ joined #mojo
08:25 jzawodn joined #mojo
08:41 Jonis anyone here tried hmac with utf8 in strings?
08:42 rihegher joined #mojo
08:43 bobkare you probably want to explicitly encode it first so you run the hmac over bytes
08:45 marcus_ I see undead people
08:52 arthas joined #mojo
08:54 nicomen sri: hm, care t0 explain, it followed the way you were accessing psgi.input I thought
08:56 fhelmber_ joined #mojo
08:58 yakudza joined #mojo
09:00 rihegher left #mojo
09:02 jpn joined #mojo
09:05 sri nicomen: you have to explain why it's a good fix that couldn't cause problems first
09:06 sri also, did you ever see me apply any "fix" without a test?
09:06 kwa joined #mojo
09:13 sri not having researched anything, i question the possibility of combining a request based error handle with an out of band logger
09:16 rem_lex| joined #mojo
09:25 ver joined #mojo
09:28 maxhq joined #mojo
09:30 * sri kinda wants to build a mango version of resque :o
09:31 * sri wonders if the resque or celery worker architecture is better
09:33 sri considering perl always leaks... i suppose resque wins
09:37 dpetrov_ joined #mojo
09:41 nicomen sri: ok, I'll do a bit more research, I tried setting it up in the psgi_to_app part, but it didn't seem to trigger, later
09:46 sri oh wow... i was wondering how resque was detecting other workers on the same host... damn... https://github.com/resque/resque/blob/m​aster/lib/resque/process_coordinator.rb
09:49 sri considering there are manager processes, i guess i will make managers update a timer in mongodb regularly to confirm that they are still alive, then clean up with a recurring timer
09:52 * sri puts it on his todo list
09:53 sri using mango for something serious will be fun, and should help it stabilize
10:09 basiliscos1 joined #mojo
10:13 egopro joined #mojo
10:14 basiliscos joined #mojo
10:44 bowtie joined #mojo
10:46 sri perl could really use proper support for refinements
10:47 sri lexical subs are almost there... if only one could combine them with an exporter
10:50 nicomen you mean to override existing classes and methods?
10:51 sri to overload methods or add them
10:51 nicomen isn't that very easy in perl since you can access everything from everywhere?
10:51 sri { use Mojo::UserAgent::FooBar; $ua->foo_bar(...) }
10:51 sri lexical
10:52 sri the point of refinements is that they are not global
10:52 nicomen ah
10:52 sri basically { local sub Mojo::UserAgent::foo_bar {...}; $ua->foo_bar(...) }
10:53 sri you can have one or the other atm, but not both
10:54 sri mst was hacking around that by exporting variables... but i don't like that aesthetically
10:54 sri { use Mojo::UserAgent::FooBar; $ua->$_foo_bar(...) }
10:56 nicomen like this?
10:56 nicomen $ perl -wle 'package Foo; sub lal { print "bar"; }; package main; { no warnings "redefine"; local *Foo::lal = sub { print "boo"; }; Foo::lal(); }; Foo::lal();'
10:56 nicomen boo
10:56 nicomen bar
10:57 sri yes, that's global
10:58 shmuel joined #mojo
10:58 sri umm, i mean you can't do that from a module
10:58 nicomen how global?
10:58 sri from import()
10:58 nicomen maybe Sub::Override
10:59 sri you can;t do it
10:59 sri the goal is { use Mojo::UserAgent::FooBar; $ua->foo_bar(...) }
10:59 sri lexical
11:01 sri let me make it 100% obvious... { use Mojo::UserAgent::FooBar; $ua->foo_bar('works!') } $ua->foo_bar('dies!')
11:12 whitebook joined #mojo
11:15 TitanOfOld joined #mojo
11:16 jberger sri: run4flat has been working on that for PDL
11:17 sri GET IT INTO CORE!
11:17 jberger that would be awesome!
11:17 jberger and +1 for mango resque
11:18 * sri loves seeing peter martini patches getting applied to core
11:19 jberger peter martini is ridiculously  awesome
11:38 libsysguy joined #mojo
11:43 abra joined #mojo
11:48 abra joined #mojo
11:48 abra joined #mojo
11:51 shmuel joined #mojo
11:53 arpadszasz joined #mojo
12:00 D4RK-PH0ENiX joined #mojo
12:02 sri \o\
12:02 sri /o/
12:03 sri wonder what we'll really do if signatures land in 5.20 :)
12:04 sri just use them and require 5.20, activate them when available in Mojo::Base and use them in documentation, or wait 10 years
12:04 mire joined #mojo
12:04 sri (spoiler: option 3 is not really an option)
12:08 abra joined #mojo
12:10 jberger sri: since signatures supposedly will just expose a signatures api with a tiny reference implementation, do you expect that mojo will (a) use the reference implementation, (b) use a cpan implementation (ala Method::Signatures (using new api)) or (c) develop our own implementation?
12:10 Caldrin left #mojo
12:10 sri use the reference implementation i suppose
12:11 sri i don't really want anything fancy
12:11 jberger that would be my guess too, since the latter two would require XS presumably
12:11 sri get '/' => sub ($self) { $self->render(...) }
12:12 jberger oh I hope there is an option for automagic $self
12:12 jberger even in the reference implementation
12:12 sri doubt it
12:12 sri how would that work?
12:12 jberger pretty much all of the CPAN modules now do that
12:12 sri it would require a separate keyword
12:12 hotsnow joined #mojo
12:12 jberger its usually `method`
12:13 sri not that i would complain about get '/' => method { $self->render(...) }
12:13 jberger get '/' => method () { ... }
12:13 sri but i don't think it's going to make it in
12:14 * sri expects only sub ($foo, $bar, @baz) {}
12:14 sri although, if the reference module (signatures) ends up being dual life, a lot can happen
12:15 jberger I would be surprised if there isn't something like method, its just SO ubiquitous on CPAN
12:15 sri problem is getting it through p5p
12:15 sri how would a built in method keyword interact with p5-mop? :o
12:16 jberger it might need `use signatures 'method' or some such
12:16 sri now that would be annoying
12:16 jberger or a feature
12:16 jberger but yeah, perhaps keeping method safe for p5-mop
12:16 jberger hmmm
12:17 * sri has lowered his expectations drastically
12:17 jberger for our case Mojo::Base could just import it
12:18 jberger in that sense we have it lucky
12:18 jberger we have a central point of import
12:18 jberger (I've been using that pattern more in my own code too)
12:21 hotsnow how can i use agent to post Text/xml data ?
12:22 abra joined #mojo
12:24 yakubori joined #mojo
12:25 Dandre joined #mojo
12:26 whitebook joined #mojo
12:27 yakubori o/
12:28 nic hotsnow: When you look at the post examples, which bit in particular do you want help with?
12:29 hotsnow chang json to xml and replace the json data to xml string ?
12:33 nic I don't think 'xml' is built in
12:33 dimuls joined #mojo
12:34 nic I think you set the "Content-type" header yourself
12:37 nic $ua->post('localhost:3001' => {'Content-Type' => 'text/xml') => '<wearedoomed/>');
13:07 denisboyun_ joined #mojo
13:09 amirite joined #mojo
13:11 Vandal joined #mojo
13:14 punter joined #mojo
13:20 abra joined #mojo
13:31 sh4 joined #mojo
13:35 dimuls joined #mojo
13:35 ftumsh joined #mojo
13:46 asarch joined #mojo
13:47 mire joined #mojo
13:49 d4rkie joined #mojo
13:59 whitebook joined #mojo
14:04 Dandre joined #mojo
14:09 ftumsh hello
14:09 ftumsh Im having some trouble with template inheritance
14:10 ftumsh ie I am unable to reference in the child a variable declared in the parent
14:10 ftumsh any idea?
14:10 ftumsh ideas?
14:11 shmuel joined #mojo
14:27 ftumsh anyone?
14:27 nic ftumsh: The parent can stuff stuff in the stash
14:29 hotsnow left #mojo
14:29 ftumsh it can, but it doesn't carry through to the child
14:31 nic A minimalist example might illustrate what you mean
14:31 ftumsh Aye. I was hoping there was an obvious fix :)
14:32 nic there might be, once there's an obvious question :)
14:34 ftumsh heh. Ok I'm on it.
14:36 ftumsh Here a snippet
14:36 ftumsh in my parent I have:
14:36 ftumsh % stash foo => 'bar';                      %= content action_menu => begin                       <td>
14:36 nic pastebin please
14:37 ftumsh ah sorry
14:37 ftumsh the parent has:
14:37 ftumsh http://mibpaste.com/DjLDei
14:38 ftumsh the child is (in entirety):
14:38 ftumsh http://mibpaste.com/2EZWOR
14:39 ftumsh Essentially in the parent I am looping for a table. Each row of the table has an id, I need to pass the id in to the child, somehow.
14:40 nic tl;dr
14:41 ftumsh tl;dr?
14:42 nic not a minimal example => I need to get back to projects
14:42 ftumsh ok np
14:42 ftumsh Thank you foryour time
14:43 nic if you can express the problem with a minimal example (eg each template no more than 2 lines) then you'll have more luck
14:44 nic make an executable single-file example of no more than 20 lines and a solution will come flying in
14:47 gryphon joined #mojo
14:47 libsysguy is it possible to use mojo in a non webserver-y way…for example, can I run a mojo lite app and use it without using a url?
14:47 * libsysguy is really not sure how to ask what he wants :p
14:53 whitebook joined #mojo
14:55 ftumsh Yes. Thanks, will do.
14:55 yakubori libsysguy: i suppose, if you dig into the source enough, you could find a way
14:56 yakubori but I don't know if anyone would lend a hand in that case
14:56 marty ftumsh:  why can't you just pass another stash variable with the row id?   ie:    $self->render($menu_, partial => 1, row => $row, rowid => $row_id )
15:00 sri marty: you should use the include helper more ;)
15:01 ftumsh marty, because I am not using the renderer to call the [arent, I am using extends.
15:02 ftumsh marty, having said that, what you say is what I am currently doing, but then that isn't using inheritance.
15:02 marty Ahh the voice from above urging me to "use the include".  I use it all the time myself, but had a DOH moment.  :)   Thanks, sri.
15:03 dolfy joined #mojo
15:04 marty ftumsh:  Ahh ok.
15:09 ftumsh I have the minimal code here:
15:09 sh4 joined #mojo
15:09 ftumsh http://mibpaste.com/Z2waT0
15:10 ftumsh It may be that my whole way of doing it is not correct
15:12 sri it's the opposite direction
15:13 sri first child, then parent
15:13 sri think about it, you say extends inside the child, there is no way the parent could be rendered first
15:16 abra_ joined #mojo
15:24 sri p5-mop loooks so nice https://github.com/stevan/p5-mop-redux/blob/roles​-take-one/t/030-roles/003-multiple-role-compose.t
15:25 sri https://github.com/stevan/p5-mop-redux/blob/​roles-take-one/t/001-examples/007-currency.t
15:28 marty the more I work with bson_oid the more I love it.
15:29 sri now that you mention it, i wonder if it would be useful to be able to extract the unique machine id too
15:32 marty funny you should mention that.  I was thinking that exact thing the other day.
15:34 marty however, I can only imagine real world use cases since I do not have a need atm.
15:35 sri i was thinking about using it for the resque clone :)
15:36 dolfy left #mojo
15:36 sri to identify machines the active workers belong to
15:36 sri but the machine id is only 3 bytes... not very unique
15:36 sri basically the first 3 bytes of the md5 sum of the hostname -.-
15:39 marty ahhh, so in reality machines with hostnames foo1 and foo2 might have the same machine id?
15:40 marty I supose not a big deal if that limitation is known up front
15:40 sri depends on the md5 sum.... foo and bar might have the same id ;p
15:40 marty ahhh
15:42 sri the id is 4 bytes times, 3 bytes machine id, 2 bytes process id and a 3 byte incrementing counter
15:42 sri s/s//
15:43 sri reasonably unique, but not very reusable information
15:46 marty batch insert with mango ROCKS!  I just inserted 50k documents in 25 seconds and most of that time was in the perl sub massaging the info.  awesome!!
15:47 sri \o/
15:51 bpmedley joined #mojo
15:55 arpadszasz joined #mojo
15:59 dod joined #mojo
16:02 dimuls joined #mojo
16:16 ftumsh Well thats one way of looking at it
16:17 dvinciguerra joined #mojo
16:17 ftumsh I suppose
16:17 ftumsh However, with inheritance the child knows all about the parent, the parent knows nothing about the child.
16:17 ftumsh What youre saying is the opposite way round
16:20 ftumsh np tho, I'll just dump extends and go back to using if then else partials.
16:20 ftumsh Thank you all for your time
16:20 ftumsh ttfn
16:21 judofyr joined #mojo
16:33 dimuls Guys, how can i make shared memory and shared clients between hypnotoad workers?
16:38 whitebook joined #mojo
16:52 tba joined #mojo
16:53 tba_ joined #mojo
16:53 tba libsysguy: you can, but it depends what your trying to achieve
16:53 tba_ left #mojo
16:53 libsysguy I just want a redis listener
16:53 tba well mojo ioloop stuff all works without a mojolicious site (i.e., without the app/controller etc)
16:54 libsysguy like a daemon that subscribes to channels and pokes the result into mysql
16:54 libsysguy so maybe I can just use ioloop
16:54 tba probably, and some timers :)
16:54 libsysguy while(1)
16:54 libsysguy :p
16:54 tba yes, but thats blocking and/or runs continuously :p
16:54 tba unless you need it to run as fast as possible, IOLoop has timers you can use to make things happen at a set frequency
16:55 tba having said that, for daemon processes you probably do want while(1) :)
16:55 libsysguy I am not really sure what I need quite yet…I'm not even sure if mojo is the right tool for what I want to do
16:55 libsysguy even though it is a nice swiss army knife
17:09 judofyr_ joined #mojo
17:21 gryphon_ joined #mojo
17:31 judofyr joined #mojo
17:55 ynonp joined #mojo
17:57 suy joined #mojo
17:58 whitebook joined #mojo
18:04 trone joined #mojo
18:05 sri yakubori: you could have mentioned why you think the build example should match the parse one
18:08 yakubori ya -- sorry, it just seemed more like it was out of place given the other parameters. not something that was broken or anything.
18:08 good_news_everyone joined #mojo
18:08 good_news_everyone [mojo] kraih pushed 2 new commits to master: http://git.io/nPevoA
18:08 good_news_everyone mojo/master 2656384 Rick Yakubowski: Mojo::URL pod build example....
18:08 good_news_everyone mojo/master 31f1846 Sebastian Riedel: Merge pull request #510 from yakubori/url-pod...
18:08 good_news_everyone left #mojo
18:08 sri agree
18:09 Tiger joined #mojo
18:11 tba_ joined #mojo
18:27 suy joined #mojo
19:11 denisboyun_ joined #mojo
19:11 russum joined #mojo
19:23 KindOne joined #mojo
19:24 russum left #mojo
19:34 denisboyun joined #mojo
19:35 KindOne joined #mojo
19:45 dvinciguerra joined #mojo
19:55 btyler joined #mojo
19:56 denisboyun joined #mojo
19:57 whitebook joined #mojo
20:29 mire joined #mojo
20:48 bowtie joined #mojo
21:00 MeierM joined #mojo
21:00 amirite_ joined #mojo
21:12 bowtie joined #mojo
21:25 iSlug joined #mojo
21:29 bowtie joined #mojo
21:34 lukep joined #mojo
21:57 bowtie joined #mojo
22:23 BeDa joined #mojo
22:25 punter joined #mojo
22:33 yakubori joined #mojo
22:50 basiliscos joined #mojo
23:18 bowtie joined #mojo
23:18 jnbek joined #mojo
23:55 jberger libsysguy left, but if he should check the log, I have some options for you

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