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

IRC log for #mojo, 2014-07-24

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

All times shown according to UTC.

Time Nick Message
00:02 vervain joined #mojo
00:07 disputin joined #mojo
00:24 * jberger likes
00:36 jberger joined #mojo
01:08 basic6 joined #mojo
01:43 Averna joined #mojo
01:45 Averna joined #mojo
01:49 klapperl_ joined #mojo
02:00 jberger hmmmmm trying to get ForkCall to start on the next tick without introducing cycles is tough
02:07 jberger actually, no its not
02:07 jberger delay! inside out storage!
02:07 jberger who cares if its only one step!
02:21 mattastrophe joined #mojo
02:23 d^_^b hey everyone
02:23 purl i guess everyone is asleep
02:24 dj_goku joined #mojo
02:39 jberger sri oetiker: does this test look sane
02:39 jberger https://github.com/jberger/Mojo-IOLoop-ForkCall/blob/master/t/multiple.t
02:39 jberger it tests the problem that oetiker discovered earlier
02:40 jberger it depends on the children being able to print tap to the same output stream
02:40 jberger it would trivially pass without that
02:41 jberger d^_^b: o.
02:41 jberger o/
02:42 jberger sri oetiker: it does indeed fail without this line: https://github.com/jberger/Mojo-IOLoop-ForkCall/blob/master/lib/Mojo/IOLoop/ForkCall.pm#L82
02:49 woz joined #mojo
02:53 human39 joined #mojo
03:02 human39 joined #mojo
03:16 jberger well, that's that then
03:21 woz joined #mojo
03:21 jberger oetiker: Mojo::IOLoop::ForkCall 0.11 released
03:22 * jberger really needs to figure out what is up with cpan_mojo
03:25 dvinciguerra joined #mojo
03:30 jb360 joined #mojo
03:33 jb360 joined #mojo
03:45 disputin joined #mojo
03:56 basic6_ joined #mojo
04:31 woz joined #mojo
04:36 batman sri: the collection change is super sweet! +2 ;)
04:36 batman I forget to use collection :(
04:37 gatitskiy joined #mojo
04:45 disputin joined #mojo
04:52 KCL joined #mojo
05:33 woz joined #mojo
05:37 gatitskiy joined #mojo
05:42 espen joined #mojo
05:47 gatitski_ joined #mojo
05:53 dotandimet joined #mojo
06:00 gatitskiy joined #mojo
06:10 gatitski_ joined #mojo
06:11 Lee joined #mojo
06:11 sujithm joined #mojo
06:12 oetiker jberger great!
06:13 denis_boyun joined #mojo
06:21 gatitskiy joined #mojo
06:34 laouji joined #mojo
06:36 * sri would really like to make Mojo::Colelction::compact faster
06:36 sri but i'm not sure if it being slow is a feature
06:37 sri it currently stringifies all elements in the collection before making sure they are not equal to the empty string... that can be ridiculous with Mojo::DOM objects
06:38 woz joined #mojo
06:38 sri if we did a ref check before the comparison it would be much much faster
06:40 sri i guess the description would support an optimization... "Create a new collection with all elements that are defined and not an empty string."
06:42 _WildPikachu_ joined #mojo
06:42 sri objects may stringify to an empty string, but they are not empty strings :)
06:54 good_news_everyon joined #mojo
06:54 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/SrusQw
06:54 good_news_everyon mojo/master a9a574a Sebastian Riedel: improved Mojo::Collection performance
06:54 good_news_everyon left #mojo
06:54 sri that leaves Mojo::Collection::uniq, which stringifies before making sure everything is unique
07:00 Vandal joined #mojo
07:04 batman https://github.com/jhthorsen/mojolicious-plugin-surveil # any ideas for another name?
07:04 batman any other feedback is greatly apperciated :)
07:05 sri Mojolicious::Plugin::NSABackdoor?
07:06 batman :D
07:20 dp_ joined #mojo
07:22 sri how odd... i just had a use for Mojo::Collection::reduce
07:22 sri to turn a collection of form elements into a hash
07:23 * sri was looking for a one-liner to replace the ->val on <form> feature
07:28 trone joined #mojo
07:30 sri closest i got
07:30 sri perl -Mojo -E 'my %form = map { $_->{name} => $_->val->join->to_string } g("github.com")->dom->find("form")->first->find("input, select, textarea, button")->grep(sub { $_->{name} })->each; say r \%form'
07:32 sujithm joined #mojo
07:36 * sri suddenly understands git https://pbs.twimg.com/media/BtQnfw2CYAIh123.jpg:large
07:38 gatitskiy joined #mojo
07:40 woz joined #mojo
08:02 sri littke tempted to add $dom->has('foo') and $dom->not('foo')
08:02 sri *little
08:03 sri ->not being the opposite of ->match and ->has checking with ->at if this element has a descendant of that type
08:04 mire joined #mojo
08:04 sri as an alternative to a :has() pseudo class
08:04 sri which might still be years away
08:05 rawler joined #mojo
08:05 sri my $lists_containing_lists = $dom->find('ul')->has('ul')->compact;
08:08 sri that of course brings me back to the ->uniq problem
08:08 sri i kinda would like two versions of ->uniq
08:09 sri one that compares string values, and one that compares ref addresses
08:09 sri maybe ->uniq(1) for comparing ref addresses
08:10 sri or some kind of ->uniq_ref method
08:10 * sri shrugs
08:11 * batman is lost
08:11 batman but the reduce() idea sounds cool
08:11 sri that is literally the worst idea of today :o
08:11 _eugen joined #mojo
08:13 sri let me illustrate the ->uniq problem
08:13 sri perl -Mojo -E 'say x("<div>A</div><div>A</div>")->find("div")->uniq'
08:13 sri those two <div> elements look the same when stringified, but they are not the same
08:14 dod joined #mojo
08:14 sri soooo
08:15 sri lets say we select the same elements twice for some reason
08:15 sri perl -Mojo -E 'say x("<div>A</div><div>A</div>")->find("div")->parent->find("div")->flatten'
08:15 sri how do we get unique Mojo::DOM objects here?
08:15 basiliscos joined #mojo
08:16 sri well
08:16 sri actually scratch that... it doesn't work :S
08:17 sri the objects are not identical
08:21 oetiker jberger with 0.11 you do not return the pid of the child anymore ... until now we have been using this information to clean up when we exit and forks are still running. how would you do that now ?
08:30 batman joined #mojo
08:30 marcus joined #mojo
08:31 jberger_ joined #mojo
08:32 laouji joined #mojo
08:32 oetiker jberger_ with 0.11 you do not return the pid of the child anymore ... until now we have been using this information to clean up when we exit and forks are still running. how would you do that now ?
08:38 edestler joined #mojo
08:42 woz joined #mojo
08:44 woz joined #mojo
08:45 fhelmber_ joined #mojo
08:48 laouji_ joined #mojo
08:52 laouji joined #mojo
08:56 laouji joined #mojo
08:56 gatitski_ joined #mojo
09:08 neyasov_______ joined #mojo
09:27 trone joined #mojo
09:42 sri eeeeeep
09:43 sri i've been looking into https://github.com/kraih/mojo/issues/652
09:43 sri and if i change PODRenderer to use the official Pod::Simple::HTML escape method... even more stuff doesn't actually work!
09:44 trone joined #mojo
09:54 mire joined #mojo
09:55 geira joined #mojo
10:01 sri ah, found the problem
10:02 sri how do you escape a selector for jquery?
10:02 sri like a class with % and () characters
10:04 blacklight joined #mojo
10:05 blacklight hi *, is there any working example of websocket client using mojo? mojo is described as a client-server framework, but i can't find any example of websocket clients on the web
10:06 sri http://mojolicio.us/perldoc/Mojolicious/Guides/Cookbook#WebSockets
10:06 sujithm_ joined #mojo
10:06 sri http://mojolicio.us/perldoc/Mojolicious/Guides/Cookbook#Testing_WebSocket_web_services
10:11 blacklight ok i didn't investigate well enough :D
10:11 blacklight btw, does it work only if the backend is a mojo-based server?
10:12 blacklight i'm testing the sample against a node.js ws server (http://einaros.github.io/ws/) and the handshake fails
10:13 geira joined #mojo
10:27 good_news_everyon joined #mojo
10:27 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/TJFDCg
10:27 good_news_everyon mojo/master b193c67 Sebastian Riedel: fixed support for Unicode anchors in Mojolicious::Plugin::PODRenderer...
10:27 good_news_everyon left #mojo
10:27 sri i guess this might break some old anchors
10:42 gatitskiy joined #mojo
10:42 gatitskiy joined #mojo
10:48 dvinciguerra joined #mojo
11:16 mattastrophe joined #mojo
11:18 mire joined #mojo
11:24 neyasov_______ joined #mojo
11:27 rem_lex joined #mojo
11:29 jberger oetiker: $child is the child pid
11:30 jberger So the return value shouldn't have changed
11:31 jberger Unless i screwed something up
11:33 d4rkie joined #mojo
11:35 jberger blacklight: the client should work regardless of the server architecture
11:36 oetiker jberger earlier run used to return the $pid now _run returns the pid, but run returns whatever $self->ioloop->next_tick returns
11:39 sri next_tick always returns undef, it's a feature
11:39 oetiker :-)
11:39 oetiker sri just saw in the docs
11:40 sri i'd add a spawn event that gets the pid as argument
11:40 sri it's what i do in prefork and minion
11:40 sri child gets forked, the parent emits a spawn event
11:40 oetiker jberger ... sorry you return the delay object missed the last patch
11:41 oetiker spawn event ... cool
11:41 gatitskiy joined #mojo
11:42 sri i think we only have one non-blocking api in mojolicious that has a real return value, which is Mojo::IOLoop->client
11:42 sri no wait
11:42 sri timers too :)
11:42 sri ok, it's rather common after all ;p
11:43 sri but yea, with fork you want to be able to delay stuff... so event is the best path
11:44 oetiker jberger btw the documentation still sais you return the pid from run
11:48 jberger Ahhhhh
11:48 jberger The delay
11:48 purl hmmm... The delay is the second argument, not the first
11:48 jberger Shut it purl!
11:50 jberger Yeah ok, slab
11:50 jberger Grrr
11:50 jberger Yeah ok, spawn event it is
11:58 sri one thing that bugs me a little with collections is that it can get hairy when they are nested
12:00 sri like here
12:00 purl like here is how you build a tranaction manually and make a call
12:00 sri perl -Mojo -E 'say r x("<div>A</div><div>A</div>")->find("div")->parent->find("div")'
12:00 sri purl: forget like here
12:00 purl sri: I forgot like here
12:01 sri once you flatten things get a bit clearer
12:01 sri perl -Mojo -E 'say r x("<div>A</div><div>A</div>")->find("div")->parent->find("div")->flatten'
12:02 sri remove the r call and be confused :)
12:11 blacklight left #mojo
12:12 neilhwatson joined #mojo
12:21 sri batman: do you want to upload a release? :)
12:22 batman no idea how i do that :( i use my own shipping process for my modules...
12:22 batman perl Makefile.PL; make manifest; make dist; cpan-upload...?
12:24 batman sri: ^
12:24 sri 1) make sure master is in a good state, 2) tag release, 3) perl Makefile.PL; make manifest; make dist, 4) upload release, ...optional... 5) tweet release if there were noteworthy changes, 6) make "bump version" commit to master like i always do
12:26 sri 7) notice you've included garbage files like .DS_Store and return to step 1
12:27 sri i think both jberger and marcus did that... ;p
12:27 sri me a few times too
12:28 sri use the same tag format already used
12:31 sujithm joined #mojo
12:32 batman ok
12:32 sri https://github.com/kraih/mojo/releases/tag/v5.16
12:33 sri https://github.com/kraih/mojo/commit/3593a7bbcc3da25e7db2e00a8a3f10967386f2db
12:35 batman http://p.thorsen.pm/22b0a52619fd # looks good so far
12:35 batman next step is to upload + push tag
12:37 batman sri: i will upload now, unless you want to look things over. the paste contain the list of files in the dist
12:38 sri looks good
12:39 batman feels strange :)
12:40 sri don't worry too much... we need more releases anyway... to get away from those awkward version numbers that are too similar to perl versions :)
12:40 good_news_everyon joined #mojo
12:40 good_news_everyon [mojo] jhthorsen tagged v5.17 at master: http://git.io/Qxu8BQ
12:40 good_news_everyon left #mojo
12:40 batman hehe
12:40 * batman makes a tweet
12:41 Ptolemarch joined #mojo
12:41 sri i like to use this format... but do your own thing https://twitter.com/kraih/status/481443731477106688
12:42 mattastrophe joined #mojo
12:43 sri oh, terror warning for oslo, be careful!
12:46 punter joined #mojo
12:48 batman oh?
12:48 sri http://edition.cnn.com/2014/07/24/world/europe/norway-terror-threat/index.html
12:48 batman https://twitter.com/jhthorsen/status/492290271863144449
12:49 sri no link?
12:50 sri you know, like https://github.com/kraih/mojo/compare/v5.16...v5.17#diff-c112bb3542e98308d12d5ecb10a67abcR2
12:50 sri ;p
12:50 sri i'll retweet if you say it's ok
12:51 batman i didn't have any room :(
12:51 sri oh noes
12:51 batman i had 0 characters left
12:52 sri no version bump commit?
12:55 batman what??! i thought you did that :(
12:55 sri that was just an example ;p
12:56 batman oh! you bump it, so it's ready for the next version?
12:57 sri it's for my OCD
12:57 batman OCD?
12:57 purl i think OCD is Obsessive-Compulsive Disorder. or Offensive Compulsive Disorder
12:57 batman ;)
12:57 * sri pats purl
12:57 purl how condescending
12:58 good_news_everyon joined #mojo
12:58 good_news_everyon [mojo] jhthorsen pushed 1 new commit to master: http://git.io/gobZ0Q
12:58 good_news_everyon mojo/master 6c8dd94 Jan Henning Thorsen: bump version
12:58 good_news_everyon left #mojo
12:58 batman i've converted App::Mypp to App::git::ship which handle all these things for me
13:00 woz joined #mojo
13:00 sri batman++ # happy first release \o/
13:00 batman thanks for guiding me through it :)
13:01 D4RK-PH0ENiX joined #mojo
13:17 D4RK-PH0ENiX joined #mojo
13:34 gatitskiy joined #mojo
13:41 mire joined #mojo
13:49 woz joined #mojo
13:51 jb360 joined #mojo
13:54 btyler joined #mojo
13:55 gatitskiy joined #mojo
13:56 disputin joined #mojo
13:59 gatitskiy joined #mojo
14:00 sh4 joined #mojo
14:08 dvinciguerra joined #mojo
14:08 jb360 joined #mojo
14:11 woz joined #mojo
14:12 doby joined #mojo
14:13 HtbaaPi joined #mojo
14:19 Ptolemarch joined #mojo
14:25 gatitskiy joined #mojo
14:26 HtbaaPi joined #mojo
14:30 mishantil I love this summer. 31C outside now. :) A couple degrees up and it's just perfect.
14:32 neyasov_______ joined #mojo
14:33 * sri is melting
14:33 mishantil How hot is it there?
14:34 sri 32C or so
14:34 mishantil Nice. :) Though perhaps not so nice for you.
14:34 sri weather forecast keeps promising rain... but nothing happens!
14:34 purl Try a 4-letter station code (see http://weather.noaa.gov/weather/curcond.html for locations and codes)
14:34 mishantil Where do you live?
14:35 sri northern germany
14:41 mishantil I went to Berlin earlier this year. Great city. :)
14:42 woz joined #mojo
14:55 mr-foobar joined #mojo
15:01 disputin joined #mojo
15:03 gatitskiy joined #mojo
15:08 genio 33.33°C here right now
15:09 genio not too bad
15:18 btyler_ joined #mojo
15:23 _eugen joined #mojo
15:24 _eugen joined #mojo
15:30 disputin joined #mojo
15:31 gatitskiy joined #mojo
15:36 gatitskiy joined #mojo
15:44 woz joined #mojo
15:54 woz joined #mojo
15:59 gatitskiy joined #mojo
16:05 vervain joined #mojo
16:05 gatitskiy joined #mojo
16:10 batman 33C now...
16:13 gatitskiy joined #mojo
16:24 denis_boyun joined #mojo
16:25 gatitskiy joined #mojo
16:31 gatitskiy joined #mojo
16:45 klapperl joined #mojo
16:50 klapperl_ joined #mojo
16:51 genio 35.56°C  <-- Florida's f-ing hot
16:52 KCL_ joined #mojo
16:55 woz joined #mojo
16:55 klapperl joined #mojo
16:57 gatitskiy joined #mojo
17:04 dvinciguerra joined #mojo
17:18 jb360 joined #mojo
17:34 gatitskiy joined #mojo
17:47 disputin joined #mojo
17:56 gatitskiy joined #mojo
18:00 woz joined #mojo
18:04 btyler joined #mojo
18:36 Ptolemarch joined #mojo
18:54 mire joined #mojo
18:55 dod joined #mojo
19:01 woz joined #mojo
19:09 dod joined #mojo
19:17 dod joined #mojo
19:17 dod joined #mojo
19:35 neyasov_______ joined #mojo
19:43 disputin joined #mojo
20:03 woz joined #mojo
20:11 mattastrophe joined #mojo
20:30 dvinciguerra joined #mojo
20:43 neyasov_______ joined #mojo
20:52 dotandimet joined #mojo
21:02 berov joined #mojo
21:05 woz joined #mojo
21:24 disputin joined #mojo
21:32 babl joined #mojo
21:37 disputin joined #mojo
21:39 denis_boyun joined #mojo
21:48 dotandimet joined #mojo
22:00 hadfl joined #mojo
22:09 woz joined #mojo
22:18 disputin joined #mojo
22:22 hadfl joined #mojo
22:24 hadfl is there a better way of creating a recurring timer w/ changing interval times than to chain timers (i.e. create next timer in one timer callback)?
22:36 diegok hadfl: If you need to change interval it's not recurring. So, you need to "chain".
22:37 hadfl ok. thanks
22:37 diegok :)
22:38 WildPIkachu_ joined #mojo
22:53 berov joined #mojo
23:00 D4RK-PH0ENiX joined #mojo
23:11 woz joined #mojo
23:25 Averna joined #mojo
23:51 jberger_ batman++
23:52 jberger_ sri: what do you think is the best way to defeat the prepended string that emit_safe adds?
23:53 jberger_ do you think I could safely use $@?
23:53 jberger_ eeek!
23:53 jberger_ that would be fragile if you chose to localize it in emit_safe
23:57 hadfl jberger_: what is the reason for attaching ForkCall run to the eventloop? and not just return the pid as it was in 0.10?
23:57 hadfl i'd just like to understand it

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