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

IRC log for #mojo, 2015-03-14

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

All times shown according to UTC.

Time Nick Message
00:10 disputin joined #mojo
00:50 disputin joined #mojo
01:10 disputin joined #mojo
01:17 asarch joined #mojo
01:24 mattastrophe joined #mojo
01:29 sri that went different than i expected https://groups.google.com/d/msg/mojolicious/4lmP_jwq5M0/uAUOv0PCnPwJ
01:41 * marty is intrigued by the way sri's blog example creates the 'posts' helper.   Very groovy indeed.
01:42 sri embrace the helpers :)
01:42 nicomen heh
01:43 marty It looks like that helper returns an object.  I had no idea that could be done.
01:44 sri you've never done that with mango?
01:46 marty Unfortunately no.   You've saved me from making the same mistake during my conversion to Mojo::pg
01:46 marty sri++
01:47 sri minion plugin does it that way too https://github.com/kraih/minion/blob/master/lib/Mojolicious/Plugin/Minion.pm#L14
01:48 nicomen what would happend if you did $minion instead of sub{$minion} ?
01:49 sri https://thisistwitchy.files.wordpress.com/2014/11/morbo-doom.jpg
01:49 Grinnz sri, "I really did it" haha
01:52 jberger I guess credit for owning up
02:12 sawtooth joined #mojo
02:16 mattastrophe joined #mojo
02:20 klapperl_ joined #mojo
02:34 Zoffix joined #mojo
02:35 sri wonder where these are coming from http://www.cpantesters.org/cpan/report/c02bfc0a-c9cb-11e4-b221-9e126cbd7f71
02:36 sri 5 of those for solaris
02:37 Zoffix Dunno if there's a place to report this... I was going over the example at http://mojolicio.us/perldoc/Mojolicious/Guides/Tutorial#User-agent and it kept giving me a 404 for metacpan.org. After some debugging, I found that any HTTPS site gave a 404 and long story short, my IO::Socket::SSL was too old...
02:37 sri lol
02:37 Zoffix And after going through all the stuff prior to that section, I must say, Mojolicious is pretty amazing :D
02:38 sri oops, wrong channel :o
02:38 sri not that old IO::Socket::SSL isn't funny ;p
02:38 dustinm joined #mojo
02:38 Zoffix :D
02:58 jberger and Net::SSLeay am I right? hahahahaha
02:59 Zoffix Yeah
03:00 * jberger had quite possibly had too much beer for irc
03:00 * jberger switches to scotch
03:01 preaction jberger: you can't give me the sicks and then drink beer! damn you!
03:02 nicomen time for bed here
03:02 Zoffix time for moar coffee here :)
03:03 cereal time for MOAR beer here.
03:03 preaction time for nyquil, ice cream, and unconsciousness here... :p
03:03 jberger the sicks?
03:03 jberger me?
03:03 purl it has been said that jberger is on the core team, but I will leave it up to the others if they want me to pursue this further or https://s-media-cache-ak0.pinimg.com/236x/7f/75/6b/7f756bcb3481db56650768cc5fc0cf50.jpg or Foreman
03:03 jberger botsnack
03:03 purl :)
03:05 sri more like http://thefunnyplace.org/wp-content/uploads/2013/10/Minion-David-is-drunk.jpg
03:07 preaction you and i were at perl mongers last night. today i'm sick. Q.E.D.
03:08 jberger dunno. if I get sick I'm going to blame you now!
03:09 preaction well how's that possible? if you got me sick, i can't get you sick! it's a circular reference!
03:12 jberger but I'm not sick (yet)!
03:13 * sri puts _method back on the table... for a very short time
03:13 jberger and it's off again ;p
03:13 sri and it's off again
03:13 Grinnz lol
03:13 Zoffix lol
03:13 sri and back on the table
03:21 noganex_ joined #mojo
03:21 sri (maybe)
03:44 sri this solution is not inelegant https://gist.github.com/anonymous/b309ac31d92a9f07dac8
03:58 * sri is slightly +1-ish on it now
03:58 sri since we should be better at crud
03:59 Zoffix left #mojo
03:59 Zoffix joined #mojo
04:05 basic6_ joined #mojo
04:12 mattastrophe joined #mojo
04:22 sri and combined with a new shortcut recipe for crud resources https://gist.github.com/anonymous/656d9db70df11456aae2
04:24 mst sri: neat, though I still prefer two controllers per resource type, one for the collection and one for a member
04:25 mst but I get that's probably too much typing for most users
04:25 jberger will read in the morning, I'm probably not a good judge of code things atm
04:38 jberger ahhhhh bpo got hacker news bombed
04:38 jberger https://news.ycombinator.com/item?id=9197873
04:39 Oleg joined #mojo
04:49 cereal heh was just reading that reddit post
04:53 irq joined #mojo
06:23 good_news_everyon joined #mojo
06:23 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/pFcK
06:23 good_news_everyon mojo/master 1febff4 Sebastian Riedel: allow _method query parameter to override the request method
06:23 good_news_everyon left #mojo
06:24 sri added for now, not entirely sure yet if it stays
06:24 sri so review!
06:49 sri OMG THIS IS HILARIOUS https://github.com/mackyle/sqlite/blob/3cf493d4018042c70a4db733dd38f96896cd825f/src/os.h#L52
06:52 deserted sri, that is brilliant lol
06:54 deserted quick question on Mojolicious-Plugin-Config, are nested hashes returned as hashref? ie is my %sizes = $self->config('sizes') correct, or my $sizes = $self->config('sizes')? or am I fine to just call $self->config('sizes')->{small}
06:58 sri second and third
06:58 purl 5
07:00 deserted sri, thanks mate
07:36 batman sri: have you looked at https://metacpan.org/pod/Mojolicious::Plugin::MethodOverride ?
07:50 Vandal joined #mojo
08:18 martin joined #mojo
08:19 martin morning :)
08:20 martin if anyone's about I have a quick style question..
08:20 martin about clearing locks.
08:22 martin I've implemented some crude locking whereby we have a last activity timestamp and username stored in a database. I'm locking further updates to that table to actions associated to that user only
08:23 martin Ignore me.. I think i've just answered my own question just by starting to articulate it.
08:23 martin quack, quack
08:30 marcusr o/
08:34 batman sri: i think i was wrong. the annoying part is that i have to make the proof that i'm wrong, and not alexalex :/ what do you think? https://gist.github.com/jhthorsen/2d0cb18726f70089b04d
08:34 batman hey marcusr
08:46 dod joined #mojo
08:51 dod joined #mojo
08:54 sh4 joined #mojo
09:09 kmx joined #mojo
09:13 sh4 joined #mojo
10:05 crab martin: isn't it us who should quack?
10:10 martin ;)
10:12 trone joined #mojo
10:17 meshl joined #mojo
10:23 marcusr we are the knights who say QUACK
10:32 tgt joined #mojo
10:43 Oleg batman: don't you forgot to start ioloop here https://gist.github.com/jhthorsen/2d0cb18726f70089b04d ?
10:44 batman Oleg: i thought that was part of the test. making sure they leak no matter the context.
10:44 batman Oleg: i start the ioloop in test #1 and #2
10:45 batman so... i'm not trying to figure out a better way. i'm simply trying to prove/disprove that fieldhash is better or the same.
10:46 Oleg ah, i see "wait"
10:48 batman but right now, i'm not sure of any "proof" i write. i see what happens, but i'm not sure if i'm testing the right thing, the right way.
10:49 Oleg batman: both original and custom fails with "no more objects" tests, so this didn't proof something
10:50 batman Oleg: i would say it proves that both are equally bad. (if i'm right)
10:51 Oleg ok :)
10:52 batman Oleg: please speak out if you think/know i've made a mistake
10:55 Oleg when you don't start event loop delay will not delete steps, so $self will be stored inside delay and because of this it will not be destroyed.  This is what your tests proves
10:56 irq_ joined #mojo
10:56 batman yeah, you're right.
10:56 batman my head is spinning.
10:57 batman my test is dumb.
10:57 batman sri: i think i fold :(
10:57 batman sri: i need to get mct up and running instead :/
11:01 berov joined #mojo
11:04 sh4 joined #mojo
11:08 Oleg batman: but i was wondered why delay itself was not garbage collected. Here is the answer: https://metacpan.org/source/SRI/Mojolicious-6.02/lib/Mojo/IOLoop/Delay.pm#L32 :)
11:09 batman yes. that is correct. $d is stored inside Mojo::IOLoop->singleton
11:09 Oleg now I am writing some blog post about this references shit to find is fieldhashes are useful
12:11 amon joined #mojo
12:46 cpan_mojo Ado 0.84 by Krasimir Berov - http://metacpan.org/release/BEROV/Ado-0.84 (depends on Mojolicious::Plugin::OAuth2)
13:11 serderperder joined #mojo
13:15 Oleg here it is http://rec.data-flow.ru/articles/2015/3/circular-references-memory-leaks-and-mojo.html  # sorry for my poor english
13:16 serderperder салам, кто-нибудь пользуется модулем 'Mojolicious::Command::deploy::heroku' ? При выполнении create, все упирается в модуль Mojo::JSON и якобы остутствие в нем метода new. Модуль стоит. Зависимости для модуля deploy heroku тоже.
13:17 marcusr serderperder: gavarit pa angelisk sdes...
13:17 serderperder ok
13:18 nicomen kak delak?
13:19 serderperder kak saja bela
13:20 marcusr nicomen: serderperder the object interface of Mojo::JSON was deprecated and removed some time ago, I'm guessing the deploy::heroku command needs to be updated to use the functional interface.
13:21 nicomen oh ;)
13:21 nicomen spasiba
13:21 mattastrophe joined #mojo
13:21 Oleg serderperder: http://stackoverflow.com/questions/27771510/why-is-my-use-of-hypnotoad-crashing-on-heroku
13:28 serderperder marcusr: thx. helpful information for me.
13:33 serderperder Oleg: thx bro. i see that there responsive perl community. not such as gentoo )))
13:42 serderperder anybody have perl 5.18 on wheezy? i want use FindBin, but it need perl 5.18. wheezy have v5.14.2
13:42 buu what
13:43 sh4 joined #mojo
13:43 buu There's no way findbin needs 5.18
13:43 pink_mist FindBin is part of your perl
13:43 pink_mist so it doesn't need anything newer than the one it comes with
13:43 pink_mist I assure you
13:45 serderperder buu: Module  < FindBin (RJBS/perl-5.18.4.tar.gz)
13:46 buu serderperder: Er, it comes with perl, you don't need to (re) install it
13:46 Oleg you don't need to install it, it already comes with perl as core module
13:48 Oleg $ apt-file search FindBin.pm
13:48 Oleg perl-modules: /usr/share/perl/5.14.2/FindBin.pm
13:54 reneeb joined #mojo
14:05 serderperder Oleg: sorry. you right. perl-modules: /usr/share/perl/5.14.2/FindBin.pm
14:11 serderperder Oleg: you use cpan or deb to install modules in the system? what the best way to get fresh version of modules? i try dh-make-perl, but it havnt auto update if module have new version. now i carefully use sudo cpan for install PM what i need.
14:13 Oleg serderperder: http://forum.pragmaticperl.com/threads/11-%D0%BA%D0%B0%D0%BA%D0%BE%D0%B9-perl-%D0%B8%D1%81%D0%BF%D0%BE%D0%BB%D1%8C%D0%B7%D1%83%D0%B5%D1%82%D0%B5-%D0%BD%D0%B0-%D0%BF%D1%80%D0%BE%D0%B4%D0%B0%D0%BA%D1%88%D0%B5%D0%BD%D0%B5-%D1%81%D0%B8%D1%81%D1%82%D0%B5%D0%BC%D0%BD%D1%8B%D0%B9-%D1%81%D0%B0%D0%BC%D0%BE%D1%81%D0%B1%D0%BE%D1%80
14:13 Oleg i still use apt-get + cpan, but this is a bad practice, i need to move to perlbrew
14:16 asarch joined #mojo
14:33 riche joined #mojo
14:34 serderperder Oleg: posledniy comment ot vti "esli ispolsovat Alien:: to problem ne budet..." nedavno reshil glanut na Padre 1.0, ne zahotel stavitsa, skazal wx widget ne tot. hotya alien wx uje stoyal. okazivaetsa nado bilo ego snesti, zatem zanogo postavit, chtobi pri ustanovke alienwx perekompilirovalsa. posle etogo Padre 1.0 vstal. Vse ravno, kak padal 0.96, tak i 1.0 bez prichini padaet. pokrutil, plunul i poshel dalshe ispolzovat vi )
14:35 Oleg :) Cool story
14:35 serderperder )
14:38 serderperder а кириллицу тут не видно чтоль? )
14:38 disputin joined #mojo
14:44 berov Аз виждам кирилицата :)
14:45 serderperder )
14:58 jberger I hate to sound like the ignorant American, but please guys, this is an English language channel
14:58 jberger also I kinda want to know the cool story ;p
15:01 jberger Oleg++ nice investigation
15:01 jberger that's the investigation that alexbyk should have done
15:02 tempire Finally a perl conference site has easy "Submit a Talk" link
15:02 tempire It's like a new age.
15:03 tempire \o/
15:05 jberger does purl have a factoid for:
15:06 jberger age of aquarius?
15:06 jberger drat
15:07 tempire age of mojoconf
15:07 tempire age of mct
15:09 Zoffix jberger, The cool story is: "Last comment from vti 'if using Alien:: then there won't be a problem...' recently decided to take a look at Padre 1.0, had issues installing it, said 'not the right wx widget.' Even though alien wx was already installed. Turns out, you had to uninstall it, then install it back, so that during the installation alienwx got recompiled. After that, Padre 1.0 installed successfully. Anyway, as 0.96 crashed for no re
15:09 Zoffix ason, so does the 1.0. I said screw it and went back to using vi"
15:14 zivester joined #mojo
15:20 jberger Zoffix++
15:20 jberger I don't think Alien::WX is using Alien::Base, so I don't have to worry
15:21 jberger nope
15:26 asarch joined #mojo
15:26 sri Oleg++ # quite the article
15:27 * sri still wants opinions on https://github.com/kraih/mojo/commit/1febff498fe4a4bca55193f3b8f187b3f8a51ada
15:29 jberger sri: reviewing that now
15:29 sri Oleg: so, your recommendation is just to get rid of fieldhash?
15:30 Grinnz apparently i misunderstood circular references and they're not when an object has a reference to itself!
15:30 Grinnz according to the great wisdom of alexbyk
15:32 sri i've given up on alexbyk
15:32 sri but i listen to Oleg
15:33 sri the one thing about delays without fieldhash that worries me, is still false positives with Devel::Cycle
15:33 sri perl -Ilib -Mojo -MDevel::Cycle -E 'my $ua = Mojo::UserAgent->new; Mojo::IOLoop->delay(sub { my $d = shift; $ua->get("mojolicio.us" => $d->begin); find_cycle $ua }, sub { $ua->get("mojolicio.us" => shift->begin) }, sub {})->wait'
15:33 jberger I don't think I knew that form_for would add method="POST" for me if the route needed it
15:33 sri like this one, where $ua suddenly has one
15:33 Oleg sri: yes, I would remove fieldhashes
15:33 sri jberger: added that specifically for upload examples, made code much nicer :)
15:34 jberger sri++
15:34 jberger also
15:35 jberger could we provide a utility like Devel::Cycle (probably using it) that can remove false positives?
15:35 jberger like Carp can declare packages safe
15:35 * jberger is spitballing
15:35 sri unlikely
15:35 sri without actual testing i can't even say which cycle is harmless
15:36 Grinnz sri, are the delay steps also deleted if they aren't run? i.e. because there was no $delay->begin or because of an exception
15:36 sri Grinnz: yes
15:37 sri https://github.com/kraih/mojo/blob/master/lib/Mojo/IOLoop/Delay.pm#L60
15:37 Grinnz ok
15:38 Grinnz i like how alexbyk still thinks he got banned because he said we were wrong
15:38 Oleg btw what's going on when we call loop->reset inside on of the steps?
15:38 Oleg it leaks in this situation with both implementations
15:39 sri that would seem quite dangerous
15:39 crab great. openbsd replaced nginx with a new web server that does only fastcgi.
15:39 Oleg yes, this is strange action, so i don't care
15:40 sri jberger, batman, tempire, marcusr, crab: time to collect votes again, fieldhash or no fieldhash?
15:40 sri make sure to read Oleg's post
15:40 Grinnz crab, wut
15:40 sri http://rec.data-flow.ru/articles/2015/3/circular-references-memory-leaks-and-mojo.html
15:40 jberger if it's not a benefit beyond debugging, and its costing cycles, I say remove it
15:41 crab sri: reading post now
15:41 sri yes, i consider it proven that there is no additional leak protection at all
15:41 jberger but I still think perhaps we can make a debugging aid: https://metacpan.org/pod/Devel::Cycle#find_cycle-object_reference-callback
15:44 riche joined #mojo
15:46 crab oleg; wow
15:46 crab oleg: that is an excellent explanation
15:46 crab thank you.
15:46 crab sri: no fieldhash
15:47 jberger sri: can you explain suggested_method, I'm not grokking it
15:48 jberger its traversing the route, keeping track of the available methods (which haven't yet been excluded)
15:49 sri that's correct
15:49 jberger then POST if post is available and not GET, that one I understand
15:50 jberger Then GET if GET is an option
15:50 jberger why the sort?
15:50 jberger cause you want it to be deterministic?
15:50 sri so it's not random
15:50 jberger ok
15:50 sri no other reason
15:50 purl no other reason is, like, needed
15:50 jberger ok, so I mostly had it
15:51 sri it's a rather pragmatic method, i'm totally open to switch around semantics to make it useful of other use cases
15:51 jberger A route that only has DELETE and PUT in its available methods is going to be rare
15:51 jnbek joined #mojo
15:51 jberger but in that case, DELETE gets prefered
15:51 * sri nods
15:53 jberger short of defining a full preference order, I'm not sure how to avoid that though
15:53 sri also, if you have a PUT/DELETE route, do you really care which one is suggested?
15:53 jberger you probably know which one you are doing, yeah
15:54 jberger maybe if (keys %via) > 1 it shouldn't return anything
15:54 jberger force you to choose
15:55 jberger once GET and POST are ruled out
15:55 * tempire votes to remove
15:55 sri ok, 3 votes for no more fieldhash, that settles it
15:55 jberger what will the new doc read?
15:56 jberger Delay makes a best effort to clean up circular references caused by contained steps?
15:56 jberger or
15:57 jberger "Steps are removed after the delay is complete", possibly with note about circular references?
15:57 Zoffix joined #mojo
15:58 good_news_everyon joined #mojo
15:58 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/pN1v
15:58 good_news_everyon mojo/master f8e8e1d Sebastian Riedel: do not hide harmless circular references anymore in Mojo::IOLoop::Delay
15:58 good_news_everyon left #mojo
15:58 tempire We could just include a link to http://static.fjcdn.com/gifs/Deal+with+it_12e775_4191317.gif
15:58 * sri shrugs
15:59 jberger hehehe, sri, what about (reverse sort keys %via), so happens that that pushes DELETE (and CONNECT) to the end :-P
15:59 jberger nah, I think I like my previous idea of not suggesting any methods if not GET or POST and keys %via > 1
16:00 * Grinnz adds a ABC method
16:00 Zoffix You know how when you single-file prototyping, it's reading from __DATA__... is it possible to make it read from some single separate file? The plugin in my editor that does 90% of HTML/CSS typing isn't working in __DATA__, so I wanted to type in another file..
16:01 jberger Zoffix: yes
16:01 Zoffix Sweet
16:01 jberger behaves just like a mojolicious full app
16:01 Grinnz that would just be a template file no?
16:01 jberger __DATA__ section is just a shortcut
16:02 Zoffix Grinnz, well, I could make separate template files, but I want a single file.. Essentially copy/pasting entire __DATA__ section to a single file (where a bunch of templates would be.. in a single file)
16:03 sri jberger: also open for changing the method name if there is something better than suggested_method
16:04 sh4 joined #mojo
16:04 jberger I don't mind the name, that is descriptive
16:06 jberger the fact that I just needed this the other day makes me worry that I'm biased in my opinion though, be sure at least one other person likes it
16:06 jberger but I think I'm +1
16:06 jberger especially if PUT vs DELETE doesn't default to DELETE
16:06 jberger that bit just worries me a little
16:06 sri well, i'm biased too of course
16:07 sri jberger: but PUT/DELETE does default to DELETE with sort
16:07 jberger I'm saying if we make it so that it doesn't I'm stronger in favor, that's my only qualm atm
16:07 sri and unlikely combination though
16:07 jberger agreed
16:07 sri PATCH/PUT is the most common i suppose
16:08 sri since it's a REST idiom to combine them
16:08 jberger ok that too, we can't DW(they)M, so I think if keys %via > 1 we return undef
16:09 sri jberger: actually i disagree, it shouldn't matter which of the two you get
16:10 sri you get some possibly random method that leads to that route, wich only GET and POST getting preferred
16:10 sri s/c/t/
16:10 crab what are you guys talking about?
16:10 jberger its true that the doc doesn't specify further than that
16:10 jberger crab: https://github.com/kraih/mojo/commit/1febff498fe4a4bca55193f3b8f187b3f8a51ada
16:11 jberger can haz opinionz? ^^
16:11 xtetsuji_ joined #mojo
16:11 batman sri: I'm in no positioN
16:11 batman Oops!
16:11 sri don't want to guarantee order in case we realize later that something else needs to be preferred as well ;)
16:11 crab i'll read
16:12 jberger sri: that's a valid point
16:12 batman sri: I'm in no position to vote. I can't seem to find the difference, even though I'm pretty sure I've experienced the difference @work
16:12 sri who know what might come up later... webdav over post forms... ;p
16:12 batman I'm starting to think I've just gotten better at weaken() at work.
16:14 sri jberger: actually, yes, i totally disagree with your return undef on more than one... because of the PATCH/PUT idiom for #update
16:16 jberger I'm willing to conceed, but just as a sidenote, I still think that defaulting to DELETE when there are other options is scary
16:17 sri what could go wrong?
16:18 Grinnz where's UNDO?!
16:18 sri what does an "any [qw(DELETE PUT)] => sub {...}" route do?
16:18 jberger its a resource that you can create or destroy
16:18 sri worst case, it checks $c->req->method imo
16:18 sri but, the actual method is POST
16:18 Grinnz it's a russian roulette method
16:18 Grinnz do you feel lucky
16:19 sri even if you subdispatch on the method, it wouldn't match DELETE
16:20 jberger I thought that the whole point of this is that if _method=DELETE is in the query, it will route to the delete handler
16:20 jberger oh
16:21 jberger it doesn't change the req->method?
16:21 * jberger reads again
16:21 Zoffix Yey. Sorted myself out: require 'data.html'; push @{ app->renderer->classes }, 'Fake'; (where data.html starts with package Fake; 1; __DATA__) \o/
16:21 jberger ah, ok
16:21 jberger sri: nm, I relent
16:22 jberger I was mapping my understanding onto the old before_dispatch hack
16:22 jberger now I'm good :-)
16:23 jberger Zoffix: ?
16:23 jberger why not just put the file in templates/data.html ?
16:23 jberger I mean, you can do it your way, but are you aware of the alternatives?
16:24 riche joined #mojo
16:25 jberger templates can be put in a templates/ folder, static files can be put into a public/ folder
16:25 jberger and mojo finds them without any intervention
16:25 jberger of course you can modify those paths too. examples within: http://mojolicio.us/perldoc/Mojolicious#ATTRIBUTES
16:26 Zoffix It's not working that way... data.html contains more than one template, all named differently.
16:26 pink_mist but you can't keep all your templates in one file then, jberger :<
16:26 pink_mist Zoffix: what editor are you using that you can't get highlighting to work in the __DATA__ section?
16:26 jberger I thought that was the point?
16:26 pink_mist no, the point was he wanted highlighting of the html in the __DATA__ section
16:27 marcusr guess i was too late to vote.
16:27 jberger oh and it only supports one mode, perl vs html
16:28 jberger I would just switch highlight modes depending on what part I'm working on I guess :-)
16:28 Zoffix pink_mist, not highlighting per say. I'm using Sublime Text 2 with Emmet plugin. You can do crazy stuff like type ul>(li>a.foos)*50 press tab, and it would expand into a <ul> containing fifty <li><a>....</a></li>s :) And that expansion isn't working inside a Perl file.
16:28 marcusr Also, Prompt 2 is a great ssh client. well worth the three cups of coffee.
16:28 pink_mist oh I see
16:28 pink_mist cool
16:29 Zoffix But I sorted it now, by keeping a separate data.html and using the above method to load it up as if I were typing inside __DATA__
16:29 jberger Zoffix: by the time I'm adding 50 li-s though, I wouldn't want it to be a single file anyway :-P
16:30 tempire marcusr: does it really make ssh useful on an ios device?
16:30 tempire Seems like the best it could do is make it a little less obnoxious
16:30 tempire for a pinch
16:32 Zoffix jberger, haha, true, but it also is cool for css, like to write CSS { display: block; float: left; clear: both; text-align: center; border: 1px solid #000; } All I'd need to press would be   {db fl  cb  tc  bd+ } (where space represents pressing tab and then enter keys :)
16:34 marcusr tempire: I find it useful. Would kill for mosh support tho.
16:41 sri marcusr: what would you have voted?
16:41 sri (just so we can blame everyone equally later)
16:42 sri marcusr: juicessh supports mosh
16:43 melo joined #mojo
16:44 * jberger uses juicessh
16:45 jberger hmmmm, if you provide your own callback to Devel::Cycle::find_cycle you lose all the formatting
16:46 jberger the formatting is all in private functions, it could be done, but it would rely on private api
16:47 marcusr sri: to remove. juicessh is nice, but android only.
16:48 jberger hahahaha, look who is the only person who uses Devel::Cycle::_do_report on CPAN: http://grep.cpan.me/?q=_do_report
16:49 jberger true its in a test, but still :-)
16:50 PotatoGim^Home joined #mojo
16:50 Zoffix :)
16:51 good_news_everyon joined #mojo
16:51 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/pNjn
16:51 good_news_everyon mojo/master 3bec2b5 Sebastian Riedel: another routing test
16:51 good_news_everyon left #mojo
16:51 mst and it only fires if the test's about to fail
16:52 mst but, yeah, I was assuming when you laughed it was either one of mine or one of ingy's :D
16:52 good_news_everyon joined #mojo
16:52 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/pNjr
16:52 good_news_everyon mojo/master e742b5b Sebastian Riedel: test both endpoints
16:52 good_news_everyon left #mojo
17:13 asarch joined #mojo
17:24 sh4 joined #mojo
17:42 trone joined #mojo
17:45 good_news_everyon joined #mojo
17:45 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/pAZC
17:45 good_news_everyon mojo/master e14e377 Sebastian Riedel: fix typo in routing guide
17:45 good_news_everyon left #mojo
17:56 jb360 joined #mojo
17:59 inokenty left #mojo
18:05 inokenty joined #mojo
18:24 punter joined #mojo
18:27 inokenty joined #mojo
18:56 kaare joined #mojo
18:57 jberger sri: I think you aren't likely to like this preliminarily, because its a diagnostic tool in the wrong place, but look past that for the moment and give me opinions on the general utility of this: http://pastie.org/10026168
19:02 * sri faints
19:04 jberger it seems to "work"
19:04 jberger :P
19:05 jberger in truth I would probably implement it as Mojo::Util::find_cycle($target, @safe)
19:05 sri but you're right, my problem is the "where"
19:06 jberger where @safe is like [$obj, $index]
19:06 sri Mojo::MoreUtils::find_cycle_in_delay($delay) wouldn't bother me
19:06 sri or Mojo::LeakToolkit or whatever :)
19:06 juikuen joined #mojo
19:06 Zoffix joined #mojo
19:07 jberger the problem with that is that $delay->{remaining} is private
19:07 sri not anymore
19:07 Zoffix Is it possible to produce output from embedded perl inside the templates, such as this:   % if ( title ) { print '/' }
19:07 Zoffix More accurately, I'm looking for single-line conditionals. I'm kinda bummed they end up on three lines
19:07 Zoffix (e.g. include '/' character, only if title is set)
19:07 jberger well $delay->remaining isn't, but do you mind if a cpan module relies on ->{remaining}
19:08 sri oh, now i see what you mean
19:08 jberger this goes back to the same things we discussed for weakening
19:08 jberger yeah
19:08 sri well... it's declared as an attribute now... so ->{remaining} being private is arguable
19:08 sri same problem as delete $delay->{remaining}
19:08 jberger right
19:10 pink_mist Zoffix: %= title ? '/' : '' #?
19:10 Zoffix pink_mist, tried that already: "Search pattern not terminated or ternary operator parsed as search pattern at template"
19:10 berov Zoffix:  whydont you take a look at the documentation http://mojolicio.us/perldoc/Mojolicious/Guides/
19:11 berov template are embedded Perl
19:11 Zoffix berov, well, the only docs I see for embedded Perl are here http://mojolicio.us/perldoc/Mojolicious/Guides/Rendering#Embedded-Perl
19:12 berov that should be enough
19:12 berov it is perl, just use perl
19:12 sri Zoffix: wat? perl -Mojo -E 'a({inline => q{<%= param("foo") ? "/" : "" %>}})->start' get /?foo=1
19:12 berov and do not print in templtes
19:12 sri pink_mist is absolutely correct
19:14 Zoffix Ah, ok. I had <%= title ? "" : "/" %>, should be <%= title() ? "" : "/" %>
19:14 sri this one is also fun to look at
19:14 sri MOJO_TEMPLATE_DEBUG=1 perl -Mojo -E 'a({inline => q{<%= param("foo") ? "/" : "" %>}})->start' get /?foo=1
19:14 Zoffix pink_mist++ sri++
19:15 Zoffix That doesn't even compile. No ojo.pm. Where does that module come from?
19:15 Zoffix nm
19:15 pink_mist it comes from mojolicious...
19:15 Zoffix Yeah, weird.
19:16 Zoffix sorted it out (seems a remnant from my cpanm/local::lib/perlbrew screwup I was dealing with last night)
19:17 sri ojo is awesome for showing a problem
19:17 jberger http://pastie.org/10026225
19:17 jberger <3 ojo
19:17 Zoffix Thanks. I'll keep it in mind.
19:18 jberger sri: that pastie was for you ^^
19:19 sri jberger: still like the idea of specialized debug tools for finding actual leaks, but don't like the location :)
19:19 jberger yeah
19:20 jberger also, I kinda want to make it @safe where you can specify multiple known-safe paths, but it gets all double-loop-y
19:21 sri you forgot a default Mojo::Base::find_cycle ;p
19:22 jberger hmmmm, but you still have to specify safe data indexes
19:23 jberger our @SAFE = (qw/remaining .../) # kills sri :-D
19:24 jberger @Mojo::IOLoop::Delay::SAFE
19:24 sri http://img1.wikia.nocookie.net/__cb20130724145419/mortal-kombat/fr/images/e/e2/Mortal-Kombat-Fatality.jpg
19:24 jberger HAHAHAHA
19:24 purl LOLCON 4 reached.
19:27 asarch joined #mojo
19:27 jberger anyway, it makes this nice: perl -Ilib -Mojo -E 'my $ua = Mojo::UserAgent->new; Mojo::IOLoop->delay(sub { my $d = shift; $ua->get("mojolicio.us" => $d->begin); $d->find_cycle }, sub { $ua->get("mojolicio.us" => shift->begin) }, sub {})->wait'
19:28 jberger or
19:28 jberger perl -Ilib -Mojo -E 'my $ua = Mojo::UserAgent->new; Mojo::IOLoop->delay(sub { my $d = shift; $ua->get("mojolicio.us" => $d->begin); $d->find_cycle($ua) }, sub { $ua->get("mojolicio.us" => shift->begin) }, sub {})->wait'
19:28 jberger (second one explicity tests $ua)
19:28 mattastrophe joined #mojo
19:33 jberger I'm going to let that percolate through the grey matter for a bit
19:44 sri wonder if we can do anything useful with the new knowledge that most cycles in callbacks that only run once are harmless
19:45 sri (and are guaranteed to run or get cleared on error)
19:47 sri ->recurring(...) and ->on(...) are the most dangerous, $ua->...(... => sub {...}) and ->delay(...) the most harmless
19:47 sri ->once(...) is somewhere in between, since it may not actually get emitted
19:53 mattastrophe joined #mojo
19:54 trone joined #mojo
20:09 sri this is what #remove support would look like in the blog example if we decide to keep _method https://gist.github.com/anonymous/38f67cf577beb228bbba
20:10 sri personally, i really like that style
20:10 sri crud should be that simple
20:11 crab joined #mojo
20:16 sri btw. i encourage anyone who maintains any sort of mojolicious database binding to fork the Mojo::Pg examples
20:27 sri side note: the DBIx::Class docs would look soooo much better if all the __PACKAGE__->foo() stuff was replaced with keywords
20:28 mst sri: it's called DBIx::Class::Candy but there's enough complexity involved we're reticent about coring it
20:31 jberger sri: I use it in Galileo
20:32 jberger https://github.com/jberger/Galileo/blob/master/lib/Galileo/DB/Schema/Result/User.pm
20:36 marmez joined #mojo
20:40 crab joined #mojo
20:43 crab joined #mojo
20:43 sri looks much better
20:49 crab joined #mojo
20:51 crab joined #mojo
21:04 DesertFox joined #mojo
21:13 Adura joined #mojo
21:22 good_news_everyon joined #mojo
21:22 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/pxwl
21:22 good_news_everyon mojo/master e7e72fb Sebastian Riedel: also show an example for _method
21:22 good_news_everyon left #mojo
21:26 sri what the hell happened to cpantesters? it looks terrible http://matrix.cpantesters.org/?dist=Mojolicious+6.02
21:27 sri apparently we fail a lot on solaris
21:28 sri and it's always this one test https://github.com/kraih/mojo/blob/master/t/mojo/ioloop.t#L281
21:31 sri we don't happen to have a solaris user here, do we?
21:32 * DesertFox crickets
21:32 purl i guess crickets is http://dilbert.com/fast/2008-11-30/
21:33 * augensalat
21:34 augensalat $loop->timer(15 => sub { shift->stop; $err = 'failed' });
21:34 augensalat seems to help
21:34 sri so, it's just very slow?
21:34 augensalat looks like
21:35 sri would this make a difference? https://gist.github.com/anonymous/f6c35f5406b90e592edb
21:37 augensalat will try
21:39 sri not that i would mind increasing the timeout
21:39 jberger shift; shift; shift->close?
21:39 jberger $_[2]->close doesn't work?
21:39 sri pop->close ;p
21:39 jberger that too
21:40 mst sri: I suspect a lot of solaris smokers are on fairly old sparc kit
21:41 mst though 5 seconds still seems like a long time, the hardware I was using in ... oh wait fuck
21:41 mst want to bet there's some sort of dns lookup kicking in with a 5s timeout?
21:41 augensalat we have seen this on x86 OpenIndiana
21:42 sri hmm
21:44 sri if it's dns then the ->close shouldn't make a difference
21:45 sri 15 is kind of suspicious, since it's the default inactivity timeout
21:48 good_news_everyon joined #mojo
21:48 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/pxXo
21:48 good_news_everyon mojo/master ca3a8af Sebastian Riedel: just wait a little longer
21:48 good_news_everyon left #mojo
21:49 sri oh
21:49 mst maybe it's worth dtracing it
21:49 sri i'm also a moron
21:49 mst ... the universal sound of a bug about to be fixed
21:50 sri no wait, not my fault this time :)
21:51 sri just noticed the timers are not cleared, so if the one from the first test might kill the second test.... but they are using fresh Mojo::IOLoop instances
21:57 augensalat close() does not fix it
21:57 riche joined #mojo
22:01 juikuen joined #mojo
22:05 mattastrophe joined #mojo
22:06 sri thanks, at least we have a workaround with the timeout
22:09 sri that leaves only this old Minion problem on certain windows boxes http://www.cpantesters.org/cpan/report/f20293e9-6bf6-1014-848f-b4975977df38
22:09 sri "Attempt to free unreferenced scalar: SV 0x2e83524, Perl interpreter: 0x2ce0014" is certainly a good sign
22:10 mst it definitely bodes.
22:17 augensalat the minimum timeout seems to be 11s - and it always fails with 10s
22:17 augensalat (on my box)
22:19 mst augensalat: does dtrace reveal where it's pausing?
22:19 augensalat never used dtrace
22:20 augensalat can you guide me
22:20 augensalat ?
22:21 mst I'm sorry, that's basically modern solaris' equivalent of strace but I've not had a chance to experiment with it yet
22:23 pink_mist I though strace was merely a pale shadow of dtrace
22:23 sri something like "sudo dtruss perl t/mojo/ioloop.t"
22:23 sri i've only used it on os x though
22:23 sri and mostly just with "dtruss -p 123" to attach it to running daemons
22:26 augensalat hm, too late for manpages
22:26 augensalat will ask a solaris guru @work on monday
22:31 good_news_everyon joined #mojo
22:31 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/pxbl
22:31 good_news_everyon mojo/master cab348a Sebastian Riedel: test clean routes too
22:31 good_news_everyon left #mojo
22:38 alnewkirk joined #mojo
22:48 augensalat here is a truss output of the failing test
22:48 augensalat https://gist.github.com/anonymous/97a7b1443908d71df4c8
23:08 sri hmm, EINVAL
23:08 sri interesting
23:09 meshl joined #mojo
23:13 sri invalid argument for the connect(), quite odd
23:15 sri you'd think that would make it always fail, and not just require more time
23:19 mattastrophe joined #mojo
23:19 sri guess it could be a timing problem
23:19 sri the server closes the accepted socket so fast, it's not propagated properly to the client or so
23:20 sri maybe this would work https://gist.github.com/anonymous/e2f93a9db7dd9bee1ed3
23:20 sri let the client close the connection
23:22 good_news_everyon joined #mojo
23:22 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/ppIN
23:22 good_news_everyon mojo/master 1179af4 Sebastian Riedel: let the client close the connection
23:22 good_news_everyon left #mojo
23:22 sri actually i like that scenario better in general ;p
23:31 mattastrophe_ joined #mojo

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