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

IRC log for #mojo, 2015-06-25

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

All times shown according to UTC.

Time Nick Message
01:15 klapperl_ joined #mojo
02:11 noganex joined #mojo
02:43 zivester joined #mojo
03:02 disputin joined #mojo
03:07 ilbot2 joined #mojo
03:07 Topic for #mojo is now ūüćĽ cheers | http://mojolicio.us | http://irclog.perlgeek.de/mojo/today
03:15 hshong joined #mojo
03:41 woz joined #mojo
04:27 cpan_mojo Mojolicious-Plugin-RedisSubscriber-0.0.1 by BINARY https://metacpan.org/release/BINARY/Mojolicious-Plugin-RedisSubscriber-0.0.1
04:28 Grinnz uhhh... someone hasn't seen Mojo::Redis2
04:28 preaction or doesnt' care
04:37 Grinnz_ joined #mojo
04:52 woz joined #mojo
05:32 woz joined #mojo
05:45 berov joined #mojo
05:58 woz joined #mojo
06:11 absolut_todd joined #mojo
06:26 absolut_todd joined #mojo
06:30 batman Grinnz: oh. that sucks :(
06:30 batman i think i've made it explicit... https://metacpan.org/pod/Mojo::Redis
06:32 batman s/think i've/thought i/
06:33 Grinnz yes, quite
06:33 batman good.
06:33 * batman will drop an email later today
06:33 batman first... got to get to work.
06:34 batman spent far too much time on materializecss now :)
06:40 dp_ joined #mojo
06:42 dod joined #mojo
06:48 dod joined #mojo
06:54 trone joined #mojo
07:09 eseyman joined #mojo
07:33 ghandi|work joined #mojo
07:39 Vandal joined #mojo
09:39 jkramer left #mojo
10:11 ashimema morning peeps
10:12 ashimema jberger still around?
10:14 ashimema ok, throwing question out to anyone then..
10:15 ashimema what are people preferred way to catch errors generated by croaks..
10:15 ashimema Mojo::JWT throws croaks for any error..
10:15 ashimema for dbic i've been using Try::Tiny.. but wondered if anyone had any other advice in here?
10:26 batman ashimema: i'm not cathing JWT errors. if the user screwed up i consider him/her to be a hacker and i'm showing 500
10:26 ashimema I want to catch a token timeout..
10:26 ashimema the other I'm doing the same for
10:28 ashimema such that in that particular case I can throw a 401 instead ;)
10:28 * ashimema is using tokens instead of session cookies in this particualr app
10:29 batman ashimema: $jwt->expired(''); eval { $jwt->decode($token); } die "Expired" unless $jwt->expired;
10:30 ashimema that's nice and succint..
10:30 ashimema saves me grabbing try:::tiny too..
10:30 batman sorry. you don't need to clear expired(). it's done inside decode()
10:30 batman also, remember that it will die unless $claims->{exp} is set in $token
10:31 ashimema indeed
10:31 ashimema in this case exp shuold always be set.. else I want it to die :)
10:31 ashimema naughty hacker people ;P
10:31 batman hehe
10:40 ladnaV joined #mojo
10:51 neilhwatson joined #mojo
10:53 Nemix joined #mojo
10:54 Nemix_ joined #mojo
10:58 punter joined #mojo
11:07 * Lee is just about to release an update to OAuth2::Server plugin that can gen JWTs...
11:11 woz joined #mojo
11:29 dvinciguerra joined #mojo
11:32 wingfold joined #mojo
11:38 ashimema new question.. sure it's there somewhere in the docs
11:38 ashimema how do i drop out of a controller early..
11:39 Sneyla joined #mojo
11:39 ashimema ie. I'm creating a 401 ( return $c->rendered(401); ) before I hit the controller..
11:40 ashimema but the controller is still going on to render further content
11:41 ashimema sort of a 'break' in while loop
11:42 batman ashimema: do you mean break out of a route chain? are you using under() ?
11:43 batman if so.... https://metacpan.org/pod/Mojolicious::Guides::Tutorial#Under
11:43 batman (you need to return undef, not a true value)
11:43 ashimema hmm.
11:43 ashimema ok..
11:43 ashimema is it not bad practice to return undef?
11:44 ashimema general perl practice that is.
11:44 batman also, are you sure you want to use rendered? why not $c->render(text => "sorry. no can do", status => 401); ?
11:44 batman ashimema: return "" or return 0; i don't think mojo care.
11:44 batman also... no. it's not bad practice.
11:45 batman it's just a return value. perl don't care if you return undef or return 42; both undef and 42 is a value.
11:45 ashimema hmm..
11:45 ashimema true
11:45 ribasushi ashimema: you are confusing "return in value context" with "return in boolean context"
11:46 ashimema I'm not using under in this case.. but the suggestion is getting me closer ;)
11:46 ribasushi if an API is documented "callback needs to return true/false" then return (); return undef; return 0; and return '' are all fine
11:46 ashimema ooh.. didn't realise you also lurked in moj ribasushi..
11:46 ashimema your everywhere ;)
11:46 ashimema omnipresent
11:46 ashimema coolios
11:47 ribasushi ūüôá
11:47 batman ribasushi: well... return (); is very different from return false; ... so it might not be the same.
11:47 ribasushi batman: <ribasushi> if an API is documented "callback needs to return true/false"...
11:48 ashimema so.. I was actually hoping there was a call to the controller I could make to say.. 'stop here'
11:48 batman ribasushi: ok
11:48 batman ashimema: "return;" is "stop here"
11:49 batman $r->get("/foo" => sub { return; $c->render(text => "yay"); }); # this won't ever render "yay"
11:49 ashimema I'm looking to far up the call chain..
11:49 ashimema thanks guys.. think I'm onot somthing now ;)
11:49 batman ashimema: another way is die;
11:50 ashimema yeah.. die gives a naty hash error at the minute
11:50 batman not sure what happens if you do $c->render(text => "yay"); die "oops!";
11:50 batman it could be undefined behavior
11:51 batman pretty sure you will seee "oops!" in the application log...
11:51 batman not sure what will be rendered to the client.
11:51 batman sorry for rambling. it just looks ugly. don't go down that rabbit hole.
11:52 ashimema hehe
12:05 sri there is nothing wrong with "return undef"
12:06 sri is "return();" equivalent to "return;"?
12:08 sri if that's the case, then "return();" is the one that's bad most of the time
12:08 CandyAngel sri: "return undef" can be wrong because if the caller can end up with an array of one element (undef) rather than an empty array
12:08 CandyAngel return and return() are the same as far as I know
12:09 sri CandyAngel: context sensitivity is a bug, not a feature imo
12:09 sri (conway also agrees these days)
12:10 CandyAngel So do I, I don't do any "what context is it called in" stuff in my code (that I am aware of)
12:10 sri if your function or method returns a single value, then "return undef" is perfectly fine
12:11 sri the problem with bare return is that it does make your function/method context sensitive
12:11 CandyAngel How so?
12:11 sri foo(bar => my_function())
12:12 CandyAngel Ah, unexpected number of elements in hash
12:12 woz joined #mojo
12:12 CandyAngel ?
12:12 sri yes
12:13 dod joined #mojo
12:13 nicomen is that even a problem, if you stay away from not returning anything else than scalars?
12:13 CandyAngel I don't like that code style (putting method calls in other method calls) anyways
12:13 nicomen *if you never return anything than scalar/refs?
12:14 sri nicomen: especially then
12:14 nicomen ah
12:14 marcusr Perl is hard, let's go shopping.
12:15 marcusr or play hearthstone. #whatever
12:15 * sri is very glad we got rid of all context sensitivity in mojolicious
12:15 marcusr +1
12:15 purl 1
12:15 sri marcusr: banana brawl already got boring :S
12:16 marcusr sri: Not enough resistance?
12:16 marcusr haven't seen any alternatives to the mage deck yet.
12:16 marcusr Guess paladins should be able to adjust
12:16 sri yea, it's all mages now
12:17 marcusr not very balanced
12:17 mattastrophe joined #mojo
12:17 CandyAngel I guess it mostly depends on how you code things
12:17 CandyAngel I can see why people would stick to one way or another
12:18 CandyAngel I started with 'return undef' and was convinced to change to 'return'.. I'm happy to be convinced back
12:18 CandyAngel I just want to code the best way :P
12:18 sri CandyAngel: perl best practices was very wrong there
12:18 ribasushi <CandyAngel> I don't like that code style (putting method calls in other method calls) anyways <--- I don't understand what this even means...
12:18 CandyAngel ribasushi: I prefer
12:18 CandyAngel my $value = func();
12:18 marcusr yo dawg, I heard you like method calls
12:18 CandyAngel otherfunc($value)
12:19 CandyAngel Instead of: otherfunc(func())
12:19 marcusr CandyAngel: why?
12:19 ribasushi CandyAngel: in hot code this will have a very noticeable effect
12:19 sri CandyAngel: conway now recomments "return undef" in the new video http://shop.oreilly.com/product/110000790.do
12:19 CandyAngel Makes it easier to step in between the two to check what func is returning
12:19 sri s/t/d/
12:20 CandyAngel I can just add a new line between the two, rather than changing 1 line to 3
12:22 ribasushi CandyAngel: PERL5OPT="-MDevel::Dwarn" <your app as usual>  ... and then otherfunc( ::DwarnL func() )
12:23 ribasushi or ::Dwarn (no L) if you want to respect wantarray
12:23 marcusr ribasushi++ # neat trick
12:24 CandyAngel ribasushi: That looks really handy! Thank you
12:24 ribasushi marcusr: it's not perfect, but covers 98% of the ground
12:24 marcusr frew++ # too I guess :)
12:24 nicomen I've needed something like that for { foo => func(), ... }
12:24 ribasushi one often finds themselves having to throw a $Data::Dumper::Maxdepth = 2  before the call to ::Dwarn*
12:25 ribasushi otherwise things become very unreadable very quickly
12:25 ribasushi other than that it just works
12:26 ashimema is there a way to check with 'rendered' has been called already in a controller?
12:28 CandyAngel I like my filesystem crawler thing so far, it's pretty spiffy :)
12:32 CandyAngel it's a little awkward to develop though
12:32 CandyAngel Because while morbo reloads when I update the code, workers don't, so they end up running the old code :\
12:38 CandyAngel UNless I am not supposed to run workers separately?
12:41 batman marcusr: hahahahaha! (a bit late, but referring to "yo dawg")
12:43 batman ashimema: you could try to check $c->res->code
12:46 CandyAngel Hmm.. if I wanted to share information between minion workers, is my best bet to put that information in the app object..?
12:48 batman i've never worked with minion, but i think the answer is that it's your worst bet.
12:49 batman i could be very, very, very wrong, since i don't really get what "information" in this case is.
12:49 ashimema batman.. that did the trick!
12:49 ashimema thanks..
12:49 ashimema been battling with it for a couple of hours now
12:49 CandyAngel Just a timestamp to throttle how often the minions will do certain tasks
12:50 CandyAngel So like, if there at 10 tasks, the minion can check the last time a task was started, so it can sleep 1; or something like that
12:51 CandyAngel Rather than processing IO-heavy tasks as fast as possible (and causing my machine to lock up because I have weird IO issues)
12:56 Mikey i think minion tasks were intended to be more ephemeral than how you're using them CandyAngel
12:56 Mikey one task = one job.  the only influencer of scheduling is the priority option iirc
12:57 Mikey so, the next task will run as soon as the last task is done until there are no more tasks (if you spawned one worker)
12:57 Mikey if you want to run things on an interval just use cron :)
12:57 Mikey and a mojo command
12:58 CandyAngel Mikey: Quite possibly, I come up with weird ways of using stuff sometimes (e.g. I use git-annex as a backend for a Second Life-esque VR environment)
12:58 Mikey CandyAngel: and i am honestly fascinated that you're using it in the way you're using it.  devs like you are awesome.
12:58 jberger Egad! The backlog!
12:58 * jberger yawns then reads
12:58 CandyAngel Fumbling around not knowing what I am doing is awesome? Awesome! :D
12:59 Mikey some light morning reading jberger :D
12:59 jberger Mikey++
12:59 Mikey i dont think that it's fumbling around as much as it shows your creativity and the strength of your own worldview
12:59 CandyAngel ^_^
13:01 Mikey i, too, misappropriated minion, so don't feel bad.
13:02 CandyAngel I'm not misappropriating it, I'm just finding "alternative" use cases, right? :)
13:03 Mikey i use zeromq to tie it back into websocket IOLoops so I can do blocking operations "in the websocket" without blocking the process
13:03 Mikey CandyAngel: exactly :D
13:03 CandyAngel I might have a series of articles called "Why on Earth would you do that?!?!" and write up about them :P
13:04 Mikey and yeah, whatever you need to access from minion needs to be in an external file or database really.  or it needs to be passed in to the job when it's scheduled.
13:04 stephan48 CandyAngel: i found the same problem wile i worked with minion... i found out thats even worser when i am developing with workers running under a different user :)
13:05 Mikey pretty much, since a minion worker is its own process, not forked from the app itself, it's a bit of an island.  but minion workers at least call app->startup()
13:05 stephan48 you could use DBM::Deep for deduplication/passing of stuff between workers
13:05 jberger Mikey: seen ForkCall?
13:05 purl I haven't seen 'ForkCall', jberger
13:05 jberger Not you purl!
13:05 purl piss off then, hippie.
13:05 Mikey jberger: yes, and i love it and use it in some places :)
13:05 stephan48 purl: learn some manners please!
13:05 purl stephan48: what?
13:06 Mikey minion lets me run jobs on other nodes of a cluster.  it's more horizontally scaleable friendlierer
13:06 CandyAngel stephan48: I'm already using DBM::Deep (as the job backend) so I may be able to just get that and put it in there (without breaking all the things)
13:07 stephan48 yea
13:07 Mikey so i can dispatch on box a.. box b's minion worker process it, throws results into postgres, notifies that work's done over zmq, websocket ioloop gets zmq message, returns results from db.
13:07 jberger CandyAngel: that will tie you too that backend
13:07 jberger And might be fragile to db schema changes
13:08 Mikey it also allows me to create worker pools for really blocky stuff (oracle db io, usually), on vms with high memory
13:08 stephan48 yea. i tend to use a different DBM::Deep DB and leave Minions DB alone
13:08 CandyAngel Yeah, could do
13:08 stephan48 Mikey: sounds cool
13:08 CandyAngel Being tied to that backend is fine but if it depended on schema, I would avoid it
13:08 Mikey ty :)
13:09 CandyAngel A separate DBM::Deep would make more sense as any limits would be per-machine
13:10 stephan48 for my project i just used the jobid as a key in my own store for saving infos like who started the job and stuff like the results
13:11 Mikey that's a good idea.  i need better auditing overall
13:11 cpan_mojo Mojolicious-Plugin-OAuth2-Server-0.20 by LEEJO https://metacpan.org/release/LEEJO/Mojolicious-Plugin-OAuth2-Server-0.20
13:11 CandyAngel Yeah, I could use that for building the heirarchy..
13:11 stephan48 the only downside is that you can
13:11 CandyAngel Because I have jobs that start other jobs
13:11 CandyAngel Or.. queue other jobs, rather
13:11 stephan48 the only downside is that you can't automatically cleanout your jobs when Minion does its cleanup
13:12 dod joined #mojo
13:13 woz joined #mojo
13:14 jberger lee: your plugin is only using the symmetric jwt?
13:14 Lee er... yes?
13:14 jberger Ok
13:14 CandyAngel stephan48: Doesn't Minion emit an event during cleanup?
13:15 jberger Does oauth ever use asymmetric secrets?
13:15 Mikey also my run-for-a-week hypnotoads level out around 200mb of memory.. whereas a just initialized minion worker is around 80MB.. forking the minion worker uses less ram / the ram it uses is more specific to the task
13:15 Lee i don't think that applies here as it's the token not the client secret (assuming that's what you are referring to)
13:15 stephan48 it does? cool. i was sure it didn't but i did not check the full docs in quite a time
13:16 Lee jberger: i was going to run with this then maybe add asymmetric encoding of the JWT
13:16 CandyAngel I'm not sure if it does, but that would be the first thing I'd check
13:16 Lee gah, i forgot to add files to the MANIFEST...
13:16 Mikey i implemented JWTs for a Microsoft REST API thing i wrote like 3 days before the JWT mojo plugin came out
13:17 Mikey i was so sad
13:17 Lee heh
13:17 * Lee is glad he didn't rush to implement JWT in the early version of the plugin
13:17 Mikey JWT was easy.  i also implemented SAML2.
13:17 Mikey signed xml is stupid.
13:18 jberger Lee: ok, I know very little about the ouath process
13:18 Lee Mikey: s/signed// :)
13:18 Mikey amen
13:18 marcusr saml is such a nightmare
13:18 marcusr and my employer uses it all over the place
13:18 jberger I seem to be the rare person that is using jwt for something completely different
13:18 zivester joined #mojo
13:19 marcusr hopefully feide connect will usher in a time of peace and tranquility.
13:19 Mikey marcusr: same here.  plus i had to get it all to play nice with ADFS which is its own terrible adventure.
13:19 jberger Mikey: jwt is easy except for the one huge bug many people make in writing their validation function
13:19 * batman use jwt instead of oauth(2)
13:19 batman i'm so happy
13:19 Lee JWT is useful for the oauth server plugin as it can now be perisitent and multi proc safe in it's simplest form without requiring db lookup (since the detail is in the JWT). that does make revoking tokens none-trivial though
13:20 Mikey jberger: what bug is that?
13:20 purl i guess bug that is refered by the page you posted is a FTBFS (fails to build from source) bug on s390.
13:20 batman jberger: what huge bug?
13:20 Mikey can i use one weird trick to fix one huge bug?  will obama hate me?
13:20 jberger Mikey: hahaha
13:21 batman Mikey: yes --- if you test and document
13:21 Mikey (i just wanna check to see if i implemented it, tho that API's not production, and I plan on using your JWT when we get there)
13:21 jberger If you let the jwt define the algo AND you reuse a field for the symmetric secret and asymmetric public key
13:21 cpan_mojo Mojolicious-Plugin-OAuth2-Server-0.21 by LEEJO https://metacpan.org/release/LEEJO/Mojolicious-Plugin-OAuth2-Server-0.21
13:21 jberger Then you have a huge vulnerability
13:22 batman can you point me to the details? i don't even understand half of what you're saying :(
13:22 jberger Sec
13:22 Mikey will check when i get to the office.  also +1 to batman's question.  i'll bbiab &driving
13:24 Lee jberger: you mean the secret can be brute forced?
13:25 jberger No, if you expect an asymmetric algo, and this use public key
13:26 jberger But an attacker prepares a jwt that claims a symmetric algo
13:26 crux joined #mojo
13:26 jberger And uses the public key as the secret
13:26 jberger And if the validation library doesn't protect you from that
13:26 Lee right
13:26 stephan48 oh that is nasty!
13:26 jberger Then it will validate anything
13:27 jberger Yeah
13:27 jberger Mojo::JWT is safe because it well not confuse secret and public
13:27 Lee heh, again glad for Mojo::JWT
13:27 Lee jberger++
13:27 jberger s/well/will/
13:28 Lee jberger: https://auth0.com/blog/2015/03/31/critical-vulnerabilities-in-json-web-token-libraries/ # this?
13:28 jberger https://auth0.com/blog/2015/03/31/critical-vulnerabilities-in-json-web-token-libraries/
13:28 batman jberger: so the issue does not exist when you use Mojo::JWT?
13:29 jberger Right
13:29 jberger Because it doesn't use a single secret field
13:29 jberger Most other libraries now implement an acceptable algos field
13:30 jberger But I think that is silly
13:30 jberger The jwt can still specify the algo as long as you don't confuse the type of validation you are doing
13:30 jberger Sym vs asym
13:33 Grinnz my %stuff = (one => thing_that_gets_value_but_could_return_early(), two => 'blah') # if anyone still doesn't see why return; is bad
13:33 cpan_mojo Mojolicious-Plugin-OAuth2-Server-0.22 by LEEJO https://metacpan.org/release/LEEJO/Mojolicious-Plugin-OAuth2-Server-0.22
13:33 Lee third time's a charm...
13:33 bpmedley joined #mojo
13:34 berov1 joined #mojo
13:34 CandyAngel Grinnz: I get why it is bad, I just can't remember that it is called when you use function calls in the argument list :P
13:34 CandyAngel remember what*
13:34 Grinnz that's not an argument list, it's a regular list
13:34 Grinnz which happens to end up in a hash
13:35 CandyAngel Oh yeah, whoops
13:35 * CandyAngel mutters "Read all the sentence"
13:35 Grinnz but yeah those are the two main usecases where context sensitivity will bite you
13:36 CandyAngel Mhm, I am considering going back to returning undef *nodnod*
13:36 Grinnz return based on the context the function is expected to return in, so undef if it returns a single value, () if it returns a list
13:39 batman CandyAngel: neither undef or () is "right". you need to know what you want to do and document/test it.
13:47 jb360 joined #mojo
13:49 gryphon joined #mojo
13:50 woz joined #mojo
13:51 punter joined #mojo
13:58 ashimema marcusr: how are you doing saml/shibboleth in mojo then?
13:59 ashimema I asked about that a few days back and was met with silence ;)
14:00 marcusr ashimema: I don't. I work in operations ;)
14:00 ashimema shame.
14:01 marcusr hey, no ops-shaming!
14:01 marcusr :p
14:01 ashimema haha.. not the ops front.. the using saml with mojo front ;)
14:01 marcusr having said that, there are multiple saml modules on cpan
14:01 ashimema I'm going to have to support shibboleth at some point soon ;)
14:01 marcusr did you try using Net::SAML2 ?
14:02 marcusr luckily we're done with shibboleth
14:02 ashimema in the cgi/plack/whatever world where it's runnig behind apache or nginx I just use the native service provider stuff and bind on env veriables within the app..
14:02 marcusr ashimema: native service provider stuff => simplesamlphp?
14:02 ashimema but I was hoping to deploy via hypnotoad and not stick it behind apache or nginx or whatever
14:03 marcusr or mod_whatever?
14:03 ashimema i've also used simplesamlphp
14:03 ashimema mod_shib
14:03 marcusr simplesamlphp was developed by the group who runs http://feide.no/ - which we manage
14:03 ashimema https://wiki.shibboleth.net/confluence/display/SHIB2/NativeSPLinuxInstall
14:04 ashimema yup..
14:04 ashimema I use simplesamlphp as a gateway in a couple of places..
14:04 marcusr gateway drug to pain
14:04 Grinnz but it has both 'simple' and 'php', it couldn't possibly be a problem!
14:04 ashimema but for performance when dealing only with shibboleth I opt for the native shibboetlh client (written in C by the guys who wrote the shibboleth spec i beleive_
14:05 ashimema 'though recently I'm sure it's sprung a memory leak somewhere..
14:05 ashimema restarting it has become a pain
14:05 ashimema fiede.no is great for testing against.. I'd have been lost without it ;)
14:08 ashimema kinda worries me that Net::SAML and Net::SAML2 don't really appear to have been touched in a few years.. and have no '++' in metacpan
14:08 ashimema I'll probably end up dumping hypnotoad behind nginx.. that won't be soo bad will it?
14:08 marcusr saml2 looks like it has a reasonably decent architecture at least
14:09 marcusr from reading the synopsis and the dependency list
14:09 marcusr but if you want to do an async mojo::saml2 I'm all for it ;)
14:10 batman \o/
14:11 ashimema hehe
14:12 mattastrophe joined #mojo
14:12 ashimema I have serious doubts my coding is up to scratch for a mojo::saml ;)
14:12 ashimema though might be tempted if anyone here fancied tutoring me ;)
14:13 ashimema s/tutoring/mentoring/
14:13 * marcusr volunteers batman to the task.
14:13 Mikey haha simplesamlphp was so key in figuring out wtf was going on
14:13 ashimema me too Mikey..
14:13 * batman escapes to ISS
14:13 batman (the space station)
14:13 ashimema then once I had worked it out.. siwthcing to shibboleth native made loads of sense
14:13 ashimema haha..
14:14 Mikey god damnit i wish i could just open source this stuff.
14:14 ashimema haha..
14:14 Mikey maybe if someone released it under a different name
14:14 Mikey ...
14:14 batman Mikey: leak it to me and i will perltidy the code and doc and release it
14:14 Mikey nah i dont wanna get fired or get anyone sued
14:14 batman :)
14:14 ashimema what do you work on then Mikey..
14:14 Mikey i wrote an academic portal.. that the university i work at is trying to commercialize
14:15 Mikey its at its core a decentralized social network + single sign on features
14:15 CandyAngel ashimema: Code it anyway, it can always be improved later
14:15 CandyAngel Not knowing what I'm doing has never stopped me!
14:15 Mikey CandyAngel's right!  just do it!
14:15 ashimema I'm slowly managing to work my company round to open sourcing this product I'm currently working on
14:15 marcusr ashimema: we'll be quite pleased to help you with concrete challenges if you try, anyways.
14:15 Mikey this is like 40k lines of mojo app
14:15 ashimema all our other stuff is already open.. so I don't see why this one shouldnt' be too ;)
14:15 CandyAngel Mikey: That's a lot of Mojo
14:16 marcusr my university develop all their crap in java.
14:16 marcusr which is why I'm not a developer here.
14:16 CandyAngel marcusr: I'm sorry
14:16 Mikey yeah.  it is.  and mojo has handled this scale so well.
14:16 ashimema Mikey, pull re-usable components out an cpan 'em ;)
14:16 ashimema that's my aim with a bunch of this project..
14:16 Mikey ashimema: i think i can get away with it.  plus i am the only one with root on the svn server ;)
14:16 ashimema sounds like we're in the same space btw..
14:16 ashimema I'm all about libraries and acadmenic shizzle in this job..
14:16 ashimema moodle like stuffs
14:17 Mikey well now that we've sold it once... tech commercialization is going apeshit
14:17 Mikey they lawyered up hard
14:17 ashimema where you based?
14:17 CandyAngel Well one reason I like Mojo is that the time between having no idea about some part of it and "getting it" is pretty short
14:17 Mikey wayne state university, Detroit, MI
14:17 Mikey CandyAngel: totally!
14:17 purl GAG ME WITH A SPOON!!1!
14:17 Mikey purl: :P
14:17 purl i think P is not for Planning ;)
14:18 ashimema We're having allot of luck getting big accademics to open code here in the UK ;)
14:18 CandyAngel Yay, the UK doing something decent, what a nice change :)
14:18 ashimema lol
14:18 Mikey i it was a small little thing they'd have no problem
14:19 ashimema that's funny..
14:19 ashimema I'm having the oposite issue..
14:19 Mikey like had i broken off and cpan'd the parts as i wrote them, i'd probably be fine.
14:19 marcusr most of the things we do are open source as well (uio.no)
14:19 Mikey maybe i can come work at one of your schools' after this is all over.
14:19 Mikey cos its really wearing me out
14:19 Mikey i just wanna code man
14:19 ashimema until my code is big enough that it scares away people from just grabbing the code and running it themselves I don't have much chance of opening it.
14:20 ashimema ooh..
14:20 ashimema oslo aye..
14:20 Mikey ashimema: haha that is the very opposite of my situation
14:20 ashimema I suppose it's jsut the nature of my company..
14:21 ashimema we've done really well with a few open source bits of kit.. selling support and development..
14:21 ashimema but if it's too simple people just go and do it themselves.. and thus the company woudl die
14:21 Mikey i need to find a good content management system to integrate with
14:21 Mikey do you have one that you recommend?
14:21 Mikey (i was gonna implement a lightweight wiki otherwise)
14:21 Mikey just so i can say "WE CAN DO WEBPAGES SEE"
14:22 ashimema marcusr.. are you part of the lot using koha for the library in oslo?
14:23 marcusr ashimema: nope. I've heard of it tho.
14:23 marcusr ashimema: I took a look at the koha code base then promptly fled the scene
14:23 ashimema koha is where most of my coding time goes..
14:23 ashimema needs one hell of a tidy up though ;)
14:23 ashimema don't blame you..
14:23 marcusr not sure if the university library uses it?
14:23 ashimema it's scary
14:23 ashimema no idea..
14:23 purl i think no idea is http://jays.net/images/noidea.jpg
14:24 marcusr we just manage their web page :)
14:24 Till joined #mojo
14:25 marcusr (https://www.ub.uio.no/english/)
14:25 marcusr doesn't look like they are using koha
14:25 Till Hello, I have an application specific command which I can call from the command line with "./myapp.pl db reset".
14:25 Till Is it possible to call this command (or the underlying sub) from a test file (db.t)?
14:26 ashimema nope..
14:26 marcusr till: This is perl, anything is possible :p
14:26 ashimema primo.. massive expensive closed source jobby ;)
14:27 Mikey you can instantiate the command as an object and call run() on it
14:27 Mikey with args passed in
14:28 Mikey i actually created a readline-supporting command shell for my portal using mojolicious commands, usage, etc
14:28 Mikey so i do that a lot
14:28 Till Yes, but I have to do this in many test files and I want to avoid code duplication. Isn't there a simple and clean solution?
14:30 marcusr Till: did you look at the command file to see what it actually does?
14:30 Mikey subclass Mojo::Test and add it to the constructor?  i feel like i dont understand your problem because i can think of too many solutions to it
14:30 marcusr Mikey++
14:31 Till ok, I will try... thanks
14:35 zackiv31 joined #mojo
14:36 Till $t->app->start(qw(db reset)) did it :)
14:36 jberger Till: I might put the db reset logic in a helper
14:36 jberger then you can test the helper and the command can just call the helper too
14:38 Till Is it good to have a helper only for a command and tests?
14:43 Kogurr joined #mojo
14:50 jberger Till: I don't understand your question
14:51 jberger helpers are easier to test (IMO) than commands
14:51 jberger so if a command is a thin wrapper to a helper, then it is de-facto easier to test
14:53 Till Is it ok to have a helper which is never used within a controller?
14:53 jberger Till: sure
14:54 jberger and you might want it to be nested so that it doesn't appear as a function in your templates
14:54 jberger helper 'db.reset' => sub { ... }
14:55 Till ok, thanks :)
15:00 neilhwat1on joined #mojo
15:00 woz joined #mojo
15:00 sh4 joined #mojo
15:07 sri oh, atom is now 1.0
15:08 jberger did they figure out all the highlight breakage?
15:08 sri nope, highlighting regressions are still there
15:10 sri i guess leaving it just as broken as highlighting on github is a feature
15:10 sri https://github.com/kraih/mojo/blob/master/lib/Mojo/JSON.pm
15:11 * jberger sticks with vim
15:11 jberger about 90% of my editing lately is over ssh anyway
15:11 jberger so atom doesn't help me
15:13 dod joined #mojo
15:30 gryphon joined #mojo
15:31 disputin joined #mojo
15:38 lluad joined #mojo
15:39 hahainternet hey hey friends, when using DBIx::Class is there a nice way to hook in mojo validation?
15:40 wingfold_ joined #mojo
15:40 jberger hahainternet: mojo validation is really aimed at query param validation
15:40 jberger I don't think anyone has really though too much about using it elsewhere
15:41 jberger there are other good things on CPAN
15:41 PryMar56 joined #mojo
15:42 hahainternet jberger: well, in a way this is exactly what we want, when users try to add an entry to the database
15:42 hahainternet we'd like to keep the validation out of the controller ideally, i suppose we could add to DBIx::Class package
15:42 hahainternet anyhow it's for a coworker this, he's hacking at it now then i'm going to read
15:43 hahainternet but i thought jberger would be the ideal person to ask :D
15:43 jberger hehe, not really, I rarely use the mojo validation (yet)
15:44 hahainternet well i know you wrote the DBIx::Class example iirc
15:44 jberger but if you are using it with forms, then go right ahead
15:44 hahainternet i also need to figure out how to use DBIx::Class to paginate based on giving a uuid at a position
15:44 jberger tempire's example was better than mine, though, his long predated the form validation stuff
15:44 jberger hahainternet: that's a question for #dbic
15:48 hahainternet jberger: yeah i agree it is, but for now we're going to stick the mojo validator stuff inside the dbix class file
15:49 hahainternet that way at least the logic for what values are acceptable, and where they are stored can be grouped together
15:49 jberger as long as it provides the functionality you need, then cool
15:57 ToApolytoXaos joined #mojo
16:01 woz joined #mojo
16:13 sri btw. i think i do have a solution to the tag helpers problem and upload validation
16:13 sri there's already a similar case with password_field
16:13 sri it's actually 2 lines less code :o
16:20 jberger sri: oh yeah?
16:20 purl totally!
16:20 jberger purl++
16:20 jberger botsnack
16:20 purl :)
16:20 sri https://gist.github.com/anonymous/6a187567036efd222b76
16:20 sri i think this would work
16:20 sri it adds a few new lines because the hash doesn't fit on a single line anymore though :S
16:21 sri costs 3 lines
16:22 jberger that'd be worth it IMO
16:23 jberger this is an often requested feature
16:23 sri not considering the documentation cost though
16:24 jberger right, that goes without saying
16:24 jberger its only in the validation doc anyway
16:24 jberger I don't worry about those, I worry about the guides getting too long
16:25 jberger although eventually, I might see a validation guide being nice
16:25 jberger or more like form guide
16:25 jberger (explain how values get reinserted etc)
16:26 jberger that'd be in the future though
16:58 sri full patch with tests https://gist.github.com/anonymous/4ac3f6efbfac749be151
17:02 woz joined #mojo
17:04 jberger does the 16MB limit apply to uploads as well?
17:04 sri yes
17:04 sri to everything
17:05 dod joined #mojo
17:06 sri marcusr, Grinnz, jberger, tempire, batman, crab: i'd like to hear your opinion
17:07 jberger will the size validator handle Mojo::Upload objects?
17:07 sri no
17:07 sri none of the other checks work
17:08 sri and there is no way to ever make them work without special cases for Mojo::Upload objects in every check
17:09 Grinnz_ it seems reasonable to me, checking that a file upload is provided seems like the most common validation for that type of field
17:09 jberger I'm not sure its worth torpedoing the entire feature (handling uploads) over it, but I expect someone is going to do $v->file->size(100)
17:09 jberger or whatever the syntax is
17:10 sri yea, i was worried about that one from the start
17:10 disputin joined #mojo
17:10 Grinnz_ maybe just mention in the docs that those checks only work for GET/POST parameters
17:10 sri Grinnz_: how?
17:10 jberger maybe document in the size check
17:10 sri and note that validation is mostly neutral right now
17:10 sri it has no concept of GET/POST parameters
17:11 jberger size checks with "length"
17:11 sri it just checks arbitrary values in a hash
17:11 jberger yeah, genericism is good
17:12 Grinnz_ "... representing a file upload. The contents of file uploads are not automatically validated by other checks such as L</"size">."
17:12 Grinnz_ something like that? maybe
17:12 sri i doubt referring to "length" will tell a newbie anything
17:12 Grinnz_ i'm not sure i have enough experience with this module to write the language
17:12 jberger Grinnz might be on to something there
17:12 jberger actually, I wonder if the name shouldn't be file but upload
17:13 jberger </bikeshed>
17:13 Grinnz_ didn't he set it as file_upload originally :P
17:14 sri i chose file so file_size and friends could become a convention for naming checks
17:14 sri ->required('foo')->file->file_size(1, 1024)
17:15 marcusr sri: I have no real opinion on the matter :-/
17:16 Grinnz_ file works for me, that's what the form field type is after all
17:17 mattastrophe joined #mojo
17:17 sri tag helper is called file_field
17:18 sri now is the time for anyone else who cares about this to speak up too!
17:19 sri like everyone who commented on https://github.com/kraih/mojo/issues/812
17:20 sri (no opinion matters too, if nobody cares the feature is not important)
17:21 * CandyAngel has a look because she can develop an opinion on anything
17:23 disputin joined #mojo
17:25 * sri just searched for an opinion meme... and failed :(
17:26 jberger see I would think that file_size would use -s
17:26 sri oh, i guess this will do \o/ http://cdn.webfail.com/upl/img/9e65148e365/post2.jpg
17:26 jberger whereas upload_size would use Mojo::Upload or Asset
17:26 jberger nice
17:26 jberger hahah
17:26 CandyAngel >.<
17:26 * CandyAngel saves
17:27 jberger how did you miss this?!
17:27 jberger http://www.quickmeme.com/img/3e/3e563b9a02f0a0996107d755e8fed879aa839491a93880586d1d11bb0114729b.jpg
17:28 Grinnz_ mental block on quickmeme.com?
17:29 CandyAngel http://weknowmemes.com/wp-content/uploads/2013/04/what-happens-when-two-women-have-a-different-opinion.jpg
17:29 jberger kinda like this one too: http://imgace.com/wp-content/uploads/2012/09/if-i-agree-with-you-we-would-both-be-wrong.jpg
17:30 CandyAngel That's a good one
17:35 CandyAngel Anyways, if you are going to break something people use with the change, I wouldn't do it unless it wasn't documented
17:39 sri :D
17:40 sri CandyAngel: it doesn't break anything, the problem is that it might confuse people in the future
17:41 sri right now upload validation is simply not supported, that is easy to understand
17:41 sri if we do support upload validation, then we suddenly have two conflicting classes of checks
17:42 sri like, you can't do ->file->size(0, 1024)
17:42 sri because ->size() only operated on strings, not Mojo::Upload objects
17:43 CandyAngel Doesn't Mojo::Upload stringify?
17:43 sri hell no
17:44 sri "oops, 10gb file slurped into memory"
17:44 CandyAngel :P
17:44 CandyAngel Mozilla get away with it :|
17:46 Grinnz_ lol
17:46 _dave_ wow all the meme sites
17:51 jberger I vote adding file_size (or actually upload and upload_size) because the existence of (type)_size might act as the indication that size isn't what you wanted
17:52 jberger and then by inference from there, the others might not be either
17:53 sri you don't think $validation->upload might get confused with $req->upload?
17:54 sri which also happens to have a $req->param method
17:57 jberger hmmmmm
17:57 jberger would anyone ever be trying to validate and ACTUAL file
17:58 jberger that's my only concern
17:58 jberger s/and/an/
17:59 CandyAngel As in, validate that it is a valid XML file?
18:01 sri adding a file_size check is 2 more lines btw.
18:02 sri whole thing doesn't feel very elegant anymore though
18:04 woz joined #mojo
18:05 hahainternet sri: this might be a stuid question, i brought it up with jberger before
18:05 hahainternet but i'd like to know where you think mojo validator should fit in with an ORM
18:06 hahainternet at the moment we're just putting a 'validate' function in the same package as the resultset
18:06 sri hahainternet: i'm anti orm
18:06 hahainternet but having no real connection between mojo and dbix::class
18:06 hahainternet sri: what does that mean though? you don't believe in any object models? or just don't like the level some people go to
18:06 hahainternet because i can't stand the django ORM, but i do believe some sort of orm is good practice
18:06 sri the current patch https://gist.github.com/anonymous/e5a2cbb9997fc66ef5dd
18:07 hahainternet anyway no rush, i'm no expert in this
18:07 hahainternet just thought i'd ask advice from people with much more mojo knowledge :D
18:09 sri allright, i think we can summarize that most folks here are indifferent on upload validation
18:09 jberger hahainternet: I think generally, ORMs are fine practice, just as it happens I don't think there are a ton of people here who use them regularly
18:10 sri and we are all worried about confusion
18:10 jberger and certainly not with Mojo validation which is really geared at forms
18:10 hahainternet jberger: understandable, i really don't want some super heavy ORM to be honest
18:10 sri so, i think it's not worth it
18:10 hahainternet jberger: i'm going to let the guy get on with his code and review it at lunch tomorrow
18:11 jberger sri: can this code live as a plugin?
18:11 sri sucks to throw away the patch, but i think it's better
18:11 sri jberger: an ugly plugin perhaps
18:11 jberger the one line in sub validation {} looks hard to inject
18:11 sri you'd have to do the tag helper stuff
18:12 jberger oh right
18:12 sri there's little things sprinkled around everywhere
18:12 jberger I'd rather have this confusion than confusion over there not being uploads handled at all
18:12 jberger it seems that we have confusion already
18:13 sri if there's confusion either way, then the simplest solution wins
18:13 sri which is what we have now ;p
18:13 jberger from these primatives, other people can hook up other file/upload checks
18:14 jberger if as you say, without core functionality changes, plugins aren't really possible, then I would rather make it possible
18:14 jberger that's my $0.02
18:14 sri you can redefine the file_field helper from a plugin
18:14 sri it's all possible, just ugly
18:15 sri thing is, if we decide it's good enough as a plugin, i'm not even sure there's someone who cares enough to write and maintain it
18:16 jberger don't completely nix it just yet
18:16 jberger let me have a think about it
18:17 jberger its just a patch right now after all
18:17 sri who here actually wants to use it?
18:17 jberger that's the thing, I'm seeing form validation on my horizon
18:17 jberger which is why I'm caring though I don't YET need it
18:18 jberger my 10 year old code base is now completely running on mojo, via Mojo/Mason shims where necessary
18:18 jberger no form validation of any kind
18:19 hahainternet oh you've just reminded me
18:19 hahainternet sri: i don't know if i've asked this before
18:19 * jberger injects a $m variable that is an instance of MyApp::Legacy::MasonProxy which has an scomp method which proxies to an new mason interpreter's exec method etc etc etc
18:19 hahainternet but do you know if read slaves in postgres send pub/sub alerts?
18:20 hahainternet we haven't had time to test yet
18:20 hahainternet i suppose i should just google better
18:23 sri making ->size() work for Mojo::Upload objects as well would require almost no additional code btw.
18:23 bin_005 joined #mojo
18:24 jberger ref ? ->size : length
18:24 sri yes"
18:24 jberger that would actually work on more than just Mojo::Upload objects
18:25 jberger anything that implements size
18:25 lb quack
18:26 sri on the other hand, who even uses soft ->size checks on uploads?
18:26 sri we have hard limits for security
18:26 jberger I would be more interested in minimum
18:26 jberger can ->size do that?
18:26 sri it's a range
18:27 jberger I thought so, I just hadn't looked
18:31 jberger you might also want a smaller max if you were doing say a pic post
18:34 sri alternative proposal with ->size() working for uploads and warnings for other checks https://gist.github.com/anonymous/6906a8bfae22a5d8a941
18:39 sri "Note that this check does not work with file uploads for security reasons."
18:39 jberger yeah
18:39 jberger works for me, but we have seen that I'm already +1 on this, I'd like to hear from other too
18:40 sri Grinnz, marcusr, batman, tempire, crab: *poke*
18:40 lb sri: still taking wishlist requests?
18:40 Grinnz_ "security reasons"? how's that :P
18:40 jberger OOM
18:40 Grinnz_ ah, i guess
18:41 sri DoS is a security concern
18:41 Grinnz_ +1, that way works for indicating those checks don't work for uploads too
18:47 amon joined #mojo
18:48 sri the minimal file size use case seems very valid to me
18:49 * sri thinks he might be +1-ish on the latest patch too
19:01 Grinnz_ i can never remember how links work in github markdown
19:01 Grinnz_ it always seems backwards
19:08 woz joined #mojo
19:09 CandyAngel I'm sure I should be a software tester
19:10 CandyAngel I have a directory that is 8MB
19:10 CandyAngel Not "a directory containing 8MB of files", but the directory itself..
19:10 CandyAngel drwxr-xr-x 2 gemma gemma 8.6M Jun 25 20:05 tmp
19:12 CandyAngel Pretty sure directories are supposed to be $blocksize (4K) :|
19:13 jberger CandyAngel: :o
19:13 lluad That's a lot of files.
19:13 CandyAngel It's an empty directory!
19:13 sri lol
19:13 jberger whaaaa?
19:14 CandyAngel $ ls -lah  tmp/
19:14 CandyAngel total 8.6M
19:14 CandyAngel drwxr-xr-x 2 gemma gemma 8.6M Jun 25 20:05 .
19:14 CandyAngel drwxr-xr-x 3 gemma gemma 4.0K Jun 25 19:39 ..
19:15 CandyAngel I.. have no idea how I achieve these things
19:15 lluad It probably had a lot of files at one point.
19:16 * jberger blames the NSA
19:16 CandyAngel Haha
19:17 CandyAngel They are storing everyone's metadata on my computer
19:24 spicyjack CandyAngel: sounds like you unpacked something with a lot of files/directories in your tmp
19:24 spicyjack CandyAngel: or, you have a process open that's got one of the files in that directory open
19:24 spicyjack CandyAngel: OS won't reclaim the space until the process closes the file
19:24 spicyjack CandyAngel: lsof tmp?
19:29 ningu joined #mojo
19:30 sri maybe an unlinked but still open file, yea
19:32 mst well, or, lots of them
19:32 mst but, yeah, lsof
19:44 kaare joined #mojo
19:54 * sri wonders if mr robot can live up the the hype
19:55 jberger is that just Dexter but s/murder/hacking/
19:56 jberger which wouldn't be the worst thing in the world
19:57 sri the first episode was pretty awesome
19:57 sri don't think you can compare it to anything else
19:58 jberger sri: did you watch Halt and Catch Fire?
19:58 sri apparently the first episode was directed by the guy who made the original swedish version of girl with the dragon tattoo
19:58 jberger compelling characters but not too much hacker cred
19:58 sri it's very similar to that
19:58 sri halt and catch fire bored me
19:59 jberger if I didn't like a couple of the characters, it might have done so for me too
19:59 jberger altough they kinda wimped out on the girl
20:00 jberger she was going all Starbuck, then they made her left turn to "why doesn't he love me"
20:00 jberger which did irk me
20:03 mst dexter season one was good, then they made him all human
20:03 * mst sticks to the books
20:03 Grinnz_ i finally got around to watching the rest of Dexter, that finale was... just what
20:05 sri dexter was a total mess... psychopath with feelings... and then LUMBERJACK!
20:06 mst he doesn't have feelings in the books
20:06 mst this makes it far more fun
20:06 sri weren't the books about demons?
20:07 * sri is not really into that supernatural stuff
20:07 Grinnz_ no buffy, then? :P
20:07 ajr_ joined #mojo
20:07 sri buffy is different ;p
20:08 * sri is just glad space operas are back
20:10 jberger and GoT of course
20:10 woz joined #mojo
20:10 jberger or more like ASOIAF
20:10 jberger GoT might start to suck
20:10 sri of course
20:11 * jberger googles "winds of winter" and has hopes crushed, again
20:12 jberger sri! look what you did! http://www.ibtimes.com/winds-winter-george-rr-martin-trip-hamburg-germany-inspires-novels-death-scene-1983038
20:13 ningu joined #mojo
20:16 sri oops
20:18 sri stortebecker is indeed a very popular local legend
20:26 jberger next time he is in hamburg you have to capture him and give him a faster computer
20:27 jberger (have you seen the thing he is using to "word process" those books?!
20:27 jberger )
20:33 ningu if I want all POST request bodies to be assumed to be JSON and automatically decoded, should I use a before_dispatch hook or is there an easier/better way?
20:36 Repaster joined #mojo
20:36 ningu hmm... ok so you can do $c->req->json I guess
20:36 CandyAngel How come lite_app has the PODRenderer plugin by default?
20:37 Grinnz_ ningu: exactly.
20:40 sri soooo, do we have any more opinions on the upload validation patch? https://gist.github.com/anonymous/d5bad1bda9feea9bfa45
20:43 sri CandyAngel: why not?
20:43 CandyAngel Because if it doesn't do anything then its weird to have it there? :P
20:44 sri open http://127.0.0.1:3000/perldoc
20:46 CandyAngel Ah I see
20:46 CandyAngel Maybe there should be a route for that with a link :P
20:48 jberger http://grep.cpan.me/?q=plugin.*PODRenderer
20:48 Grinnz_ sri: i dunno if you saw the discussion in f#perl, but Net::LibAsyncNS is a possibility for a non-blocking resolver that's less finicky than NDN ... the libasyncns library looks well-established (it's even available in centos6) and leonerd is looking into bundling it
20:51 sri Grinnz_: last release over a year ago
20:52 mst sri: that's because it works.
20:52 Grinnz_ the library itself has been stable since 2009 so that's not suprising
20:52 Grinnz_ http://0pointer.de/lennart/projects/libasyncns/
20:52 sri with 29 cpantersters results
20:52 Grinnz_ that's probably because it's not bundled :P
20:53 sri thing is, Net::DNS::Native works very very well
20:53 Grinnz_ not on non-threaded perls :/
20:53 sri on many non-threaded perls too
20:53 sri like on os x
20:53 Grinnz_ i'm only considering this for the possibility of not having that issue at all
20:53 sri the perl just needs to be linked right
20:55 sri as long as its not bundled the discussion is moot anyway
20:58 Grinnz_ i might play around with it later, hopefully he gets it bundled
20:58 sri so, libasyncns has not been updated since 2009?
20:58 pink_mist CandyAngel: I'm pretty sure the comment in a generated lite_app right by the plugin line tells you it'll be accessed via /perldoc on your server
20:58 Grinnz_ sri: it says it's "stable and feature complete"
21:00 Grinnz_ which makes bundling even more attractive
21:00 sri i remain sceptical
21:00 Grinnz_ i wouldn't expect otherwise ;)
21:01 jberger Grinnz_: were you around yet for NDN inclusion?
21:01 jberger not as core obviously, but hanging around?
21:01 jberger it was quiet a painful deal
21:02 Grinnz_ not initially, just the later parts where it was segfaulting :P
21:02 jberger and now that it is working for the most part, its going to take a lot of trust to do something like it again
21:02 jberger right :-P
21:02 sri yea
21:02 CandyAngel pink_mist: That's true
21:03 jberger personally I would be in favor of removing PODRenderer from the generate lite_app
21:03 jberger http://grep.cpan.me/?q=plugin.*PODRenderer
21:03 Grinnz_ that's why i'm considering this at all though, i don't like NDN being dependent on how perl is built
21:03 jberger but I'm not so strongly in favor that I would call the vote
21:06 * sri disagrees with jberger
21:07 jberger it is a good demonstration of how to use plugins
21:07 mst and it's a useful thing for newbies to have available
21:07 jberger but I do see that plugin call in cargo culting all the time
21:07 CandyAngel I think it just needs layouts/default.html.ep to be changed to include a link to it
21:07 pink_mist plus it lets you access the Mojo docs
21:08 mst the lite generator is all about best first run experience
21:08 mst also, people will always find -something- to cargo cult
21:08 mst adding a comment saying "remove this for production" to the generator might be ok
21:08 mst removing it seems punishing newbies because some people cargo cult
21:09 jberger mst: fair point
21:10 good_news_everyon joined #mojo
21:10 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/vtswm
21:10 good_news_everyon mojo/master 954e97c Sebastian Riedel: add support for validating file uploads
21:10 good_news_everyon left #mojo
21:10 sri (it might still get removed)
21:10 CandyAngel Wait.. the commit bot is called "good news everyone"? that's awesome!
21:10 Adura You added an e.
21:11 Grinnz_ heh
21:11 CandyAngel Oh
21:11 sri http://scyp.net/wp-content/uploads/2015/01/18271-good-news-everyone-i-was-just-kidding-professor-farnsworth-wallpaper-1280x1280-1-750x410.jpg
21:11 CandyAngel Well.. i thought it was just truncated on my IRC client :P
21:11 woz joined #mojo
21:11 mst IRC nick length limit
21:12 jberger if only those damn irc admins would get their heads out of their ... oh hi mst :-P
21:12 Grinnz_ feature request: increase nick length limit by 1 for the sake of the commit bot
21:12 CandyAngel :P
21:12 sri +1
21:12 purl 1
21:12 pink_mist +1
21:12 purl 1
21:13 jberger well this is interesting
21:13 jberger purl: literal +1
21:13 purl jberger: +1 =is= <reply>-1
21:14 jberger ?
21:14 Grinnz_ someone actually added that? lol
21:14 jberger its not the right thing!
21:14 jberger -1
21:14 purl -1
21:14 jberger ARHG
21:14 Grinnz_ rofl
21:14 * jberger throws purl down a well
21:14 purl seven days
21:14 pink_mist that sounds ominous
21:14 CandyAngel SHeesh
21:14 CandyAngel So threat
21:15 sri botsnack
21:15 purl thanks sri :)
21:29 good_news_everyon joined #mojo
21:29 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/vtsXS
21:29 good_news_everyon mojo/master 90a86d9 Sebastian Riedel: link to documentation from newly generated apps
21:29 good_news_everyon left #mojo
21:30 pink_mist hah, nice :D
21:30 jberger sri++
21:30 pink_mist sri++
21:30 CandyAngel yay \o/
21:30 jberger karma sri
21:30 purl sri has karma of 539
21:30 sri i just want to avoid making the default apps feel too bloated
21:30 CandyAngel Oh
21:30 CandyAngel The ++ thing actually does something
21:31 jberger sri: right, but if it's there and no one knows it
21:31 jberger CandyAngel++ # let's get you started
21:31 CandyAngel uh oh
21:31 sri CandyAngel++
21:31 sri jberger++
21:32 * jberger looks around
21:32 CandyAngel I just thought it was like.. the way people showed they approved of something, didn't know it was being tracked
21:33 pink_mist it's why we keep purl around, surely :P
21:33 jberger It's both
21:33 pink_mist it can't be because of his wit
21:33 CandyAngel :P
21:33 CandyAngel Poor purl
21:33 purl *snif*
21:33 * CandyAngel pats it on the head
21:33 pink_mist botsnack
21:33 purl :)
21:33 pink_mist sorry purl :P
21:34 CandyAngel Also, I've already moved onto another Mojolicious project
21:35 CandyAngel Passthrough-type of deal
21:35 CandyAngel Mojo fetches urls, does extra processing
21:56 stryx` joined #mojo
22:08 good_news_everyon joined #mojo
22:08 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/vtsAR
22:08 good_news_everyon mojo/master c9da4c1 Sebastian Riedel: it can be characters or bytes
22:08 good_news_everyon left #mojo
22:12 woz joined #mojo
22:14 sri btw. there is one more thing
22:14 sri the hard message size limit
22:15 sri your validation might pass even though the hard message size limit has been reached
22:15 sri http://mojolicio.us/perldoc/Mojolicious/Guides/Tutorial#File-uploads
22:15 sri $c->req->is_limit_exceeded;
22:15 crux joined #mojo
22:16 sri whole thing is rather tricky
22:16 absolut_todd joined #mojo
22:18 mishanti1 Is there a way to disable keep-alive for hypnotoad?
22:19 sri http://mojolicio.us/perldoc/Mojo/Server/Hypnotoad#requests
22:19 mishanti1 Doh! Thanks. :) So setting that to 0 should do it?
22:20 mishanti1 Or 1?
22:20 purl i guess 1 is 1 there.
22:24 howitdo joined #mojo
22:29 lb i love when sri ignores me
22:31 sri lb: quack
22:31 sri (http://irclog.perlgeek.de/mojo/2015-06-25#i_10806334)
22:32 sri http://weknowmemes.com/wp-content/uploads/2011/12/look-at-this-duck.jpg
22:36 sri lb: i don't really take wishlist requests, i'm just available to discuss stuff
22:37 CandyAngel Uh.. I'm really confused
22:37 CandyAngel I have a Mojo::Collection with one item in it.. putting it into an array with 'each' works fine.. I get undef from $collection -> first :\
22:37 jberger lb: sorry it got lost in other discussion
22:38 jberger What feature are you interested in?
22:39 CandyAngel Ugh, okay, never mind, I got it to work now, though I don't get why it wasn't >.<
22:42 jberger CandyAngel: https://github.com/kraih/mojo/blob/master/lib/Mojo/Collection.pm#L31
22:42 jberger Pretty simple logic, so I'm not sure what went wrong for you
22:42 CandyAngel I had it like this..
22:43 jberger I looked because I was worried about some falsy behavior
22:43 CandyAngel my $coll = $tx -> res -> dom -> find ('h1') -> grep (sub {...});
22:43 CandyAngel Which returned a collection with one element
22:43 CandyAngel then when I did $coll -> first, it gave me nothing
22:43 CandyAngel But if I replace grep with first, it works :/
22:44 jberger And you are certain that your grep is working?
22:44 CandyAngel yeah
22:44 CandyAngel If I do like
22:44 CandyAngel my @h1 = $coll -> each;
22:44 CandyAngel I get an array with 1 DOM element in it (the h1 I am looking for)
22:45 jberger CandyAngel: can you put together a minimal example script and pastie it?
22:45 CandyAngel Sure, I'll try
22:46 sri perl -Mojo -E 'say x("<h1>Foo</h1>")->find(...)->...'
22:47 mishanti1 There might be something I am missing, but when hypnotoad reached inactivity_timeout for a request, should it not log that? The logs here says it returned 200, but the client recieves a connection close prematurely.
22:48 mishanti1 Discovered it because Varnish was throwing 503's on a particular request that took >20s to complete, but returned 200 OK.
22:48 mishanti1 Once I upped inactivity_timout in hypnotoad all was well.
22:54 sri i love when lb ignores me
22:56 PryMar56 joined #mojo
22:59 woz joined #mojo
23:20 CandyAngel Whoops, I made morbo freak out >.<
23:28 CandyAngel Errr.. what? I don't get this. morbo can't make requests against itself?
23:35 jberger CandyAngel: nope, single threaded engine
23:36 jberger You can if you do a non blocking request
23:40 CandyAngel So you couldn't, for example, have a route that provided a JSON output which could be used with AJAX and by Mojolicious at the same time?
23:42 CandyAngel Or would you like.. make a helper that provided the JSON and use the helper in Mojo and the route just render it?
23:43 sri don't make mojolicious perform requests against itself, that's wasted resources
23:43 jberger CandyAngel: that should just be a controller method that isn't itself an action
23:43 jberger then have two actions which both call that method to get its data
23:44 jberger or better even, model classes
23:46 CandyAngel What
23:46 CandyAngel Argh, it works in my test script..
23:48 CandyAngel And now it works in my project :|
23:48 CandyAngel yay for heisenbugs!
23:48 CandyAngel But the inverse of heisenbugs
23:51 CandyAngel I think it counts as the "when you go to show someone, it suddenly works" times -.-
23:51 CandyAngel Silly Mojolicious, I can make myself look like an idiot without your help, thank you very much! :P
23:53 ajr_ joined #mojo

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