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

IRC log for #mojo, 2014-11-27

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

All times shown according to UTC.

Time Nick Message
00:00 preaction every website then has to load myPhone look-and-feel if i'm on a myPhone
00:00 Grinnz_ except s/phone/tiny laptops/
00:00 preaction before the App Store, it was said that websites/webapps would do everything
00:00 Grinnz_ google got further with that idea!
00:01 crab a web site that knew your battery status could switch to a dark background if you're low on battery!
00:01 Grinnz_ that actually isnt a terrible use case :P
00:02 preaction but dark backgrounds require more LCD cells to be held closed. or do LCDs need power to hold them open?
00:02 howitdo joined #mojo
00:02 Grinnz_ idk. all i know is, that display is still the biggest battery eater
00:03 preaction it's all about the brightness, but switching to a dark color doesn't change the display brightness. unless maybe we're talking OLEDs
00:03 Grinnz_ phones have quad cores now, and those dont even use much
00:04 Grinnz_ plasma phone screens!
00:04 Grinnz_ and actually yeah. a lot of new phones are OLED
00:04 Grinnz_ mine is :)
00:09 good_news_everyon joined #mojo
00:09 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/1HRgPg
00:09 good_news_everyon mojo/master 23aae00 Sebastian Riedel: added BASICS section to Mojolicious::Guides
00:09 good_news_everyon left #mojo
00:09 sri should that start with a little opening sentence? http://mojolicio.us/perldoc#BASICS
00:22 jberger_ joined #mojo
00:23 * jberger_ thinks it might be time to add another guide
00:23 jberger_ On DOM recipes etc
00:24 jberger_ Maybe mix in some "scraping" techniques like concurrency limiting
00:25 jberger_ Mojo::DOM now has so much functionality
00:25 jberger_ And if the class documentation is meant as a reference, we really should have a guide devoted to it
00:26 sri yes, we follow the traditional 3 documentation levels
00:26 jberger_ Mojolicious::Guides::Client ?
00:26 sri class reference, tutorial, guides
00:27 jberger_ (That was a rhetorical "if")
00:27 sri Mojolicious::Guides::UserAgent i'd assume
00:28 jberger_ if you can include DOM in that name then sure
00:28 sri Mojolicious::Guides::ClientSide if you want to get more conceptual
00:28 jberger_ That was kinda where I was going with it
00:29 sri i suppose you could rip a few recipes out of the cookbook for it
00:29 sri but someone has to write good introduction sections, like the other guides have, for concepts and stuff
00:29 jberger_ sri: you had some really good examples of node usage recipes for like stripping comments etc
00:30 jberger_ Sure, that's where things like explaining resolving and rate limiting might come in
00:30 sri most of my examples are in the class reference somewhere
00:30 sri ther is *a lot* of stuff inline
00:31 * jberger_ nods
00:33 jberger_ Might even work in some delay examples
00:33 jberger_ I think it could be a really rich area for a guide
00:33 sri you can take the whole section here http://mojolicio.us/perldoc/Mojolicious/Guides/Cookbook#USER-AGENT
00:33 jberger_ Yeah that would be a start
00:36 sri if you want to give it a shot make a branch
00:37 jberger_ I might give it a go
00:37 jberger_ But I'm not sure exactly when
00:37 good_news_everyon joined #mojo
00:37 good_news_everyon [mojo] kraih deleted net_dns_native_again at bbe3c42: http://git.io/aneGjw
00:37 good_news_everyon left #mojo
00:37 good_news_everyon joined #mojo
00:37 good_news_everyon [mojo] kraih deleted net_dns_native at 5109a23: http://git.io/dNDwpA
00:37 good_news_everyon left #mojo
00:37 good_news_everyon joined #mojo
00:37 good_news_everyon [mojo] kraih deleted less_autoload at d60d8f5: http://git.io/07pUaw
00:37 good_news_everyon left #mojo
00:38 jberger_ I have only one more day of work at the bank
00:38 good_news_everyon joined #mojo
00:38 good_news_everyon [mojo] kraih deleted installable at 2e19c43: http://git.io/CXXxpA
00:38 good_news_everyon left #mojo
00:38 good_news_everyon joined #mojo
00:38 good_news_everyon [mojo] kraih deleted log_target at 7c2c2ee: http://git.io/MpLe3w
00:38 good_news_everyon left #mojo
00:38 sri DELETE ALL THE THINGS
00:43 absolut_todd joined #mojo
00:43 Grinnz those were branches i'm guessing?
01:04 absolut_todd joined #mojo
01:10 absolut_todd joined #mojo
01:17 crab thing all the branches?
01:49 jberger BRANCH ALL THE DELETES!!!
01:56 woz joined #mojo
01:57 woz_ joined #mojo
02:05 jberger icky!
02:05 jberger http://mobile.businessweek.com/news/2014-11-26/twitter-starting-to-track-list-of-users-apps-on-mobile-devices
02:06 jberger gross gross gross
02:06 jberger #idontwanttoliveonthisplanetanymore
02:08 crab what's so gross about that
02:08 crab it's just to help build a more personal twitter experience for you
02:10 Grinnz lol
02:10 jberger oh I hate that euphemism so much
02:10 Grinnz i wonder if it would take into account the random bullshit apps that i can't uninstall like NFL
02:11 Grinnz oh yeah, i totally want football news
02:11 klapperl joined #mojo
02:36 sri btw. a quick reminder for those asking for more advanced examples
02:36 sri https://github.com/kraih/mojo/pull/412
02:37 sri we had a non-blocking crawler with url queue example before
02:38 sri but there's people that will start nitpicking once an example reaches a certain size, forcing it to grow further or get removed
02:38 sri jberger: keep that in mind
02:40 sri suddenly you start maintaining apps that have been sneaking into the docs
02:40 sri the commit in question https://github.com/kraih/mojo/commit/602adb3eb51528ce723b3ae2946bddbd60f5eb0c
02:41 sri Grinnz, franzkafka: ^
02:42 Grinnz i don't know if "more advanced" was what we were asking for, i can see the problems there sure
02:45 sri problem is, many of those people are very determined, so your choices are a monster of an example, or loud complaints about your docs recommending bad practices
02:45 Grinnz though i would consider that nitpicking irrelevant to the guide
02:45 sri i'm bringing it up because that example was the correct direction for how to deal with thousands of requests
02:45 sri but we can't have examples for it because this kind of simplified example makes certain people unbearable, and a full example would be way too big
02:46 Grinnz well, if anything, it could be its own guide page; but probably better as a blog post like that guy said he would do
02:47 sri this is why the examples for concurrency in the docs are simplistic
02:47 Grinnz i know the original question was about dealing with lots of requests, but personally i was just trying to figure out how to make it explain better how to use the delays
02:48 Grinnz as in: syntax and functionality wise, not design-wise
02:59 jberger my blog has many examples btw
03:11 good_news_everyon joined #mojo
03:11 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/hm5ZmA
03:11 good_news_everyon mojo/master 96699fd Sebastian Riedel: better description for WebSocket test
03:11 good_news_everyon left #mojo
03:12 good_news_everyon joined #mojo
03:12 good_news_everyon [mojo] kraih tagged v5.66 at bdbb2dc: http://git.io/yYWDfw
03:12 good_news_everyon left #mojo
03:14 good_news_everyon joined #mojo
03:14 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/SzlhBA
03:14 good_news_everyon mojo/master 8dbaa78 Sebastian Riedel: bump version
03:14 good_news_everyon left #mojo
03:21 romkaspb joined #mojo
03:21 romkaspb hi there
03:21 romkaspb can anybody help?
03:21 romkaspb i got a troble with bridge and stash
03:22 romkaspb i got something like this:
03:22 romkaspb my $routes = $r->bridge()->to(%routes_args, cb => sub {
03:22 romkaspb my $self = shift;
03:22 romkaspb $self->stash->{lang} ||= 'ru';
03:22 romkaspb return 1;
03:22 romkaspb });
03:22 genio romkaspb: explain the problem and if possible provide a gist of the code.  Someone who can answer will.
03:22 genio Please don't paste in the channel though
03:22 romkaspb ok,
03:23 romkaspb how to paste?
03:23 romkaspb oh, pastebin?
03:23 purl i think pastebin is see nopaste. or see shadowpaste
03:23 genio gist.github.com is good.  any pastebot site
03:23 romkaspb ok sec
03:23 genio pastebin is generally frowned upon due to the number of ads on it, but whatever
03:28 romkaspb omg guys i solved the problem :D
03:29 romkaspb thank you for ready to help :)  i tried to solve the probler for an 3 hours :D
03:29 Grinnz lol
03:30 genio heh.  don't you love it when that happens?
03:32 romkaspb my favourite moment in programming :D
03:39 genio Well, now that you've made it past that, hang around and see answers to questions you never knew you'd have.
03:39 Grinnz like "why is my eye twitching"
03:39 Grinnz thanks google autocomplete
03:40 Grinnz "why are the simpsons yellow"
03:41 romkaspb sorry, i'm not good in english. you offering me to show code and explane the problem?
03:55 Grinnz romkaspb, he meant discussions/questions other people have
03:56 good_news_everyon joined #mojo
03:56 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/QdIWiA
03:56 good_news_everyon mojo/master c24e48a Sebastian Riedel: fixed bug where embedded applications would deserialize sessions twice
03:56 good_news_everyon left #mojo
03:57 sri i hate finding bugs just after a release :S
04:02 romkaspb \help
04:02 romkaspb oh, ok :)
04:43 irq joined #mojo
04:45 franzkafka sri, earlier jberger posted a Gist in here (https://gist.github.com/jberger/5153008) that I definitely feel would be awesome as an example in the documentation to pick apart and explain.
04:45 franzkafka I've been working with this all day, picking it apart, reading the documentation on all the methods, and it's an awesome example imo.
04:46 franzkafka I imagine with web scraping, it's really hard to use real world examples.
04:53 nicomen what is the actual format of respond_to?
04:57 basic6 joined #mojo
05:01 good_news_everyon joined #mojo
05:01 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/As4NEA
05:01 good_news_everyon mojo/master 350478b Sebastian Riedel: improved overall performance by deserializing sessions only on demand
05:01 good_news_everyon left #mojo
05:01 sri franzkafka: that's 120 lines
05:02 sri how would that look in the guides?
05:02 sri and now imagine what happens when people start nitpicking
05:03 sri the limit for examples in the guides is maybe 20 lines
05:07 sri franzkafka: it took me 20 seconds to find the thing you can discuss about for months
05:07 sri utf8::all
05:08 sri you can start holy wars with that in an example
05:08 jberger bring forth the holy hand grenade of antioch!
05:11 good_news_everyon joined #mojo
05:11 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/c95ulg
05:11 good_news_everyon mojo/master 4f6dba0 Sebastian Riedel: no need to return
05:11 good_news_everyon left #mojo
05:11 sri franzkafka: of course, don't let that stop you from actually showing a proposal patch
05:12 sri i'm eager to see how you would present a 120 line example
05:13 jberger most of that example's main package can be removed
05:14 jberger though most of the filters are useful as examples in their own right
05:15 sri next holy war topic, there's no exception handling
05:16 sri that's another dozen or so lines
05:16 jberger hmm yes, that's true
05:16 sri that line looks odd https://gist.github.com/jberger/5153008#file-urlqueue-pl-L29
05:16 sri wait does nothing if the ioloop is running
05:17 jberger this example came from pre 5.0
05:18 sri next holy war topic, security
05:18 sri for starters you're storing visited pages in a singleton https://gist.github.com/jberger/5153008#file-urlqueue-pl-L88
05:18 woz joined #mojo
05:19 sri there's no robots.txt handling
05:19 sri not even a cooldown period for hosts
05:20 jberger re robots:this was written at the request of the site owner
05:20 jberger I don't know what you mean by the second point
05:21 sri it is customary not to DDoS a host into oblivion with your crawler
05:22 sri i'm not criticising btw.
05:22 sri i know it's just an example
05:22 sri but franzkafka is asking for it to be in the guides
05:22 jberger with a concurrency limit of 4 I don't think that's an issue, but I get your point
05:22 sri and i'm making a point here
05:22 jberger sri: I understand that
05:23 jberger I take no offense
05:23 sri i've been on the other end so many times....
05:24 sri "sri: this example is only meant to demonstrate a concept, not a best practice"..."foo: but users will just copypasta it!!!1"
05:25 sri that's why we can't have nice things
05:26 firnsy pffft ... "foo!" ... i never liked that guy
05:32 jberger mmmmmmm copypasta
05:33 jberger sri: your point is well made though
05:33 jberger it is really hard to do even good exception handling in examples
05:35 jberger in truth, reading gods cpan modules probably makes for the best examples
05:35 jberger s/gods/good/
05:36 jberger (god writes really shitty code ;-p )
05:37 * jberger imagines syntax highlighting stone tablets
05:42 franzkafka god's cpan modules, haha
05:43 franzkafka sri, those are all really good points. Hm, Im
05:44 franzkafka I guess really the point is, Mojolicious needs a book. I think I'm going to start working on something like this: https://github.com/castaway/dbix-class-book/blob/master/chapters/00-Preamble.md
05:45 franzkafka I know that I will do things wrong, but at least I can contribute topics that would be nice to cover, that sort of thing. A Mojo::UserAgent chapter would be awesome. Then the rest of the book could be building a Mojolicious webapp.
05:45 franzkafka Is Mojo::Pg production ready?
05:46 franzkafka The problem is, and I see this a lot reading blogs.perl.org, is that pretty much everything is controversial :D
05:50 sri jberger: obligatory ;p http://xkcd.com/224/
05:51 franzkafka Dammit, can't find it now. I recall reading something about Mojo on blogs.perl.org, and the comments went something like this, "We've been able to do that years before Mojolicious came along." Stuff along those lines, and the blog post was simply showing how to do it in Mojolicious, not saying it was some revolutionary thing.
05:51 franzkafka Arg, can't find it now, but I recall the comments on that one really bothered me.
05:51 franzkafka sri++, never saw that one before.
05:51 sri no argument there, we need a real book
05:51 franzkafka I want that on a shirt.
05:53 franzkafka sri, I got a lot of heat at work for the back of my shirt, "Where is your language on the food chain?"
05:53 franzkafka :P
05:53 sri :)
05:53 sri last time i made another one too, with "CPAN always finds a way" on the back
05:54 franzkafka I really like that!
05:54 franzkafka Arg, I'm contemplating getting the tie dye one
05:54 franzkafka haha
05:55 sri no tie dye on the eu store... so jelly :(
05:55 franzkafka ok, glow in the dark, I am sold
05:57 franzkafka I can order and send you one :P
05:58 franzkafka jberger, in your example, what do you think would be the best way to have different process events? Separate subroutines?
05:59 jberger sri: I do like that one
06:01 sri it's actually from the original design http://blog.kraih.com/post/43196105956/a-logo-for-perl-5
06:01 jberger franzkafka: why would you have different process events?
06:01 jberger what would be the distinction?
06:03 franzkafka Ah, so I have one to gather the links, then another event that goes through them and grabs some content from each one.
06:04 franzkafka So process I have modified such that it puts the links into $q->links rather than pushing to the queue. Then I loop on $q->links.
06:05 jberger ?
06:05 jberger That sounds like a queue to me
06:06 jberger I'm not sure what your use case is, this is a spider
06:06 jberger so it adds found links to the queue
06:06 franzkafka Yeah, it is a queue. Hm, let me continue to think about how to approach this. I want to first collect all the links, then grab content from each one.
06:06 jberger franzkafka: why?
06:06 jberger why not process add you go?
06:07 jberger as
06:07 franzkafka OK, not a bad idea honestly.
06:07 franzkafka Yeah, wtf, why not?
06:07 franzkafka haha
06:07 franzkafka thanks jberger
06:07 jberger or else make a second instance
06:07 jberger have the first queue push onto a second
06:07 jberger doesn't matter much tbh
06:10 jberger anyway, nn all and happy thanksgiving
06:17 thowe joined #mojo
06:18 good_news_everyon joined #mojo
06:18 good_news_everyon [mojo] kraih tagged v5.67 at 1dc81c5: http://git.io/vDM6iA
06:18 good_news_everyon left #mojo
06:20 good_news_everyon joined #mojo
06:20 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/t2lqQA
06:20 good_news_everyon mojo/master 768f575 Sebastian Riedel: bump version
06:20 good_news_everyon left #mojo
06:26 chansen joined #mojo
06:31 sri some badass out there actually has a pink tie dye shirt with a blue glitter pirate cloud :)
06:54 dotandimet joined #mojo
06:54 franzkafka Haha, I got the black (?) one. I think it's black anyway.
06:54 franzkafka Were they a big seller?
07:07 woz joined #mojo
07:08 dod joined #mojo
07:13 preaction cpan_mojo: you're behind GumbyPAN!
07:25 jamesaxl joined #mojo
07:26 franzkafka I have the following: $content->{title} = $tx->res->dom->at('h1.niceHeaderTitle > a[href]')->text;
07:26 franzkafka My question on that, how do I test that it exists before trying method ->text on it. If it doesn't exist, I get 'Can't call method at one undefined.' error.
07:31 franzkafka I had wrapped it in a try { };, now I am using UNIVERSAL::can, but just wondering if there's a method for it.
07:48 firnsy franzkafka: stop at the at() and then check if it's undef before attempting to call text() on it
07:58 inokenty joined #mojo
08:06 trone joined #mojo
08:22 Vandal joined #mojo
08:32 sugar joined #mojo
08:43 nicomen is there some way I can define a route like this: $r->get('/:controller/:action'), but if either the controller or action aren't found, just continue to next route?
08:50 basiliscos joined #mojo
08:54 moritz nicomen: sounds like that would make any method in your controller classes callable from remote
08:54 moritz nicomen: that is, a security nightmare
08:54 nicomen yes
08:54 nicomen why?
08:55 moritz nicomen: controllers inherit from Mojolicious::Controller; it's not designed with "every method in here should be remote-callable safely" in mind
08:56 sugar_ joined #mojo
08:56 nicomen well, even better, where would I place such a test for say "continue route chain if controller doesn't exist or controller exists but method doesn't exist or isn't of type x"
08:56 woz joined #mojo
08:57 moritz methods don't have types
08:57 nicomen *attribute sorry
08:58 moritz nicomen: step back. What do you want to achieve?
08:58 franzkafka sri, if possible, could you add mojolicious stickers to the spreadshirt store?
08:58 moritz it sounds like a classic "XY problem"
08:58 nicomen to not write every route in manually, I want to decide in a controller what should work or not
08:59 nicomen and if not I need to check another place if the url matches
08:59 moritz so what you want is to write routes inside the controller
09:00 omega nicomen: what you want is catalyst :P
09:00 woz_ joined #mojo
09:00 nicomen well, define them there
09:00 nicomen omega: well some of the stuff in catalyst, sure
09:01 moritz nicomen: one thing you can do is  define an   $route->under('/controller'), and pass it to a method in your controller that sets up the local routes there
09:01 franzkafka I want a mojolicious sticker to put on my laptop. This is important.
09:02 nicomen omega: in that sense I think I want django btw ;)
09:02 omega nicomen: hehe, ok :)
09:02 franzkafka Wtf is this? http://www.cafepress.com/mf/1397662/oval-perl_sticker?utm_medium=cpc&utm_term=3327907&utm_source=google&utm_campaign=sem-cpc-product-ads&utm_content=search-pla&productId=3327907
09:02 franzkafka Is this some sort of meme I managed to miss? E.g., pretty much every meme ever.
09:03 moritz franzkafka: I'm not aware of such a meme
09:03 franzkafka OK, well that sticker doesn't make any sense to me. Dammit, I want Perl merch.
09:04 moritz trying to make sense of every random bit found on the internet won't make you happy :-)
09:06 franzkafka Ha, yes that is definitely true :P
09:10 dotan joined #mojo
09:22 odc joined #mojo
09:39 irq joined #mojo
09:58 franzkafka I am grabbing text from a div, but the text is being printed like so: \x{43a}\x{440}\x{435}\x{43f}
09:58 franzkafka I have tried with utf-8 and without
10:20 franzkafka Trying to find a decode method, but can't seem to find anything.
10:20 franzkafka OK, heads up, I am asking in #perl
10:21 franzkafka Blech, I'm tired, time for bed.
10:24 ver joined #mojo
10:25 yuni joined #mojo
10:36 amon joined #mojo
10:44 niczero joined #mojo
10:45 niczero I once was lost, but now I'm found
10:45 niczero [lesson: don't just trust the banner in your irc client]
10:46 Nei one of my users claims that android 5 doesn't connect to a SSL websocket anymore, anyone heard such reports?
11:01 denis_boyun joined #mojo
11:05 franzkafka Got it!
11:13 niczero sri: Thanks for pointing out my JSON mistake
11:38 dvinciguerra joined #mojo
11:46 alnewkirk joined #mojo
11:56 fhelmber_ joined #mojo
12:23 basic6_ joined #mojo
12:29 denny joined #mojo
12:32 rem_lex joined #mojo
12:38 dotandimet joined #mojo
12:38 jkramer Can I from inside a sub given to $c->delay(...) add more steps to the queue?
12:43 jkramer I'm trying to fetch data from redis in two (non-blocking) steps. First sub gets a list of keys from redis, which is pass()ed to step 2, which should fetch values for all the keys and then render.
12:46 jkramer Nevermind, got it
13:02 aleksey joined #mojo
13:02 aleksey left #mojo
13:35 jberger nicomen: I think you might enjoy the Mojolyst example
13:35 jberger http://blog.kraih.com/post/43198653667/mojolicious-hack-of-the-day-mojolyst
13:37 jberger I'm not sure if the DATA sections well work anymore
13:37 jberger s/well/will/
13:49 jkramer Is it possible to define a template block in a template and include that template in another template and use the block there? Or the other way around: Is it possible to pass variables to a template included with %= include ...?
14:03 oetiker joined #mojo
14:04 good_news_everyon joined #mojo
14:04 good_news_everyon [mojo] jberger pushed 1 new commit to master: http://git.io/nqiWrQ
14:04 good_news_everyon mojo/master 467e47d Joel Berger: fixed documentation link
14:04 good_news_everyon left #mojo
14:06 TeddyDemo joined #mojo
14:07 jberger jkramer: http://mojolicio.us/perldoc/Mojolicious/Plugin/DefaultHelpers#include
14:07 jberger I have just fixed that link, but it doesn't seem that the site has refreshed yet
14:08 jberger anyway, it points to this: http://mojolicio.us/perldoc/Mojolicious/Controller#render_to_string
14:09 jkramer Yeah I know about include, but can I access variables that are defined in the including template from the included template?
14:10 jkramer Guess not
14:10 jberger but you can pass variables, which you also asked
14:11 neilhwatson joined #mojo
14:12 jkramer Oh, so the format => 'txt' from the example is passed as a variable?
14:12 jkramer Or in stash or as param?
14:13 jberger its is a localized stash, as documented
14:14 jberger hmmmm, maybe the phrasing could be a little better
14:16 jkramer I found the docs kinda of hard to find and/or incomplete more often than not to be honest. Where does it say that about the stash?
14:17 jberger jkramer: did you follow the link?
14:17 jberger alias for render_to_string
14:18 jkramer Ah ok, there it is.
14:18 jkramer My fault
14:19 jkramer But earlier today for example I was trying to learn about delayed/async IO, and $c->delay() isn't mentioned anywhere in the docs of Mojolicious::Controller
14:20 Nei usually everything is documented somewhere
14:20 Nei nevertheless I often feel similar to you ;)
14:20 jkramer Yep, _somewhere_ :D I learned most about Mojolicious from googling and reading random examples/code snippets
14:20 Adura Google is the docs.
14:21 Nei well somewhere in the mojo docs I mean
14:21 Adura But, that's not specific to Mojo, hah.
14:21 jberger 1) remember the class documentation is an API reference
14:22 jberger 2) http://mojolicio.us/perldoc/Mojolicious/Guides/Rendering#Including-partial-templates might stand to demontrate localizing stash variables in included templates
14:22 jberger I'm going to try my hand at 2
14:23 jberger Nei / jkramer: I know you it can seem frustrating, but we put a LOT of time into the docs
14:23 Nei I know sri likes people to "figure it out"
14:23 Nei probably once you get into mojo lots of things will be easier
14:23 jkramer I found the delay() docs \o/ :D http://mojolicio.us/perldoc/Mojolicious/Plugin/DefaultHelpers#delay
14:24 jberger when things seem confusing, a suggestion is better than "I found the docs kinda of hard to find and/or incomplete more often than not to be honest. " only to find out that you hadn't clicked through
14:24 good_news_everyon joined #mojo
14:24 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/Hs6QbQ
14:24 good_news_everyon mojo/master e7f31c6 Sebastian Riedel: less detailed description for render method
14:24 good_news_everyon left #mojo
14:24 jberger jkramer see also Mojo::IOLoop::Delay
14:24 Nei indeed. sometimes we're just confused in general and dont have a good suggestion though
14:26 jberger sri: can we think of a new section title for http://mojolicio.us/perldoc/Mojolicious/Guides/Rendering#Including-partial-templates
14:26 jberger we don't use the term partial anymore
14:27 sri i can't
14:29 jberger what about something as simple as "Including other templates" ?
14:29 * jberger ponders
14:30 sri "Include templates"
14:30 ignacio_ joined #mojo
14:31 jberger anyway, once that gets figured out, I would like to add a stash value to that include
14:31 jberger maybe the title text itself
14:31 jberger that's kinda odd though because there is the title helper already
14:34 good_news_everyon joined #mojo
14:34 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/n0QpeA
14:34 good_news_everyon mojo/master 592adbd Sebastian Riedel: made a few changes to the partial template section
14:34 good_news_everyon left #mojo
14:34 sri seems sensible
14:35 jberger sri: you beat me to it! http://pastie.org/9746971
14:35 jberger jkramer: would that have been more clear?
14:36 sri :)
14:37 jberger jkramer: http://mojolicio.us/perldoc/Mojolicious/Guides/Rendering#Include-templates
14:37 jkramer jberger: Yes, much better! :)
14:38 jberger cool
14:38 * sri wonders if "Including additional templates" is better
14:43 jkramer Maybe "including other templates"? But it doesn't really matter I think, the examples are important :)
14:45 jberger obviously I liked "additional" but I don't have a strong reaction for or against any of the ideas
14:47 good_news_everyon joined #mojo
14:47 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/101MAQ
14:47 good_news_everyon mojo/master 3aa3d01 Sebastian Riedel: use a different title for include section
14:47 good_news_everyon left #mojo
14:48 sri http://mojolicio.us/perldoc/Mojolicious/Guides/Rendering#Including-additional-templates
14:48 jberger sri++
14:48 sri jberger++
14:49 jberger meanwhile, in the derp world: http://www.reddit.com/r/perl/comments/2njrao/forget_perl_6/
14:49 jberger why make ad-hominem attacks on a volunteer project
14:49 jberger I don't even care about p6 and I felt I had to respond
14:51 * jberger hates ad-hominem attacks deeply to his core
14:52 * sri has a hard time trying to care
14:53 * niczero hates ad hoc uses of Latin
14:54 * jberger sets niczero in-ferno
14:54 crab well, that sort of snobbery is only to be expected, given the kind of zero-terminated person you are!
14:54 crab hm. that's maybe not quite an ad hominem. oh well.
14:55 jberger sri: you are probably better off
15:15 sh4 joined #mojo
15:27 dod joined #mojo
15:30 sri it's so frustrating to hear that people don't find anything in the docs, and then get no suggestions for improvements
15:30 jkramer Is there any documentation/example on how to write my own non-blocking helper?
15:32 sri what makes a helper non-blocking?
15:32 niczero sri: json.t (lines 288+291)...  x + 0 should be 0 + x
15:32 sri niczero: why?
15:34 niczero fails with wrong number of args, and that's the easiest/cleanest (but not the only) fix
15:35 niczero oh, hang on
15:35 jkramer sri: Well I want to use $c->delay(stuff) inside a helper defined with $c->helper, and I want to call it from another sub that was passed to $c->delay somewhere else and so
15:35 niczero ignore me, obviously the test passes in pure Mojolicious
15:37 jberger jkramer: nested delays work just fine
15:40 Grinnz sri, you just have to keep asking (nicely) for people to try to suggest stuff; it's easier to say what's wrong than what's right. sometimes we don't know enough about the topic to make a suggestion :)
15:41 sri Grinnz: complaints without suggestions are a pretty big burnout risk
15:42 Grinnz it's part of the job, with any software dev :/
15:43 Grinnz you have been doing pretty good at pushing people to suggest improvements, at least in here
15:45 jberger fwiw, complaints and questions are not the same thing
15:45 jberger "I found the docs kinda of hard to find and/or incomplete more often than not to be honest. " feels like a complaint
15:46 Grinnz yep, all you can do is try to get more specific
15:48 sri btw. it looks like spreadshirt doesn't have stickers atm.
15:48 jkramer Stop mocking me for that line, all I wanted to say is that I couldn't find the documentation and needed more help with my problem :)
15:49 sri best i can do is flip flops and santa hats ;p
15:49 Nei weird I thought they did stickers too
15:50 Grinnz jkramer, well it makes a good example XD
15:51 Grinnz i'm just glad at my job, my boss tries to filter all the complaints so i don't have to deal with that :P
15:51 jberger jkramer and I have made our peace
15:51 jkramer :D
15:51 jberger his penance is one fish slap
15:51 * jberger slaps jkramer with a fish
15:52 Grinnz harsh, but fair
15:52 jkramer Wait what? And I thought we're mojo buddies now
15:52 jberger hahahaha
15:52 purl LOLCON 4 reached.
15:52 * jberger slaps purl with a fish
15:52 * purl slaps jberger with comically large fish in return
15:54 * jberger goes to make pumpkin pancakes
15:54 jkramer With whole pumpkins?
15:54 sri SHUT UP AND WRITE A BOOK will be my retort from now on
15:55 sri we need a book
15:57 jberger sri: iirc one person has claimed the space
15:57 jberger not that anyone can't try, but one person is really trying now
15:58 sri it's all just vaporware atm.
15:58 jberger mine certainly seems to be :'(
17:03 sri looks like metacpan is having trouble :S https://metacpan.org/release/Mojolicious
17:04 sri wait a minute
17:04 sri it's only Mojolicious that's affected
17:05 sri in fact, mojolicious is not in the metacpan search results anymore
17:05 sri are we blacklisted or something?
17:09 odc haha, must be a Dancer guy
17:10 go|dfish works okay here
17:11 jberger sri: reported on #metacpan and they rebuilt the index
17:12 jberger arhg, that was not supposed to include the :
17:12 sri a conspiracy!
17:12 purl There really is a conspiracy!  That is the real conspiracy.
17:17 jberger
17:18 niczero Grinnz: I've fixed-up the tests and documented changes https://github.com/niczero/mojo-jsonxs/blob/master/lib/Mojo/JSON_XS.pm#L54-L141
17:20 sri oh, i didn't know about uppercase/lowecase
17:20 sri rfc uses uppercase though http://tools.ietf.org/html/rfc7159
17:21 niczero The more I looked into the differences the less I was sure I wanted to use the XS version :D
17:21 sri there's a mistake though
17:22 sri "because the only false"
17:22 sri string is the empty string
17:22 sri sorry for multiline copypasta :S
17:22 niczero Are there more false strings?
17:23 sri "0" is very falsesy too
17:23 niczero ah, so that par is completely wrong; will fix
17:24 sri there's a special "0 but true"
17:27 sri some like to use "0E0" too
17:29 odc so there is actually no reason to use Mojo::JSON->true or false when creating a JSON document?
17:29 odc it's the same as writing 1 or 0
17:29 sri you mean \1 and \0
17:30 sri the advantage is that the constants are actually true and false
17:30 sri while the refs are both true
17:30 odc sri, no i mean the end result (the json text)
17:30 sri that's very different
17:30 sri \1 becomes true while 1 becomes 1
17:31 odc ...but this document sees to say the opposite
17:31 odc seems*
17:31 sri just try it
17:31 sri perl -Mojo -E 'say j([1, \1])'
17:32 odc ohh
17:32 odc so i should use \1 instead of Mojo::JSON->true
17:32 sri you *can*
17:33 sri for true it doesn't really matter
17:34 sri but false is a bit tricky
17:34 sri because
17:34 sri perl -Mojo -E 'say "true" if \0'
17:34 odc i'm saying that because in the documentation that i send to customers, i write json examples with true and false. So i don't want mojo::json to render 1 and 0 instead
17:35 sri i think you're mixing some stuff up
17:35 sri perl -Mojo -E 'say j([1, \1, Mojo::JSON->true])'
17:35 odc perl -Mojo -E 'say j([1, \1, Mojo::JSON->true])'
17:35 odc oops
17:36 sri Mango::BSON actually works the same way
17:36 odc oh.. i see now
17:37 odc the json_xs doc confused me
17:37 sri there's one more
17:37 sri perl -Mojo -E 'my $some_random_scalar = "hello #mojo!"; say j([1, \1, Mojo::JSON->true, \$some_random_scalar])'
17:37 odc perl -Mojo -E 'my $some_random_scalar = "hello #mojo!"; say j([1, \1, Mojo::JSON->true, \$some_random_scalar])'
17:38 sri lol
17:38 niczero odc: What should I fix/clarify in there?
17:39 odc niczero, it may be just me, but i confused "stringification" with "encoding"
17:39 odc it's late i'm tired
17:40 niczero ah, ok, I'll think about that
17:40 odc i guess you could add sri's examples
17:40 odc but it would be less pretty then :/
17:41 niczero (cos I think there'll be some people who don't use that module but find the notes useful... if they're right :o) )
17:41 odc niczero, i do find your notes interesting
17:42 human39 joined #mojo
17:42 sri for completeness sake ;p
17:42 sri perl -Mojo -E 'my $true_scalar = "1"; my $false_scalar = "0"; say j([1, "1", \1, Mojo::JSON->true, \$true_scalar, 0, "0", \0, Mojo::JSON->false, \$false_scalar])'
17:43 sri actually, there's also dualvars... but i'm not gonna go there :)
17:43 odc i almost pasted that in irc again
17:43 asarch joined #mojo
17:44 odc ahh so that's why mojo and mango booleans are compatibles
17:44 sri the only reason Mojo::JSON->true/false exists is because \0 and \$false_scalar evaluate to true in perl
17:45 sri since both are just refs to a scalar, which are always true
17:46 odc thx for the lessons! see you tomorrow
17:54 dparry joined #mojo
17:55 dparry Hi, I'm trying to get more info from a got '500' expected '200' failed test. MOJO_CLIENT_DEBUG=1 doesn't seem to add any extra info. any tips / tricks please?
17:58 dparry this is a test that passes fine in one environment (5.18.2) but fails in a 5.14.2 chroot in case that makes a difference...
17:58 crab turn up logging, or add a breakpoint, or add print statements...
17:59 dparry I'd hoped MOJO_CLIENT_DEBUG would turn up the logging...
18:00 crab (a) why? it's debugging the client, not the server (which is presumably returning the 500 response)
18:00 crab hm. s/(a)//
18:02 dparry this is within the Test::Mojo framework, so I'm not sure I have server logs per se?
18:04 crab MOJO_LOG_LEVEL=debug ./app test
18:06 ashimema joined #mojo
18:22 disputin joined #mojo
18:33 sri dparry: what is MOJO_CLIENT_DEBUG?
18:34 sh4 joined #mojo
18:38 dparry something I lifted from http://blogs.perl.org/users/tempire/2011/02/testing-your-mojo-with-testmojo.html
18:39 niczero MOJO_USERAGENT_DEBUG=1 is awesome when debugging calls against an API
18:39 sri haha, almost nothing from that post exists anymore
18:39 dparry :)
18:39 niczero sri++  # all the tools
18:40 dparry I google for mojo::test debug and that post was top hit. My bad :(
18:42 sri http://mojolicio.us/perldoc/Mojo/UserAgent#DEBUGGING
18:43 dparry hmmm, if I run perl script/App test then all tests pass but prove t/test.t fails
18:43 sri http://mojolicio.us/perldoc/Test/Mojo#DESCRIPTION
18:46 denis_boyun joined #mojo
18:54 dparry thanks crab / sri / niczero - seems like MOJO_USERAGENT_DEBUG=1 has given me what I need!
18:55 basic6 joined #mojo
18:58 marmez joined #mojo
19:05 dparry think some of my confusion stemmed here from make test not being the same as perl script/App test
19:06 dparry the latter causes some state to be created that means the tests pass whereas with make test that state is not created and the tests fail.
19:14 irq joined #mojo
19:36 jonasbn joined #mojo
19:52 denis_boyun joined #mojo
19:56 jamesaxl joined #mojo
20:13 franzkafka If I am doing a $dom('table > tr')->map( sub { return if ... } ); will it move to the next td or break?
20:13 franzkafka I know it's not a loop
20:14 hernan604 franzkafka: perldoc -f map
20:14 hernan604 you dont return from map
20:15 hernan604 try: $dom('table > tr')->map( sub { ( ... condition ... ) ? $some_result : () } )
20:15 ignacio_ joined #mojo
20:16 hernan604 ie perl -e 'map { warn $_ } qw|aa bb cc|'             VS                perl -e 'map { return warn $_ } qw|aa bb cc|'
20:17 jberger franzkafka: either grep first or else do like hernan604 says
20:18 franzkafka OK, maybe I am just going about this wrong: http://paste.scsys.co.uk/447396
20:18 franzkafka I'm just trying to grab certain div siblings if the text of the first sibling matches some text.
20:18 franzkafka I'm treating it like a loop, which I know it's not
20:19 franzkafka Are your eyes burning?
20:20 jberger when things get too complex for a map, maybe try each
20:20 jberger or remember, its still just perl
20:20 jberger break out of the chaining and just operate as you normally would in a perl script
20:20 franzkafka I can't do a next in an each, that's what bothers me I guess.
20:21 sri do what i said yesterday, and don't use collection methods
20:21 jberger baby mojo is every bit as acceptable as baby perl (I don't in any way mean that as insulting)
20:21 sri $collection->map(...) only makes sense when you already know perl -f map
20:22 sri learn the map/grep dance
20:23 sri it's actually one of the more important steps of leveling up your perl skills
20:25 franzkafka sri, yeah, it's the one thing I love to see, try to use, but I'm not very good at.
20:26 * thowe suddenly isn't sure he's a beginner anymore...
20:26 franzkafka :P
20:28 sri well, the learning perl book calls it "some advanced Perl techniques"
20:28 thowe no takebacksies
20:28 franzkafka ok, last question. Data::Dumper is always really helpful to me, but if I try to use dumper I seem to get the entire data structure. e.g., for ( @{ $tx->res->dom('div#coreGameRelease > div') } ) { say Dumper $_; }
20:29 hernan604 use Data::Printer
20:29 franzkafka sri, I've read Modern Perl and Beginning Perl by Ovid. I've never read any of the O'Reilly Perl books.
20:29 franzkafka Probably a bad thing
20:29 hernan604 perl -e 'use DDP; my $arr = [qw|aa bb cc|]; warn p  $arr'
20:29 sri those two books are pretty good
20:29 thowe I actually got excited about by Perl when I read the Camel 3rd edition.  Well, the first 7 or so chapters anyway.
20:30 sri the o'reilly books are pretty old school in some places
20:31 thowe There's also Higher Order Perl, which can be found online in PDF format.  I like Effective Perl Programming also.
20:31 sri perl best practices
20:31 purl I wonder if that means s/Best/My/ ... or out
20:31 sri (if you take it with a grain of salt)
20:32 sri i agree with most of the stuff in the book, and totally disagree with some parts
20:33 thowe I wasn't sure how it held up, so I have not taken the time.
20:33 thowe Haven't gotten very far through Effective yet, either.
20:33 thowe I have learned a lot by looking at Mojo stuff...
20:33 sri it's funny how in the end damian might have been right about inside out objects
20:34 sri we all disagreed about that, but new object systems like p5-mop will embrace it again
20:34 thowe over my head
20:35 sri my personal pet peeve is that damian encourages "return;" instead of "return undef;"
20:36 jberger sri: of all the Mojo classes, custom Data::Printer support for Mojo::DOM objects might be nice
20:36 * sri hates context magic
20:37 sri jberger: i'm not actyally a Data::Printer user
20:38 sri think i tried it for a time, but it modified data strucutres and broke stuff for me
20:38 sri (would have been years ago though)
20:38 jberger I did have that bug a few days ago
20:38 jberger but for the most part, DDP is really handy
20:38 jberger anyway, this is what I mean
20:38 jberger https://metacpan.org/pod/Data::Printer#MAKING-YOUR-CLASSES-DDP-AWARE-WITHOUT-ADDING-ANY-DEPS
20:40 * sri uses Mojo::Util::dumper most of the time
20:40 sri https://github.com/kraih/mojo/blob/master/lib/Mojo/Util.pm#L106
20:42 jberger anyway, more later, time for turkey
20:42 jberger o/
20:43 thowe IN a controller method, where do I look to see what method (get, post) was used to get to me?
20:43 * sri is jelly... no turkey holiday in this part of the world
20:43 sri \o
20:43 * thowe sends sri turkey and yams and beer.
20:44 sri \o/
20:44 chansen sri: I'm sure you know that the only way to extend an object without knowing the internals of the derived class is to use inside out objects
20:46 thowe Ah, req->method...  Life is better when you learn to navigate the docs.
20:47 sri in case you've missed it, this usually helps a lot with navigating http://mojolicio.us/perldoc#REFERENCE
20:48 thowe Yeah, that's what I am clicking through.  I'm not always sure where in the object hierarchy is the method I am looking for.
20:48 thowe I'm starting to get better at guessing, though.
20:48 chansen sri: it's not about demian being right or not, it's the only way unless you make assumptions of the derived class
20:49 thowe sri, where are you?  Europe?  I would invite you over for the crazy amount of food we have here...
20:49 sri chansen: i like to think he saw the development of p5-mop coming :)
20:49 thowe Been cooking since yesterday.
20:50 * sri is in germany
20:50 thowe I love the Germans.  We should send them some Turkey and creamed greens.
20:50 chansen sri: ok, lol ;P
20:51 thowe Our turkey is a heritage breed raised on the same local farm that we got our potatoes  from.  This breed doesn't even need basting because it is naturally moist.  I have beer from Germany, though.
20:52 thowe We have, I think, 5 different kinds of potato in the mash...
20:52 chansen thowe: sounds nice!
20:53 thowe I am so lucky...  I met this local farmer on accident a few years ago and we been eating like kings ever since.
20:54 thowe I was going to buy some of one of his cows, but my chest freezer aparently broke.
20:54 sri at least i get to enjoy the seasonal baked goods from around here now
20:54 thowe Like what?
20:54 sri http://2.bp.blogspot.com/-QDhV8nJnjGc/UQwci08lwLI/AAAAAAAABZk/Yw18LbXSz1o/s1600/mutzenmandeln.jpg
20:54 thowe Christmas in Germany must rock.  I think that's where the Victorians got it from.
20:55 sri hahahaha, english name is supposedly the vienna doughnuts
20:55 thowe Looks like a home made doughnut hole.
20:56 sri they don't taste like doughnuts though
20:56 thowe I think we have pie...  Or maybe pumpkin cheese cake.  I didn't grow any pumpkins this year, so I don't know.  A friend is bringing the pies.
20:56 thowe What do they taste like?
20:56 sri https://www.google.com/search?q=mutzenmandeln&safe=off&source=lnms&tbm=isch&sa=X&ei=CpB3VPyyOMfgOLalgLgF&ved=0CAgQ_AUoAQ&biw=1158&bih=572
20:56 thowe It's 1pm here, I should have a beer in my hand...
20:57 chansen thowe: I would like to visit you in Turkey to get a genuine experience instead of all the bullshit bazaars I have experienced as a tourist in Ankara
20:57 thowe I'm not in Turkey.  I'm eating turkey. :)
20:57 thowe I'm on Oregon.
20:57 thowe Well, I'll eat it in a few hours...
20:58 chansen thowe: LOL
20:58 thowe https://en.wikipedia.org/wiki/Oregon
20:58 thowe But I will happily host you and feed you turkey if you are in the neighborhood.
20:59 thowe chansen, Where are you?
21:02 chansen thowe: I'm not not ignorant, I'm quite familiar with the states in US (we had to learn Europe countries and US states in elementary school), I'm located in southern Sweden
21:03 thowe I didn't think you were ignorant.  I don't know how well the various states are known outside of North America.  I bet you know know the US better than I know Europe.
21:04 thowe I've never managed to travel anywhere.  I'm very ignorant.
21:08 chansen thowe: you have to travel otherwise you get indoctrinated, the world is full of nice surprises!
21:08 Akron joined #mojo
21:09 thowe Yeah.  I try to read a lot and talk to lots of different people.  I've got a lot of responsibilities keeping me in one place.
21:12 chansen thowe: You will never understand the Pyramids in Egypt unless you have been there neither would you understand the Great wall of China unless you have seen it. Same for the tower of Paris. ... etc
21:12 lb there's a tower in paris?!??
21:13 thowe *sigh* yeah...  If wished were horses then beggars would ride.
21:14 thowe I'm going to have a beer...
21:14 * thowe sends a beer to sri and chansen
21:16 woz joined #mojo
21:16 thowe I have some "Ill Tempered Gnome" here...
21:17 thowe Winter Ale
21:17 purl Winter Ale is quite nice
21:18 chansen lb: surely I'm, talking about the Eiffel Tower, if thats not iconic for the tower, then please educate me
21:19 chansen or perhaps you where ironic, and I faild to grock it ;)
21:19 lb most likely
21:19 purl I doubt it
21:20 chansen lb :)
21:20 lb they should tear down that old thing and reopen the tour montparnasse, it has a much nicer view
21:21 chansen hehe, wasn't that the original plan? It should only be temporary if IIRC
21:21 lb uh, tour montparnasse is open again, really recommended if you get to paris
21:22 * thowe wonders if he should use twitter bootstrap
21:22 lb then you shouldnøt
21:22 lb 't
21:23 preaction why not?
21:24 lb because it's an architecture decision, and doubt on architecture is healthy
21:24 lb also, bootstrap is so 2012
21:26 preaction saying something is "so 2000-anything" is so 2008
21:26 lb being cynical about saying something is so 20xx is so 2014
21:29 Akron I guess it's a pretty lame question, but is there a way to perform a non-blocking action in a template helper?
21:31 sri Akron: not lame at all
21:31 sri and i guess you'd need something like Coro for that
21:32 sri otherwise i doubt there's a way
21:33 lb depends on what "perform" means
21:33 Akron Oh - really? Hm. I thought there is some render_later magic that works with halfway rendered templates.
21:33 chansen lb++
21:34 berov joined #mojo
21:34 lb chansen: cheap shot
21:34 lb most answers when consulting is "it depends"
21:34 Akron lb: for example something like <%= fetch_content 'http://...' %>...<% end %>, where the content is fetched when the helper is called.
21:35 Akron (Missing a "begin", sorry)
21:35 lb you don't want to do that
21:35 lb do that complicated stuff in the controller, make the template simple
21:35 lb then the render_later becomes simple and obvious
21:36 sri he wants to render the first half independently
21:36 Akron The complicated stuff is done in a plugin.
21:36 sri so stuff already happens in the browser
21:36 lb what
21:36 Akron sri: Not necessarily. I am fine when this doesn't happen.
21:36 sri only way i see is to split up the template
21:36 sri oh
21:37 lb "template helper?" in the browser?
21:38 sri request -> render and send to browser <head> section -> do async stuff -> render and send to browser <body> section -> done
21:38 lb Akron: i meant, don't start rendering the template and then get all async, get your data async first, and then render your template
21:38 sri that was my assumption
21:38 chansen keep tha shit separated or maintenance hell will unt you down
21:38 lb templates should be simple, or you'll suffer phpitis
21:38 Akron The helper performs some stuff and I would like to have the same look for async call and for blocking call. Guess that's not possible.
21:38 lb and that stuff is itchy
21:38 * chansen s/unt/hunt/
21:38 lb bunt
21:39 chansen lol
21:39 Akron chansen: Maintenance is plugin stuff. It would be easier to switch from blocking to non_blocking by a helper parameter instead of changing stuff everywhere.
21:39 Akron The template is easy.
21:40 Akron s/easy/simple/.
21:40 sri i don't think there is any other reason to go non-blocking in a template than flushing a <head> section to the browser
21:40 chansen Akron: we are talking about model vs views
21:42 lb mojo barely has views
21:42 Akron The reason is ease of adoption.
21:42 lb for whom?
21:42 purl for thee!
21:42 sri templates are views
21:43 lb that's doing some disservice to the pattern
21:43 lb but yes
21:43 lb barely
21:43 Akron chansen: I know what you are meaning - but in Mojo helpers can be called in templates and in controllers. So I don't see a maintenance problem and a reasonable advice to users for when calling the helper.
21:43 chansen lb: true, that doesn't mean you put your dumb hat on
21:44 * lb pretends he never put on his dumb hat
21:44 chansen hehe
21:44 Akron lb: To someone already using the helper with a blocking call (in that case it's just a local call) to switch to a non-local resource (should be called non-blocking.
21:45 lb do that stuff in the controller?
21:45 Akron *sigh*
21:45 lb seriously
21:45 purl is that for real?
21:45 chansen Akron: it's simple keep you "models" separate from your views otherwise you will end up in deep shit
21:45 sri wait, is your real problem that template blocks are also callbacks, and therefore you can't use that to differentiate between blocking/non-blocking?
21:46 Akron sri: No. My problem is that I can't figure out how to stop rendering once render() is called.
21:46 chansen Akron: what if management want a different view, lets say CLI
21:46 sri ok, i don't get it
21:46 lb do complicated shit in the controller, let the template present the simple shit
21:46 Akron chansen: No problem - they can use the helper in that way.
21:47 chansen Akron: either you listen to the expertise in this channel or you do it your way
21:48 Akron sri: How can I use, stupid example, a timer in a helper? I can't get this working.
21:48 lb i've been doing webs for this many days!
21:48 * lb holds up fingers
21:49 lb Akron: a GREAT FUCKING RULE is don't call render until you have all the data in the stash, and that's what render_later helps you do
21:50 Akron chansen: I am grateful for your opinion and I currently do the logic in a controller. The thing is that there is already a use pattern where the helper is used in templates.
21:50 lb if you need to say "oh btw, i need this data too!" down somewhere in the template, you're doing shit wrong
21:50 Akron lb: Yeah, you are probably right.
21:51 lb surprisingly this doesn't surprise me :P
21:52 lb (there's nothing i haven't done wrong by now)
21:52 chansen Akron: He is not probably right, He is right! You will learn when you have the expirence!
21:54 lb mvc is wrong - it should be mcv, because the c is a mediator
21:54 lb if your v knows about your m, you have pain in your future
21:54 lb and obviously vice versa
21:55 chansen yeah, couldn't agree more
22:02 sugar__ joined #mojo
22:09 damaya joined #mojo
22:19 thowe My dog is so stupid...  He sneezed and fell down the stairs.
22:20 * lb is pretty sure he has worked with thowe's dog's code
22:28 chansen or he tried to combine the model with the controller and failed with calculate basic arithmetics ;o)
22:31 chansen /me I'll bb for real now
22:44 dotandimet joined #mojo
23:13 dotandimet joined #mojo
23:15 sugar joined #mojo
23:25 tempire ITSTHANKSGIVING
23:25 tempire The time for pumpkin cheesecake
23:25 Averna joined #mojo
23:26 preaction ooh nice choice
23:34 sugar_ joined #mojo
23:34 disputin joined #mojo

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