Camelia, the Perl 6 bug

IRC log for #mojo, 2013-09-04

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

All times shown according to UTC.

Time Nick Message
00:05 asarch joined #mojo
00:09 freman the test suite just boots up the script with daemon
00:10 freman (sorry I realize I used 'server' to describe 'daemon' - but it's not even my project any more so I forget how it's put together)
00:17 good_news_everyone joined #mojo
00:17 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/F9329g
00:17 good_news_everyone mojo/master 3805b04 Sebastian Riedel: better recipe for operating modes
00:17 good_news_everyone left #mojo
00:21 zivester joined #mojo
00:21 good_news_everyone joined #mojo
00:21 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/-7lWdQ
00:21 good_news_everyone mojo/master 2c3438e Sebastian Riedel: added comment to mode example
00:21 good_news_everyone left #mojo
00:23 sri starting to wonder if the whole "sub production_mode {}" stuff should be deprecated
00:23 dsteinbrunner joined #mojo
00:23 sri it doesn't translate vert well to lite apps, and "if ($self->mode eq 'production') {}" is almost as short
00:24 sri but does translate
00:36 shmuel joined #mojo
00:52 laouji joined #mojo
01:13 russum joined #mojo
01:19 basic6_ joined #mojo
01:37 russum left #mojo
01:37 zakame joined #mojo
01:40 cooper joined #mojo
01:50 laouji joined #mojo
02:00 d4rkie joined #mojo
02:38 dvinciguerra joined #mojo
03:05 StinkfooT joined #mojo
05:20 hummeleBop joined #mojo
05:33 fhelmber_ joined #mojo
05:59 yakudza joined #mojo
06:01 d4rkie joined #mojo
06:03 dotandimet joined #mojo
06:04 Vandal joined #mojo
06:06 arthas joined #mojo
06:06 yakudza joined #mojo
06:17 batman sri: i agree
07:07 dod joined #mojo
07:09 basiliscos joined #mojo
07:13 dod joined #mojo
07:16 dotandimet joined #mojo
07:18 dpetrov_ joined #mojo
07:22 trone joined #mojo
07:26 arpadszasz joined #mojo
07:44 trone joined #mojo
08:21 basiliscos joined #mojo
08:50 fhelmber_ joined #mojo
08:52 maxhq joined #mojo
08:55 alnewkirk joined #mojo
08:59 maxhq joined #mojo
09:13 Meiermann joined #mojo
09:19 KindOne joined #mojo
09:57 dsteinbrunner joined #mojo
10:15 gatitskiy joined #mojo
10:22 gatitskiy Hello everybody! How to send broadcast msg to websockets with app running under hypnotad with several workers? Example with 'global' varibale $clients  not work. Thank you in advance
10:44 dqw joined #mojo
11:09 dotandimet joined #mojo
11:28 Adura joined #mojo
11:30 DaniBunny joined #mojo
11:35 mire joined #mojo
11:54 dod joined #mojo
12:06 batman gatitskiy: use redis as backend
12:07 batman $redis = Mojo::Redis->new; $sub = $redis->subscribe('global:messages'); $redis->on(message => sub { $c->send($_[1]) });
12:07 batman ^something like that (you also need a redis server...)
12:09 gatitskiy for global i have redis server, yes but if i need to send message only for one user? (several tx)
12:10 gatitskiy can i store tx references in redis?
12:11 batman filter the messages somehow. i'm doing $redis->publis(Mojo::JSON-​>new->encode(\%message)); # that way i can unwrap it in the other end and check if i should do $c->send() or not
12:11 ryozi joined #mojo
12:11 batman that sounds awful. i wouldn't even consider completing that though :/
12:12 batman you should filter on some client id somehow. you can even make more pub/subs if you need to.
12:15 batman *thought
12:16 gatitskiy 'check if i should do $c->send() or not' ok^ i get it! i will go to try))
12:16 gatitskiy thank you
12:24 asarch joined #mojo
12:28 batman gatitskiy: i can't really give you any better answer without looking at more detailed design
12:41 Meiermann joined #mojo
12:55 Dandre hello,
12:56 Dandre can anyone explain to me what is the meaning or this type of construct:
12:56 Dandre has [qw(placeholders tree)] => sub { [] };
12:56 Dandre I have understood that it create 2 attribute
12:56 moritz there are two attributes declared
12:56 moritz and they have the default value []
12:56 Dandre but what do they do?
12:56 moritz ie empty array reference
12:56 moritz but you have to put the default value in a coderef
12:57 moritz otherwise each attribute get the same array ref, and they are shared
12:57 Dandre ok
12:58 jberger joined #mojo
12:59 Dandre I have an object which as a reference to a hash. Is there any way to create an attribute that can be bound to the members of this hash
13:00 Dandre ie $self->foo should be equivalent to $self->{myhash}->{foo}
13:00 batman Dandre: sub foo { shift->{myhash}{foo} }
13:03 Dandre ok
13:05 Dandre attributes are just function wrappers around key values in the object?
13:05 sri any other opinions on deprecating "sub production_mode {}" and the like in favor of "if ($self->mode eq 'production') {}"?
13:05 dqw joined #mojo
13:06 batman sri: i'm still pro :)
13:06 sri Bender: trust jberger
13:06 Bender OK, sri
13:06 Dandre $seft->myattr equivalent to $self->{myattr] and $seft->myattr('foo') equivalent to $self->{myattr]='foo' ?
13:06 perl2012 joined #mojo
13:07 batman Dandre: if you fix the typo: yes.
13:08 jberger I've only ever used ->mode
13:08 Dandre batman: ok thnaks
13:08 sri jberger: the mode specific methods predate Mojolicious::Lite :o
13:08 sri i assume most people use ->mode
13:08 sri these days
13:09 jberger :o
13:09 jberger Have you grepped cpan?
13:11 jberger I guess deprecation does not depend on current usage
13:11 jberger I have no problem with deprecating
13:12 sri it is used once in documentation by Mojolicious::Plugin::DOCRenderer and once in a test by Mojolicious::Plugin::PlackMiddleware
13:12 dqw joined #mojo
13:13 sri the test is a copy of one of our tests, so it's not intentional use
13:15 dsteinbrunner joined #mojo
13:15 jberger http://grep.cpan.me/?q=sub+%28%5Cw*%29​_%28%3F%3Aproduction%7Cdevelopment%29
13:15 sri that's not a very good search
13:16 sri you want _mode
13:16 jberger I guess I don't understand the feature
13:17 sri that settles it, deprecation!
13:17 jberger I was assuming it worked like template names
13:17 sri http://mojolicio.us/perldoc/Mojolicious#mode
13:17 jberger Oh, got it now
13:18 jberger Yeah +1, deprecate
13:18 jberger I'm surprised, I've read the doc through quite a few times and apparently never noticed that
13:19 sri it's a very old feature and only documented there
13:23 jberger I really only go to the doc for Mojolicious.pm for hooks
13:23 jberger So maybe that's it
13:26 jberger Is it odd that I like TIMTOWTDI in a language, but "one obvious way" in a framework?
13:27 jberger I guess that's not totally true, but since nothing else uses that type of api in the rest of mojo ...
13:27 * jberger waves goodbye
13:29 good_news_everyone joined #mojo
13:29 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/fHu2aw
13:29 good_news_everyone mojo/master c52aca1 Sebastian Riedel: deprecated mode specific methods in application class
13:29 good_news_everyone left #mojo
13:29 gtodd zzzz ...  did anyone else write  Mojolicious::Command::deploy::scp while I was asleep ?
13:32 gtodd ....  Mojolicious::Plugin::CSVRenderer would be more interesting now ....  :)
13:35 good_news_everyone joined #mojo
13:35 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/llPRGg
13:35 good_news_everyone mojo/master 28c3106 Sebastian Riedel: removed redundant connection test
13:35 good_news_everyone left #mojo
13:36 gtodd I wonder how much less/more difficult a beast like "Mojo::Desktop::Suite"  (CSV Spreadsheet app, IRC/XMPP, client Markdown editor, email client ....)  would be than similar stuff in java ....
13:37 bd does grub support booting into mojolicious directly?
13:37 gtodd HTML5 and  a few plugins ... (errm and a ton of javascript) and  badabing!
13:37 gtodd bd: heh
13:37 bd let's call it mojobook and blow away that pesky google chromebook
13:37 gtodd :) nice ...
13:37 bd becaus,e you gotta have mojo
13:38 Vandal joined #mojo
13:38 * gtodd checks if domain is free
13:38 gtodd grrr
13:42 jberger gtodd: re csv: seen my Tie::Array::CSV? It's about as easy of a csv interface as I can imagine if I do say so myself
13:43 jberger Write a web based ui around it and you are done :-)
13:43 gtodd jberger: yeah nice ... I used it to play around with silly files from http://data.gc.ca/  ..... our government's  "open data" initiative
13:43 gtodd jberger: that was my idea :)
13:44 jberger Cool
13:44 btyler joined #mojo
13:46 gtodd some way of "editing" ; moving "records" (lines) ; clicking to sort ... and I would have enough .... feature parity with Google Spreadsheets would remain an open task :)
13:48 gtodd jberger: Tie::Array::CSV  reminded me that most spreadsheets are @arrays  not %hashes :)
13:50 batman when is a spreadsheet a hash..?
13:51 PerlJam batman: "cell A5" sure sounds like a hash lookup
13:53 batman PerlJam: i would argue that the structure of a spreadsheet is @rows = (\@row1, \@row2, ...)
13:53 batman and that cell A5 = $rows[5][0];
13:53 batman or probably $rows[5][0] :P
13:54 PerlJam batman: sure ... but many people fail to abstract that, so a spreadsheet looks like a hash
13:54 gtodd jberger:  but sometimes I "use ..." the wrong module ....  Tie::Hash::Array   Tie::Array::CSV     Tie::Handle::CSV  .... etc etc.
13:54 batman it makes sense for reading, but writing... that would totally mess things up
13:55 batman $rows[4][SOME_CELL_A_CONSTANT] <-- i would rather do that...
13:55 gtodd jberger  ... somewhere someone is thinking that Tie::Hash::Array  is crying out for Tie::Array::Hash :)
13:56 moritz and then I want Tie::Array::Hash::Array :-)
13:56 jberger Every so often I think about adding hash-y access, but I never end up liking the code,  so I pitch it
13:57 gtodd one of the several CSV modules allows for     ->{'Header name'}  ... or $rowasarray[3]
13:58 jberger But since TACSV is already doubly tied, I would love to add another tied layer! I doubt there are any 3 layer tied modules out there :-)
13:59 bzero joined #mojo
14:01 gtodd depending on how you define the filehandle ... (with header = %hash without = array)
14:01 jberger gtodd: I will consider a pull request, but I'm going to be extra picky since its one of my favorite modules
14:01 gtodd :)
14:01 * gtodd groks
14:01 yko joined #mojo
14:01 jberger That said I would love to see this feature added
14:01 jberger I have meant to for a while
14:04 gtodd since I only intermittently use perl I usually find some modules confusing and end up using a favourite set of simple ones
14:06 bluescreen joined #mojo
14:07 gtodd but first I end up accidentally creating what moritz said Tie::Array::Hash::Array (monkey .... keyboard ...)  or some other spaghetti ... :)
14:09 gtodd which while lurking on IRC channels I observe someone like mauke replace with a one liner ...
14:09 gtodd ... I call this "learning" ...:)
14:22 * sri did not know metacpan can diff https://metacpan.org/diff/release/SRI/​Mojolicious-4.29/SRI/Mojolicious-4.30
14:23 * sri should look at the sidebar every now and then :o
14:30 moltar joined #mojo
14:31 jberger <3 metacpan
14:32 jberger gtodd that is part of the fun
14:35 * sri wonders if there should be an ->is_mode('production') method
14:44 jamesw joined #mojo
14:46 sri http://pastie.org/8297678 # does that look better?
14:46 jberger Or is_production
14:46 jamesw joined #mojo
14:46 batman jberger: i don't like it
14:47 sri there may be many different modes
14:47 batman jberger: too many possible modes
14:47 sri yea, -1 from me as well
14:47 batman sri: i don't like it, since i would probably rather do if($self->mode =~ /^prod/) or something
14:47 batman err... "i don't care"
14:47 batman :)
14:48 jberger That was just an idea
14:48 punter joined #mojo
14:49 jberger sri: I suppose I like it, it looks better, but in the end it's still just starting equality
14:49 connor_goodwolf joined #mojo
14:49 jberger s/starting/testing/
14:50 jberger (swipe fail)
14:51 good_news_everyone joined #mojo
14:51 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/J_mU6A
14:51 good_news_everyone mojo/master f2c1ae6 Sebastian Riedel: better description for change
14:51 good_news_everyone left #mojo
14:51 sri meh, then no is_mode()
14:56 batman mojo++ # makes sense :)
15:15 mire joined #mojo
15:18 asarch joined #mojo
15:18 d4rkie joined #mojo
15:22 gatitskiy joined #mojo
15:35 d4rkie joined #mojo
16:11 yakudza joined #mojo
16:21 tempire Can you skip steps in ::Delay?
16:22 tempire without modifying internal structures.
16:36 basiliscos joined #mojo
16:41 espent joined #mojo
16:47 jberger Just return from the step early? We made delay more resilient a while back, should work iirc
16:49 tempire I mean, for example, I'm in the 3rd step, and decide I want to skip to the 8th.
16:56 gatitskiy joined #mojo
16:57 bowtie_ joined #mojo
17:09 jberger Perhaps a second delay/steps inside the first? Is that possible? Sane?
17:34 sri I HEAR YOU LIKE DELAYS
17:52 gatitski_ joined #mojo
17:52 dvinciguerra joined #mojo
17:55 batman jberger: it's possible. i do it all the time :)
17:55 batman not directly inside, but i'm calling methods which might start another Mojo::IOLoop->delay(...)
17:55 batman i don't really care. it just works :)
17:57 gatitskiy joined #mojo
18:30 good_news_everyone joined #mojo
18:30 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/XdVDJQ
18:30 good_news_everyone mojo/master a09aff4 Sebastian Riedel: documentation tweaks
18:30 good_news_everyone left #mojo
18:38 jnbek joined #mojo
18:50 mire joined #mojo
19:26 trone joined #mojo
19:26 punter joined #mojo
19:41 Kovensky joined #mojo
20:07 good_news_everyone joined #mojo
20:07 good_news_everyone [mojo] kraih tagged v4.31 at 328b158: http://git.io/7T_smg
20:07 good_news_everyone left #mojo
20:09 sri ok, no more releases for a few weeks now!
20:09 PerlJam that bot has an awesome name
20:09 sri (that usually results in someone proposing a very cool feature within a few hours)
20:12 batman :D
20:46 rem_lex| joined #mojo
21:02 dotandimet joined #mojo
21:03 perlite_ joined #mojo
21:10 tempire It's strange that the transport error code is used for web applications.
21:11 * tempire wonders when mixing that layer became "normal"
21:13 tempire I guess it's because cgi was originally thought of as acting as the web server.
21:17 basiliscos joined #mojo
21:55 sri \o\
21:55 sri /o/
22:28 jberger \o-
22:28 jberger -o/
22:28 jberger |o|
22:28 jberger ¡o¡
22:40 punter joined #mojo
23:02 whatitdo joined #mojo
23:06 hesperaux joined #mojo
23:15 StinkfooT left #mojo
23:32 jberger_ joined #mojo
23:33 jberger joined #mojo
23:44 jberger_ joined #mojo
23:49 good_news_everyone joined #mojo
23:49 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/U7aPuQ
23:49 good_news_everyone mojo/master 954fb2c Sebastian Riedel: do not link to the Mojolicious class when referring to the whole distribution
23:49 good_news_everyone left #mojo

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