Camelia, the Perl 6 bug

IRC log for #mojo, 2013-04-01

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

All times shown according to UTC.

Time Nick Message
00:06 ka2u joined #mojo
00:09 denisboyun joined #mojo
00:41 chansen joined #mojo
01:09 ka2u joined #mojo
01:20 d4rkie joined #mojo
01:38 ka2u joined #mojo
01:56 Meiermann joined #mojo
02:03 preflex_ joined #mojo
02:31 beyondcreed joined #mojo
03:01 preflex_ joined #mojo
03:48 arpadszasz joined #mojo
04:26 jzawodn joined #mojo
04:27 basiliscos joined #mojo
04:36 rihegher joined #mojo
04:53 rihegher left #mojo
04:58 ka2u joined #mojo
05:17 basiliscos joined #mojo
05:56 Meiermann joined #mojo
05:57 ver joined #mojo
06:00 hesperaux joined #mojo
06:43 Britzel joined #mojo
06:51 denisboyun joined #mojo
07:05 Vandal joined #mojo
07:14 sh3 joined #mojo
07:21 coff joined #mojo
07:49 jzawodn joined #mojo
08:13 mire joined #mojo
08:26 marcus joined #mojo
08:27 batman joined #mojo
08:27 marcus yay
08:29 KindOne joined #mojo
08:51 KindOne joined #mojo
09:00 suy joined #mojo
09:22 ObseLeTe joined #mojo
09:51 lukep joined #mojo
09:59 bowtie joined #mojo
10:39 Britzel_ joined #mojo
10:56 ka2u joined #mojo
11:01 KindOne joined #mojo
11:11 GabrielVieira joined #mojo
11:13 * sri yawns
11:26 mattastrophe joined #mojo
11:27 sri http://stackoverflow.com/questions/15713422/how-​can-i-get-the-port-that-mojoliciouslite-chooses # looks like brian is misunderstanding something completely
11:39 dpetrov_ joined #mojo
11:47 ladnaV joined #mojo
11:48 ladnaV joined #mojo
11:51 * sri creates a SO account :o
11:55 sri wow, SO is terrible, how the hell is it so popular?
11:58 vervain joined #mojo
12:00 suy I don't like it either, but it appers so high in web searches... I don't have an account yet. I prefer the "official" communities to ask and answer.
12:06 moltar joined #mojo
12:09 rem_lex|pivo joined #mojo
12:16 Kripton joined #mojo
12:19 Kripton joined #mojo
12:37 dabudabu It's better than what we had before
12:37 dabudabu (Forums)
12:39 jberger it was meant to kill expertexchange
12:39 jberger which was awful
12:40 jberger sri: curious what you don't like about SO?
12:41 sri jberger: impossible to get people to clarify bad questions
12:41 jberger oh you don't have any rep, so you can't do anything
12:41 jberger you probably can't comment yet right?
12:41 sri right
12:42 jberger that comes with only a little rep, just to keep the spammers out
12:42 sri still, those comments suck too
12:42 jberger I upvoted, everyone go give sri some rep
12:42 vel joined #mojo
12:42 jberger yeah, the comments suck
12:42 sri no way to have a conversation to get information about bugs and stuff like that
12:42 jberger you can only do line code in comments
12:42 jberger there is an SO chat system
12:43 jberger but its rare that two good programmers need to back-and-forth on something
12:43 jberger SO is almost entirely for newish programmers
12:43 sri happens all the time on the mailing list
12:43 jberger sure, but not on SO
12:43 jberger I see SO as a Perl/Mojolicious marketing opportunity
12:44 jberger I rarely use it to get answers about anything
12:45 sri that's my point ;)
12:46 jberger oh, sure, but you're not the target
12:46 jberger :-P
12:46 jberger the target is almost always, "how do I split a line on a comma?"
12:47 sri even perlmonks is better for that
12:47 jberger and as frustrating as it is, if you don't give some kind of good answer, they probably will get one from python and we lose that one
12:48 sri i'm not saying don't answer, just that there should be alternatives
12:48 * sri has an idea :)
12:51 mire joined #mojo
12:55 jberger the thing I don't get about brian's question is, my hack that he sites is just that, a quick hack to serve static files and handle /
12:55 jberger its not some big app to test, and if it was, a tiny Test::Mojo would work fine
12:56 jberger do people have tests that cover if Apache comes up?
12:57 sri that's why i said he much be misunderstanding something, the question makes no sense really
12:58 moltar joined #mojo
13:11 lukep joined #mojo
13:13 sri *must
13:13 * sri thaught the internet would be unusable today, but it doesn't seem so bad
13:14 jberger ?
13:14 sri it's april 1st
13:14 jberger oh
13:14 jberger right
13:14 sri so far it's just google making boring jokes
13:15 jberger that reminds me, I have to send an email to my wife \m/
13:15 * sri sets jberger on fire
13:15 * jberger runs around looking for the comical seltzer sprayer
13:16 jberger its no coincidence that the Cubs' first game is today
13:17 jberger its going to be a long baseball season :-/
13:17 sri baseball is one of those games you americans invented so you don't have to compete with the rest of the world, right? ;p
13:18 jberger nope, thats football (american)
13:19 jberger baseball is a beautiful sport, and really shouldn't be thought of in the same way as football/soccer/hockey etc
13:19 avenj (by beautiful he means 'dull until the third beer or so')
13:19 * avenj runs away
13:19 jberger haha
13:19 jberger if your team is bad
13:20 jberger then again, late season, that slowness == tension
13:20 jberger no, I mean, the perfect separation of offense and defense
13:20 jberger and with the exception of the pitcher (and even he depends on the catcher) its must necessarily be a team sport
13:20 jberger one player rarely can make the team great
13:23 * sri grew up with soccer
13:25 * jberger sees more young people in the states watching soccer
13:25 jberger and certainly more and more people watch the big events like the world cup
13:26 jberger I think the biggest problem for soccer in the states is that the other sports have saturated the market
13:27 Kripton Hi, it's ok to ask questions about Mojo here? Or this is for the Mojo developers only ?
13:27 Britzel_ Kripton: Just ask.
13:28 Kripton OK thanks, I have this working with get: $t->get_ok('/login/teste', {Authorization => "Basic $auth"})->status_is(200);
13:28 sri don't make your own Authorization headers
13:29 Kripton This is suppose to work with post_ok too ?
13:29 sri http://mojolicio.us/perldoc/Test/Mojo#ua
13:30 Kripton i have tried different methods ,all works with get, but i cant make work with post, and cant find any example
13:31 sri get_ok and post_ok work exactly the same, infact, all $method_ok methods do
13:36 Kripton using this code " $t->post_ok('/login' => json => {cliente => $clienteId, login => $login_teste}) " and inspecting the Data Dumper i find this line :
13:36 Kripton 'content' => '{"login":"rubens_teste","cliente":23}',
13:36 Kripton but with this code: "$t->post_ok('/login' => {Authorization => "Basic $a"} => json => {cliente => $clienteId, login => $login_teste})"
13:37 Kripton that same line change to: 'content' => '
13:37 Kripton {"login":"rubens_teste","cliente":2',
13:37 btyler joined #mojo
13:38 Kripton as you can see the line with 'content' seens like incomplete
13:39 good_news_everyone joined #mojo
13:39 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/tToHyg
13:39 good_news_everyone mojo/master b89f57d Sebastian Riedel: better authentication example for Test::Mojo
13:39 good_news_everyone left #mojo
13:41 Kripton the PUT, DELETE and GET methods are all working fine, this problem is only with POST
13:43 sri perhaps you should try making a minimal test case
13:43 Britzel joined #mojo
13:44 Kripton I am trying, the problem is the test , with an web browser works fine
13:45 Kripton this problem only shows when i am using test::mojo
13:45 rem_lex| joined #mojo
13:48 Kripton I have tested with bash/curl and worked , my app was passing in all the tests, Now i need the Basic Auth fuctionality , and i cant see how make the same tests working using Basic Auth
13:51 cosimo joined #mojo
13:57 Kripton On this URL http://pastebin.com/yrjdPV15 , the  "print STDERR Dumper($self->req);" of two Requests with BasicAuth and without
13:57 rihegher joined #mojo
13:58 Kripton please check the lines 69,70 and 163 , you will see something like an parser error
13:59 rem_lex joined #mojo
14:01 rem_lex|pivo joined #mojo
14:01 bluescreen joined #mojo
14:06 mire joined #mojo
14:07 sh3 joined #mojo
14:11 sh4 joined #mojo
14:12 marty joined #mojo
14:12 sri Kripton: i don't see anything wrong
14:12 sri MOJO_USERAGENT_DEBUG=1 perl -Mojo -E 'p("/login" => {Authorization => "Basic bmV0bWdyLWRldjowMjNobjAxZDI="} => json => {cliente => 23, login => "rubens_teste"})'
14:13 Kripton did you see the URL on pastebin ?
14:13 sri what you pasted is not a minimal test case, it's out of context gibberish
14:14 Kripton the line 163 is working fine , but the line 70 is missing a "}" at the end
14:14 sri ok, maybe someone more qualified will be able to help you
14:15 Kripton please just check this two lines in the pastebin
14:15 Kripton you will see that there are a missing "}" at the end , maybe this is the error
14:17 rem_lex joined #mojo
14:17 Akron joined #mojo
14:18 Kripton is seens like the content json is incomplete when using the basic auth , as show in line 70 but is OK on line 163, without the BasicAuth
14:22 gryphon joined #mojo
14:23 Akron Kripton: Without a minimal case it's hard to help you.
14:26 Kripton i understand, so what you are saying is that you need a very small code so you can try by  yourself ?
14:27 btyler also so that people can reason about the core problem without having to read through a lot of code that isn't strictly related
14:28 Akron Yes - just put the json-serving line in a Test::Mojo/M::Lite-Suite with the post_ok and get_ok tests that fail and we can inspect what is happening.
14:29 Kripton ok i will do that right away
14:29 Kripton Thank a lot for your help and time
14:29 Kripton thanks*
14:30 Kripton And as you can see, English is not my first language, i hope i can be back here to talk more about soccer, i am from Brazil :)
14:30 Akron :) Great! (Germany here).
14:31 Kripton this was the topic when I joined the channel
14:32 Akron Yepp - I've read the log.
14:36 tempire I love stackoverflow
14:37 tempire it has the same issues as any other forum-based sight, but it's the best forum-based site.
14:37 tempire for what it is, it's really well implemented
14:37 tempire integrated with resumes
14:38 tempire I use it all the time for arbitrary tech questions
14:38 mattastrophe joined #mojo
14:38 tempire especially in javascript
14:53 asarch joined #mojo
14:57 rihegher Hello
14:58 Akron \o
14:58 rihegher I'm trying to figure out about all the hooks available with mojo
14:59 Akron rihegher: http://search.cpan.org/~sri/Mojoli​cious-3.91/lib/Mojolicious.pm#hook
14:59 rihegher but I'm trying to hook somewhere between 'before_routes' and 'after_render'
14:59 rihegher like "before_render"
15:00 rihegher or 'after_routes'
15:00 Akron If you come up with a really good use case, sri is open to think about implementing such stuff.
15:00 Akron What is your use case?
15:00 rihegher I'm not sure it's a really good use case
15:00 sri for a new hook it's two use cases, they need to be versatile enough
15:01 rihegher basically it's more a proof of concept I'm trying to do
15:02 rihegher I'd like to make a proto of a web app where I could navigate dynamically using websocket
15:02 rihegher the idea would be to detect if the browser support websockets
15:03 rihegher if so then I'll intercept the click on internal link to pass the info to a websocket listening for internal nav
15:04 rihegher the websocket would then analyse the url asked and match to the normal routes (not the websocket routes)
15:05 sri sounds like you're reinventing pjax
15:06 GabrielVieira joined #mojo
15:06 rihegher once match it would render the associated template and not the layout within a partial and send back the rendering to the browser which could overwrite the container that is used by template dynamically
15:07 rihegher thanks I didn't know pjax
15:10 rihegher yes basically I'd like to use pjax
15:13 rihegher the thing is if I want to use websocket I can't just do it like pjax
15:13 rihegher because normal routes and websocket can't be shared, can they?
15:17 rihegher If I use pjax I can use the header X-PJAX to detect it's a pjax request
15:19 rihegher the only trouble I see now is how to avoid rewritting twice the routes
15:19 rihegher once for websockets routes and once for normal routes
15:19 Akron righegher: Shortcuts?
15:20 Kripton Hi this is minimal test case http://pastebin.com/SQk8pCFS, on the botton there is a commented POST test, that pass if you disable the Basic Auth
15:22 rihegher no shortchut wouldn't do
15:22 rihegher actually what I'd like would be to write my normal HTTP routes
15:22 btyler joined #mojo
15:23 rihegher and before these routes a unic websocket routes that would treat the pjax request, except that these requests would be made through websockets
15:24 Akron Why would shortcuts don't work for this? (However - I never really tried websockets so I am no expert on this issue.)
15:24 rihegher in my websocket listening code I would have just to call the route matcher to match the normal routes with the url asked
15:26 rihegher I don't  see how shotcuts could work for this
15:26 Kripton As far as i know, if the http client supply the Authentication Basic Headers, even if the server does not require, is suppose to work , as the server will simple ignore the authentication headers
15:27 rihegher I still have to find a way to call the router_matcher
15:27 rihegher hold on
15:29 labrown joined #mojo
15:29 Akron righegher: Define Both cases in a shortcut and use this shortcut on each route. I don't see a problem ...
15:30 Akron Kripton: I'll try your code now.
15:30 Kripton ok thanks
15:33 Kripton wait there is a BUG on that code
15:33 Kripton i will paste another version
15:34 Kripton line 82: should be  ->json_content_is({"data" => 'rubens'}); instead of  ->json_content_is({"username" => 'rubens'});
15:39 Kripton where is the URL for the correct version http://pastebin.com/ycwTLZDY
15:41 Akron In that case I don't understand the post - because you post a username.
15:42 rihegher Akron: I've try that but it didn't work, at least I didn't manage to have it working
15:42 mire joined #mojo
15:42 basiliscos joined #mojo
15:42 rihegher it was falling in one case or the other
15:43 denisboyun joined #mojo
15:43 rihegher no routes was able to handle a HTTP request and a websocket request
15:43 Akron Kripton: I've got a working version.
15:44 Akron Kripton: https://gist.github.com/Akron/6351d4f3981ce0b0cdb2
15:44 rihegher even if it was possible, that would means that for each route I would have to make 2 shortcuts
15:45 Akron Kripton: You are mixing the data and the authentication. You should avoid that by don't creating your own Authentication stuff - Just use userinfo on your URLs, Either by using Mojo::URL or by writig this directly in your accessor.
15:45 Akron rihegher: Two shortcuts? I don't understand.
15:46 rihegher on for HTTP request and one for websocket request
15:46 rihegher for every route
15:47 rihegher s/on/one
15:49 Kripton Akron: i have learned from here: https://groups.google.com/forum/?fromg​roups=#!topic/mojolicious/sy5ydyK0Kl4
15:50 Akron I don't know if that's a good advice.
15:50 marcus some men just want to set jberger on fire.
15:50 sri it's bad advice
15:50 Akron :)
15:52 * sri posts a reply
15:53 Akron rihegher: As far as I understood, websockets are treated as route methods in Mojolicious - so I see no problem in defining a route, attaching a shortcut and in that shortcut, there are endpoints defined for http and websocket methods. But again - I never worked with websockets.
15:54 sri websocket routes are just a GET with additional check for WebSocket related headers
15:54 Akron sri: So there shouldn't be a problem with shortcuts, right?
15:54 sri i've not followed the discussion
15:56 Akron My advice was, instead of doubling route definitions for http gets and websockets, endpoints could be gathered in a shortcut.
15:57 Kripton Akron: Thanks a lot for your help :) it is working fine now
15:57 rihegher ok then I'll try again
15:57 Akron Kripton: Glad to help.
15:58 rihegher maybe I just did something the wrong way
15:58 Akron sri++ (for your ggroups response)
15:58 good_news_everyone joined #mojo
15:58 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/J3ZXcA
15:58 good_news_everyone mojo/master 88171ad Sebastian Riedel: more advanced authentication example for Test::Mojo
15:58 good_news_everyone left #mojo
15:59 rihegher in case I can't get it working I'll paste something here for you to see if you don't mind
15:59 sri that should make it more obvious
16:00 rihegher Akron: thank you anyway
16:00 Akron rihegher: Sure. I'll watch the log. Unfortunately I have to go off now.
16:00 Akron Bye!
16:00 rihegher Bye
16:01 btyler_ joined #mojo
16:05 suy Is there some way to tell UserAgent to load a local file? Or is necessary to read the contents myself and pass them to Mojo::DOM? (sorry, I'm still such a newbie :-) )
16:11 mire joined #mojo
16:36 asarch joined #mojo
16:41 sh3 joined #mojo
16:44 suy OK, I did it with Mojo::DOM and reading the file manually. But would it make sense to support file:// transactions for "mojo get"?
16:55 mire_ joined #mojo
17:00 d4rkie joined #mojo
17:01 marcus joined #mojo
17:02 batman joined #mojo
17:07 moltar joined #mojo
17:07 jpn joined #mojo
17:11 beyondcreed joined #mojo
17:16 wingfold joined #mojo
17:22 marcus joined #mojo
17:22 batman joined #mojo
17:24 denisboyun joined #mojo
17:27 moltar joined #mojo
17:43 denisboyun joined #mojo
17:59 rihegher left #mojo
18:09 denisboyun joined #mojo
18:11 marcus joined #mojo
18:11 batman joined #mojo
18:31 sri suy: maybe as part of the #423 refactoring, otherwise i'm against it https://github.com/kraih/mojo/issues/423
18:37 suy sri: ok. Is not a big deal, of course. After all, seems simple to write a custom server for such a use case. It was just me testing. :)
18:47 marty bummer, a MongoDB object ID cannot be used as a javascript variable.  :(
18:48 bzero Hello
18:48 marty \o
18:49 bzero Why mojo daemon loads CPU for 2-4%?
18:50 marty that all depends on your app.  usually it does not
18:51 bzero It loads CPU when idling. It simple app, like example.
18:53 mire_ joined #mojo
18:53 bzero I tested it on a few machines.
18:53 marty mojo version and platform?
18:54 bzero Debian, Perl        (v5.12.4, linux), Mojolicious (3.91, Rainbow)
18:54 bzero And Ubuntu.
18:56 bzero According "strace" it's polling.
18:56 bzero May be I should decrease some parameter for daemon... But I do know what a parameter. :)
18:56 marty using morbo?
18:57 bzero Not morbo, daemon.
18:57 bzero ./script/app daemon
18:57 marty I suppose on some machines 2-4% might be normal.
18:57 marty let me check mine.....
18:58 bzero I suppose it could be changed customized in Mojo::IOLoop...
18:58 bzero tick or something else...
19:00 marty hmmm, my bad.  I never noticed but on my machine, using morbo it's about 3% load avarage
19:01 marty I don't know about daemon
19:02 marty oopps, meeting, afk
19:04 bzero with hypnotoad is the same...
19:04 bzero It loads CPU about 2-4%... :(
19:06 * bzero is going to sleep...
19:06 sri http://mojolicio.us/perldoc/​Mojo/IOLoop#accept_interval
19:18 inokenty joined #mojo
19:45 rem_lex|pivo joined #mojo
19:59 mattastrophe joined #mojo
20:10 dabudabu My Mojolicious app is coming along pretty nicely ♪
20:27 sri tempire: here's a bootstrap theme for you http://divshot.github.com/geo-bootstrap/
20:34 preaction that is awesome
20:51 marcus geocities ftw
20:55 jpn joined #mojo
21:20 vervain http://allisonrandal.com/2013/03/31​/mythbusters-why-i-still-love-perl/
22:26 ka2u joined #mojo
22:48 heytrav joined #mojo
23:06 Averna joined #mojo
23:16 hrupp_ joined #mojo

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