Camelia, the Perl 6 bug

IRC log for #mojo, 2012-06-03

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

All times shown according to UTC.

Time Nick Message
00:55 andy82 hey I'm finding it hard to troubleshoot this error, it's really not giving enough information http://www.gitpaste.com/paste/708/
00:55 andy82 Global symbol "$categories" requires explicit package name at template "ph.html.ep" from DATA section line 11, near "  <tr>".
00:56 andy82 if there's something wrong with my categories then I can't see where
00:56 GeorgeJetson joined #mojo
00:57 balazs joined #mojo
01:02 andy82 is there any way to echo that stuff out so at least I can read what's going on there?
01:06 tempire andy82: try executing a $self->render_later; before the ua->get
01:07 andy82 haha thanks tempire
01:07 andy82 I'm not sure I saw that docs on that one
01:08 sri we're really making that stuff too easy... no perl beginner should be able to do non-blocking http requests so early on :S
01:08 tempire pshaw.  that's a sign you're doing it right.
01:08 balazs hi guys. has anyone used Basic Auth with a mojolicious server ?
01:08 tempire balazs: yes
01:09 sri i'm serious ;p
01:09 balazs I guess I'm asking for pointers :)
01:09 tempire balazs: search.cpan.org will solve all your woes
01:10 tempire sri: so am I.  shouldn't that be the goal?  to make it accessible?
01:10 sri tempire: i'm not sure it's a good idea to make things accessible that are so hard that i can't actually explain them properly yet
01:11 tempire I've never thought it was all that complicated.  I think it only becomes hard when the interface is complicated.
01:12 sri you can explain event loops?
01:12 tempire the thingy keeps looping over and over again until it finds something it supposed to do.
01:13 sri the thought of having to explain to beginners how to debug event watchers makes me cringe
01:14 sri Mojo::IOLoop->start inside a Mojolicious app is still a FAQ on the mailing list ;)
01:15 sri i really wish there was some basic introduction to event loops
01:16 sri you know... like a mojocast :D
01:18 sri there's a lot of small topics, preventing memory leaks with weaken, dealing with useless stacktraces, action at a distance in general...
01:20 sri implications on scalability, if your apps don't block you have to do manual throttling
01:29 andy82 http://www.gitpaste.com/paste/709/  - None of these routes matched your GET request for /api/v1/category/57/items/xml/, maybe you need to add a new one?
01:29 andy82 - Trying to get the link from the category to go to /ph/category/way*
01:30 andy82 though it seems to be mashing them all together
01:31 andy82 I've also tried to use a regex to find /category\/\d+ but that does not seem to work either
01:46 balazs I'm looking at Mojolicious::Plugin::BasicAuth, but not sure how exactly to use it
01:46 balazs am I to add a check to all routes that should be under basic auth ?
01:47 mikegrb one sec
01:50 mikegrb https://gist.github.com/2860934
01:50 mikegrb there's a chunk from something at #work
01:50 mikegrb uses apache style htpasswd with sha hashing
01:50 mikegrb applies auth to all routes
01:51 balazs oh ok
01:54 mikegrb that uses  File::Spec, File::Slurp, Digest::SHA1 'sha1_base64', and File::Basename 'dirname'
01:57 balazs and this goes in the "main file", that I run with morbo for example ?
01:58 mikegrb my example goes in the lib/MyApp.pm
01:58 mikegrb with the htpasswd in the apps root directory
02:00 balazs cool tx
02:07 andy82 sigh it was so simple - I got it. On to the next task
02:34 GitHub97 joined #mojo
02:34 GitHub97 [mojo] kraih pushed 1 new commit to master: http://git.io/T4mhHQ
02:34 GitHub97 [mojo/master] small optimizations - Sebastian Riedel
02:34 GitHub97 left #mojo
02:42 andy82 ok this is quite frustrating - there's no error at all here: http://www.gitpaste.com/paste/710/ - the page just times out, nothing in the log, in eclipse, or on the browser
02:43 andy82 it should be traversing something like this - but does nothing: http://api.powerhousemuseum.com/api/v1/​item/9720/xml/?api_key=8fbb61ea34d6f5d
02:44 andy82 oh sorry the error is Error 324 (net::ERR_EMPTY_RESPONSE): The server closed the connection without sending any data.
02:44 andy82 in the browser only
02:55 andy82 is there any way I can just get some echoing here?
02:58 tempire andy82: your question requires a lot of investment in reading through your document. maybe try recreating the problem with one route and a couple lines of code, you'll probably get better responses.
02:59 andy82 tempire: right I've tried to simplify the call as much as possible on my side, I'll see if I can make it simpler -
02:59 andy82 I remember I can get some output using dumper - what was the syntax for that?
03:02 sri tempire: the action at a distance aspect of non-blocking requests will make that a lot of fun to debug ;)
03:02 tempire we just need better tools is all
03:02 sri like?
03:02 tempire when I know, I'll build them.
03:02 sri ;p
03:03 tempire andy82: http://mojolicio.us/perldoc/Moj​olicious/Plugin/DefaultHelpers
03:03 sri there are no better tools, when you go non-blocking you leave the safety net of the framework
03:05 sri no pretty debug screens, just some events in the distance
03:05 andy82 tempire: thanks I'll play with that for a bit
03:06 andy82 I wouldn't really need the pretty screens as much as getting something in the logs
03:06 andy82 it doesn't sound easy considering what I"m trying to do though
03:59 andy82 ok I think I've found it - it's happening because I'm using the find commend - and it's finding 5 tags with the same name of item: http://www.gitpaste.com/paste/711/
03:59 andy82 I probably shouldn't use find here
04:00 andy82 unless I can find first
04:00 andy82 it's looking at this page for example: http://api.powerhousemuseum.com/api/v1/​item/6651/xml/?api_key=8fbb61ea34d6f5d
04:08 andy82 there are parent items, and then children items
04:36 ryozi joined #mojo
05:01 memowe_ joined #mojo
05:04 y0j_- joined #mojo
05:05 xxtjaxx__ joined #mojo
05:05 spacebat_ joined #mojo
05:05 angelixd_ joined #mojo
05:06 phips_ joined #mojo
05:07 estrai_ joined #mojo
05:07 BlueT__ joined #mojo
05:07 Psyche^ joined #mojo
05:07 gizzlon_ joined #mojo
05:08 rakshasa joined #mojo
05:08 janus` joined #mojo
05:11 tinx joined #mojo
05:11 maluco_ joined #mojo
05:12 mike__ joined #mojo
05:13 xantus[] joined #mojo
05:14 ruz_ joined #mojo
05:18 tardisx` joined #mojo
05:29 mandreacchio joined #mojo
05:30 rwstauner joined #mojo
05:30 xaka1 joined #mojo
05:30 mattastrophe joined #mojo
05:30 JasonCrome joined #mojo
05:30 nic joined #mojo
05:30 mattp_ joined #mojo
05:30 chansen joined #mojo
05:30 phillipadsmith joined #mojo
05:30 gabiruh joined #mojo
05:30 al joined #mojo
05:33 ilbot2 joined #mojo
05:33 Topic for #mojo is now Mojolicious real-time web framework  🌊🌊🌊 http://mojolicio.us 🌊🌊🌊 http://irclog.perlgeek.de/mojo/today
05:33 keedi joined #mojo
05:33 preflex joined #mojo
05:33 geira joined #mojo
05:34 atrodo joined #mojo
05:36 marcus joined #mojo
05:37 BinGOs joined #mojo
05:37 omega joined #mojo
05:37 maluco joined #mojo
05:37 ryanc joined #mojo
05:37 memowe joined #mojo
05:37 ruz joined #mojo
05:37 whee joined #mojo
05:37 burk joined #mojo
05:37 angelixd joined #mojo
05:37 alnewkirk joined #mojo
05:37 tinx joined #mojo
05:38 mike_ joined #mojo
05:40 jmmills joined #mojo
05:40 charsbar__ joined #mojo
05:40 tempire joined #mojo
05:40 perlite joined #mojo
05:40 estrai joined #mojo
05:40 avenj joined #mojo
05:40 xxtjaxx joined #mojo
05:40 MisterHatt joined #mojo
05:40 augensalat joined #mojo
05:40 y0j_ joined #mojo
05:40 jzawodn joined #mojo
05:40 ashleydev joined #mojo
05:40 dmn001 joined #mojo
05:40 vervain joined #mojo
05:40 hide joined #mojo
05:40 geira joined #mojo
05:40 atrodo joined #mojo
05:40 whee joined #mojo
05:40 mike_ joined #mojo
05:40 tinx joined #mojo
05:40 angelixd joined #mojo
05:40 burk joined #mojo
05:40 ruz joined #mojo
05:40 ryanc joined #mojo
05:40 omega joined #mojo
05:40 marcus joined #mojo
05:40 d4rkie joined #mojo
05:40 zipkid joined #mojo
05:40 trone joined #mojo
05:40 smpb joined #mojo
05:40 gizzlon joined #mojo
05:40 phips joined #mojo
05:40 BlueT_ joined #mojo
05:40 rhaen joined #mojo
05:40 stephan48 joined #mojo
05:40 DaTa joined #mojo
05:40 kthakore joined #mojo
05:40 zivester joined #mojo
05:40 migo joined #mojo
05:40 kenjiskywalker joined #mojo
05:40 cosimo joined #mojo
05:40 al joined #mojo
05:40 gabiruh joined #mojo
05:40 phillipadsmith joined #mojo
05:40 chansen joined #mojo
05:40 mattp_ joined #mojo
05:40 nic joined #mojo
05:40 JasonCrome joined #mojo
05:40 mattastrophe joined #mojo
05:40 xaka1 joined #mojo
05:40 rwstauner joined #mojo
05:40 ask joined #mojo
05:40 [R] joined #mojo
05:40 diegok joined #mojo
05:42 xxtjaxx joined #mojo
05:44 diegok joined #mojo
05:44 [R] joined #mojo
05:44 ask joined #mojo
05:44 cosimo joined #mojo
05:44 kenjiskywalker joined #mojo
05:44 migo joined #mojo
05:44 zivester joined #mojo
05:44 kthakore joined #mojo
05:44 DaTa joined #mojo
05:44 stephan48 joined #mojo
05:44 rhaen joined #mojo
05:44 BlueT_ joined #mojo
05:44 phips joined #mojo
05:44 gizzlon joined #mojo
05:44 smpb joined #mojo
05:44 trone joined #mojo
05:44 zipkid joined #mojo
05:44 d4rkie joined #mojo
05:44 marcus joined #mojo
05:44 omega joined #mojo
05:44 ryanc joined #mojo
05:44 ruz joined #mojo
05:44 burk joined #mojo
05:44 angelixd joined #mojo
05:44 tinx joined #mojo
05:44 mandreacchio joined #mojo
05:44 crab joined #mojo
05:44 jmmills joined #mojo
05:44 charsbar__ joined #mojo
05:44 tempire joined #mojo
05:44 perlite joined #mojo
05:44 estrai joined #mojo
05:44 avenj joined #mojo
05:44 MisterHatt joined #mojo
05:44 augensalat joined #mojo
05:44 y0j_ joined #mojo
05:44 jzawodn joined #mojo
05:44 ashleydev joined #mojo
05:44 dmn001 joined #mojo
05:44 vervain joined #mojo
05:44 hide joined #mojo
05:44 geira joined #mojo
05:44 atrodo joined #mojo
05:44 whee joined #mojo
05:44 mike_ joined #mojo
05:44 mikegrb joined #mojo
05:44 edenc joined #mojo
05:44 Kovensky joined #mojo
05:44 brambles joined #mojo
05:44 tholen42 joined #mojo
05:44 Gedge joined #mojo
05:44 hernan joined #mojo
05:44 bobkare joined #mojo
05:44 tardisx joined #mojo
05:44 yko joined #mojo
05:44 ryozi joined #mojo
05:44 predgtr1 joined #mojo
05:44 bzero joined #mojo
05:44 kmx joined #mojo
05:44 BinGOs joined #mojo
05:44 alnewkirk joined #mojo
05:44 al joined #mojo
05:44 gabiruh joined #mojo
05:44 phillipadsmith joined #mojo
05:44 chansen joined #mojo
05:44 mattp_ joined #mojo
05:44 nic joined #mojo
05:44 JasonCrome joined #mojo
05:44 mattastrophe joined #mojo
05:44 xaka1 joined #mojo
05:44 rwstauner joined #mojo
05:48 rwstauner joined #mojo
05:50 jmmills joined #mojo
05:50 charsbar__ joined #mojo
05:50 tempire joined #mojo
05:50 perlite joined #mojo
05:50 estrai joined #mojo
05:50 avenj joined #mojo
05:50 MisterHatt joined #mojo
05:50 augensalat joined #mojo
05:50 y0j_ joined #mojo
05:50 jzawodn joined #mojo
05:50 ashleydev joined #mojo
05:50 dmn001 joined #mojo
05:50 vervain joined #mojo
05:50 hide joined #mojo
05:50 geira joined #mojo
05:50 atrodo joined #mojo
05:50 whee joined #mojo
05:50 mike_ joined #mojo
05:55 gabiruh joined #mojo
05:58 crab joined #mojo
05:58 mandreacchio joined #mojo
05:58 tinx joined #mojo
05:58 angelixd joined #mojo
05:58 burk joined #mojo
05:58 ruz joined #mojo
05:58 ryanc joined #mojo
05:58 omega joined #mojo
05:58 marcus joined #mojo
05:58 d4rkie joined #mojo
05:58 zipkid joined #mojo
05:58 trone joined #mojo
05:58 smpb joined #mojo
05:58 gizzlon joined #mojo
05:58 phips joined #mojo
05:58 BlueT_ joined #mojo
05:58 rhaen joined #mojo
05:58 stephan48 joined #mojo
05:58 DaTa joined #mojo
05:58 kthakore joined #mojo
05:58 zivester joined #mojo
05:58 migo joined #mojo
05:58 kenjiskywalker joined #mojo
05:58 cosimo joined #mojo
05:58 ask joined #mojo
05:58 [R] joined #mojo
05:58 diegok joined #mojo
05:58 mikegrb joined #mojo
05:58 edenc joined #mojo
05:58 Kovensky joined #mojo
05:58 brambles joined #mojo
05:58 tholen42 joined #mojo
05:58 Gedge joined #mojo
05:58 hernan joined #mojo
05:58 bobkare joined #mojo
05:58 tardisx joined #mojo
05:58 yko joined #mojo
05:58 ryozi joined #mojo
05:58 predgtr1 joined #mojo
05:58 bzero joined #mojo
05:58 kmx joined #mojo
05:58 BinGOs joined #mojo
05:58 alnewkirk joined #mojo
05:58 garu joined #mojo
05:59 mandreacchio hey how do I get first in the useragent?
05:59 mandreacchio ?
05:59 marty joined #mojo
05:59 Liam`` joined #mojo
05:59 xaka1 joined #mojo
05:59 mattastrophe joined #mojo
05:59 JasonCrome joined #mojo
05:59 nic joined #mojo
05:59 mattp_ joined #mojo
05:59 chansen joined #mojo
05:59 phillipadsmith joined #mojo
05:59 al joined #mojo
05:59 alnewkirk joined #mojo
05:59 mikegrb joined #mojo
06:00 rhaen joined #mojo
06:00 Kovensky joined #mojo
06:00 tinx joined #mojo
06:00 diegok joined #mojo
06:00 bobkare joined #mojo
06:00 marcus joined #mojo
06:02 DaTa joined #mojo
06:04 gizzlon joined #mojo
06:07 rafl joined #mojo
06:07 burk joined #mojo
06:07 BlueT_ joined #mojo
06:07 trone joined #mojo
06:07 tardisx joined #mojo
06:07 predgtr1 joined #mojo
06:07 ruz joined #mojo
06:07 zipkid joined #mojo
06:07 kmx joined #mojo
06:07 hernan joined #mojo
06:07 mandreacchio joined #mojo
06:07 [R] joined #mojo
06:07 zivester joined #mojo
06:07 tholen42 joined #mojo
06:07 migo joined #mojo
06:07 cosimo joined #mojo
06:07 kenjiskywalker joined #mojo
06:07 Gedge joined #mojo
06:07 brambles joined #mojo
06:07 phips joined #mojo
06:07 omega joined #mojo
06:07 angelixd joined #mojo
06:07 ryanc joined #mojo
06:07 kthakore joined #mojo
06:07 al joined #mojo
06:07 phillipadsmith joined #mojo
06:07 chansen joined #mojo
06:07 mattp_ joined #mojo
06:07 nic joined #mojo
06:07 JasonCrome joined #mojo
06:07 mattastrophe joined #mojo
06:07 xaka1 joined #mojo
06:07 Liam`` joined #mojo
06:07 marty joined #mojo
06:07 bzero joined #mojo
06:07 ask joined #mojo
06:07 ryozi joined #mojo
06:07 yko joined #mojo
06:07 stephan48 joined #mojo
06:07 smpb joined #mojo
06:07 edenc joined #mojo
06:11 Leandr joined #mojo
06:15 garu joined #mojo
06:18 d4rkie joined #mojo
06:25 BinGOs joined #mojo
06:43 Vandal joined #mojo
06:51 rem_lex| joined #mojo
06:54 crab joined #mojo
07:09 ashleydev joined #mojo
07:33 ashleydev joined #mojo
07:38 inokenty joined #mojo
07:45 Polarn joined #mojo
07:46 Leandr joined #mojo
08:22 mandreacchio Hey guys - I've hit another wall - I've made a simple app so that I might be able to get some help with it - it should run by its self on the rest URL and be able to show the problems that I've been having
08:22 mandreacchio the first thing - this app does not work against that $url - it works for most of them but not this one
08:22 mandreacchio http://pastebin.com/Zk7q7Zdk
08:22 mandreacchio something is going on in that map and I'm not sure
08:25 mandreacchio if anyone does get a look at it, the next problem is that I should actually be displaying all the fields that aren't "None" - I don't know how to go through the full .xml tree in a simple iterative way
08:31 mandreacchio humm seems I've managed to solve the first error
08:32 i_am_batman joined #mojo
08:32 mandreacchio http://pastebin.com/HzfPjgSF
08:33 mandreacchio though I'm still not able to iterate around the full tree
08:33 mandreacchio http://api.powerhousemuseum.com/api/v1​/item/970/xml/?api_key=8fbb61ea34d6f5d
08:33 mandreacchio or display all the remote multimedia
08:35 mandreacchio do I need another sub routine in that subroutine?
08:40 mandreacchio like I don't see how I could get it to render two different arrays
08:42 plu joined #mojo
08:42 i_am_batman joined #mojo
08:58 mandreacchio ok I've gotten this far now - it doesn't work
08:58 mandreacchio http://pastebin.com/bsTe77u2
08:58 mandreacchio trying render two arrays in the page there
09:00 mandreacchio this is a simple an app that I can make - well I guess I can pull out all the if's there and make the map smaller if it makes it any easier to help me out
09:08 inokenty >_<
09:08 inokenty Hi
09:08 inokenty Try this http://pastebin.com/yUtLz8R4
09:09 mandreacchio inokenty: hey how's it going?
09:09 mandreacchio haha I guess you're not too impressed with the way I did that
09:11 mandreacchio woohoo it werks thanks inokenty
09:11 inokenty Oops, one mistake
09:11 inokenty <dd><%= $name->text %></dd> instead of <dd><%= $name %></dd>
09:12 Akron joined #mojo
09:14 mandreacchio inokenty: I see so you just stick more into the stash and keep going from there
09:14 mandreacchio the biggest pain I've been having is how to work around the full tree there and display all the fields
09:14 mandreacchio seems fairly impossible the way I'm doing it
09:18 Akron What do you mean with "around the full tree"?
09:19 mandreacchio I guess the DOM
09:19 mandreacchio everything that is a field in this page: http://api.powerhousemuseum.com/api/v1​/item/970/xml/?api_key=8fbb61ea34d6f5d
09:20 mandreacchio I suppose for simplicity's sake, all text that is not "None" Akron
09:21 dbr joined #mojo
09:22 dbr joined #mojo
09:22 Akron And how do you want to display the different levels?
09:25 mandreacchio don't care
09:25 mandreacchio Akron: just want them to show whatever text is there
09:27 Akron So something like: status: 200\n names_item: Specimen\n names_item: Wool Specimens?
09:27 Akron (Well - only the items, okay ...)
09:28 mandreacchio Akron: all text under the first 'item'
09:28 mandreacchio that is not 'None'
09:29 Akron I see.
09:39 i_am_batman marcus: how do you link to "get_token <$provider>, <%args>" ?
09:39 i_am_batman in the POD
09:48 Akron mandreacchio: In that case, get the complete item tree and create a tree walker based on Mojo::DOM. Either in the template or in your app.
09:55 mandreacchio Akron: cool I'll give it a go - will report back if there's tears
09:57 Akron ;)
09:59 Akron mandreacchio: If you are aware of XSLT - this would be a more natural way in doing this.
10:34 alexeiras joined #mojo
10:36 mandreacchio would something like XML::Twig do it?
10:37 ki0 joined #mojo
10:43 i_am_batman marcus: thanks for pinboard :)
10:43 i_am_batman got my shortcuts set up and everything now... life is good
11:28 sri joined #mojo
11:32 tempire sri: do you still have that screenshot of your latest colorscheme?
11:32 * sri shrugs
11:32 sri should be n my twitter image stream
11:46 Akron joined #mojo
11:49 Akron mandreacchio: Only if you think, SAX proceesing is in your case easier than DOM processing.
11:50 mandreacchio Akron: DOM has been by far easier up till now
11:58 mandreacchio what module would best perform that Akron ?
11:59 i_am_batman is this correct: i can do as many non-blocking requests to morbo as i like, but only one blocking request?
12:02 sri wish somebody would send me pull requests like this :) https://github.com/alekstorm/tornado/commi​t/d29d3669a37c8a69635c4ef05851616b0bbfaf76
12:05 i_am_batman nice commit message :)
12:07 sri yea
12:08 Akron mandreacchio: Mojo::DOM is good for small documents - so you can stay with this. Remember: You can always get the tree structure out of your dom-object by using "->tree", which can be quite useful for a tree walker.
12:09 sri better use ->children recursively for a tree walker
12:15 Akron sri: But mandreacchio needs the tag names - is there an attribute for it in Mojo::DOM?
12:15 sri type
12:16 Akron Ah ... just thought this would return either tag or text etc. ... okay. Yeah - in that case ->children is nicer.
12:46 GitHub145 joined #mojo
12:46 GitHub145 [mojo] kraih pushed 1 new commit to master: http://git.io/ASbBDw
12:46 GitHub145 [mojo/master] better connection information tests - Sebastian Riedel
12:46 GitHub145 left #mojo
12:53 GitHub157 joined #mojo
12:53 GitHub157 [mojo] kraih pushed 1 new commit to master: http://git.io/Yh3NDQ
12:53 GitHub157 [mojo/master] use non-routable addresses for tests - Sebastian Riedel
12:53 GitHub157 left #mojo
13:08 Psyche^ joined #mojo
13:15 GitHub164 joined #mojo
13:15 GitHub164 [mojo] kraih pushed 1 new commit to master: http://git.io/TlXfVw
13:15 GitHub164 [mojo/master] test tweaks - Sebastian Riedel
13:15 GitHub164 left #mojo
13:58 Foxcool joined #mojo
13:58 gryphon joined #mojo
14:33 ki0 joined #mojo
14:38 hide joined #mojo
15:20 andrefs joined #mojo
15:31 balazs joined #mojo
15:41 sri marcus: you should reopen issues if you want to discuss them further
15:41 marcus sri: I just responded by email.
15:42 i_am_batman joined #mojo
15:44 sri i see, reopened it for you ;p
15:45 marcus sri: it was mostly meant as information for the poster of the issue, but whatever :)
15:45 marcus I've seen loads of similiar errors on various modules on my freebsd jails.
15:46 sri freebsd jails make peerhost a different value than sockhost?
15:56 marcus sri: doesn't seem to on my jail
15:57 marcus sri: provided this is right https://gist.github.com/2863976
15:57 marcus could be that the situation is better on freebsd 8 than it was on freebsd 7 tho.
15:58 sri nono, i mean from the other end
15:58 sri sockhost in the client, peerhost in the server
16:04 marcus sri: probably works, since all tests for Mojolicious passes on there
16:05 sri ok, those wouldn't pass if it was the case
16:05 balazs why is it that manually telneting to the port where the server runs and typing "GET /foo HTTP1.1" doesn't seem to work ? My request cannot be routed then.
16:05 balazs but it works from a browser
16:06 sri perl -Mojo -E 'a("/" => {inline => q{<%= $self->tx->remote_address %>}}); my $tx = app->ua->get("/"); say $tx->res->body, app->ua->ioloop->stream($tx->c​onnection)->handle->sockhost'
16:06 sri here's also a oneliner test case :)
16:08 balazs doesn't even work if I manually type in a HTTP1.0 request.
16:20 crab HTTP1.1? that's not valid syntax
16:21 balazs I type: "GET / HTTP/1.0", then an empty line
16:22 mandreacchio hey i've got to connect to a wsdl SOAP service and send it some stuff - what module is good for that?
16:23 balazs hold on; it works now
16:23 balazs wtf... ?
16:25 mandreacchio forget it - soap::lite
16:25 crab when it didn't work, you were typing it wrong. :-)
16:27 i_am_batman joined #mojo
16:27 balazs crab: what happened was that I was using the /agent example from the docs, which does a $self->render(text => $self->req->headers->user_agent);
16:27 balazs so from the command line there was no user agent
16:28 balazs HTTP is not designed to return empty documents
16:29 balazs kind of a nasty error/bug if you ask me
16:31 i_am_batman 201 Empty
16:32 crab balazs: aha
16:33 crab it's not that you can't return an empty document, it's that ->render(text => undef) doesn't give you an empty document, it's a no-op
16:33 crab unfortunate, but what's the sensible behaviour in that case?
16:34 i_am_batman not even if you set the http status code?
16:38 i_am_batman $_[0]->res->code(204);$_[0]->render_text("")
16:38 balazs I'm not saying this is something that needs a change. I'm just learning mojo, so I have no opinion
16:41 i_am_batman balazs: undef and empty string is not the same thing...
16:41 balazs right
16:44 balazs also a minor not about docs, namely http://mojolicio.us/perldoc/Mojolicious/Lite : I'd be great if all the examples were cut&pasteable. so no 2 character indentation, but put the source in a div and pad it. Also if all the necessary lines, like "use Mojolicious::Lite" and "app->start" were included.
16:45 balazs I'd be glad to make that change
16:53 d4rkie joined #mojo
16:54 alexeiras joined #mojo
16:57 GitHub60 joined #mojo
16:57 GitHub60 [mojo] kraih pushed 1 new commit to master: http://git.io/d8Lxqw
16:57 GitHub60 [mojo/master] made Mojolicious::Lite examples more consistent - Sebastian Riedel
16:57 GitHub60 left #mojo
16:58 sri it's true, they were inconsistent
17:03 balazs that was quick, thanks !
17:04 sri not even sure how that happened, all the newer examples had the use and start lines
17:05 sri about the indentation thing, if you can make it happen without changing the look or adding new lines of code, please send a pull request :)
17:17 balazs sri: adding "padding-left: 3em;" for "pre" looks to be working. does that constitute as adding new lines of code ?
17:19 alexeiras joined #mojo
17:24 sri balazs: i don't see how that solves anything
17:32 mandreacchio hey guys - slightly off topic but this is driving me up the wall - what do I need to go to get data passed to the WSDL? http://pastebin.com/NB0pge55 I can't see where the parameters have been set incorrectly
17:33 sri balazs: but no, i wouldn't mind 1-2 lines of additional css
17:44 balazs sri: add that css and remove those trailing couple of spaces from the "pre" blocks. I admit I'm not sure how that HTML is generated
17:45 sri umm, it's POD, we have no idea how many spaces to remove, heck, it could be tabs for all we know
17:46 Andrei666 joined #mojo
17:47 Andrei666 hey guys, how can I write a route that takes a paramater, like an id
17:47 Andrei666 eg: $r->route("/buy_movie?id", id => qr/\d+/)->to('basket#buyMovie', id => qr/\d+/);
17:48 Andrei666 what I get from this is a page not found, with that none of the routes matched my request
17:58 alexeiras joined #mojo
17:59 diegok Andrei666: if you expect a query parameter you don't define it on the router
17:59 diegok Andrei666: you define path parameters there
18:00 diegok in your controller code you can access all query parameters with param method
18:00 diegok Andrei666: $r->route("/buy_movie/:id") is what you want?
18:02 Andrei666 diegok, yes i know about that,
18:03 diegok Andrei666: so.. what's your question then? :)
18:04 Andrei666 digok i do that when I want to see details for a movie eq: $r->route('/movies/details/:id')
18:05 Andrei666 but, i've noticed at a lot of websites that I visit, that in the url there are parameters like '?id=1&othe_stuff=123'
18:05 Andrei666 and I thought that I should start using that....
18:06 Andrei666 i'm kinda new to web programing, and i've started with a personal project, a imdb-like website written with mojo
18:06 Andrei666 my question is, how should I write routes that include '?param=value'
18:07 Andrei666 is it a good practice?
18:10 diegok :)
18:10 diegok Andrei666: probably using something like a slug is a good practice.
18:11 diegok but this decision are always depending on your needs
18:11 diegok Andrei666: most of the time, you use path parames for your entities and query params for options
18:12 diegok so, /movie/:id => view
18:12 balazs what templating system do you guys use with mojo ? I'm looking for something to handle forms for example
18:12 diegok Andrei666: /movie/:id/buy
18:13 diegok Andrei666: does that looks fine?
18:13 inokenty balazs: Mojo::Template is the best for me
18:13 diegok Andrei666: It's nice to have all actions on a resource hanging on the resource path (view mostly(
18:14 Andrei666 diegok: thanks, you said it well, that one with parameters ..
18:14 Andrei666 and the one with /movie/:id/buy, looks quite allright
18:14 Andrei666 thanks
18:15 diegok Andrei666: then you can look at router bridges
18:15 balazs inokenty: maybe I was asking incorrectly. I'd like to be able to define a form with validations and have it rendered
18:15 diegok Andrei666: and share the find object and put in the stash code
18:16 Andrei666 diegok: could you be more specific, pls?
18:16 Andrei666 diegok: some examples might be helpfull :)
18:17 inokenty balazs: Mojolicious::Plugin::Validator maybe
18:17 diegok balazs: I like HTML::FormHandler when I use DBIC and I'm using Validate::Tiny for validation only.
18:18 diegok Andrei666: http://mojolicio.us/perldoc/Moj​olicious/Guides/Routing#Bridges
18:20 diegok Andrei666: so, you can create a bridge for the route /movie/:id and there you just retrieve movie from storage and place it on the stash
18:20 diegok (or shortcircuit and show 404 when movie doesn't exists)
18:22 diegok Andrei666:  and then you add your routes doing things with an existing movie on that bridge.
18:25 Andrei666 diegok: thanks, now I understand, what route bridges are for, so in that example from perldoc, i just replace $foo with $movie and set the bridge for $movie to /movie/:id
18:26 Andrei666 diegok: and then I route anything related to $movie accordingly
18:27 Andrei666 diegok: nice, very nice ...thanks
18:30 diegok Andrei666: :)
18:32 vel joined #mojo
18:34 Andrei666 now, in my code, I have a lot of parts where I check if the user is loged in, something like if($self->stash( name ) ){ ...}
18:34 Andrei666 is there something that I can do about it?
18:35 Andrei666 and not check for everything if the user is loged ?
18:40 xaka1 joined #mojo
18:44 balazs HTML::FormHandler looks more like what I was looking for
19:08 alexeiras joined #mojo
20:20 * tempire skips to my loo
20:26 andrefs joined #mojo
20:31 i_am_batman joined #mojo
20:43 sri https://github.com/kraih/mojo/issues/334 # guess i can close this issue?
20:44 sri considering that crab never votes
20:55 vel joined #mojo
21:15 balazs how do I access the request parameters ? I'd like to do something like "$form->process( params => $self->req->param);" for HTML::FormHandler
21:17 balazs http://pastebin.com/LztEbECn
21:20 mandreacchio joined #mojo
21:38 GitHub130 joined #mojo
21:38 GitHub130 [mojo] kraih pushed 1 new commit to master: http://git.io/WGorbg
21:38 GitHub130 [mojo/master] small optimizations - Sebastian Riedel
21:38 GitHub130 left #mojo
21:46 lukep joined #mojo
21:57 mire joined #mojo
22:12 gryphon joined #mojo
22:48 xaka joined #mojo

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