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

IRC log for #mojo, 2014-02-14

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

All times shown according to UTC.

Time Nick Message
00:00 good_news_everyone joined #mojo
00:00 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/JqYBdQ
00:00 good_news_everyone mojo/master 53f098d Sebastian Riedel: added direct array access for contents to Mojo::DOM
00:00 good_news_everyone left #mojo
00:00 sri there is a lot of typing to be saved :)
00:02 Dandre joined #mojo
00:02 ka2u joined #mojo
00:04 jberger_ Mojoconf \o/
00:05 jberger_ btw Mojo::IOLoop::ForkCall is now passing on all platforms, except I haven't seen anything from cygwin
00:05 sjn jberger_: come to #oslo.pm if you want to keep up to date on the #mojoconf2014 discussions :)
00:05 jberger_ sjn will do
00:06 dvinciguerra joined #mojo
00:06 sjn crab: you're quite welcome there too :)
00:06 tempire jberger_!
00:06 tempire get a bouncer already
00:06 Gedge joined #mojo
00:06 sri CYGWIN *shakes fist in anger*
00:07 jberger_ I expect it will work, just no reports yet
00:07 jberger_ As of last night
00:08 sri honestly, cygwin scares me more than vanilla windows perl these days
00:08 sri networking is so wonky there
00:08 tempire I can't imagine using cygwin for anything.
00:09 sri you had a few people run tests on windows perl, think all is cool... and then a wild cygwin appears with the weirdest test failures
00:16 mattastrophe joined #mojo
00:23 BinGOs jberger_: [00:22] <+relay2> FAIL JBERGER/Mojo-IOLoop-ForkCall-0.06.tar.gz cygwin-thread-multi-64int 1.7.9(0.23753) perl-v5.12.4
00:23 sri SEE!!!
00:26 BinGOs 32bit cygwin on 32bit OS
00:32 stokachu is there a websocket event emitted for when a connection is initially opened?
00:32 stokachu maybe just after the connection get upgraded
00:32 jack joined #mojo
00:32 zM joined #mojo
00:33 jberger_ :-(
00:36 BinGOs another one: [00:31] <+relay2> FAIL JBERGER/Mojo-IOLoop-ForkCall-0.06.tar.gz cygwin-thread-multi 1.7.25(0.27053) perl-v5.18.2
00:36 BinGOs 64bit cygwin 64bit OS
00:37 jberger_ Well I'll have a look
00:37 BinGOs and on the bright side:
00:37 BinGOs [00:22] <+relay2> PASS SRI/Mojolicious-4.80.tar.gz cygwin-thread-multi-64int 1.7.9(0.23753) perl-v5.12.4
00:37 BinGOs [00:31] <+relay2> PASS SRI/Mojolicious-4.80.tar.gz cygwin-thread-multi 1.7.25(0.27053) perl-v5.18.2
00:37 jberger_ I basically have copied all of ae util fork call
00:37 sri you jinxed it when you said "i expect it will work"
00:38 jberger_ There's only one thing left, limiting the socket message size
00:38 gryphon joined #mojo
00:38 BinGOs cygwin is my primary working perl environment on Windows.
00:38 * jberger_ stands jinxed
00:38 s1037989_ Does anyone have any estimates of what it will cost to attend mojoconf?
00:39 sri sjn will know
00:39 BinGOs sounds like an austin powers conference
00:40 s1037989_ thanks, sri!  I'll ask sjn
00:41 sri surprised it's not on the website yet
00:42 * sri vaguely remembers some norwegian words resembling "prices" in the "done" section on trello
00:49 jberger_ BinGOs: perhaps could you try the branch of fork call on github?
00:49 jberger_ I'm just arriving home, I'll send a link
00:50 d4rkie joined #mojo
00:50 jberger joined #mojo
00:51 jberger BinGOs, https://github.com/jberger/Mojo-IOLoop-ForkCall/tree/buffered_write
00:53 jberger BinGOs, also, is it possible to see those reports yet? I don't see them on the website?
00:54 jberger if I had a cygwin environment available to me, I bet I could knock it out relatively quickly
01:04 mattastrophe joined #mojo
01:13 good_news_everyone joined #mojo
01:13 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/lJ4xOw
01:13 good_news_everyone mojo/master dc4e1f5 Sebastian Riedel: documentation tweak
01:13 good_news_everyone left #mojo
01:15 mattastrophe joined #mojo
01:17 laouji joined #mojo
01:26 ivan joined #mojo
01:31 skullbocks joined #mojo
01:31 bpmedley https://github.com/brianmed/mojo-ioloop-procbackground/blob/master/lib/Mojo/IOLoop/ProcBackground.pm  <-- What do ya'll think of this interface?
01:33 sri the i/o part makes it look much more complicated
01:34 jberger ? where is cpan_mojo??!
01:35 sri bpmedley: are you sure that example actually works? it looks to me like $proc goes out of scope
01:35 bpmedley I may have copied and pasted too soon.
01:36 cpan_mojo joined #mojo
01:36 jberger hmmmm
01:37 jberger it was still running, but it was not connected to IRC I guess
01:39 bpmedley sri: Sorry, this should fix it, correct?   my $proc = $self->stash->{_proc} = Mojo::IOLoop::ProcBackground->new;
01:40 ka2u joined #mojo
01:40 jberger bpmedley, there is no stash
01:42 bpmedley jberger: In a controller?
01:45 jberger sri: why does $proc go out of scope, it is stored in an attr
01:45 jberger bpmedley, why not have the proc constructor in the attr declaration? perhaps a command attr too
01:46 bpmedley The API is in Alpha.  The new method for Proc::Background takes an optional "options" hash, so I'm not sure how I want to work with that.
01:46 bpmedley This may not be the best, or a good way; however, I want $proc to be per request.
01:47 jberger if proc is per-request, then it can't be stored in an attribute as you do
01:47 jberger bpmedley, perhaps a job class?
01:47 sjn s1037989_: conference day (Saturday) is €20
01:48 bpmedley I'm probably confused.  Are the "has" attributes package variables or per-object variables?
01:49 cpan_mojo Mojo-IOLoop-ProcBackground 0.02 by Brian Medley - http://metacpan.org/release/BPMEDLEY/Mojo-IOLoop-ProcBackground-0.02
01:49 jberger per-object
01:50 bpmedley Ok, so what would I need to change?
01:50 jberger will each Mojo::IOLoop::ProcBackground object each have only one job?
01:50 bpmedley Yes, that's the goal.
01:50 rem_lex joined #mojo
01:51 bpmedley https://metacpan.org/pod/release/BPMEDLEY/Mojo-IOLoop-ProcBackground-0.02/lib/Mojo/IOLoop/ProcBackground.pm#SYNOPSIS  <-- Hopefully working example.
01:51 jberger then I think you are ok, I would just structure it differently
01:51 bpmedley I'd love to see your approach.
01:51 jberger I would have a command attribute, use it in the lazy builder to build the proc attribute
01:52 jberger but yours is fine I think, I'm not sure what sri sees wrong
01:52 bpmedley Can you whip-off a pastie to show that?
01:52 sri jberger: https://metacpan.org/pod/Mojo::IOLoop::ProcBackground#SYNOPSIS
01:53 sri my $proc inside action
01:53 bpmedley sri: Is my fix accurate?
01:53 jberger oh, I was looking at the code
01:53 jberger not the example
01:53 jberger :-)
01:54 sri bpmedley: guess that would work
01:54 bpmedley Cool.  Is there a better way?
01:57 s1037989_ sjn says: We're estimating that the conference (Saturday event) fee will be €20.
01:57 bpmedley Appears to work in XP and OS X.. :)
02:00 jberger has recurring => undef;
02:00 jberger has proc => undef;
02:00 jberger sub run {
02:00 jberger my $self = shift;
02:00 jberger my $command = shift;
02:00 jberger my $proc = Proc::Background->new(ref($command) ? @{ $command } : $command);
02:00 jberger $self->proc($proc);
02:00 jberger my $recurring = Mojo::IOLoop->recurring(0.05 => sub {
02:00 jberger my $reactor = shift;
02:00 jberger if ($self->proc->alive) {
02:00 jberger $self->emit_safe("alive");
02:00 jberger }
02:00 jberger was kicked by sri: Your behavior is not conducive to the desired environment.
02:00 bpmedley Gaw!
02:00 sri :O
02:00 jberger joined #mojo
02:00 jberger oops
02:01 jberger sorry
02:01 jberger AAAAAA
02:01 jberger :-(
02:01 TitanOfOld Hehe. It was like watching a slow motion trainwreck.
02:02 jberger indeed
02:02 sri haha, it was kinda hilarious how it slowly kept on posting lines
02:02 jberger copy buffer fail and too quick on the paste/return
02:02 jberger anyway, this is what I meant to paste:
02:02 * jberger checks carefully
02:03 jberger http://pastie.org/8731712
02:03 * jberger wipes brow
02:03 * sri is glad his irc client confirms all multi line pastes
02:04 * jberger checks if his can
02:05 bpmedley I like it.
02:06 bpmedley I need a better example that is simple.
02:09 firnsy joined #mojo
02:09 jberger bpmedley: you might even be able to put the timer construction into an attribute declaration if you wanted
02:10 bpmedley Would that make it easier to follow?   I think your proc attribute makes things clearer.
02:10 jberger I was debating that with myself
02:10 jberger building an object just to put it into an attribute is a bit of a code-smell to me, but perhaps you have to draw the line somewhere
02:13 cleverfox joined #mojo
02:14 klapperl_ joined #mojo
02:17 rem_lex joined #mojo
02:21 mgrimes joined #mojo
02:22 russum left #mojo
02:22 russum joined #mojo
02:26 jberger bpmedley: this is my take, and I'm starting to not hate it: http://pastie.org/8731787
02:27 bpmedley Let me think.
02:30 czinczar joined #mojo
02:34 * jberger finds this: http://xchat.org/cgi-bin/search.pl?str=multiline&amp;cat=0&amp;Submit=Search
02:37 jberger srsy? "Without Googling, name any famous developer from Japan. Or China. Or Russia. Again, I couldn’t.": http://blog.stackoverflow.com/2014/02/cant-we-all-be-reasonable-and-speak-english/?cb=1
02:38 jberger this guy needs to participate in some community more (and given that he's blogging on SO, it means almost certainly that he is near a community of developers)
02:39 jberger true most of the ones I know of communicate in english, but that isn't even the point, I know them for their code
02:39 * jberger hangs head
02:40 mgrimes joined #mojo
02:41 czinczar id have to answer matz ruby guy
02:41 czinczar but otherwise no idea
02:42 sri the fact that he mentions dhh but not matz hurts so much
02:44 jberger no kidding
02:44 czinczar whos dhh
02:44 purl well, dhh is weird at times. or David Heinemeier Hansson or the guy who created rails or read his rants at loudthinking.com
02:44 czinczar oh gods that pos
02:44 sri watch your tone
02:44 bpmedley http://pastie.org/8731855 <-- Is this example easier to follow?
02:44 sri definitely, i'd add comments too though
02:49 czinczar heh ok sorry perhaps pos is a bit strong
02:49 czinczar :)
02:51 mgrimes joined #mojo
02:59 cpan_mojo Mojo-IOLoop-ProcBackground 0.04 by Brian Medley - http://metacpan.org/release/BPMEDLEY/Mojo-IOLoop-ProcBackground-0.04
03:01 czinczar gosh trying to perlbrew up mojo on 5.18.2 on freebsd 10
03:01 czinczar zz taking forever
03:01 czinczar some kinda cpanm hikkup installing cpanoutdated
03:01 czinczar i386
03:04 bpmedley https://metacpan.org/pod/release/BPMEDLEY/Mojo-IOLoop-ProcBackground-0.04/README.pod#SYNOPSIS    <-- :)
03:05 d4rkie joined #mojo
03:20 czinczar ok who here uses perl 5.18.2 on freebsd 10?
03:20 czinczar zomg
03:20 czinczar problemas
03:21 * sri wonders if the routes command should indicate conditions and websocket checks in a route
03:21 sri http://pastie.org/8731940 # something like this
03:22 sri (for -v)
03:23 sri http://pastie.org/8731941 # verbose and not verbose
03:23 bpmedley I believe it would aid in debugging.
03:24 jberger +!
03:25 sri allright, what about the specific indicators? (*) for condition and (WebSocket) for you know
03:25 jberger even WS would work
03:26 bpmedley WebSocket: WS; condition: ->
03:28 sri http://pastie.org/8731954 # dunno
03:29 jberger not sure I like -> for condition
03:29 bpmedley How about "'"  ;)
03:30 sri i have no idea what that is
03:30 bpmedley Sorry, I was making a joke.   Probably an obtuse one.. I chose a squirely character that we couldn't read.. :)
03:30 sri maybe a (~)
03:31 sri http://pastie.org/8731965
03:33 bpmedley What if you put the type in the 1st column?
03:34 jberger oh I know! ????
03:34 jberger conditions are pretty classy
03:35 sri http://pastie.org/8731971 # then it looks awkward
03:35 bpmedley http://pastie.org/8731974
03:36 sri a websocket route can have conditions too
03:37 bpmedley Hrmm.  The [   ]  could be a flags column.
03:37 bpmedley So, [W~] and [R~]; [R.]; etc.   The W would be web socket and R for "regular".
03:37 czinczar anyone gto perl 5.18.2 on freebsd 10? pkg install fails with 5.16 in the way
03:37 bpmedley does that make ane sense?
03:38 czinczar (trying port)
03:38 sri bpmedley: seems complicated
03:38 czinczar perlbrew worked but ended with cpanoutdated being uninstallable
03:39 mattastrophe joined #mojo
03:39 bpmedley Hrmm.  How many options would there be?
03:41 jberger czinczar: I don't think these are mojo-specific questions, perhaps there is another channel that would be more helpful?
03:41 sri i think (~) and (WS) win
03:43 zM joined #mojo
03:47 good_news_everyone joined #mojo
03:47 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/Kfb6Xw
03:47 good_news_everyone mojo/master d50aa8f Sebastian Riedel: improved routes command to show which routes are WebSockets and/or have conditions
03:47 good_news_everyone left #mojo
03:50 sri actually there's more that could be shown, such as a route being a bridge and partial matching (redispatch to embedded app)
03:51 jberger bridge could be ->
03:51 bpmedley That's what I was getting at with the flag options.
03:52 bpmedley http://www.builtinperl.com/startups <-- Anyone know of any Mojo projects here?
03:53 sri flags are ugly though
03:53 sri most of the time they would look like [....] signaling nothing at all
03:53 bpmedley I see.  The common case should be svelt..
03:53 sri sometimes a [W...] or [.C..]
03:56 bpmedley Could you put the GET/POST column in the flags, as well?
04:07 jnbek man, u guys are killing me with all the releases ;-)
04:07 jnbek uploading a new PKGBUILD almost everyday anymore :D
04:07 gnephiak joined #mojo
04:07 sri http://pastie.org/8732056 # can't say i'm a fan of flags
04:08 * jnbek notes, just making an observation not complaining
04:09 sri http://pastie.org/8732061 # the patch anyway
04:11 good_news_everyone joined #mojo
04:11 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/JoY0vg
04:11 good_news_everyone mojo/master e2fe11a Sebastian Riedel: removed WebSocket and condition support from routes command again
04:11 good_news_everyone left #mojo
04:11 sri it's just not good enough
04:15 sri i'm open for re-adding if anyone can make it actually pretty
04:19 sri hahaha
04:19 sri http://pastie.org/8732079 # this one actually looks funky
04:20 sri Bridge, Condition, Detour, WebSocket
04:22 bpmedley Ascii art with routes.. :)
04:24 sri http://pastie.org/8732097 # or with dash, like ls -l
04:26 sri dots look better if no flags are set though
04:27 * sri pokes jberger
04:27 * jberger was blogging
04:27 sri you kids and your blogs
04:30 jberger jnbek++ # keeping up
04:30 jnbek :)
04:32 jberger I don't mind the flags
04:32 jberger and yeah, the - feels rather natural, as you say, because of ls -l
04:33 sri http://pastie.org/8732109 # flags with dots patch
04:34 sri http://pastie.org/8732110 # i like dots for no flags better
04:34 sri i think no flags will be the most common case
04:36 jberger why not $flags .=
04:37 jberger I guess it wouldn't be any shorter
04:37 bpmedley Dots are better
04:37 sri yea, i'm join '', @foo type of person ;p
04:37 sri *+a
04:38 sri so, is the feature worth 5 lines of code?
04:40 jberger code lines in a command worry me a lot less than lines in the main code-base
04:40 jberger yeah, I think it's useful
04:40 sri lines in commands are mostly untested though ;p
04:46 good_news_everyone joined #mojo
04:46 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/Ofpysg
04:46 good_news_everyone mojo/master 9b8f60d Sebastian Riedel: improved routes command to show which routes are using certain features with flags
04:46 good_news_everyone left #mojo
04:46 laouji joined #mojo
04:50 jberger looks good to me, sri++ bpmedley++
04:53 bpmedley http://blogs.perl.org/users/brian_medley/2014/02/running-a-non-blocking-command-in-mojolicious.html <-- Thoughts?
04:55 jberger bpmedley: a few comments
04:56 bpmedley Please!
04:56 jberger it would be nice if it had a finish event or else the ability for a completion callback
04:57 jberger it would feel more mojo-y
04:57 bpmedley I could rename "dead" to "finish".
04:58 jberger also, as the author of another module with a similar goal, if you could spare a few lines for comparison between the use-case for your module vs Mojo::IOLoop::ForkCall (mine), AnyEvent::Util::fork_call (my inspiration) Mojo::IOLoop::ReadWriteFork (batman's)
04:58 bpmedley Sure.
04:59 jberger I do think they occupy different niches, but it might be helpful to mention at least why/when yours would be preferred if not doing a full comparison
04:59 jberger (which I would also welcome, but I don't expect you to shill for me)
05:04 jberger also, because bpo is stupid, to have your fair spot on the front page, you have to put your post time as after mine
05:04 bpmedley http://pastie.org/8732163 <-- How is this?
05:05 jberger which is after the guy from japan, and since bpo doesn't understand time zones, you are reduced to this crap
05:07 jberger bpmedley: sure that looks fair
05:08 jberger maybe I would say "There is more than one way to 'unblock' a blocking command/process"
05:08 jberger but that's just me being pedantic
05:11 bpmedley http://blogs.perl.org/users/brian_medley/2014/02/running-a-non-blocking-command-in-mojolicious.html
05:17 jberger cool, bpmedley++
05:18 jberger ok all, ttfn
05:18 jberger o/
05:20 ka2u joined #mojo
05:25 avkhozov joined #mojo
05:28 ka2u joined #mojo
05:29 Insane joined #mojo
05:36 btyler joined #mojo
05:44 good_news_everyone joined #mojo
05:44 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/D0D2dw
05:44 good_news_everyone mojo/master cfb4699 Sebastian Riedel: mention flags in documentation
05:44 good_news_everyone left #mojo
05:47 sri i love how the synopsis is now the exact usage message :)
05:49 sri those are the small details that make me happy \o/
06:02 gnephiak I have another question! How shoul I clear all sessions in fixture teardown?
06:05 good_news_everyone joined #mojo
06:05 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/k458bA
06:05 good_news_everyone mojo/master bb52134 Sebastian Riedel: better example for routes command in routing guide
06:05 good_news_everyone left #mojo
06:06 moritz gnephiak: you change the app's secret
06:06 gnephiak moritz: All sessions will be cleared if I change the secret?
06:07 moritz gnephiak: yes; the cookies become invalid
06:07 gnephiak moritz: Thanks! I'll try this solution out
07:01 Vandal joined #mojo
07:20 entro joined #mojo
07:23 cpan_mojo Mojolicious-Plugin-Qooxdoo 0.4 by Tobias Oetiker - http://metacpan.org/release/OETIKER/Mojolicious-Plugin-Qooxdoo-0.4
07:23 cpan_mojo MojoX-Dispatcher-Qooxdoo-Jsonrpc 0.95 by Tobias Oetiker - http://metacpan.org/release/OETIKER/MojoX-Dispatcher-Qooxdoo-Jsonrpc-0.95
07:27 fhelmber_ joined #mojo
07:39 flubber joined #mojo
07:40 flubber let's say I have templates/foo/bar/baz.html.ep, how can I create a route to that?
07:41 flubber i tried get('/foo')->to('foo#bar#baz') and that didn't work
07:42 flubber also, if I have stuff in templates/foo/buzz (such as header.html.ep, footer.html.ep
07:42 flubber how do I include that in my baz.html.ep template? I tried %= include 'buzz/header.html.ep' and taht did not works
07:43 d4rkie joined #mojo
07:44 d4rkie joined #mojo
07:46 abra joined #mojo
07:57 eseyman joined #mojo
07:58 denis_boyun joined #mojo
08:02 ka2u joined #mojo
08:14 firnsy joined #mojo
08:18 maxhq joined #mojo
08:25 basiliscos joined #mojo
08:31 trone joined #mojo
08:37 bpmedley flubber:  return($self->render("foo/bar/baz"));  <-- Will that work for you?
08:37 batman flubber: ->to(template => 'foo/bar/baz');
08:37 batman and %= include(...) will take an argument relative to your template root
08:38 batman no idea why you tried to swap "foo/" for "buzz/"
08:38 batman i think you're making things up instead of telling us what you really are doing.
08:39 rawler joined #mojo
08:43 odc joined #mojo
08:45 ka2u joined #mojo
08:56 flubber are you talking to me?
08:56 flubber batmani think you're making things up instead of telling us what you really are doing.
08:57 batman yes. all from "flubber:" to now is to you
08:58 flubber first, try to make sense when you talk. read a book and learn English if you have to.
08:59 flubber second, stop being an idiot.
08:59 flubber i have no reason to make anything up
08:59 flubber fucking moron
09:00 flubber "to now is you"? what does that even mean?
09:00 batman please educate me. i'm eager to learn.
09:01 batman i meant that everything i said since 09:37:24 is to you
09:02 bpmedley flubber: Do you have a code sample you can pastie?
09:02 batman if you're not making things up, i'm very glad i'm not working with you. most developers call their classes "App::Person", "App::Product", ... and not Buzz, Foo, ...
09:04 flubber i don't have any code. i was just reading the examples and i didn't see any examples of it, so i was wondering.
09:04 flubber batman you're incredibly stupid
09:04 nicomen flubber: please
09:05 batman flubber: thanks for trying to bring me down. i need to hear that, since i'm mostly too high on myself.
09:05 batman ...
09:06 flubber i've got a guy accusing me of lying here when i am trying to learn something
09:06 flubber lying for what?
09:06 nicomen "let me join a support channel, and if I fail to communicate my questions, either because I am misundertanding the answers or because the respondants are not getting what I'm asking for, I'll just use derogating statements, that will work!"
09:07 flubber why would anyone lie about what I asked?
09:07 nicomen *derogative
09:07 batman flubber: i did not mean to accuse you of anything. i said "i think..."
09:07 flubber think what you want dipshit, nobody is going to lie about a question they have when trying to learn something
09:07 flubber well, i think i will just stick with ruby on rails
09:07 flubber not really liking this community so far anyway
09:08 bpmedley flubber: I think all batman wanted was to see a code exampe
09:08 nicomen flubber: you are the only one using words like dipshit, moron and stupid
09:09 batman flubber: did you try what i was suggesting? ->to(template => ...) ?
09:09 al joined #mojo
09:10 nicomen batman: also, I think he had two separate questions, the buzz thing was about including other templates
09:10 batman yes, and i answered both.
09:11 nicomen okidoki
09:14 batman at least i tried...
09:14 nicomen "utakk er verdens lønn"
09:17 batman marcus: i'm planning on releasing https://github.com/jhthorsen/mojolicious-plugin-linkembedder now. got any input?
09:17 batman or anyone else?
09:17 purl i think anyone else is welcome to answer also :P
09:18 batman too bad flubber quit. maybe he could help me with my english in that module...
09:18 marcus batman: Sounds great. Also, I think I'm happy to let RoR keep flubber.
09:18 batman haha! thanks :)
09:19 batman i hope he was just a kid...
09:19 bpmedley They really took that comment way to personal
09:20 batman i often make things up to simplify, but things do get lost in translation...
09:20 batman they have even made a movie about that, so it must be true ;)
09:21 batman marcus: i'm pretty sure i screwed that linkembedder library up, but i'm releasing it anyway :/
09:21 avkhozov joined #mojo
09:21 marcus batman: elaborate please.
09:21 purl somebody said elaborate please. was the state correct?
09:21 batman marcus: about the "screw up" part? not sure about the api
09:21 batman ..in general
09:21 * marcus pushes purl down the stairs
09:21 * purl dodges and laughs as marcus loses balance and crashes down the stairs.
09:22 batman :D
09:23 marcus batman: in the example, maybe it would be better to use it in a .ep template?
09:23 marcus <% = embed_link($url) %> ?
09:24 batman no. it's async
09:24 marcus oh
09:24 batman since fallback is to do "HEAD $url"
09:24 marcus we really need async .ep templates ;)
09:25 batman haha
09:25 batman good luck
09:25 purl You'll need it.
09:25 batman i know purl
09:26 * batman will add a default handler
09:34 denis_boyun joined #mojo
09:35 cpan_mojo Mojolicious-Plugin-LinkEmbedder 0.02 by Jan Henning Thorsen - http://metacpan.org/release/JHTHORSEN/Mojolicious-Plugin-LinkEmbedder-0.02
09:35 batman wow. when did that happen ^ ?
09:35 batman i mean, cpan_mojo ..?
09:35 bpmedley Does anyone utilize AirPlay?
09:35 bpmedley batman: I believe that's jberger's bot
09:36 batman no idea what "utilize" means, but i use it from my iphone to xbmc
09:36 batman bpmedley: ok
09:36 bpmedley https://github.com/jberger/Mojo-FriendFeed
09:36 bpmedley Sorry, I meant "utilize".
09:36 bpmedley batman: Do you have time to test my app on your setup?
09:37 batman not sure. give me more details please...
09:38 bpmedley http://filebeagle.com/  <-- I'm writing a media server in Perl and Mojolicious.  Right now it supports HTML5 Audio and Video with DLNA.
09:38 denis_boyun_ joined #mojo
09:39 batman i think you should ask someone who actually has an apple tv :/
09:39 batman if i tell you it doesn't work, then i might be xbmc's fault.
09:39 bpmedley That's fine.  I'd like to support xmbc as much as possible.
09:40 bpmedley xbmc, even
09:40 bpmedley I'm not 100% sure what I need to do in order ot support AirPlay.
09:40 denis_boyun___ joined #mojo
09:40 bpmedley How do you get content onto your xbmc, at present?
09:41 ladnaV joined #mojo
09:42 batman i would rather not tell ... ;)
09:43 bpmedley No issues.  Do you use a lot of adhoc physical files?
09:46 batman i'm streaming most of my content from nrk.no, ted.com, tv3play, ...
09:47 bpmedley I see.  Would it be helpful if those streams were available via DLNA?
09:48 batman no idea.
09:48 batman i don't think i'm your guy :/
09:49 batman my day: check facebook. read twitter on the bus. hack at work. check facebook. read twitter on the bus. hack at home. watch a series on my tv. hack. go to bed.
09:50 bpmedley Actually, you're a perfect example of a use case I would like to support with my app.
09:50 batman when it's not like that, it's: ...go home. drink, dance, talk, ... :)
09:50 batman *coffee time*
09:52 batman if DLNA can make coffee, i'm your guy ;)
09:52 denisboyun joined #mojo
09:53 bpmedley Heh; the way I understand DLNA/UPnP is that it allows for blasting content from a server to a client with minimal, if any configuration.
09:55 batman i think my tv and server does UPnP... so i can see my media directly on the tv.
09:55 batman except that the tv is shit.
09:55 batman so i won't use it
09:56 bpmedley Understood.  What server software do you use?  Do you use XBMC for everything?
09:56 batman yes
09:56 bpmedley Thanks for answering my questions.
09:57 denis_boyun joined #mojo
09:57 batman you're more than welcome
09:57 firnsy joined #mojo
09:57 batman what i want btw...is ubuntu one with a image gallery that just works.
09:58 batman i'm thinking about cancelling ubuntu one, if it wasn't for the reason i wanted to support ubuntu
09:58 bpmedley One of my goals is to have a Image Gallery in FileBeagle.
09:59 batman https://metacpan.org/pod/Mojolicious::Plugin::Shotwell # that's why i made this. since ubuntu one sucks :P
09:59 batman right. image galleries are hard imo
09:59 batman haven't really found one i like
10:04 ver joined #mojo
10:07 mire_ joined #mojo
10:12 firnsy joined #mojo
10:13 Stefan joined #mojo
10:17 denisboyun joined #mojo
10:33 Adurah_ joined #mojo
10:35 ryozi joined #mojo
10:38 andrefs joined #mojo
11:15 bjoernfan 10:52             batman | if DLNA can make coffee, i'm your guy ;)
11:15 bjoernfan Now we're talking!
11:16 batman bjoernfan: haha
11:16 skullbocks joined #mojo
11:28 denis_boyun joined #mojo
11:35 rawler joined #mojo
11:36 firnsy joined #mojo
11:36 Vandal joined #mojo
11:39 al joined #mojo
11:39 zM joined #mojo
11:44 al joined #mojo
11:59 mire_ joined #mojo
12:17 al joined #mojo
12:17 denis_boyun joined #mojo
12:17 Stefan joined #mojo
12:17 eseyman joined #mojo
12:17 fhelmber_ joined #mojo
12:17 entro joined #mojo
12:17 gnephiak joined #mojo
12:17 klapperl_ joined #mojo
12:17 cleverfox joined #mojo
12:17 jberger joined #mojo
12:17 cpan_mojo joined #mojo
12:17 ivan joined #mojo
12:17 Dandre joined #mojo
12:17 inokenty joined #mojo
12:17 drift joined #mojo
12:17 genio joined #mojo
12:17 Negor|2 joined #mojo
12:17 Tiger joined #mojo
12:17 kwa joined #mojo
12:17 sjn joined #mojo
12:17 ioguix joined #mojo
12:17 tianon joined #mojo
12:17 purl joined #mojo
12:17 KindOne joined #mojo
12:17 s1037989__ joined #mojo
12:17 bowtie_ joined #mojo
12:17 bowtie joined #mojo
12:17 nicomen joined #mojo
12:17 jnbek joined #mojo
12:17 hesperaux_ joined #mojo
12:17 omega joined #mojo
12:17 marty joined #mojo
12:17 TitanOfOld joined #mojo
12:17 mudler joined #mojo
12:17 bjoernfan joined #mojo
12:17 Zx3 joined #mojo
12:17 mattp joined #mojo
12:17 alnewkirk joined #mojo
12:17 cooper joined #mojo
12:17 frustrating_chat joined #mojo
12:17 tempire joined #mojo
12:17 jwang joined #mojo
12:17 zivester joined #mojo
12:17 jzawodn joined #mojo
12:17 s1037989_ joined #mojo
12:17 snap_ joined #mojo
12:17 ashleydev joined #mojo
12:17 Foxcool joined #mojo
12:17 suy joined #mojo
12:17 howitdo joined #mojo
12:17 tl joined #mojo
12:17 stephan48 joined #mojo
12:17 bjakubski joined #mojo
12:17 bzero joined #mojo
12:17 DaniBunny joined #mojo
12:17 mishantil joined #mojo
12:17 sri joined #mojo
12:17 icenine joined #mojo
12:17 hesco joined #mojo
12:17 bayashi joined #mojo
12:17 mtj joined #mojo
12:17 Sjors joined #mojo
12:17 Bender joined #mojo
12:17 crab joined #mojo
12:17 buu joined #mojo
12:17 yko joined #mojo
12:17 mfontani joined #mojo
12:17 __mkrull joined #mojo
12:17 memowe joined #mojo
12:17 michael joined #mojo
12:17 sivoais joined #mojo
12:17 Ralesk joined #mojo
12:17 Kundun joined #mojo
12:17 cosimo joined #mojo
12:17 Farow joined #mojo
12:17 avenj joined #mojo
12:17 cottoo joined #mojo
12:17 da5id joined #mojo
12:17 chansen joined #mojo
12:17 rhaen joined #mojo
12:17 nic joined #mojo
12:17 Kovensky joined #mojo
12:17 espent joined #mojo
12:17 BinGOs joined #mojo
12:17 lucs joined #mojo
12:17 sycobuny joined #mojo
12:17 edeca joined #mojo
12:17 mtths joined #mojo
12:17 bc547 joined #mojo
12:17 robinsmidsrod joined #mojo
12:17 diegok joined #mojo
12:17 augensalat joined #mojo
12:17 HtbaaPi joined #mojo
12:17 rj11 joined #mojo
12:17 caeles joined #mojo
12:17 bobkare joined #mojo
12:17 sawtooth joined #mojo
12:17 stokachu joined #mojo
12:17 mst joined #mojo
12:17 ascent joined #mojo
12:17 xtetsuji joined #mojo
12:17 garu joined #mojo
12:17 Jonis joined #mojo
12:17 jan joined #mojo
12:17 gabiruh joined #mojo
12:17 Andreas joined #mojo
12:17 phips joined #mojo
12:17 go|dfish joined #mojo
12:17 akiym joined #mojo
12:17 bd joined #mojo
12:17 moritz joined #mojo
12:17 DaTa joined #mojo
12:17 lestrrat joined #mojo
12:19 mishantil So how's it going with mojoconf?
12:22 batman mishantil: good question. anything specific you want to know?
12:22 batman mishantil: i think next step is to publish cfp
12:22 mishantil batman: Just curious as to which kind of talks that was planned, etc.
12:23 batman none yet actually.
12:23 mishantil batman: We are a 3-man perl-shop in Bergen and the idea of mojoconf here in Norway is pretty appealing.
12:24 batman i think either marcus or nicomen will release cfp (call for papers) and then we'll all know what kind of talks there will be :)
12:24 mishantil I though the batman's thing was being prapared :p
12:24 mishantil *prepared
12:24 bjoernfan bpmedley: Is there a demo of filebeagle anywhere?
12:24 batman "batman's thing" ?
12:24 bpmedley bjoernfan: http://filebeagle.com
12:24 mishantil Yeah, besides being a neurotic, psycotic killing-machine.
12:24 batman mishantil: sorry. don't get it :/
12:25 mishantil "na na na na na na na na Batman!" ? :)
12:25 bjoernfan bpmedley: I don't se any demo? I see download links, but no live demo.
12:26 batman don't get what that has to do with mojoconf talks :(
12:26 bpmedley bjoernfan: It's in free beta
12:26 batman bpmedley: i think bjoernfan want to see a video of how it works
12:26 d4rkie joined #mojo
12:26 bpmedley I see.  I don't have anything like that, yet.  I need to; just not enough time.
12:27 bjoernfan batman: Not really video, but if there's some kind of interface I'd like to see it. :)
12:27 bjoernfan bpmedley: Okay, I'll try it myself from github when I have the time. :)
12:28 bpmedley bjoernfan: It's an embedded web app.  You might try downloading the beta, running it, and going to http://127.0.0.1:8080
12:28 bjoernfan Mojoconf looks interesting! Oslo!
12:28 moritz and learning Norwegian isn't all that hard :-)
12:29 bjoernfan I think I'll get along fine as a swede. :)
12:30 batman moritz: the talks will be in english, so no need to learn norwegian :)
12:30 batman most of us (below 50 years old) also talks (understandable) english .... ... .. .
12:31 batman at least i thought so, until i met flubber :P
12:32 batman http://www.mojoconf.org/mojo2014/search?search=Search#user-list
12:36 moritz batman: I was mostly joking
12:36 moritz though I do try to learn bokmål, for other reasons
12:36 batman moritz: i figured that much... anyhow. i hope at least one of us thought it was funny ;D
12:43 bjoernfan Shouldn't there be a big banner or something about mojoconf on the mojolicio.us frontpage?
12:44 marcus moritz: trying to catch the elusive norwegian blonde? :)
12:45 moritz marcus: I have married her; now I'm trying to understand her when she talks to our daughter :-)
12:47 marcus moritz: same reason I'm trying to learn Russian.
12:48 marcus also, I agree there should be a banner about mojoconf on mojolicio.us - Guess sri would accept a pull request =)
12:52 bjoernfan :)
12:54 bjoernfan Maybe put the Oslo skyline on the background.
12:58 bjoernfan I think I'm going unless I'm in Dhaka then.
12:59 bjoernfan batman: I think it would be nice to have a "Tickets" headline on the front page of mojoconf as well.
13:00 batman bjoernfan: can you give me more details?
13:00 mattastrophe joined #mojo
13:00 batman bjoernfan: like "click here to join" button?
13:02 bjoernfan No, just "Tickets will be available from mid-march and they will cost between $10 and $5000" or something.
13:03 batman aha.
13:03 bjoernfan It took a few clicks to find out if tickets were even needed.
13:03 bjoernfan :)
13:03 batman thanks!
13:03 jack joined #mojo
13:03 bjoernfan np :)
13:05 batman bjoernfan: will update the page as soon as i get enough info
13:12 jberger batman += 3 # not losing his cool to troll
13:13 * jberger suspects from troll's style that flubber == schmorp
13:14 jberger also, batman, yes cpan_mojo is mine. do you like it?
13:14 jberger its essentially a clone of the twitter bot @cpan_new, but using Mojo::IRC instead of twitter
13:16 jberger (and by clone I mean I reimplemented AnyEvent::FriendFeed::Realtime as Mojo::FriendFeed then implemented the twitter bot using it)
13:16 batman jberger: thanks for the ++. i'm really not sure if i'm good or bad these days :/
13:17 batman i like cpan_mojo, yes. good to get mojo dist related updates here
13:17 jberger batman: your response seemed very well measured in the face of all-out attack
13:17 batman \o/
13:17 jberger I would have kicked the guy halfway through had I been here
13:18 jberger mst: you are welcome to ban the user flubber
13:18 marcus Yeah, what an asshat
13:18 batman asshat++ # funny
13:18 mst huh?
13:19 jberger on you "ban the asshats" list or some such
13:19 batman mst: http://irclog.perlgeek.de/mojo/2014-02-14#i_8283086
13:19 batman the conversation between me and flubber ^
13:19 jberger I've only seen two people go straight from "are you sure you're giving us a good example" to "you called me a liar", schmorp and flubber
13:20 batman :/
13:20 jberger maybe its only one person
13:20 jberger anyway, that behavior has no place here
13:20 mst well, you're an op
13:20 mst you're welcome to ban him
13:21 mst it being a random mibbit user I'm unsure how successful that'll be
13:21 jberger hmmm, probably true
13:21 batman mst: did the log amuse you?
13:23 jberger mst is embracing the love, not the hate :-)
13:23 mst mst finds idiot newbies not particularly surprising or amusing
13:24 mst about the only entertainment I get out of them now is when they go -seriously- nuts
13:24 mst I especially like it when they start yelling 'faggot'
13:24 mst because, y'know', "don't worry kid, I suck cock way better than you write perl" is clearly the best kick message ever.
13:24 jberger haha!
13:25 marcus bassoon!
13:25 purl i heard bassoon was a beautful instrument
13:25 jberger anyway, off to work
13:26 jberger joined #mojo
13:27 batman mst++
13:27 stephan48 mst++
13:36 d4rkie joined #mojo
13:42 eugen joined #mojo
13:46 GabrielVieira joined #mojo
13:46 ghandi|work joined #mojo
13:52 ghandi|work Hi there, i've discovered something odd.:
13:52 ghandi|work $r->bridge("/foo/")->get("/bar"); # GET /foo//bar
13:53 ghandi|work Is this indendet to be like that? I can understand that trailing slash at the bridge and leading slash on the get will produce an url which "needs" a double slash, but shouldn't this be documented somewhere?
13:53 ghandi|work At least i was searching my routing problem for quite a while to get to this ;)
13:57 skullbocks joined #mojo
13:58 bpmedley ghandi|work: http://pastie.org/8733322 <-- This would have helped
14:02 ghandi|work Yeah, after debugging it, it's quite clear to me. ;) But Mojolicious::Guides::Routing states under "Routes": "A trailing slash is always optional." which isn't true for bridges in this case ;)
14:04 bpmedley ghandi|work: It might be a bug.
14:21 rawler joined #mojo
14:24 sh4 joined #mojo
14:27 mire_ joined #mojo
14:28 GabrielV_ joined #mojo
14:29 batman bjoernfan: http://www.mojoconf.org/mojo2014/ # the text change if you're logged in or not
14:29 batman regarding the "tickets"
14:29 batman most important change to the webpage is probably the "All glory to the Hypnotoad!" heading on the landing page ;)
14:30 sjn this is an important change
14:32 batman hehe
14:39 GabrielVieira joined #mojo
14:40 batman https://twitter.com/9GAG/status/433344698342572033/photo/1 :)
14:43 bjoernfan batman: Well, before you register (I have) you have no idea if it's a 20 euro ticket or a 2500 euro one. I wouldn't sign up if it was the latter, and signing up just to find out is... well, it's adding another obstacle to someone who want to join. If you put it on the front page a user might think "Oh it's only 20 euros, I'd better sign up and get a ticket before it's sold out!".
14:43 bjoernfan Or put it another way, is there any reason to not put it on the front page? :)
14:44 bjoernfan change of heading++
14:44 purl bjoernfan: that doesn't look right
14:44 bjoernfan :(
14:44 bjoernfan I fail my first ++ on IRC ever.
14:46 batman bjoernfan: doesn't it say it's 20 euros? or am i missing something here...
14:50 bjoernfan Then I'm sorry and I might be blind. :)
14:50 batman if you didn't read it, then i need to make it more obvious
14:50 bjoernfan I didn't see it when I registered a few hours ago.
14:50 batman bjoernfan: not at all! most people only read 30% of the text on a webpage
14:50 batman bjoernfan: oh. this is completely new. i just changed the landing page.
14:51 batman http://home.thorsen.pm/private/raw/notverysecret/mojoconf-tickets-not-registered.png vs http://home.thorsen.pm/private/raw/notverysecret/mojoconf-tickets-registered.png
14:51 bjoernfan Aah, and I thought you just said you added it to the page you get to when you log on, not the regular front page. Now we're on the same page, no pun intended. :)
14:51 batman :D
14:52 batman but i should probably make the conference cost bigger...
14:52 batman do you get that it's €20 only for saturday or do i need to make that more obvious?
14:53 bjoernfan Logged in front page gives the impression that the whole conference is 20 euros total.
14:53 bjoernfan imo
14:54 bjoernfan Since it does not mention days, and I assume the conference is three days.
14:54 bjoernfan But I've never been to a conference before, so maybe people who usually go would think different.
14:55 bjoernfan "differently"? hrm
14:56 bjoernfan But it does say "one day of conference and one day of hackathon" right above so...
14:57 bjoernfan I should really get back to work so I can leave before midnight, but I'll give you some more feedback later if you're interested. :)
14:58 mattastrophe joined #mojo
15:00 batman no, i think you're right.
15:00 batman but now i need to get some food. will change it afterwards.
15:00 batman bjoernfan: say hello to miksva ;)
15:01 eugen_ joined #mojo
15:01 GabrielV_ joined #mojo
15:06 btyler joined #mojo
15:13 gryphon joined #mojo
15:13 Stefan joined #mojo
15:19 GabrielVieira joined #mojo
15:25 GabrielV_ joined #mojo
15:28 batman https://metacpan.org/release/TOSHIOITO/Plack-App-WebSocket-0.03 # i don't get this... will it use one plack worker to do ws..?
15:35 bjoernfan batman: ;)
15:38 GabrielVieira joined #mojo
15:45 sri bpmedley: what might be a bug?
15:46 bpmedley $r->bridge("/foo/")->get("/bar");  <-- The trailling slash on /foo/ given that the documentation specifies: "A trailing slash is always optional.".
15:47 sri did you actually look at that part of the documentation?
15:47 bpmedley Yes
15:48 sri http://mojolicio.us/perldoc/Mojolicious/Guides/Routing#Routes # where do you see a route with a trailing slash?
15:48 bpmedley /user/show/23/ -> /user/:action/:id -> {action => 'show', id => 23}
15:48 sri that's not a route
15:49 bpmedley Oh!  It's referring to the past in uri.
16:05 cfedde I wonder if there is a clearer way to write those examples.
16:12 basiliscos joined #mojo
16:12 sri cfedde: i'm waiting
16:13 cfedde thanks for that.
16:14 batman :P
16:14 sri pretty sure slash at the end of a *route* is actually unspecified
16:14 sri same for routes like ///foo/bar///
16:14 batman i will make a prediction: sri will not wait long
16:14 batman :)
16:14 * batman has noe idea really
16:15 cfedde First I need to work on that style sheet so my old eyes can read the displays better.
16:15 irctc955 joined #mojo
16:15 dvinciguerra joined #mojo
16:16 irctc955 is there any way to catch errors before they get rendered?  say, i have a sub that normally renders, and dies on error, but then i have another sub that i want to catch those errors and render them a different way?
16:16 batman yes. add a before_render hook irctc955
16:17 punter joined #mojo
16:17 irctc955 ah... but no way to actually catch them as an eval {}
16:17 batman they are already caught with eval{}
16:17 batman https://metacpan.org/pod/Mojolicious#before_render
16:18 batman the $args will contain template => 'exception' iirc. (might remember wrong)
16:18 irctc955 if i use my own eval... it doesn't work ... so i think they are caught another way.   sub x {my $self=shift; die unless ....;  $self->render...};  sub y {eval{x;}  if ($@) {do_something}}
16:18 batman which version of perl?
16:18 sri http://mojolicio.us/perldoc/Mojolicious/Guides/Rendering#Rendering_exception_and_not_found_pages
16:19 batman irctc955: x() might reset $@, you should do this: eval { x(); 1; } or do { do_something() };
16:19 batman err... "stuff" inside x() might reset $@
16:19 irctc955 what winds up happeneing is that $@ is never set
16:20 irctc955 no matter what x() does
16:20 irctc955 because mojolicious uses the __DIE__ handler instead of eval i think
16:20 batman try to replace x() with just die "yikes!" and see what happens
16:20 irctc955 ok
16:21 batman oh. i didn't know mojo did that. did you change from eval {} to __DIE__ or has it always been __DIE__ sri ?
16:21 sri batman: i have no idea what you're talking about
16:21 batman neither do i. will check myself
16:21 irctc955 actually YIKES works
16:21 irctc955 it's thus my wonky code
16:22 batman irctc955: then x() probably creates an evil object that clear $@
16:22 batman irctc955: wonky code never good ;)
16:25 sri soooooo
16:26 sri what should ->bridge('/foo/')->route('/bar'); actually match?
16:28 irctc955 what's the right way to die, say if you're nested way down in a bunch of asynchronous callbacks....   so that the controller knows which $self to render to?
16:28 irctc955 i think the issue is my use of die
16:29 sri die...nested...asynchronous callbacks... those words don't go together
16:30 __mkrull left #mojo
16:31 sri i'm starting to get a little annoyed... everyone has an opinion about what looks like a bug, but nobody wants to talk about unspecified behavior
16:31 irctc955 i mean this sort of thing: get_json =>sub {my ($self, $tx) = @_; #here i am.. .got some results; if (they suck) {die;} else {$self->render("nice")}    }
16:31 bpmedley sri: I'm sorry, my opinion was moot when you explained it.
16:31 irctc955 that should work right?
16:31 sri bpmedley: too late! now you summoned me and the unspecified behavior is on the table
16:32 bpmedley Let me think.
16:32 * sri chains bpmedley to the channel
16:33 bpmedley A person may want to actually create a route that matches // to workaround a legacy app.
16:33 bpmedley The horror of mod_rewrite comes to mind.
16:34 sri it looks like ->bridge('/foo')->route('/bar/') is already tested to match /foo/bar
16:34 irctc955 yeah, i can't die... $self->render_exception() works fine.... just tested it.   die doesn't
16:34 bpmedley What about: GET /foo//bar?
16:35 sri bpmedley: i don't think those cases count, you can always rewrite $self->req->url->path
16:35 bpmedley What if the GET request is originating from a non-Mojo app?
16:35 sri what about it?
16:36 bpmedley I may be mis-understanding.  I should create a test case - is it worth that much time spent on the subject?
16:36 sri yes
16:37 bpmedley It will take a few minutes.
16:37 sri http://mojolicio.us/perldoc/Mojolicious/Guides/Cookbook#Rewriting
16:37 sri this is what i'm referring to
16:37 sri if it's hacky you can always do stuff with that
16:39 bpmedley Wow.  How long has the Rewriting section been there?  Years?  I must have missed it.  That would allow multiple use-cases and a lot of flexibility, correct?
16:40 sri years
16:40 irctc955 example that wont work... : get '/foo' => sub  { my $self = shift; $self->ua->post($api_url, form=>{},sub { die "not ok" unless $res->json->{ok}; $self->stash("vals", $res->json); $self->render('ok'); }); }
16:42 irctc955 is there a way to tell the controller who "$self" is?
16:42 * sri is about to say... screw this... we'll just ignore all leading and trailing slashes
16:42 bpmedley irctc955: Would you create a Mojolicious::Lite pastie?
16:42 sri (in routes)
16:47 irctc955 not sure what you mean by a pastie..... im imagining something inappropriate
16:48 bpmedley irctc955: http://pastie.org/
16:50 sri bpmedley: there's of course also RFC 3986 to consider, a path can't ever start with a //
16:52 bpmedley Hrmm.  Just a sec.
16:53 sri and then it gets really complicated... path_for needs to have defined behavior too
17:04 rem_lex joined #mojo
17:04 irctc955 ok this is an example that doesn't work
17:04 irctc955 http://pastie.org/8733865
17:04 ka2u joined #mojo
17:05 irctc955 if you hit this path .... works fine http://127.0.0.1:2888/foo?val=1
17:05 irctc955 if you hit this path .... hangs ... instead of rendering exception http://127.0.0.1:2888/foo?val=0
17:05 irctc955 i think it's me doing something wrong
17:06 bpmedley sri: http://pastie.org/8733870
17:06 sri bpmedley: i don't understand
17:07 bpmedley Totally sweet.  Given my example of an old app that was generating odd uri's, then it's totally supported.  I didn't know this was possible when I made the statement there might be a bug.
17:07 bpmedley Does that make sense?
17:07 sri ok
17:10 bpmedley irctc955: What would expect to happen?
17:10 bpmedley irctc955: If you want an exception page: return $self->render_exception unless $res->json->{ok};
17:13 bluescreen joined #mojo
17:15 Jonneh joined #mojo
17:17 Stefan joined #mojo
17:18 Jonneh hi there
17:18 Jonneh is there a mojo equivilent of php output buffering?
17:19 batman Jonneh: $c->write("some data..."); maybe?
17:19 bpmedley Jonneh: Without knowing php's output buffering: http://mojolicio.us/perldoc/Mojolicious/Controller#write_chunk, maybe?
17:20 Jonneh I have a recursive function in a template that is farting out html, but when it iterates through, it's as if the stack has borken and it starts the whole thing over again
17:21 bpmedley Jonneh: Do you have a small example Mojolicious::Lite app?
17:21 Jonneh not atm but I can make one
17:21 Jonneh although that write_chunk thing might solve my problem
17:22 irctc955 yeah, i guess i have to render an exception page....instead of using die
17:23 irctc955 it would be nice if i could register the current $self with the controller or something
17:23 bpmedley Is the behaviour what you expect now?
17:23 irctc955 so that "die" always works
17:23 irctc955 in a callback
17:23 irctc955 i would like to be able to get "die" to work
17:24 irctc955 do that i can "die unless $res->json->{ok};"
17:24 irctc955 without having to rewrite "die"]
17:24 irctc955 especially if i'm calling a module that uses exception handling, etc.
17:25 irctc955 i bet theres some way to say like app->routes->continue($tx) ... or somthing?
17:26 irctc955 the documentation says "Continue dispatch chain"  ...kind of terse.... not sure if that's the right function
17:26 irctc955 seems like it would be though
17:27 good_news_everyone joined #mojo
17:27 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/TFfzPQ
17:27 good_news_everyone mojo/master a44cb3b Sebastian Riedel: a few more routing tests
17:27 good_news_everyone left #mojo
17:28 sri allright... then i won't do anything... ->route('/foo//bar') and ->route('/foo/bar/') stay unspecified behavior
17:33 sri think next time someone mentions the word "bug" i'll just go "patches welcome" -.-
17:33 irctc955 well continue doesnt work
17:34 irctc955 i'll just wrap all my functions in eval {....} .... render_exception
17:34 irctc955 that works fine
17:34 irctc955 seems to me there should be a better way, that's all
17:35 bpmedley irctc955: http://pastie.org/8733939
17:35 Stefan joined #mojo
17:35 bpmedley sri: My apologies.  I'll use the word more carefully.. :)
17:35 sri patches welcome!
17:35 purl rumour has it patches welcome is always true or even for metacpan.org or swahili for "Put up or shut up."
17:38 sri it's funny how ->route('/foo///bar') currently matches /foo/bar, /foo//bar and /foo///bar, but not /foo////bar
17:39 irctc955 that works
17:39 sri trailing slash does something at the end of nested routes, but not endpoints
17:41 nic joined #mojo
17:43 bluescreen_ joined #mojo
17:43 irctc955 ok, so i'm stashing the error handler... that way any function that happens to use a user agent can get it, and call the "on" function
17:44 denisboyun joined #mojo
17:44 irctc955 oh nevermind
17:44 irctc955 u dont have to  $self->ua keeps the handler
17:44 Stefan joined #mojo
17:46 irctc955 thanks alot!
17:46 irctc955 that totally fixed everything....
17:50 good_news_everyone joined #mojo
17:50 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/M68iIQ
17:50 good_news_everyone mojo/master a428464 Sebastian Riedel: mention the word path
17:50 good_news_everyone left #mojo
17:52 irctc955 this works better... actually results in the like number of the error working:         $self->render_exception(app->dumper($err));
17:52 mire_ joined #mojo
17:53 irctc955 i don't know why i have to use "dumper" to get it to work... but it works http://pastie.org/8733983
17:53 irctc955 ie: it actually shows the line number of the error and everythinig
17:56 irctc955 actually it doesn't work reliably no matter how i call it
17:57 irctc955 the first time i use that pastie ... it works
17:57 irctc955 the second time i get: Mojo::Reactor::Poll: Read failed: Can't call method "req" on an undefined value at /usr/local/share/perl5/Mojolicious/Controller.pm line 261.
17:57 irctc955 http://pastie.org/8733999
17:59 beyondcreed joined #mojo
18:02 irctc955 im guessing this is a bug?  http://pastie.org/8733999
18:05 irctc955 it seems like a closure thing
18:10 sri patches welcome
18:10 purl it has been said that patches welcome is always true or even for metacpan.org or swahili for "Put up or shut up."
18:10 good_news_everyone joined #mojo
18:10 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/JsBpOQ
18:10 good_news_everyone mojo/master b946ff6 Sebastian Riedel: do not test undefined behavior
18:10 good_news_everyone left #mojo
18:11 bpmedley irctc955: $self->ua->once(error => sub {         <-- try that
18:11 irctc955 ok!
18:12 irctc955 yep that's it
18:13 irctc955 i get it
18:14 irctc955 this should totally be an example somewhere
18:14 irctc955 http://pastie.org/8734039
18:14 irctc955 it's very, very useful
18:14 bpmedley http://pastie.org/8734041 <-- This version makes me feel better.
18:15 irctc955 explicit render_later
18:16 bpmedley Irr.  Not sure if the render_later is needed; however, I unsubscribed from the error event.
18:16 irctc955 i think it should get canned at the end of the request anyway
18:16 irctc955 oh no
18:16 irctc955 maybe not
18:18 irctc955 i can't imagine error handlers persisting after the page is rendered...that would be too big of a problem, someone would have noticed... but it's nice to be explicit
18:22 ka2u joined #mojo
18:28 skullbocks joined #mojo
18:40 GabrielVieira joined #mojo
18:46 nic joined #mojo
18:57 Stefan joined #mojo
19:00 jberger irctc955: make a new ua
19:01 jberger Also if you like pastie, see Mojolicious::Command::nopaste
19:08 sri https://github.com/kraih/mojo/issues/591 # i guess this should have a public discussion to link people to
19:10 ka2u joined #mojo
19:11 sri hmm... is the last answer a little passive agressive or am i imagining things? :/
19:12 gnephiak I think I need some book like "Mojolicious in Action"
19:12 gnephiak online doc are good for people already know how other framework works, not for web newbies
19:15 genio sri: I see it as more exasperated than passive aggressive.  As her argument that she thinks it should behave the same as the others still stands even if she lost the other point.
19:16 sri i'm not sure what to make of the quoted "wrong"
19:17 genio I take that to mean that she doesn't care if the others are wrong, it's now her expected behavior
19:17 * sri shrugs
19:17 sri well, lets see where the discussion leads
19:17 genio yea... the more I read it and try to explain it the more I'm inclined to agree that it's kind of passive aggressive
19:19 genio dougwilson's argument probably just killed it
19:24 * moritz could see the discussion leading to a doc patch
19:24 sri it's explained in detail already
19:24 sri dougwilson linked to it
19:24 sri https://metacpan.org/pod/Mojo::JSON#DESCRIPTION
19:25 * moritz updates his Mojolicious to make sure he has the latest version of the docs
19:25 moritz indeed
19:26 moritz previosuly I just grepped for dualvar, but when actually reading it it's pretty clear
19:26 moritz so, close with "works as designed"?
19:27 sri i'd actually like to hear more opinions
19:27 genio I agree that it's explained, but it might be better to have a section in the doc that explains the ways it differs from the other JSON modules like ::PP and ::XS
19:27 sri JSON::XS has established the bad convention, maybe it is better to just play along
19:27 s1037989_ Is making it configureable out of the question?  Let the dev decide how it should behave?
19:28 sri yea, that's out of the question
19:28 s1037989_ :)
19:28 moritz the coward's option :-)
19:29 sri if i was evil i would ask her to open a JSON::XS ticket :D
19:29 davido_ I believe that mimicking poorly thought out behavior has never been Mojo::JSON's goal.
19:29 s1037989_ But what would that do to all JSON::XS users??
19:29 s1037989_ That is, JSON::XS *can't* change, right?
19:29 moritz s1037989_: tears, sweat, rage, and maybe eventually enlightenment
19:30 mire_ joined #mojo
19:31 davido_ It makes a lot of sense that it is far less likely for a container to accidentally hold an IV or NV than for a container to accidentally hold a PV.  So the existing behavior is has the element of least surprise in its favor, unless one is surprised that M::J isn't identical to J::XS/PP
19:33 genio after reading both sides, I think M::J has it right and shouldn't change.  But a lined out set of differences between M::J and J::* should be there in the docs so people aren't "surprised"
19:34 davido_ When I finally get around to finishing M::J::XS::Infect a goal will be for its documentation to be very explicit on "differences"
19:35 sri i think the only reason people stumble over it is Data::Dump https://rt.cpan.org/Public/Bug/Display.html?id=86592
19:36 sri which does it soooooooooooooo wrong
19:37 davido_ Scalar::Util::isdual is broken by design. :(
19:37 davido_ It really should be called Scalar::Util::has_number_and_string
19:38 bpmedley I'm trying to increase my level of understanding of the Mojo internals.  Would this code change fixup the /foo/ dilema, even though my modificaiton to the code looks a litte odd?
19:47 bpmedley http://pastie.org/8734264 <-- Helps to have code
19:49 punter joined #mojo
19:50 skullbocks joined #mojo
19:57 maxhq joined #mojo
20:12 bluescreen__ joined #mojo
20:36 ka2u joined #mojo
20:52 sri hmm... you could actually detect dualvars that do have two different values stored
20:57 jnbek what??! no release today?!?
20:57 * jnbek hides
21:00 meshl joined #mojo
21:00 sri https://github.com/kraih/mojo/issues/591#issuecomment-35124324
21:09 mattastrophe joined #mojo
21:09 davido_ say "Whoops" if $x+0 ne $x;  ...but that would trigger stringification as a side effect.
21:10 sri i've tried that as an alternative to looks_like_number, but that breaks an existing test
21:10 sri the "0 but true" numify test
21:11 davido_ ...and it makes no sense to go for an XS solution. lol
21:11 davido_ ...and I think anything B has to offer also triggers stringification when probing.
21:11 davido_ or maybe not. I haven't looked much.
21:12 sri what kind of probing could there be left?
21:12 sri looks_like_number is what perl uses internally
21:12 sri we already use all the flags at our disposal
21:13 sri there is no flag that says if a scalar was initialized as a number or string
21:15 davido_ internally one could look at the NV or IV (if present), and the PV (if present), and see if they agree with each other, without side effects.
21:16 sri nope, doesn't work with "0 but true"
21:17 sri "0+$value eq $value" would so the same, since we check the value with isdual, there would be no accidental upgrade
21:17 sri s/so/do/
21:19 davido_ So we either have the existing behavior (which I think is well thought out, and less likely to cause surprise), or the J::PP/XS behavior (which isn't as well thought out, and causes surprise by not being consistent with our behavior)
21:19 beyondcreed joined #mojo
21:19 davido_ gtg
21:19 sri or the third, which is the patch in the comment i just posted ;p
21:20 sri which is totally bananas
21:20 davido_ lol
21:20 sri trying to detect if a dualvar has different values where the string doesn't look like a number to perl
21:22 sri i'm tempted to just go with the bad JSON::XS convention to make the discussions stop
21:23 sri reality is people don't want things to be better, just consistently good enough
21:24 mire_ joined #mojo
21:30 sri hahahahaha... if i do that $json->encode([Mojo::ByteStream->new('lalala')]) breaks
21:34 sri interesting
21:34 sri perl -MJSON::XS -Mojo -E 'say encode_json [b("lalala")]'
21:34 sri that bails with "encountered object 'lalala', but neither allow_blessed, convert_blessed nor allow_tags settings are enabled (or TO_JSON/FREEZE method missing)"
21:39 sri tempire, jberger, marcus, crab: some support would be very much appreciated
21:40 jberger Holy back log Batman!
21:41 jberger sri is there a short recap?
21:41 marcus jberger: reading the github issue is probably fine.
21:41 sri https://github.com/kraih/mojo/issues/591
21:41 marcus sri: I think we should keep the current behavior, seems fragile and magic to try to DTRT
21:41 marcus Want me to write it in the issue too?
21:42 KindTwo joined #mojo
21:43 mudler joined #mojo
21:43 sri added another patch
21:44 sri that represents all 3 possibilities
21:44 sri marcus: yes
21:45 sri i'd like yout opinions regarding all 3 possibilities
21:45 sri *your
21:46 jberger I'd be ok with special casing explicitly dual scalars
21:46 sri jberger: how would you explain that in the docs?
21:46 jberger But I like the current heuristic
21:46 jberger For num vs string
21:47 jberger Just say that, scalars which have been explicitly made a dualvar will be treated as a string
21:47 sri it's not really "special casing dual scalars"... it's special casing dualvars where the string part doesn't pass a looks_like_number test... which stuff like "0 but true" or "23 unicorns" pass
21:48 sri no wait
21:48 sri "23 unicorns" does not pass looks_like_number
21:48 marcus What about 22 unicorns?
21:48 marcus :-p
21:48 sri "0 but true" does though
21:48 jberger I think that no sane user should expect that dualvars serialize correctly
21:49 jberger 0 but true is a special case in the perl code base
22:01 jberger Maybe Mojo::JSON should fail to convert dualvars
22:02 jberger It is an unreasonable expectation all around
22:02 jberger It cannot possibly serialize correctly nor round trip
22:03 jberger I would rather know that it was attempted and failed than to change data on me unexpectedly
22:05 sri i've posted a link to the list, since i don't want to deal with this ever again
22:06 sri so far "keep it as is" seems to be winning
22:16 denis_boyun joined #mojo
22:30 rem_lex|pivo joined #mojo
22:43 mattastrophe joined #mojo
22:46 denis_boyun joined #mojo
23:07 Stefan joined #mojo
23:07 sri tempire: i supsect stuff like this was the reason for the github issue perl -Mojo -E 'say j({foo => $!}), " ", $! unless open "/does/not/exist"'
23:10 jberger sri that's a great time to quote that variable
23:13 dvinciguerra joined #mojo
23:31 sri bpmedley: nope, it wouldn't
23:31 sri http://pastie.org/8734757 # this is closer
23:32 sri basically replace multiple slashes with one slash and remove trailing slashes
23:32 bpmedley I see.  I neglected multiple slashes.
23:33 sri ->route('/foo///bar/') gets cleaned up to ->route('/foo/bar')
23:33 sri but at that point, you have to ask yourself if it isn't better to just leave it as undefined behavior
23:33 bpmedley :)
23:35 sri although, i'm not opposed to cleaning up routes, if that's really what we want
23:36 davido_ joined #mojo
23:40 zM joined #mojo
23:40 sri marcus, jberger, tempire, crab: moar decisions!
23:40 jberger EWONTFIX
23:43 KindOne joined #mojo
23:46 * jberger uses purl as a tea cosy
23:46 * jberger offers purl as a sacrifice to the volcano
23:49 cfedde Perl VS the Volcano!
23:52 jberger purl: come back and I will taunt you a second time
23:52 purl jberger: sorry...
23:59 sri this is the only case that would benefit from route normalization that bugs me enough to consider adding it
23:59 sri perl -Mojo -E 'any("/foo/")->any("/bar" => {text => "works!"}); app->start' get /foo/bar
23:59 sri (spoiler: it results in 404)

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