Camelia, the Perl 6 bug

IRC log for #mojo, 2012-02-10

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

All times shown according to UTC.

Time Nick Message
00:00 smellycat How can I send a JSON response to the client while still rendering my html template. If I use render_json, then I can't render my template anymore. Any ideas?
00:01 vervain For two different request types right?
00:02 smellycat yes. I need to render my template because that has my Jquery and table stuff. But I also need to send JSON structures on request
00:03 smellycat currently I am stashing json and then rendering but that does not seem right....
00:03 vervain You could use any number of methods to distinguish a json request from an html request.
00:04 smellycat Could you elaborate please? :)
00:05 vervain test
00:06 smellycat I feel like my problem lies in the fact that I am trying to respond to JSON requests in the same method/route that I am rendering my template in. It seems like they don't have to be together at all.
00:06 vervain You could use a url param, a specific route/url path, an Accept header... and probably many more.
00:06 tempire indeed, are you sure that's what you want?  it's more common to get the rendered html and then poll for json with javascript
00:06 vervain THat's correct.
00:07 tempire often, complicated stuff can be solved just by breaking each request into one simple concern
00:07 tempire much more restful
00:07 tempire in a double entendre sort of way
00:08 hshong joined #mojo
00:08 smellycat Okay great that is what I needed to know. Thank you :)
00:09 smellycat Just wondering but has anybody here successfully implemented the Data Tables jQuery plugin to work with Mojolicious?
00:20 GabrielVieira joined #mojo
00:36 batman joined #mojo
00:44 jnap joined #mojo
00:54 mercutioviz joined #mojo
01:01 d4rkie joined #mojo
01:08 scott joined #mojo
01:09 bird joined #mojo
01:21 rhaen joined #mojo
01:46 jnap joined #mojo
01:58 xaka joined #mojo
02:14 jmhgtx left #mojo
02:17 vel joined #mojo
02:27 elb0w joined #mojo
03:09 D4RK-PH0ENiX joined #mojo
03:13 jnap joined #mojo
03:20 preflex_ joined #mojo
03:35 mire joined #mojo
03:45 phillipadsmith_ joined #mojo
04:25 d4rkie joined #mojo
05:41 AmeliePoulain joined #mojo
06:36 ki0 joined #mojo
06:38 mercutioviz joined #mojo
07:03 Vandal joined #mojo
07:30 rihegher joined #mojo
07:37 federated_life joined #mojo
07:47 federated_life left #mojo
08:20 sri good morning fellow lolcats
08:39 jamesw joined #mojo
08:51 * marcus haz new linkedin pals
08:52 * tempire is pals with an Internet Fachkraft
08:52 marcus phear
08:52 tempire sounds dangerous
08:53 * tempire thinks linked in is dumb
08:54 diegok morning :)
08:55 crab linkedin keeps sending me invitation reminders months after i deleted my account.
08:55 tempire myspace is listed as a skill
08:58 sri xD
09:00 * sri hates linkedin already
09:01 tempire it's a billion % better than it used to be
09:02 rihegher Hi everyone
09:02 purl Howdy, rihegher, you fantastic person you.
09:03 rihegher Hi a newbie in PERL programming
09:03 rihegher but I quite lite the mojolicious framework
09:03 preflex_ joined #mojo
09:04 rihegher as it remind me of node.js and it non blocking I/O concept
09:05 rihegher So i thought I could use it with mongoDB, but I only found sync module to access mongoDB with mojolicious.
09:05 rihegher Any idea of how I could access it asynchronously?
09:06 sri there are currently no usable non-blocking mongodb drivers for perl
09:06 sri i'm working on one, but it's still a few months away
09:06 rihegher good !
09:07 berov joined #mojo
09:07 rihegher thanks sri that's what I wanted to know :)
09:08 tempire rihegher: also, it's Perl (only the capital P)
09:08 rihegher is it yet on github with an experimental version?
09:08 tempire not on github yet.  it's hidden in a secret experimental cave.
09:08 rihegher ok tempire I'll paid attention :)
09:09 rihegher fair enough
09:09 rihegher it there anyway I could get to know once it's will be available?
09:10 tempire follow @kraih on the twitters
09:10 rihegher checked
09:10 tempire that's pretty much the hub right there.
09:11 tempire FOR ALL THE THINGS.
09:11 sri yea, i'll tweet *a lot* about it
09:11 crab "i quite lite the mojolicious framework" <- heh heh
09:11 tempire http://tweetboard.me/#!/kraih
09:11 tempire my klout is higher than yours
09:12 tempire \o/
09:12 tempire ^ that's me winning
09:13 rihegher anyway if you guys manage to provide lots of async modules I'm sure mojo could be a great success!
09:14 sri oh my, how do i get a leet klout rating like you?!
09:14 rihegher bye now
09:14 rihegher left #mojo
09:14 sri he vanished too fast
09:15 sri we don't have to provide those modules, we can reuse existing event loops!
09:15 tempire I wasn't quite sure what to make of that.
09:15 sri heh, yea
09:15 tempire but figured it wasn't worth responding to the unintended condescension.
09:18 tempire woah
09:19 tempire mojocast visits tripled on wednesday
09:19 sri \o/
09:19 sri what happened on wednesday?
09:19 tempire mojoexample?
09:19 tempire or was that yesterday
09:20 tempire yes. mojoexample.
09:20 sri ah
09:21 tempire I'd really like to see more quick screener-type things available.
09:21 sri tempire: you might want to remove the t-shirt link from mojocasts, i've discontinued it
09:21 tempire aw
09:21 tempire :(
09:21 tempire why?
09:22 sri lack of interest
09:22 tempire I'll make it a link to perl.org, I guess
09:22 sri i'll just make a t-shirt for special occasions from now on that will be limited editions
09:23 tempire hmm.  that's a neat idea.
09:23 crab screener-type things?
09:24 tempire short screen capture videos.  screenr.com
09:28 tempire memowe: you talked about doing some screencasts awhile ago.  you could start with some screenr captures.  maybe a short series on something simple.  you can mute it if you still don't want to do audio
09:29 * sri wonders how screenr works
09:29 tempire the java
09:29 purl If java had true garbage collection, most applications would delete themselves. or written by creeps or what's in the box or like a pointy stick in the eye or vogon poetry or Java is to JavaScript what Ham is to Hamster!
09:29 sri eww
09:29 tempire old school applet.
09:29 tempire but it works.  works well.
09:29 sri it had to be something evil
09:32 tempire I think it's great.  there's no screen capture anything that compares
09:32 tempire quick, easy.
09:34 cosmincx joined #mojo
09:41 daxim joined #mojo
09:42 batman joined #mojo
09:48 judofyr joined #mojo
10:20 random joined #mojo
10:29 noganex_ joined #mojo
11:28 judofyr joined #mojo
11:39 judofyr joined #mojo
11:44 briang joined #mojo
11:57 black joined #mojo
12:11 vervain I'm thinking of writing a toy that provides an API to 'fictional data'... like generatedata.com... json driven... am I reinventing a wheel?
12:17 crab make it rounder!
12:17 vervain Very much rounder :-)
12:52 d4rkie joined #mojo
13:09 sri https://github.com/kraih/mojo/pull/284
13:15 judofyr joined #mojo
13:16 Foxcool joined #mojo
13:30 vel joined #mojo
13:41 cosmincx joined #mojo
13:45 jnap joined #mojo
13:47 judofyr joined #mojo
13:50 tabbi joined #mojo
13:51 tabbi left #mojo
13:55 ccushing joined #mojo
14:19 amoore joined #mojo
14:43 melmothX joined #mojo
14:43 sri btw. from arstechinca "The United States has already signed ACTA. The Obama administration has argued that because ACTA is an "executive agreement" and does not require changing US law, it does not need to be submitted to the Senate for ratification."
14:44 paul sri: did Peter Bright write it?
14:44 paul because if so i don't trust a single word of it
14:45 sri tempire/marty: you're screwed
14:45 sri http://arstechnica.com/tech-policy/news/2012/02/on​-eve-of-protests-germany-backs-away-from-acta.ars
14:45 paul ah, he's written a couple good articles before
14:45 paul but i would still like to see a proper citation
14:45 paul that's not americansforfreedom.biz or whatever
14:57 sri i hate the combinator part of Mojo::DOM::CSS
14:58 paul sri: i did a bit more research, and frankly i'm running into a wall in that I have no damn clue about the process of signing and ratification in the US
14:59 paul as i understand it here, we've signed it but it will never pass ratification
14:59 paul and so we are somewhat safe against its influence
14:59 sri aren't you british?
15:00 paul yes
15:00 crab more ratification, more rats
15:00 sri then i have bad news for you http://www.iptegrity.com/index.php/d​igital-britain/741-uk-minister-says-​website-blocking-proposals-imminent
15:01 vervain Our executive branch is currently claiming that it doesn't need ratification... but I think that's just an attempt to be lazy... without ratification it doesn't have teeth... So I think it's a storm in a teacup.
15:01 paul sri: there was already some pretty serious opposition
15:01 paul so we'll see how this goes
15:01 sri i'm glad the pirate party is getting stronger in germany
15:02 sri i'll vote for them again :)
15:02 crab if you have a storm in a teacup, what patterns do you see in the tea leaves afterwards?
15:02 paul i just wish people weren't such soft liberals over here
15:02 crab sri: 14% or something, i heard. a really rather non-trivial number.
15:02 paul many people voted for liberal democrats
15:02 paul but then immediately switched support
15:02 paul they act as if liberal democrats have control of the government
15:02 paul but they're a minority partner in a coalition, and despite that have achieved a large amount of their manifesto
15:02 vervain The British Gov has be spouting on about internet regulation since the early 90s... and they've managed to actually _do_ very very little... so let them continue spouting all they want.
15:03 paul vervain: well
15:03 paul vervain: BT now block newzbin based on a court order, which is extremely dubious
15:03 paul and i'm very concerned that they're using IWF justification
15:03 vervain I understand... but that's _nothing_ compared to what they actually want... and time will tell.
15:04 crab vervain: actually, britain is completely firewalled off now. all the british people you think you're speaking to on the internet are in call centres in .in and .ph
15:04 paul haha
15:04 vervain :-D
15:04 paul i am actually an indian doing an amazing impression of a cynical bitter northener
15:04 vervain Oh shit... how to they fake up my friends video streams so well? :-)
15:04 sri :D
15:05 paul vervain: they've had that technology since 911!!!
15:05 paul everyone knows because some guy could photoshop a picture if he was given a week
15:05 paul that means they can live photoshop images perfectly now!
15:05 paul !!!
15:06 vervain paul: what kind of northern... Leeds was my stomping ground with a few year stint in Macclesfield.
15:06 paul how many more exclamation marks will it take to convince you?!
15:06 paul vervain: manc i'm afraid
15:18 crab you think that's special, you should see what they're doing for the people IN britain.
15:19 paul sssh we're not supposed to say!
15:26 sri hmm, think i'll rewrite how combinators work
15:27 sri that code is garbage
15:27 sri cleaner implemntation could theoretically even be pluggable
15:28 paul sri: before i forget i wanted to ask
15:28 paul i notice that Mojo::Session is explicitly hooked in
15:28 paul but i really don't like the fact that i have to set default_timeout rather than individual timeouts, and that i've no way to extend it easily
15:29 paul would it be plausible to add in a session hook? so i can trigger off things like a redis update when i write cookie headers?
15:29 paul cause at the moment the after_dispatch or whichever hook gets triggered a bunch of times per request
15:29 sri pretty sure you're misunderstanding something
15:29 paul i'm away from the code and at work at the moment, but i just remembered i meant to ask here about the recommended way
15:29 paul quite possibly
15:30 sri you can change expiration on the fly
15:30 paul i did that, but it was reset to the default_timeout next request
15:30 sri in fact, that's how force destroying a session works
15:30 paul it looked like i had to specify the timeout in every place the cookie could be sent to
15:30 sri that's how cookies work
15:30 sri it's a fresh session *every request*
15:31 sri just data is inherited
15:31 paul right, i was hoping that the timeout would be part of the inherited data
15:31 paul i guess
15:31 paul i don't really mind because i can set default_timeout and that works well
15:31 paul but the redis update question is more severe, cause i don't know of the correct way to handle that
15:33 crab what is the question exactly?
15:33 paul when using sessions, what's the 'correct' way to hook the writing of a session, in order to update a redis entry for 'time online' or similar
15:34 sri replace app->sessions with yout own implementation
15:34 paul fair enough
15:34 paul good answer :)
15:36 sri it's actually arguable if deleting the expires value from the session could be considered a bug
15:37 sri i actually tend towards it
15:38 paul i'm confused
15:38 paul but that's easy :D
15:38 sri maybe i'll make it work the way you think it should work later, gonna think about it some more
15:39 paul ideally it shouldn't cost much to package it into the session, but then you could have people accidentally override it or whatever
15:39 paul i don't mind either way frankly
15:39 paul it just didn't seem to be noted anywhere, so i found it a little unusual
15:39 crab sri: i've thought about that too
15:39 sri crab: it's a bug isn't it?
15:41 crab there are just too many plausible requirements with this stuff to make a fits-all decision. if we don't delete expiry, how are we going to keep advancing the expiry time so that an hour of inactivity makes the session expire?
15:42 crab on balance, i think advancing it automatically serves more people than not doing so. but it would be nice to have a mechanism to do more complex things.
15:42 random is there a hook for session init already?
15:43 sri crab: thats not the fix i mean
15:43 sri or wait
15:43 sri crab: you're right :)
15:44 sri i didn't consider that expires is an epoch value
15:45 crab what we want is something like "if the user set an expiry explicitly, honour it, or manage it by ourselves so that activity postpones expiration", and i considered that too much machinery for a not-very-compelling need.
15:45 vervain joined #mojo
15:45 * sri agrees
15:46 crab random: no.
15:54 paul whatever you guys decide is fine with me
15:54 paul i have no preference either way, intuitively i would have expected it to keep my explicit set
15:55 paul but a small note in the documentation that it is for this request only would be sufficient
16:00 crab paul: can you suggest where?
16:00 mercutioviz joined #mojo
16:01 paul crab: sorry i was a little distracted, there's a guide i believe that includes sessions
16:01 paul i'll check it out when i'm at home
16:02 paul i'm desparately trying to provision machines so i can get out of here at 5pm haha
16:08 dlyke joined #mojo
16:25 random left #mojo
16:31 kaare joined #mojo
16:31 xaka joined #mojo
16:38 briang joined #mojo
16:39 ccushing joined #mojo
16:52 chorny joined #mojo
17:12 mire joined #mojo
17:33 mercutioviz joined #mojo
17:55 crab what's the easiest way to get a list of depths that <p>s are nested at using mojo::dom?
18:08 sri not sure there's an easy way
18:47 ki0 joined #mojo
18:50 crab some recursive ->map-ery was good enough.
19:00 vel joined #mojo
19:02 jnap_ joined #mojo
19:02 jnap joined #mojo
19:14 mire joined #mojo
19:15 mercutioviz joined #mojo
19:23 melmothX joined #mojo
19:54 mire joined #mojo
19:57 jnap_ joined #mojo
19:57 jnap joined #mojo
19:57 batman joined #mojo
20:09 perlite joined #mojo
20:16 mercutioviz joined #mojo
20:21 chansen joined #mojo
20:21 sri damn, the combinator code looks so much nicer after the rewrite
20:31 GitHub156 joined #mojo
20:31 GitHub156 [mojo] kraih pushed 1 new commit to master: http://git.io/moePmw
20:31 GitHub156 [mojo/master] rewrote combinator system in Mojo::DOM::CSS (closes #285) - Sebastian Riedel
20:31 GitHub156 left #mojo
20:31 sri it's ridiculous how much better the code is
20:33 sri pretty much everything could be pluggable now… combinators, attributes, pseudoclasses
20:47 DaTa tempire++ i love your Full app/Lite app example :)
20:48 chansen joined #mojo
20:49 DaTa i have a question on it: http://data.rbfh.de/p/2012-02-105z3ORpun-schema-1 tempire is doing the latter, i'm currently doing the former, is there any disadvantage in my solution?
21:01 sri yes, helper call initializes a new handle every time
21:03 sri schema attribute gets lazy initilized and preserves it
21:03 reyjrar_ if I want to route a url to a static folder, is there an easy way to do that?
21:04 reyjrar_ like /images/ -> /var/www/icons/
21:04 DaTa sri: uh, ok, thanks :)
21:07 reyjrar_ Mojolicious::Plugin::Alias
21:07 reyjrar_ :)
21:13 chansen joined #mojo
21:14 reyjrar_ or not..
21:17 batman joined #mojo
21:29 Foxcool joined #mojo
21:43 tempire I don't think mojolicious supports directory indexing by default
21:43 tempire ^ reyjrar_
21:44 reyjrar_ I need another Static Directory
21:44 reyjrar_ outside of the application directory
21:46 tempire you would have to specify it per-file
21:46 tempire http://mojolicio.us/perldoc/Mojo​licious/Controller#render_static
21:47 vervain For some reason I just got tickled at the idea of a Controller with a render_static method... it's been a long week.
21:49 reyjrar_ does routing to a cb pass the arguments to the callback?
22:06 reyjrar_ http://pastebin.com/rG9FkYmp
22:06 reyjrar_ did not work
22:16 xaka joined #mojo
22:34 reyjrar_ hard to believe this hasn't been solved
22:39 tempire it's a dangerous thing to do within a web app.
22:44 reyjrar_ yeah, but it also allows me to segregate presentation from implementation
22:45 tempire it was a consideration. but decided against because of its likely abuse.
22:45 reyjrar_ I don't disagree with the default..
22:46 reyjrar_ but it should be possibe to hang myself
22:46 tempire you can.  you can make the functionality and make a plugin.
22:46 tempire it's just that we don't provide a rope.
22:46 tempire :)
22:46 reyjrar_ I'm getting stuck with render looking for a template
22:46 reyjrar_ http://pastebin.com/rG9FkYmp
22:47 reyjrar_ is that even close to what I should be doing?
22:47 reyjrar_ or scrap that and start over?
22:48 tempire you're trying to manipulate mojolicious to do what you want, but I doubt that's going to work for you.  you'll have to construct such a thing on your own using other modules/direct directory manipulation.
22:48 tempire in essence, bring/build your own rope
22:50 tempire that is, if I understand what  you're trying to do.
22:50 reyjrar_ should I be using the route() mechanism?
22:50 reyjrar_ it eats my file extensions
22:58 alnewkirk joined #mojo
23:21 Kulag joined #mojo
23:35 batman joined #mojo

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