The web in a box - a next generation web framework for the Perl programming language

IRC log for #mojo, 2015-05-30

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

All times shown according to UTC.

Time Nick Message
00:02 tempire nested deconstructors in es6 are my dream come true
00:02 Grinnz don't make me link Deconstruction again
00:08 Grinnz but more appropriate for this channel https://www.youtube.com/watch?v=I4PkL5FwDEA
00:15 Flying_Squirrel joined #mojo
00:16 Grinnz joined #mojo
00:21 absolut_todd joined #mojo
00:27 schetchik joined #mojo
00:40 circ-user-05ppj joined #mojo
00:45 damaya Hey all, is redirecting to $c->req->headers->referrer ok? I.e., $c->redirect_to($c->req->headers->referrer);
00:51 bpmedley damaya: As long as referer is a valid url, I would assume so.
00:52 damaya ok, just want to make sure there's no chance of getting stuck in an infinite loop or anything
00:52 damaya haha
00:53 bpmedley Ceritainly possible, just depends.
00:53 damaya bpmedley: Are you a biologist, or was that jberger?
00:54 bpmedley No, I think jperger has a Ph D in physics.  I’m just a computer engineer.
00:54 bpmedley *jberger
01:01 sh4|2 joined #mojo
01:14 nicomen joined #mojo
01:24 schetchik joined #mojo
01:37 absolut_todd joined #mojo
01:40 klapperl_ joined #mojo
01:45 mattastrophe joined #mojo
01:49 csson joined #mojo
02:09 good_news_everyon joined #mojo
02:09 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/vkzuh
02:09 good_news_everyon mojo/master 5a00d9e Sebastian Riedel: fix a few typos (closes #802)
02:09 good_news_everyon left #mojo
02:12 sri hmm, looks like the google ipv6 test server is back up
02:22 schetchik joined #mojo
02:29 jasanj joined #mojo
02:44 noganex_ joined #mojo
02:47 Anon021 joined #mojo
03:20 schetchik joined #mojo
03:28 jberger damaya: yes, PhD in physics
03:29 jberger ultrafast instrumentation
03:30 basic6 joined #mojo
03:45 csson joined #mojo
04:17 schetchik joined #mojo
05:01 mattastrophe joined #mojo
05:15 schetchik joined #mojo
05:40 nicomen joined #mojo
05:52 kaare joined #mojo
06:12 schetchik joined #mojo
06:48 berov joined #mojo
07:11 schetchik joined #mojo
07:16 trone joined #mojo
07:44 Vandal joined #mojo
08:08 schetchik joined #mojo
08:22 cpan_mojo Mojo-Cloudstack-0.05 by HRUPP https://metacpan.org/release/HRUPP/Mojo-Cloudstack-0.05
08:41 amon joined #mojo
09:06 schetchik joined #mojo
09:19 batman big Mojo::IRC addition: https://github.com/jhthorsen/mojo-irc/pull/23 # comments wanted
09:49 kyshtynbai joined #mojo
10:03 schetchik joined #mojo
10:20 nicomen joined #mojo
10:24 lluad joined #mojo
10:36 punter joined #mojo
11:01 schetchik joined #mojo
11:07 ladnaV joined #mojo
11:52 jberger joined #mojo
11:54 Flying_Squirrel joined #mojo
11:58 schetchik joined #mojo
12:06 sh4 joined #mojo
12:22 dod joined #mojo
12:22 dod joined #mojo
12:22 ToApolytoXaos joined #mojo
12:27 dod joined #mojo
12:56 schetchik joined #mojo
13:15 mattastrophe joined #mojo
13:44 asarch joined #mojo
13:54 schetchik joined #mojo
14:06 bayashi joined #mojo
14:09 zivester joined #mojo
14:53 schetchik joined #mojo
14:54 Zoffix joined #mojo
15:17 PryMar56 joined #mojo
15:50 schetchik joined #mojo
16:00 btyler joined #mojo
16:03 ajr_ joined #mojo
16:07 kaare joined #mojo
16:22 kaare_ joined #mojo
16:23 nicomen joined #mojo
16:30 Flying_Squirrel joined #mojo
16:33 nicomen joined #mojo
16:37 asarch joined #mojo
16:40 nicomen joined #mojo
16:49 schetchik joined #mojo
17:01 sh4 joined #mojo
17:31 cpan_mojo Mojo-IRC-0.20 by JHTHORSEN https://metacpan.org/release/JHTHORSEN/Mojo-IRC-0.20
17:36 batman ^ not too bad delay. i ran "git ship" 2015-05-30T19:29:27
17:45 schetchik joined #mojo
17:47 mattastrophe joined #mojo
17:50 batman anyone who knows irc here? (sorry about the off topic question)
17:51 batman is there any way to figure out if a message has been received by a channel/user?
17:51 pink_mist no
17:51 batman i see a bunch of error events, but i can't seem to find a "OK, i got it!" event
17:51 pink_mist there isn't
17:51 batman crap. i was hoping i was wrong :(
17:52 batman wonder if there's a way to simulate it... i was thinking about a timer, but that seems very error-prone
17:55 mst step back. explain what you're trying to achieve.
17:57 batman mst: i'm adding async methods to Mojo::IRC, and i would like to add a send() method, that looks like this: $irc->send("mst" => "hi!", sub { my ($irc, $err) = @_; });
17:57 batman i was hoping $err could be things like "No such nick"
17:58 vmb joined #mojo
17:58 batman but i have no idea how to achieve that and at the same time call the callback on success
17:58 mst so don't
17:58 batman ...since i don't know what the "success" trigger is
17:58 mst there isn't one
17:59 mst you can't even correlate the error to the outgoing message really
17:59 mst if you send two messages to me and get a 'no suck nick' error back, you've no idea if that was the first or second message unless you get a second 'no such nick' error
18:00 batman that's fine in my case. if you send them *almost* at the same time, i will gladly trigger both callbacks with the same error
18:00 batman that's what i'm doing for the other methods i created here: https://github.com/jhthorsen/mojo-irc/pull/23
18:00 mst right, so I'd vote for the callbacks only being called on error
18:00 mst at which point the problem goes away
18:01 batman mst: what? how would that work? if i send 1000 messages, i would have 1000 callbacks just taking up memory...?
18:01 batman (if you actually get the message, that is)
18:02 mst you can -expire- them based on a timer. just don't call them when you do.
18:03 batman i don't think that's a good idea. i can already register for the events, so i think i will rather do that.
18:03 batman "the events" = the error events, like "No such nick"
18:03 mst well, no, but you started off with the assumption of passing a callback
18:03 mst so I worked within that assumption
18:04 batman i expect a callback to be called when it the method completes, so clearly that won't work for sending messages.
18:04 batman it the = the
18:11 dod joined #mojo
18:20 sri irc is not a request/response protocol
18:21 sri treat it as a stream of async messages
18:21 sri like websockets
18:22 batman i'm hoping that's what i do in that pr
18:41 sri i really wonder how stuff like this happens http://www.cpantesters.org/cpan/report/b051c2b4-021b-11e5-a85a-e28fcaadd3a7
18:41 marcus batman: You probably want to emit an error event, rather than using a cb?
18:41 schetchik joined #mojo
18:42 marcus sri: Old test harness?
18:43 sri hmm, google search seems to suggest a segfault
18:43 sri all tests passed, until perl segfaulted
18:44 marcus at the 51th test?
18:44 sri pattern.t has 127 tests
18:44 batman marcus: mojo-irc already does that
18:45 batman marcus: have you found time to review the pr yet?
18:45 marcus batman: looking at it now.
18:45 batman thanks :)
18:46 sri https://github.com/kraih/mojo/blob/master/t/mojolicious/pattern.t#L122
18:46 sri that seems to be where it segfaulted
18:50 marcus batman: In general I'm really not sure how robust this is going to be, given that you have no actual way to check that messages are responses to your queries
18:51 marcus mst: Could you take a look too, I'd value your input. https://github.com/jhthorsen/mojo-irc/pull/23/files
18:51 batman marcus: no, but i know that $irc->channel_topic("#foo") will not get the topic of channel #bar if you ask for both
18:52 marcus batman: Even if you ask for both within the same tick?
18:52 batman i consider that to be good enough. i'm not sure if i care too much about if the topic could possible be changed in between the events
18:52 batman marcus: yes. that what $needle is for https://github.com/jhthorsen/mojo-irc/pull/23/files#diff-aa4278ce2f96c9db836d381a2fb65c0aR917
18:53 batman marcus: example needle: https://github.com/jhthorsen/mojo-irc/pull/23/files#diff-aa4278ce2f96c9db836d381a2fb65c0aR448
18:54 batman so $msg->{params}[1] need to match the incoming requested $channel
18:55 pink_mist what happens if you have two $irc->channel_topic("#foo") in the same tick?
18:56 marcus pink_mist: They would get the same response, I guess?
18:56 pink_mist well yes, one would hope so :P
18:56 batman pink_mist: what marcus says.
18:57 pink_mist unless someone is just at that moment changing the topic? :P
18:57 batman but if you do $irc->channel_topic("#foo") [someone changes the topic and then $irc->channel_topic("#foo") again, they both might get the same topic.
18:57 marcus actually, won't the two just generate one event?
18:57 marcus since it's a hash...
18:57 batman but i consider that a corner case which i don't care about.
18:57 pink_mist if it's a hash, are you sure they'll both get the event?
18:58 batman marcus: i don't get your questions about the hash.
18:58 batman pink_mist: ^
18:58 marcus batman: https://github.com/jhthorsen/mojo-irc/pull/23/files#diff-aa4278ce2f96c9db836d381a2fb65c0aR912 not sure I fully understand how the needle works.
18:59 batman marcus: $needle = {1 => "foo"} means that for the callback to trigger, there must be an IRC event with $msg->{params}[1] = "foo"
19:00 asarch I am a little bit confused: I have a table for sales and a table for products and a table 'sale_product' for the n to n relationship. Question: Where do you usually set the "sale_price" column, in the "sale", "product" or "sale_product" table since every costumer has its own discount value (some 10% off, others 35%, etc)?
19:00 batman if $needle={1=>"foo",2=>"bar"} then this must be true: $msg->{params}[1] eq "foo" and $msg->{params}[2] eq "bar"
19:00 marcus batman: I get it now. So once you get one of the events you wait for, you unsubscribe all of the events for that call.
19:00 batman marcus: yes
19:01 mst batman: have you considered sitting this atop mainline Mojo::IRC ?
19:01 marcus and if it never occurs, the callbacks stay forever.
19:01 mst I've noticed that other clients tend to have a base layer, and a state-keeping layer
19:01 batman marcus: yes. that's why i asked you initially about the "master timer" (some time ago)
19:01 jberger asarch: seems off topic, are you asking in the right room?
19:01 mst this has the huge advantage that it can be treating as an experiment and put into maintenance mode later if it doesn't work out as well as it might
19:02 mst batman: because, basically, I have the same fragility concerns as marcus ... but if it works well enough, it might be a net win for some users anyway
19:02 batman mst: yes. i have consider that. i might take it out, but i'm not sure if it's worth it (splitting it up)
19:02 marcus batman: And I suggested that it should have a timeout by default, I think.
19:02 batman marcus: yes, you did. not yet implemented :)
19:02 asarch Well, I am stuck at this part in my Mojolicious-based app jberger :-(
19:02 mst batman: I think it's worth it to keep the experiment separate, even if it's only via subclassing
19:02 marcus batman: I like mst's idea of putting it in a separate class.
19:03 batman ok. i'll make the subclass, if someone can tell me what it should be called :)
19:03 batman naming is hard. can i go shopping, while you figure it out? ;)
19:03 jberger batman: get me some brown cheese!
19:03 marcus I'm afraid most of the shops are closed
19:04 batman marcus: good thing i got beer in time ;)
19:04 marcus Mojo::IRC::Stateful seems correct, but maybe cumbersome?
19:05 mst the POE thing is POE::Component::IRC::State so there's prior art for that
19:05 batman not sure if i would say "stateful". it's more "eventfuller" ;)
19:05 mst Mojo::IRC::TrackEvents ?
19:05 batman Mojo::IRC::Experimental or Mojo::IRC::DWIM ?
19:05 marcus Mojo::IRC::Simple :D
19:05 batman OMG
19:06 * mst eats a kitten
19:06 _dave_ O.o
19:06 mst there's a saying over on f#perl - 'every time you use XML::Simple, apeiron eats a kitten'
19:06 batman Mojo::InternetRelayChat
19:06 marcus Mojo::IRC::Agent
19:07 pink_mist Mojo::IRC::Events
19:07 batman TrackEvents and Agent are my favorites so far
19:08 mst Mojo::IRC::Semantic
19:08 batman i've never understood fully what semantic means :(
19:08 _dave_ someone will write a SemanticUI extension ... ;)
19:08 jberger that's a funny word not to understand what it means
19:09 * batman looks it up in the oxford dictionary :)
19:09 marcus batman::semantic
19:10 batman what do you think about ::Semantic marcus? i kind of like it.
19:10 marcus batman: I hate it.
19:10 marcus :)
19:10 batman haha. ok :D
19:10 marcus semantic web ruined it for me.
19:10 batman then i think I'm left with ::Agent and ::Events
19:10 marcus you can choose freely.
19:11 mst Mojo::IRC::Agent or ::UserAgent would work for me
19:11 marcus but let's mark it experimental, whatever we name it.
19:11 mst or Mojo::IRC::UA for less typing
19:12 pink_mist Mojo::IRC::Experimental
19:12 mst nah, because I suspect in the long run the two class architecture will be better anyway
19:13 batman marcus: all the methods are already EXPERIMENTAL, so yeah... the module will be experimental :)
19:13 pink_mist I do like ::UA
19:13 marcus I'm happy with that too.
19:13 batman \o/
19:13 batman marcus: are you happy with the method names?
19:14 marcus batman: Yea
19:14 mst why are you avoiding calling $self->nick ?
19:14 batman even channel_topic() instead of just topic() ? :)
19:15 batman mst: recursion iirc
19:16 mst oh, to avoid it sending it as a nick change?
19:17 batman no. just plain recursion. i think the search and replace got a bit crazy though...
19:17 batman i will change it back after making the subclass.
19:20 * batman need to go to the store.
19:20 batman thanks for the feedback! :)
19:22 batman marcus: i think i will merge and make a new release after the change to subclass.
19:22 batman let me know if you disagree
19:42 schetchik joined #mojo
19:44 bin_005 joined #mojo
19:52 Nemix_ joined #mojo
20:23 gryphon joined #mojo
20:28 gryphon joined #mojo
20:40 schetchik joined #mojo
20:50 gryphon joined #mojo
21:13 punter joined #mojo
21:21 amon joined #mojo
21:35 schetchik joined #mojo
21:36 bin_005 joined #mojo
21:41 jabberwok batman: semantic means you go through some-antics to impress your boss that you're doing Web 2.0^H^H^H 2.1^H^H^ 3.0^H^H^H 3.11
21:42 pink_mist for workgroups
21:42 jabberwok YES
21:47 jberger its how to be social in the cloud, disruptively
21:50 jberger marcus: can I get a new release of Mojolicious::Plugin::MountPSGI?
22:11 mattastrophe joined #mojo
22:22 mattp_ joined #mojo
22:23 cpan_mojo Mojo-Phantom-0.01 by JBERGER https://metacpan.org/release/JBERGER/Mojo-Phantom-0.01
22:24 jberger mostly \o/
22:30 vmbrasseur joined #mojo
22:32 schetchik joined #mojo
22:34 jberger anyway, there it is
22:35 jberger go therefore and test your javascript
22:35 pink_mist ohh, it's the phantom js tester!
22:35 pink_mist awesome
22:35 pink_mist jberger++
22:35 cpan_mojo Mojo-Phantom-0.02 by JBERGER https://metacpan.org/release/JBERGER/Mojo-Phantom-0.02
22:36 pink_mist did that Test::something module you needed finally get released? or did you do something else?
22:36 jberger yeah, I decided to name the dist Mojo-Phantom
22:36 jberger I punted
22:36 pink_mist I have no idea what that means :P
22:36 jberger it uses Test::More and you get crap line numbers out for the actual failed test
22:36 jberger but that's ok because those tests are wrapped in a subtest which does get the right numbers
22:37 jberger so its not that big of a deal
22:37 pink_mist ah, cool =)
22:37 jberger Test::Stream will also make it easier to test the tester itself
22:37 jberger but until then I made due
22:58 PryMar56 joined #mojo
23:15 Adura joined #mojo
23:23 jberger marcusr: btw if you don't have time to release Mojolicious::Plugin::MountPSGI I will happily do so given the correct perms
23:23 jberger but I would really like to be able to use it in an example in my talk
23:24 jberger hmmm, which marcus(r)? is marcus?
23:24 * jberger holds out a nice beer, waits for the real marcus to come grab it
23:25 jberger ok, time for blackhawks game 7
23:25 jberger o/
23:30 schetchik joined #mojo
23:35 asarch joined #mojo

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