Camelia, the Perl 6 bug

IRC log for #mojo, 2013-10-17

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

All times shown according to UTC.

Time Nick Message
00:19 kanishka any apache log file analyser
00:19 kanishka or nginx
00:26 jmmills joined #mojo
01:03 laouji joined #mojo
01:09 saurabh_abhishek joined #mojo
01:25 AndroUser joined #mojo
01:48 d4rkie joined #mojo
01:58 d4rkie joined #mojo
02:07 basic6_ joined #mojo
02:14 franzkafka joined #mojo
02:15 franzkafka I am looking at the EventSource documentation and I am wondering... I have a route set up that takes a few parameters and then updates a column of the database. Could I have that route (or set up another) that writes to the page when someone calls that route and it updates the DB column?
02:15 franzkafka The two paramaters it takes are name and location, so if no DBI error then write("$name has destroyed location..");
02:23 crab huh?
02:24 franzkafka EventSource. Basically I have a route http://domain/route/name/location and when a user goes to that route it updates the database column that matches the location with their name.
02:25 franzkafka Alright, fine and dandy. An AJAX call in my web app that hits that URL with whatever information they enter. Another section of the page contains a log that I'd like for everyone to be able to see.
02:26 franzkafka So, when nameX puts his/her name on locationY, the log is updated with text like, "nameX has put their name on locationY"
02:26 franzkafka I am looking at EventSource (the client browsers do not support WebSockets), and the example is how to send the log to the browser.
02:27 franzkafka I'd like for '/addname/:name/:location' to push "name has put their name on location" to the browser. The problem is, I don't know how to modify the EventSource example to do that.
02:27 franzkafka in Guide::Cookbook that is.
02:37 franzkafka I wish there was a book on this. The documentation is garbage and almost nobody ever seems to be active in the channel.
02:48 crab hum. i was looking at the example in the cookbook, but suddenly there goes my motivation to try and help you.
02:50 crab still, i don't think i would do it the way you describe.
02:51 crab or rather, to make it do exactly what you said, you don't need eventsource. just return text to append to your log.
02:52 crab if you want to use eventsource, do exactly what the example says (i.e. subscribe to a single source of events, say /events) and (on the server-side) feed things to the event sender from other parts of the code.
02:52 russum joined #mojo
02:52 franzkafka and that will update the browser of every person viewing the page?
02:52 franzkafka doesn't seem to work that way for me, thus the need for EventSource or WebSockets
02:52 russum left #mojo
02:52 crab no, it won't update the browser of every person viewing the page.
02:53 franzkafka Also, I may have an attitude but that is entirely due to my frustration with the incredibly horrible documentation.
02:53 crab i don't want to talk about your attitude, only about your problem.
02:53 crab look at Mojo::EventEmitter.
02:54 crab instead of subscribing to app->log's message event, create a class that emits events, and subscribe to that from your <thing-like-the-eventsource-example>
02:55 crab maybe you could call it app->eventlog (by adding has eventlog => ... to your app class).
02:56 zivester joined #mojo
02:59 crab does that help?
03:00 franzkafka That does actually.
03:00 franzkafka Looking at it now.
03:00 franzkafka Thank you.
03:10 d4rkie joined #mojo
03:13 d4rkie joined #mojo
03:19 D4RK-PH0ENiX joined #mojo
03:26 mattp joined #mojo
03:44 preflex_ joined #mojo
03:47 mattp_ joined #mojo
04:19 gtodd left #mojo
04:32 crab so. what could the documentation have done better to help you?
04:37 dqw14 joined #mojo
05:25 dotandimet joined #mojo
05:55 dotandimet1 joined #mojo
06:00 rem_lex|pivo joined #mojo
07:03 dod joined #mojo
07:06 tudorcon1tantin joined #mojo
07:10 phillipadsmith joined #mojo
07:10 Grrrr joined #mojo
07:11 Mikey joined #mojo
07:11 HtbaaPi joined #mojo
07:12 og01 joined #mojo
07:12 diegok joined #mojo
07:21 dpetrov_ joined #mojo
07:22 trone joined #mojo
07:23 hesperaux joined #mojo
07:26 dod joined #mojo
07:48 Vandal joined #mojo
07:57 dod joined #mojo
08:00 dod joined #mojo
08:06 mire_ joined #mojo
08:12 themage joined #mojo
08:12 iSlug joined #mojo
08:12 iSlug Hey !
08:14 iSlug Why do you prefer mojo to dancer or another like catalyst?
08:16 batman franzkafka: sounds like your app is blocking and has a slow backend
08:16 moritz I prefer it over catalyst because catalyst is a pain to get started
08:16 batman 1000/s... i hope that's pr. child process. since it sounds super low.
08:16 moritz first you have to define a sub in some namespace that passes the stuff to the renderer, then in another namespace write a controller, and so on
08:17 moritz I never tried Dancer, so I can't comment on that
08:17 crab iSlug: "mojo" is shorter
08:19 crab iSlug: http://toroid.org/ams/etc/trying-mojolicious
08:19 batman sri: thanks for the group{} change :)
08:20 batman never thought that people would use "0" as a parameter name, hehe
08:23 iSlug nice doc crab thanks
08:25 iSlug Have you example of your online project based on mojo?
08:25 batman sri: would it be an idea to add a negative check method? as in the opposite of like() and in() ? not sure if it would be easy, but it would be cool if all checks could be negated with a not_ prefix (ex. not_like())
08:25 batman i added not_like() and not_in() checks yesterday... would be nice if it could be avoided
08:27 batman i will try to write a patch, if you think it could be a good idea
08:29 batman again: i do like the validation api. been using it at work and in boutique. makes my code so much cleaner :)
08:29 * batman has to go to a meeting.
08:31 basiliscos joined #mojo
08:34 bpmedley iSlug: https://github.com/brianmed/InfoServant-Feeds
08:36 bpmedley iSlug: https://github.com/brianmed/sparky  <-- Not done, though.
08:40 arthas joined #mojo
08:49 sri franzkafka: you attitude is garbage
08:49 sri *+r
08:50 sri franzkafka: consider this a final warning, be nice or don't be here at all
08:52 sri jzawodn++ # hiring timtoady to work on perl6!
08:59 sri batman: it's trivial to add ->not, but the problem i see is error reporting, it would still look like a normal ->like failed
09:00 sri it would also be ->unlike instead of ->not_like
09:01 sri imo ->not is a bad idea... ->unlike and friends are better, since error reporting just works
09:03 iSlug $ morbo script/sciencesocial
09:03 iSlug Can't create listen socket: IO::Socket::INET: Address already in use at /Users/yannickberthoud/perl5/perlbrew/perls/pe​rl-5.18.1/lib/site_perl/5.18.1/Mojo/IOLoop.pm line 117
09:04 sri crab: still waiting for your validation review! :)
09:04 laouji_ joined #mojo
09:04 sri tempire, jberger: and something from you!
09:05 bpmedley iSlug: lsof -i :3000
09:05 batman sri: my not_xxx idea was to provide negative checks for -all- checks automatically
09:06 batman i see the problem with error codes.
09:06 iSlug bpmedley: perl    67390 yannickberthoud    3u  IPv4 0xbcff5daf1486d95d      0t0  TCP *:hbci (LISTEN)
09:06 sri well, if that's your plan you could also make it a plugin :)
09:07 sri have the plugin make opposites of everything in app->validator->checks
09:07 bpmedley iSlug: So, pid 67390?
09:07 iSlug yes?
09:07 iSlug ah
09:08 bpmedley Appears that pid 67390 is already listening on that port
09:08 iSlug kill -9 67390 and morbo..work
09:10 batman sri: ah! of course. will try that first :)
09:10 batman thanks
09:18 Vandal joined #mojo
09:24 rem_lex joined #mojo
09:34 b_leroch joined #mojo
09:40 jpn joined #mojo
09:40 b_leroch Hello, I am new to mojolicious and have a fundamental problem with example applications in the tutorials. Is this the right place to ask such simple questions?
09:42 moritz yes
09:42 b_leroch Hi, this is good to read ;-)
09:43 b_leroch I am currently going through http://mojolicio.us/perldoc/Mojolic​ious/Guides/Growing#Final_prototype
09:43 b_leroch when I enter http://127.0.0.1:3000/?user=sri&amp;pass=secr3t into my browser, I get the following messages on the server side:
09:43 b_leroch $ morbo myapp.pl
09:43 b_leroch [Thu Oct 17 11:39:20 2013] [info] Server listening (http://*:3000)
09:43 b_leroch Server available at http://127.0.0.1:3000.
09:43 b_leroch [Thu Oct 17 11:39:33 2013] [debug] GET / (Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:24.0) Gecko/20100101 Firefox/24.0).
09:43 b_leroch [Thu Oct 17 11:39:33 2013] [debug] Dispatching callback.
09:43 b_leroch [Thu Oct 17 11:39:33 2013] [debug] 302 Found (0.001519s, 658.328/s).
09:43 b_leroch [Thu Oct 17 11:39:33 2013] [debug] GET /protected (Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:24.0) Gecko/20100101 Firefox/24.0).
09:43 b_leroch [Thu Oct 17 11:39:33 2013] [debug] Dispatching callback.
09:43 b_leroch [Thu Oct 17 11:39:33 2013] [debug] Template "protected.html.ep" not found.
09:43 b_leroch [Thu Oct 17 11:39:33 2013] [debug] Nothing has been rendered, assuming delayed response.
09:43 b_leroch [Thu Oct 17 11:39:48 2013] [debug] GET /protected (Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:24.0) Gecko/20100101 Firefox/24.0).
09:43 b_leroch [Thu Oct 17 11:39:48 2013] [debug] Dispatching callback.
09:43 b_leroch [Thu Oct 17 11:39:48 2013] [debug] Template "protected.html.ep" not found.
09:44 b_leroch [Thu Oct 17 11:39:48 2013] [debug] Nothing has been rendered, assuming delayed response.
09:44 b_leroch this looks like the template system does not find the template, but in the final prototype it is still embedded into the myapp.pl
09:44 moritz but DON'T PASTE HERE
09:44 moritz that's what nopaste services are for
09:45 b_leroch Sorry, I never used IRC chat before, I will remember not to paste things.
09:46 dotandimet joined #mojo
09:47 moritz b_leroch: I just tried it myself, and it worked fine
09:47 moritz b_leroch: one thing you have to care of is that if you copy&paste the script, you have to remove leading whitespace
09:48 moritz b_leroch: the __DATA__ and @@ lines may not have leading whitespace
09:49 b_leroch Ok, that's it. Thanks a lot. I used the emacs indentor and it did not remove the whitespace before the @@ lines.
09:51 b_leroch From the server messages, I thought there was something with my mojolicious installation.
09:55 fhelmber_ joined #mojo
09:58 jpn joined #mojo
10:56 maxhq joined #mojo
12:24 Mad_Dud joined #mojo
12:41 dotandimet joined #mojo
13:01 dqw14 joined #mojo
13:11 * sri wonders if all americans are on vacation
13:17 punter joined #mojo
13:20 dqw15 joined #mojo
13:31 keedi joined #mojo
13:59 saurabh_abhishek joined #mojo
14:04 * marty is not on vacation. :(   But, I'm only 45 days away from launch of my new fangled mojolicous ecommerce app.   and after that, it's vacation time for me. o/
14:04 bluescreen joined #mojo
14:05 * tianon wishes he were on vacation
14:16 abhishekisnot joined #mojo
14:18 sri then tempire and jberger must be hiding :o
14:18 * sri puts up traps
14:22 dqw15 joined #mojo
14:23 gryphon joined #mojo
14:27 crab sri: i looked at validation in some detail. i like.
14:28 crab i guess i could convert all of my validation code to use it. it'll just be a bit tedious.
14:28 crab as all big conversions are.
14:28 asarch joined #mojo
14:32 sri \o/
14:32 bluescreen joined #mojo
14:35 sh4 joined #mojo
14:36 * jzawodn just saw mention of us hiring Larry.  yes, we're rather excited and happy to help
14:40 mire_ joined #mojo
14:51 crab who is "us"?
14:51 jzawodn us == craigslist
14:52 jzawodn https://twitter.com/jzawodn​/status/390609563113631744
14:52 sri best employer in the perl community i suppose :)
14:53 jzawodn I like to think we're one of the best, but I'm biased
14:54 sri jzawodn: you don't have as many perl programmers as booking though, do you?
14:54 jzawodn probably not... we have fewer than 10
14:54 sri oh, i see
14:55 sri that's a little surprising
14:55 buu jzawodn: Do you guys have any remote workers?
14:55 Mikey we go a long way.
14:56 sri (booking is all about quantity it seems... 200 perl programmers last i heard)
14:57 jzawodn buu: right now, "remote" is limited to being in the state of california (I'm one of our remote workers--I go in a few times a month)
14:57 jzawodn wow, 200 is a lot
14:57 buu =[
14:58 sri would have figured a site like craigslist was closer to 50
14:58 buu jzawodn: Texas is pretty close right?
14:58 jzawodn sri: 50 is the total company size (roughly)
14:58 jzawodn buu: heh, in some ways.  I'm hoping we'll be able to go beyond CA in the not too distant future.  Silly tax issues/complications (I think).
14:59 sri jzawodn: if you ever decide to hire remote workers in europe drop me a note :D
14:59 buu Haha
14:59 jzawodn sri: I most definitely will!
15:02 sri marcus: had a chance to review validation yet? *nudge nudge*
15:08 jim joined #mojo
15:21 good_news_everyone joined #mojo
15:21 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/osPaeg
15:21 good_news_everyone mojo/master ca78a52 Sebastian Riedel: more validator documentation
15:21 good_news_everyone left #mojo
15:24 iSlug joined #mojo
15:33 marcus sri: I will do it now.
15:33 sri \o/
15:52 marcus sri: I've read through the guide example and all the pod now. Looks good to me.
15:55 sri \o/
15:55 sri that's +3 then
16:08 dvinciguerra joined #mojo
16:09 dqw15 joined #mojo
16:19 dod joined #mojo
16:46 gryphon_ joined #mojo
16:46 russum1 joined #mojo
16:46 ladnaV joined #mojo
16:46 sh4|2 joined #mojo
16:47 jim1 joined #mojo
16:48 sh4|3 joined #mojo
16:50 sh4 joined #mojo
16:51 good_news_everyone joined #mojo
16:51 good_news_everyone [mojo] kraih tagged v4.49 at 1607206: http://git.io/1e8SFg
16:51 good_news_everyone left #mojo
16:51 sri well, then lets stabilize validation :)
16:53 sh4|2 joined #mojo
16:58 sh4 joined #mojo
17:19 batman joined #mojo
17:30 punter joined #mojo
17:31 damaya joined #mojo
17:32 damaya Is it possible to have a daemon as part of my webapp that updates a database every 30 seconds or so? Or should I just seperate something like that out into a different script?
17:47 tudorconstantin joined #mojo
17:48 d4rkie joined #mojo
17:52 nicomen joined #mojo
17:52 mst joined #mojo
17:56 hrupp joined #mojo
18:02 d4rkie joined #mojo
18:22 batman damaya: a separate something
18:23 batman perl -MMojo::IOLoop -e'Mojo::IOLoop->recurring(30 => \&update_db); Mojo::IOLoop->start' :)
18:23 dvinciguerra joined #mojo
18:24 * sri was about to say "batman: YOU'RE WRONG!"... but batman is right :S
18:24 batman i'm always right. especially when i'm wrong
18:24 batman _|o|_
18:25 sri broke your legs?
18:25 batman no. climbing up a ladder
18:26 sri and you broke the ladder?
18:29 bluescreen joined #mojo
18:30 batman you're on top of the building watching me come up the last part
18:30 batman USE YOUR IMAGINATION!!!!!!
18:30 batman ;)
18:30 batman hehe
18:31 sri http://4.bp.blogspot.com/-7DupXA0gNJ0/UZYh2VLwdd​I/AAAAAAAAA1w/7V9rdFCdIlo/s1600/donkey-kong.jpg
18:31 sri ?
18:32 batman haha :D
18:32 sri :O
18:42 nicomen $ perl -le 'print _|o|_;'
18:42 nicomen 
18:43 nicomen that's supposed to be 0x7f
18:43 mire_ joined #mojo
18:48 btyler joined #mojo
19:22 ilbot2 joined #mojo
19:22 Topic for #mojo is now 🎩, indubitably | http://mojolicio.us | http://irclog.perlgeek.de/mojo/today
19:26 thomason I want to make sure I've got a good handle on using the stash and params.
19:27 thomason It seems like calling ->param('foo') would first check for :foo as part of a route, then see if a value is in the stash, then see if there's a passed (GET|POST) parameter. Is that about right?
19:30 thomason I guess, for documentation purposes, does defining a value in the stash (or in a route) consider it a reserved stash value as far as ->param() is concerned?
19:34 alnewkirk no and no (in any web framework)
19:35 alnewkirk ->param() should check the route for params, then the querystring, then the body.
19:35 alnewkirk never the stash
19:36 alnewkirk stash is a seperate thing and you can reserve spaces
19:36 alnewkirk separate*
19:37 alnewkirk can't*
19:37 alnewkirk can't reserve spaces
19:37 alnewkirk (sigh ... I botched this didn't I)
19:47 good_news_everyone joined #mojo
19:47 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/XU8uuw
19:47 good_news_everyone mojo/master cfe02df Sebastian Riedel: improved Mojo::Message to allow max_message_size check to be disabled
19:47 good_news_everyone left #mojo
19:50 priodev joined #mojo
19:53 mmp joined #mojo
19:54 thomason I may just be using the wrong terminology. If I set up a route as ->get('/foo/:bar')->to(bar=>'VAL',...); Isn't that tossing 'bar' into the stash (set to 'VAL'), and also returning 'VAL' when ->param('bar') is called?
19:55 alnewkirk yes
19:55 _sri thomason: http://mojolicio.us/perldoc/Mojolicious/Gu​ides/Routing#Placeholders_and_destinations
19:57 thomason Right, so then it is doing what I said, and one of the places that ->param checks for a value is in the stash.
19:57 _sri http://mojolicio.us/perldoc/​Mojolicious/Controller#param
19:58 thomason I don't see anything in the docs about which one value, though. That's what I'm trying to ascertain. I can set a parameter via a route, a query string param, post param, stash value, etc. I want to make sure on which one is chosen if multiple ones are present.
19:58 thomason Or is the preferred approach to just be explicit about which potential location you're querying against?
19:58 _sri i don't understand the question
19:59 alnewkirk thomason: yes, be specific when you need to
19:59 alnewkirk simple.
19:59 thomason ->get('foo/:bar')->to('bar'=>'VAL',...); I load up the URL http://something.com/foo/abc?bar=def
20:00 thomason If I query ->param('bar'), what value do I get back? It looks like it checks the route, then the stash, then a query string param. I'm trying to confirm if that's correct and can be assumed.
20:00 alnewkirk that first thing that come to mind is, .. why would you allow that to happen
20:01 alnewkirk it's terribly confusing for the resource users and developers
20:01 thomason I'm not trying to allow that to happen, I just want to make sure I know the order of operations.
20:01 thomason My specific concern is if another dev comes in and adds a value to the stash that should be an internal parameter, I want to confirm that it cannot be overridden by a black hat handing it in in the query string if the dev is getting the value via ->param() instead of ->stash().
20:02 thomason Or if ->stash() MUST be enforced in those cases.
20:03 thomason Besides, there's nothing to stop anyone from accessing a URL in that manner (encouraged or not), and I just want to confirm how mojo would react to it.
20:03 alnewkirk how about just naming your parameters better
20:04 alnewkirk maybe stashing your internal variable somewhere specific/deeper
20:04 Mikey my chief concern is another sysadmin just putting their own /sbin/init
20:05 alnewkirk mojo stashes things in mojo.*
20:05 alnewkirk guess what happens if I overwrite those entries?
20:05 good_news_everyone joined #mojo
20:05 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/4npWKw
20:05 good_news_everyone mojo/master 6c3f774 Sebastian Riedel: list param sources in order of precedence
20:05 good_news_everyone left #mojo
20:06 Mikey a swirling vortex to hell opens?
20:06 alnewkirk petty much, yeah
20:07 thomason See, that's what I thought was the case (new docs). But if I set a value in the stash, it looks like it always uses that value and ignores any query_string params. That seemed odd, and was trying to confirm.
20:10 good_news_everyone joined #mojo
20:10 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/dse7SQ
20:10 good_news_everyone mojo/master f797b74 Sebastian Riedel: note that the message body needs to be loaded into memory for validation
20:10 good_news_everyone left #mojo
20:17 good_news_everyone joined #mojo
20:17 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/newpQQ
20:17 good_news_everyone mojo/master ec13823 Sebastian Riedel: fixed a few typos in documentation
20:17 good_news_everyone left #mojo
20:21 rem_lex| joined #mojo
20:54 chansen joined #mojo
21:08 tba_ joined #mojo
21:11 jim1 is it intentional the mojocasts don't have sound?
21:14 go|dfish jim1: works here..
21:14 jim1 @go it has sound?
21:15 go|dfish yes
21:15 jim1 ok thx
21:16 jim1 must be my firefox. chrome works. :)
21:16 go|dfish ah :)
21:39 lukep joined #mojo
21:47 dvinciguerra joined #mojo
22:04 saurabh_abhishek joined #mojo
22:29 saurabh_abhishek joined #mojo
22:37 saurabh_abhishek joined #mojo
22:49 jberger_ joined #mojo
22:50 * jberger_ gets caught in sri's trap
22:51 jberger_ Not on vacation, just busier than hell
22:56 saurabh_abhishek joined #mojo
22:57 _sri \o/
22:57 * _sri chains jberger to the channel
23:02 jberger_ Damn now I'm trapped AND chained
23:03 jberger_ In that case, what can I do for you?
23:05 jberger_ Btw: keep your eyes on this guy: https://metacpan.org/author/CALID
23:06 jberger_ He and I are talking about a side project that sri will be excited about
23:07 jberger_ If we get time that is
23:09 dqw15 joined #mojo
23:13 sri jberger_: well, i wanted you to review form validation :)
23:14 jberger_ I still haven't had time to really work it hard
23:14 jberger_ But I love the pluggability
23:14 sri it's too late now anyway, i made it stable today ;p
23:15 sri it had +3 votes
23:15 jberger_ In that case, I vote +1
23:15 sri -.-
23:15 jberger_ :-p
23:15 * jberger_ jumps on the bandwagon
23:16 * sri waves at future self... since he thinks this might be one of those moments in history he will link back to o/
23:16 passos joined #mojo
23:16 sri now only tempire didn't vote
23:16 jberger_ Truly, it looked fine to me, but you yourself taught me not to vote until I had really thought about something
23:17 sri that worked out well ;p
23:28 jberger_ joined #mojo
23:31 * sri wonders if Mojo::JSON could be converted to use the big regular expression and how fast it would be http://www.slideshare.net/brian_d_foy/json-regex
23:31 russum joined #mojo
23:32 jberger_ I thought I had seen some stats that had sequential regexen faster than one large regex
23:33 sri well, the regex engine would have to reach out to perl *a lot*
23:33 passos joined #mojo
23:34 * passos
23:34 passos left #mojo
23:34 * sri wonders if those context switches are very expensive
23:58 saurabh_abhishek joined #mojo

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