Camelia, the Perl 6 bug

IRC log for #mojo, 2012-04-04

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

All times shown according to UTC.

Time Nick Message
00:21 JerJer joined #mojo
01:02 mire joined #mojo
01:22 sri think i'm starting to get an idea of how Mojo::Channel::* could work
01:24 sri it could be a simple glue layer between a connection manager (Mojo::UserAgent/Mojo::Server::Daemon) and parsers (Mojo::Transaction::HTTP/Mo​jo::Transaction::WebSocket)
01:25 sri they provide many events to subscribe to, and create transactions/upgrade the channel class when necessary
01:26 sri a channel would be tied to a single stream, but not directly, only through the user agent/daemon
01:27 zivester joined #mojo
01:28 sri Mojo::UserAgent would only forward i/o from streams to channels and connect the right events
01:31 sri a Mojo::Channel::HTTP could for example emit an upgrade event replacing itself with a Mojo::Channel::HTTP2, which then would emit request events with normal Mojo::Transaction::HTTP objects more asynchronously
01:32 sri transactions would be tied to channels however, not to streams anymore
01:34 sri same of course for Mojo::Channel::SPDY
01:46 sri it's definitely a breaking change and will take a lot of time to get right... so maybe in 4.0 or 5.0 :)
01:59 tardisx joined #mojo
02:11 preflex_ joined #mojo
02:14 xaka1 joined #mojo
02:41 GitHub155 joined #mojo
02:41 GitHub155 [mojo] kraih pushed 1 new commit to master: http://git.io/9LtU_Q
02:41 GitHub155 [mojo/master] better Mojo::Transactor examples - Sebastian Riedel
02:41 GitHub155 left #mojo
02:54 JerJer joined #mojo
02:56 JerJer1 joined #mojo
03:59 Leandr joined #mojo
04:05 GitHub77 joined #mojo
04:05 GitHub77 [mojo] kraih pushed 1 new commit to master: http://git.io/2jWacw
04:05 GitHub77 [mojo/master] optimized Mojolicious::Plugin::TagHelpers a little - Sebastian Riedel
04:05 GitHub77 left #mojo
04:05 sri should be *a lot* more readable
04:08 JerJer1 sweeet!!!!  i have mojo app hooked into Asterisk AMI events
04:10 JerJer1 used EventEmiter as a base — had web clients subscribe to whatever ami events they need  :)
04:11 sri http://s1.static-footeo.com/uploads/thumbnails/up​loads/poitiersfutsal/news/75_shave_all_scale_infl​ate/imagescarwr1n2-300x2254_612x459__lzn5ff.jpg
04:11 * sri declares today talk in memes day
04:17 JerJer1 :)
04:25 ExpFist Talk in memes day?
04:25 ExpFist http://sri.You.Are.Mighty.Aninote.com
04:26 sri \o/
04:57 JerJer eternal truth for web developers: fallback code for IE
05:01 Leandr joined #mojo
05:07 tempire I like the channel concept
05:08 tempire makes sense
05:08 purl makes sense is http://xrl.us/bjq3kq
05:22 Leandr http://www.plakaty.ru/posters?id=41
05:22 kaare joined #mojo
05:55 asarch joined #mojo
06:06 kart00n joined #mojo
06:13 Leandr joined #mojo
06:25 athenot_ joined #mojo
06:34 Gedge joined #mojo
06:43 Mike001 joined #mojo
06:44 Mike001 Hi, could someone help me with a newbie question pls.
06:45 Mike001 I'm trying to figure out a way to apply an "active" style to a link if that's the link that is open
06:46 Mike001 I was thinking to get the requested template name and depending on it - apply the active css to a specific link
06:46 Mike001 so if that's the right way, how do I get the requested template? Something like $self->render->{template} ?
06:50 taryk joined #mojo
06:50 batman Mike001: you can use my plugin: https://metacpan.org/module/​Mojolicious::Plugin::UrlWith
06:50 batman or look at its source :)
06:54 AmeliePoulain joined #mojo
06:56 fhelmber_ joined #mojo
06:56 Mike001 OK, looks like current_page_class is what I need
06:56 Mike001 Thank you, I'll take a look at your plugin
06:57 batman if that's all you need, i suggest looking at the source...
06:57 batman https://metacpan.org/source/JHTHORSE​N/Mojolicious-Plugin-UrlWith-0.05/li​b/Mojolicious/Plugin/UrlWith.pm#L169
06:59 Mike001 ok, that's exactly what I need, thank you!
06:59 spleenjack joined #mojo
06:59 batman np
07:16 Mike001 what about breadcrumbs, what's the idea for working with them?
07:17 batman https://metacpan.org/module/HTML::Breadcrumbs <-- you have this module... been a while since i worked with it though
07:18 batman but the simplest way of making breadcrumbs would simple to split '/', $self->req->url->path: i guess
07:19 batman i'm not a huge fan of breadcrumbs myself though
07:20 tardisx good on a schnitzel
07:20 batman ;)
07:21 Gedge_ joined #mojo
07:22 batman not sure if this is of any interest, but after fighting aloha for a day, i finally discovered https://github.com/bergie/hallo
07:31 judofyr joined #mojo
07:48 migo joined #mojo
07:49 cosmincx joined #mojo
08:20 avkhozov joined #mojo
08:38 heytrav left #mojo
08:39 hugh joined #mojo
08:42 mire joined #mojo
08:47 fhelmber_ joined #mojo
08:48 migo joined #mojo
08:49 black joined #mojo
09:01 brambles joined #mojo
09:59 arpadszasz joined #mojo
10:56 JerJer joined #mojo
11:21 batman really nice that i can clean the html posted using Mojo::DOM :)
11:22 JerJer joined #mojo
11:24 spleenjack joined #mojo
11:25 cstamas joined #mojo
11:27 abra joined #mojo
12:02 Akron joined #mojo
12:07 migo joined #mojo
12:30 jnap joined #mojo
12:38 batman looks like jquery sends "application/json, text/javascript, */*; q=0.01" when asking for json in return
12:39 batman anyway you can make Mojolicious::Types::detect() understand that?
12:39 batman perl -MMojolicious::Types -le'print join " ", @{ Mojolicious::Types->new->detect(shift) }' "application/json" # works
12:39 batman perl -MMojolicious::Types -le'print join " ", @{ Mojolicious::Types->new->detect(shift) }' "application/json, text/javascript, */*; q=0.01" # doesn't...
12:42 sri intentional
12:43 sri https://github.com/kraih/mojo/issues/237
12:44 batman aha. browsers are awesome :P
12:49 xoma joined #mojo
12:57 abra joined #mojo
13:28 mire joined #mojo
13:37 baton8 joined #mojo
13:39 joe-perl joined #mojo
13:41 joe-perl hey guys
13:42 joe-perl how to do upload with mojo?
13:42 joe-perl example in the doc does not help!!
13:42 joe-perl it does not show saving the file
13:43 joe-perl http://mibpaste.com/MyayIp
13:44 inokenty joined #mojo
13:44 joe-perl any help??
13:44 purl i guess any help is appreciated
13:45 joe-perl sample code only says so nso bytes received.
13:45 joe-perl but it does not mention the file handle and saving the file
13:46 lbr put $example in the string, and it'll tell you its class
13:46 lbr that probably responds to a lot of file-like methods
13:48 lbr ah, "are automatically available as Mojo::Upload objects"
13:48 joe-perl may be. but "example" is also form field in the html
13:48 joe-perl code, which is sending the file
13:49 lbr perldoc Mojo::Upload
13:49 joe-perl shall we use Mojo or use Mojolicious::Lite;
13:49 joe-perl ?
13:50 joe-perl docs says Mojolicious can do it!!
13:50 lbr ...
13:52 judofyr joe-perl: Mojo and Mojolicious::Lite is a part of the whole Mojolicious-framework
13:53 lbr Mojolicious is pretty useless without the Mojo-classes
13:54 joe-perl that is why it is called "lite"
13:55 lbr did I solve your problem?
13:55 joe-perl i dont know what to do with Mojo::Upload
13:55 joe-perl doc is not heplful
13:56 joe-perl i hv to go thru source codes
13:56 lbr $example is an Mojo::Upload object, which is what the docs for Mojolicious::Lite says it is
13:56 joe-perl of Mojo
13:56 lbr well, enjoy
13:56 joe-perl Mojo::Upload does not have a save method but has move_to
13:57 judofyr joe-perl: what you mean? Mojo::Upload documents both a ->slurp (which just reads the file content into a string) and ->move_to (which stores it as a file somewhere)
13:57 joe-perl method. it maybe the one.
13:57 joe-perl ok will test it and report  here
14:01 Gedge joined #mojo
14:12 joe-perl ok it worked with upload
14:13 joe-perl without using mojo::upload module
14:13 joe-perl i hv just added $example->move_to($name);
14:13 joe-perl it saved file. But no mention of error handling
14:14 joe-perl what is upload is disconnected.
14:14 joe-perl what if upload is disconnected.
14:15 judofyr joe-perl: your code will only run when the upload is fully completed
14:15 judofyr that is, the action
14:16 judofyr joe-perl: see here if you want to stream the file: https://metacpan.org/module/Mojolicious::Gu​ides::Cookbook#Streaming-multipart-uploads
14:16 joe-perl docs say it is also possible to use hooks
14:16 purl okay, joe-perl.
14:16 joe-perl so, a progress bar can be implemented
14:22 dch joined #mojo
14:27 avkhozov joined #mojo
14:36 geck joined #mojo
14:38 ispy_ joined #mojo
14:59 mire joined #mojo
15:05 arpadszasz joined #mojo
15:29 sri hmmm
15:29 sri i think there's a way we could improve respond_to Accept detection
15:30 sri in rails they allow multiple MIME types for ajax requests
15:31 sri that would address all reported problems i think
15:31 * sri pokes tempire, crab and marcus
15:37 sri i already have an implementation :)
15:38 sri it would make the case batman mentioned just work "application/json, text/javascript, */*; q=0.01"
15:39 Gedge_ joined #mojo
15:41 batman could you say something like this if(m!^application/json!) { do_something_special() } else { do_the_normal_suff() }
15:44 Gedge joined #mojo
15:47 Psyche^ joined #mojo
15:48 sri hmm, there is one small problem though
15:48 sri i would like to allow alternative MIME types for extensions, but the current type map format does not allow it :/
15:50 Gedge_ joined #mojo
15:56 xaka1 joined #mojo
16:04 chorny joined #mojo
16:16 dch joined #mojo
16:20 brambles joined #mojo
16:20 brambles_ joined #mojo
16:21 GitHub191 joined #mojo
16:21 GitHub191 [mojo] kraih pushed 1 new commit to master: http://git.io/F68T2A
16:21 GitHub191 [mojo/master] added multiple MIME type and quality support for Ajax content negotiation with respond_to - Sebastian Riedel
16:21 GitHub191 left #mojo
16:21 Gedge joined #mojo
16:22 JerJer joined #mojo
16:24 sri this needs to be reviewed though, otherwise it will get removed again ;p
16:24 sri batman: might be interesting for you too
16:29 hipyhop joined #mojo
16:30 GitHub135 joined #mojo
16:30 GitHub135 [mojo] kraih pushed 1 new commit to master: http://git.io/uR83TQ
16:30 GitHub135 [mojo/master] more MIME type detection tests - Sebastian Riedel
16:30 GitHub135 left #mojo
16:32 sri ranges are not yet supported though
16:32 sri as in text/*
16:39 sri not sure if content ranges make much sense though
16:39 sri surely less than MIME type alternatives
16:40 sri alternatives is a breaking change we should consider for 3.0
16:49 conor joined #mojo
16:53 conor left #mojo
16:53 sri btw. i'm absolutely serious about removing it again if there's no feedback
16:54 sri especially with firefox and opera things could still go wrong
16:57 tempire I thought the mozilla 2 thing prevented that from solving problems.
16:57 sri ?
16:58 tempire putting types like xml before html and such.
16:58 tempire I guess this is only ajax.
16:58 sri xmlhttprequest is different
16:58 sri yes, this is exclusively for ajax
16:59 tempire what are the potential firefox and opera problems?
16:59 sri and this is only active if X-Requested-With has been set
17:00 sri firefox and opera were ignoring hmlhttprequest specs and sending stupid Accept headers in some versions i heard
17:00 sri but i couldn't confirm it yet
17:00 batman sri: not sure if is_xhr is any good...
17:01 batman but i might be remembering wrong :/
17:01 sri batman: i have no idea what you're trying to say
17:01 tempire it's ok.  he's batman.
17:01 tempire why is there not a batman unicode character.
17:01 tempire I don't understand.
17:02 batman i see now that X-Requested-With is set from firefox, but i have seen earlier that it's not there...
17:02 sri umm
17:02 tempire regarding respond_to, I don't see the problem it solves.  But I don't have any problem with it.
17:02 batman i may be mistaken, but that's what i recall :/
17:02 sri X-Requested-With is a header js libraries set
17:03 batman oh. i thought the browser added it
17:03 sri the whole point is to detect a sensible ajax request from a library
17:04 batman then it's not so strange i haven't always seen it :)
17:05 batman anyway... i'm in favour of making respond_to() more dwim
17:05 batman but i need to run away now... been inside for too long
17:06 sri you're actually convincing me of removing it again atm ;p
17:06 batman since i'm running away?
17:06 sri naah
17:06 sri nobody seems to actually grok the whole thing
17:07 sri for example, who here believes that order of MIME types in the Accept header matters?
17:07 batman i wish. but after listening to you, i don't :/
17:07 sri because it doesn't, only quality matters
17:07 chansen sri: I do =)
17:08 chansen it matter if there isn't a q parameter
17:08 chansen then order should be preserved
17:11 chansen <http://tools.ietf.org/html/rfc2616#section-14.1>
17:14 Leandr joined #mojo
17:14 sri chansen: it's actually not that simple
17:15 sri "the most specific"
17:15 sri Accept is a total clusterfuck
17:16 dch +1, we found the same thing with couchdb - no currently workable solution for all browers.
17:16 sri i don't see a clear explanation of which one in this example would the most specific "Accept: text/plain, text/html"
17:19 conor joined #mojo
17:21 xaka1 joined #mojo
17:23 chansen There is a clear example, let me nopaste
17:23 chansen nopaste?
17:23 purl nopaste is http://paste.scsys.co.uk/ or http://nopaste.snit.ch/ or http://gist.github.com/ or DO NOT USE pastebin.com IT FUCKING SUCKS
17:23 chansen http://paste.scsys.co.uk/191077
17:24 sri that's not very clear to me, both appear to have the same precedence
17:24 sri if there was a 1), 2), 3)... figure ok, but that one is still very arguable
17:25 avkhozov joined #mojo
17:26 sri anyway, i'm going to remove support for multiple MIME types again :)
17:27 chansen ok =)
17:30 sri just looked at the rails code, they actually test if an Accept header contains multiple MIME types and */* to differentiate between browsers and humans
17:32 sri with a configurable LOOKS_LIKE_BROWSER regex
17:32 * sri vomits
17:32 chansen heh
17:32 chansen HTTP is simple!!! ;P
17:32 sri REST is beautiful!!! ;p
17:33 chansen heh
17:38 yko joined #mojo
17:46 GitHub196 joined #mojo
17:46 GitHub196 [mojo] kraih pushed 1 new commit to master: http://git.io/kJC4dQ
17:46 GitHub196 [mojo/master] removed support for multiple MIME types again - Sebastian Riedel
17:46 GitHub196 left #mojo
17:55 preflex joined #mojo
17:59 jnap joined #mojo
18:24 kthakore joined #mojo
18:24 kthakore Hello
18:25 kthakore I have a Java -jar file that I want to wrap in a real time web REST api with Mojo.
18:25 kthakore how can I do this?
18:26 sri http://images5.fanpop.com/image/photos/29200000​/kill-it-with-fire-random-29296574-256-192.gif
18:26 chansen lol
18:27 kthakore sri: yeah we are working on replacing th java component
18:27 kthakore sri: will cost us 20k$
18:28 kthakore but in the meantime I just want to make a PoC with mojo
18:28 kthakore I want to send it CSV file (watch it run and give websocket return for frontend) and return CSV on completion
18:28 lbr kthakore: i've done similar stuff in the past with Inline::Java
18:29 vel joined #mojo
18:29 tempire sri: A CHALLENGE!
18:29 purl rumour has it a challenge is in coming up with the 'number' of the slides
18:29 tempire http://www.infoworld.com/d/application-develop​ment/hello-world-programming-languages-quiz-18​8874?quizkey=83678762da9e12cf11e72e9a914b3c4c
18:29 kthakore lbr: giving a real time update of the jar run?
18:29 judofyr joined #mojo
18:30 lbr i don't know what that means
18:30 kthakore could I just plug in java -jar system() call in here? http://mojolicio.us/perldoc/Mojoliciou​s/Guides/Cookbook#Backend_web_services
18:31 lbr sure
18:31 kthakore I guess I want to setup a websocket on the front end
18:31 lbr read docs to Inline::Java
18:31 lbr you can just interact with java-object as if they were perl in the rest of your app
18:32 kthakore btw this doesn't work http://mojolicio.us/perldoc/Mojolicious​/Guides/Cookbook#WebSocket_web_service
18:33 kthakore lbr: cool
18:33 kthakore will look
18:34 lbr tempire: idg-quizzes always make me want to puke
18:34 kthakore lbr: I only have a jar file, not the code
18:34 lbr doesn't matter
18:34 kthakore lbr: really?
18:35 kthakore sri: the websocket thing not workie with new mojo (from github) :(
18:35 kthakore sri: it goes page not found
18:35 tabbi joined #mojo
18:35 tabbi left #mojo
18:35 kthakore None of these routes matched your GET request for /echo, maybe you need to add a new one?
18:36 lbr just plug the relevant jars into $ENV{CLASSPATH} in a BEGIN {} or equiv.  - note, i haven't looked at this stuff for 5 years
18:36 lbr read docs :)
18:36 judofyr joined #mojo
18:37 kthakore ok
18:44 JerJer kthakore:  try eventsource
18:44 kthakore JerJer: ok
18:44 kthakore I got it working
18:44 JerJer websockets is still bleeding edge
18:44 kthakore but how do I send messages?
18:44 kthakore /echo?message="asdasd" ?
18:44 JerJer from the client back to the server?
18:44 kthakore yeah
18:45 kthakore it keeps saying Hello Mojo
18:45 JerJer ajax
18:45 kthakore so POST?
18:45 purl hmmm... so POST is boud to the content type?
18:46 kthakore ok so I wanna start with uploading a CSV
18:46 JerJer doesn't have to be a post
18:46 kthakore ok
18:46 kthakore have that spawn a websocket thing
18:49 kthakore OKIE!
18:49 kthakore this works
18:50 * kthakore huggles sri before jetting
18:50 kthakore &
18:51 lbr it's customary to drop something in the tip jar after huggling
19:00 eventi hey all - been lurking for a day or two - finally have a q
19:00 eventi I can't get my head around using the scrupt as a cgi
19:01 eventi *script - It either fails to load resources from public/ or tries to POST to /save - either way, it's unhappy
19:02 eventi Q: Do you point the DocumentRoot in Apache to the top directory created my the generator?
19:15 sri kthakore: that example works flawless here
19:20 tempire eventi: is there a reason you're wanting to use cgi?
19:20 dch left #mojo
19:21 eventi yeah- it's an internal tool in a company that's all cgi, and we don't want to have to babysit another process
19:22 eventi and there are already tools in place to manage the apaches
19:38 jnap joined #mojo
19:47 Dani joined #mojo
19:55 yko joined #mojo
20:01 jnap joined #mojo
20:19 JerJer joined #mojo
20:41 Gedge_ joined #mojo
21:28 judofyr_ joined #mojo
21:47 GitHub64 joined #mojo
21:47 GitHub64 [mojo] kraih pushed 1 new commit to master: http://git.io/yeaJgQ
21:47 GitHub64 [mojo/master] fixed small bug in Mojo::Parameters->params - Sebastian Riedel
21:47 GitHub64 left #mojo
21:52 lukep joined #mojo
22:24 kthakore l/win 2
22:43 GitHub151 joined #mojo
22:43 GitHub151 [mojo] kraih pushed 1 new commit to master: http://git.io/UWcZcg
22:43 GitHub151 [mojo/master] more Mojo::URL tests - Sebastian Riedel
22:43 GitHub151 left #mojo
22:45 chorny joined #mojo
22:55 judofyr joined #mojo
22:56 JerJer1 joined #mojo
22:57 chorny_ joined #mojo
22:57 D4RK-PH0ENiX joined #mojo
22:57 athenot joined #mojo
22:59 Liam joined #mojo
23:00 y0j_ joined #mojo
23:00 Mrono joined #mojo
23:00 xxtjaxx_ joined #mojo
23:00 burk joined #mojo
23:01 jzawodn joined #mojo
23:04 eventi joined #mojo
23:07 ryanc joined #mojo
23:11 keedi joined #mojo
23:15 lukep joined #mojo
23:16 rafl joined #mojo
23:36 geira joined #mojo

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