The web in a box - a next generation web framework for the Perl programming language

IRC log for #mojo, 2015-03-15

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

All times shown according to UTC.

Time Nick Message
00:39 mattastrophe_ joined #mojo
01:26 sri purl: seen odc
01:26 purl odc was last seen on #mojo 9 days, 11 hours, 10 minutes and 37 seconds ago, saying: yeah, i guess $delay->begin is more complicated than that  [Mar  5 14:15:55 2015]
01:34 Grinnz joined #mojo
02:13 Anon021 joined #mojo
02:18 klapperl joined #mojo
02:23 csson joined #mojo
02:27 mattastrophe_ joined #mojo
02:36 asarch joined #mojo
02:39 marmez left #mojo
03:16 good_news_everyon joined #mojo
03:16 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/ppPK
03:16 good_news_everyon mojo/master a3885b5 Sebastian Riedel: explain form_for in the rendering guide
03:16 good_news_everyon left #mojo
03:17 sri not the best example in the guide... but at least it gets the point across -.-
03:19 Zoffix $c->redirect_to('form'); ? Would that work?
03:19 noganex joined #mojo
03:22 Zoffix yup. Cool.
03:45 sri http://mojolicio.us/perldoc/Mojolicious/Guides/Tutorial#Route-names
03:47 Zoffix Thanks. I thought foo in get '/' => 'foo' was just a name of a template to use, not a name of a route. Neat.
03:58 good_news_everyon joined #mojo
03:58 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/ppDG
03:58 good_news_everyon mojo/master f72533c Sebastian Riedel: mention GET and POST as well
03:58 good_news_everyon left #mojo
04:07 melo1 joined #mojo
04:13 good_news_everyon joined #mojo
04:13 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/ppHt
04:13 good_news_everyon mojo/master b30ce8b Sebastian Riedel: show request variants in comments
04:13 good_news_everyon left #mojo
04:14 sri the form sections are still a bit dense, but at least the first example is little less complicated http://mojolicio.us/perldoc/Mojolicious/Guides/Rendering#Forms
04:21 absolut_todd joined #mojo
04:38 jb360 joined #mojo
06:12 Oleg joined #mojo
06:20 marmez joined #mojo
06:25 sri hmm, is it "a _method query parameter" or "an _method query parameter"?
06:26 Zoffix "a _method query parameter"
06:27 avenj I think I agree with Zoffix on the premise that a consonant is the next actual letter but it's an intriguing question if you attempt to read it out loud
06:27 sri it sounds weird when i say it
06:27 sri ", a C<_method> query parameter will be added as well."
06:27 sri a underscore method query parameter...
06:27 avenj right
06:27 Zoffix Yeah. If reading out loud, you'd say "an underscore method query"... but when I read it on a screen, I read it as "... a method query parameter"...
06:29 avenj my father was a professional writer for 40ish years with a phd in the subject.  should I call and wake him up to ask for a weigh-in?
06:29 avenj he'd totally appreciate it
06:29 sri lol
06:30 Zoffix Yes! I want to know his opinion :)
06:30 Zoffix I'd say "an" is correct, but "a" won't cause me to pause and go "huh?" for a sec :)
06:31 sri right now it is "an"
06:31 Zoffix Would there be an article at all?
06:31 Zoffix What's the full sentence?
06:31 sri http://mojolicio.us/perldoc/Mojolicious/Plugin/TagHelpers#form_for
06:32 sri it's actually two sentences, here's one too http://mojolicio.us/perldoc/Mojolicious/Guides/Rendering#Forms
06:35 Zoffix I wound't use an article there at all "...they are spoofed with `_method` query parameter..." reads well to me. Though English isn't my native language and I really suck with using articles properly :P
06:53 cpan_mojo Mojolicious-Plugin-FormChecker 1.001001 by Zoffix Znet - http://metacpan.org/release/ZOFFIX/Mojolicious-Plugin-FormChecker-1.001001
07:00 marmez left #mojo
07:19 dod joined #mojo
07:25 dod joined #mojo
07:31 absolut_todd joined #mojo
07:48 sh4 joined #mojo
08:10 kaare joined #mojo
08:12 Vandal joined #mojo
08:14 irq joined #mojo
08:47 augensalat sri: ioloop.t is passing now on solaris - even with a timout=5
08:51 juikuen joined #mojo
09:12 berov joined #mojo
10:29 riche joined #mojo
10:31 riche sri: when you have a chance, doing an RT on the Mojoconf call for papers tweet would be excellent
10:57 irq_ joined #mojo
11:21 amon joined #mojo
11:56 Adurah joined #mojo
12:10 mattastrophe_ joined #mojo
12:38 basic6 joined #mojo
13:09 PotatoGim^Home joined #mojo
13:21 mattastrophe_ joined #mojo
14:14 uma joined #mojo
14:15 uma Hi jberger, Just checked out your dbi application on your blog
14:15 uma thanks for that
14:15 uma Are you the developer of Mojo?
14:18 reneeb joined #mojo
14:21 crab joined #mojo
14:32 jberger uma: glad you like it, I probably should check those older articles to make sure they are still up to date
14:32 jberger I am on the core dev team yes
14:32 jberger but certainly not the primary dev
14:34 gryphon joined #mojo
14:35 jberger and uma's gone
14:35 jberger ok
14:49 riche joined #mojo
15:11 trone joined #mojo
15:34 uma joined #mojo
15:45 mattastrophe_ joined #mojo
15:57 sh4 joined #mojo
16:14 mattastrophe joined #mojo
16:19 sri augensalat: \o/
16:20 sri riche: already done 2 days ago
16:26 phil joined #mojo
16:27 phil Hi, I have some questions.
16:27 phil http://pastebin.com/YWeErreJ
16:27 phil What's the difference between these?
16:27 phil What's the better/preferred method?
16:27 phil Why is there "state" in the 1st but not in the 2nd method?
16:28 sri one is a helper, the other an attribute
16:28 zivester joined #mojo
16:28 sri perldoc -f state
16:34 sri both have their uses
16:34 sri in fact, the Mojo::Pg blog example uses both https://github.com/kraih/mojo-pg/tree/master/examples/blog
16:35 sri https://github.com/kraih/mojo-pg/blob/master/examples/blog/lib/Blog.pm#L17
16:35 sri https://github.com/kraih/mojo-pg/blob/master/examples/blog/lib/Blog/Model/Posts.pm#L4
16:36 phil ok thanks, is there a reason why Blog.pm uses the helper?
16:36 sri do you know how helpers work yet?
16:37 sri http://mojolicio.us/perldoc/Mojolicious/Guides/Rendering#Helpers
16:38 sri it's a question of scope
16:39 phil ok
16:41 punter joined #mojo
16:41 punter Anyone in Cluj?
16:44 sri lol http://swiftwtf.tumblr.com/
16:46 jberger some of those are tough, but this: http://swiftwtf.tumblr.com/post/88379189593 :o
16:47 jberger eh, well, maybe not, just feels weird
16:55 sri so, any ideas for a more appropriate non-GET/POST form example than this? http://mojolicio.us/perldoc/Mojolicious/Guides/Rendering#Forms
17:02 jberger how does the flash prevent double submit?
17:02 sri because you can display a message after redirect
17:03 jberger so it doesn't prevent double submission technically, it informs the user so they don't make the attempt
17:03 sri double submit is the whole point the flash exists
17:04 sri do you know what the double submit problem is?
17:06 sri GET /users/create -> POST /users -> user reloads page and resubmits the form
17:06 crab what is the double submit problem?
17:07 sri correct workflow is GET /users/create -> POST /users -> redirect to GET /users/23
17:08 sri but, then you don't normally get to show the user a confirmation message
17:08 sri so, the flash was invented
17:08 jberger ah, right
17:08 jberger the confirmation
17:08 purl rumour has it the confirmation is a done when a kid is old enough to accept the covenant of baptism
17:08 jberger purl is apparently religiously aware
17:08 * jberger converts purl to pastafarianism
17:10 bpmedley sri: Does that example currently work?  I get a page not found.
17:10 sri certainly does
17:12 sri it's not a great example, which is why i'm interested in better ideas
17:12 sri only requirement is a non-GET/POST method
17:20 good_news_everyon joined #mojo
17:20 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/herA
17:20 good_news_everyon mojo/master 9fa5f8f Sebastian Riedel: use a slightly more generic form_for example
17:20 good_news_everyon left #mojo
17:23 sri a little better
17:23 sri at least not as wrong as before
17:53 sri hahahaha, this is awesome https://github.com/matiasinsaurralde/facebook-tunnel#why
17:53 Grinnz lol
17:55 mst omg
18:40 punter joined #mojo
18:47 juikuen joined #mojo
18:47 marcusr seems efficient
18:50 KCL_ joined #mojo
19:16 sri who needs net neutrality when you can tunnel http over facebook chat
19:18 * jberger watches netflix by sending screenshots over imgur
19:23 Oleg found interesting thing about closures and circular references which I can't understand http://stackoverflow.com/questions/29065071/nested-closures-and-captured-variables
19:25 mst Oleg: simple, if you close over anything in a sub then perl closes over the entire pad
19:25 mst so $self is still getting captured by the inner closure
19:26 Oleg oh, this is bad, I didn't expect this behavior
19:26 mst it's a trifle irritating sometimes
19:27 Oleg ok, thanks, mst. Now I will know
19:39 mst Oleg: one approach to this is
19:39 mst $self->{surprise} = (sub { my $s = shift; sub { say $s } })->($s);
19:39 mst ala the javascript approach to get an independent copy of a loop igerator
19:40 Oleg yea, this is why i hate javascript :D
19:41 mst yeah, well, perl's -less- dumb but still dumb
19:50 * sri didn't know that either
19:54 jberger sri: have you found a pg upsert that you don't hate
19:54 jberger ?
19:54 sri that seems terrible
19:54 sri jberger: no
19:55 jberger how horrible is this? http://stackoverflow.com/a/8702291/468327
19:57 sri no locking makes me sceptical
19:58 crab doesn't seem likely that upsert will make it into 9.5 either
20:01 sri reasoning seems to be that upsert is complicated for replication
20:01 sri and more powerful replication is higher up on the todo list
20:01 crab not really. there are a lot of other problems with the approach.
20:02 * sri vaguely remembers reading something about that
20:03 mst upsert is way harder than it initially appears
20:31 mst http://toroid.org/lweshal
20:32 mst bah, wrong fucking channel
20:32 * crab eyes mst suspiciously
20:32 mst crab: #perl talked about huts in the middle of nowhere
20:32 mst I thought of you
20:34 Zoffix :D
20:34 * sri likes having some nature around, but that's just too much
20:36 crab sri: deer, porcupines, and wild boar come by every once in a while to raid the fields at night.
20:37 Zoffix Nice :)
20:37 sri we have deers here too
20:37 Zoffix crab, what's the rent? I'm looking for a quieter place :D
20:37 sri s/s//
20:39 crab zoffix: i could rent you my shed, but i like it too much to ever give it up.
20:39 Zoffix :)
20:41 berov mst: you are swearing in Bulgarian ;)
20:41 berov bah - shor for ebah - means fuck
20:42 berov short*
20:42 sri bah
20:42 berov haha
20:46 jberger ok, so I'm at a loss
20:46 jberger I need to ensure that a row exists before I update a column
20:46 jberger any advice would be appreciated
20:46 sri take a step back
20:46 jberger ok
20:47 jberger you are suggesting that the schema is bad
20:47 jberger I suppose that's possible
20:47 sri it's not enough to update and count the updated rows?
20:47 jberger and if not then create it?
20:47 crab jberger: if you really have to, just use the plpgsql exception-catching version that does an insert and swallows the uniqueness violation
20:48 sri jberger: this is how i do it, and got called names for by #postgresql ;p https://github.com/kraih/minion/blob/master/lib/Minion/Backend/Pg.pm#L84
20:49 jberger its hard to believe that this should be this hard
20:49 jberger and even that its so hard to find guidance online
20:49 sri (there was a false assumption about a possible race condition though)
20:50 jberger yeah, I don't realistically have one either
20:50 jberger a user isn't going to be deleted as he is begin made a conference admin
20:50 marmez joined #mojo
20:51 sri in my case there is no possible race condition because id is a serial
20:52 jberger ah, true
20:52 mst I'd have a separate m2m role table
20:53 jberger sorry m2m?
20:54 pink_mist many-to-many
20:54 purl it has been said that many-to-many is a tough one in CDBI or less clear
20:54 jberger ah
20:54 sri or mst likes norwegian pop music
20:56 mst pop music is Incorrect
20:56 crab i thought norway only produced death metal
20:56 sri yea, i'm really disappointed with you right now marcusr and batman
20:58 Grinnz in mysql you just do insert ... on duplicate key update
20:58 Grinnz that's one thing i miss in postgres
21:00 * sri still wants a better example for http://mojolicio.us/perldoc/Mojolicious/Guides/Rendering#Forms
21:00 Grinnz if i ever generate a form through perl ill let you know ;p
21:01 sri was thinking of making it post a gist, but github csrf token ruins the simplicity
21:03 jberger actually the github tokens are really easy to handle
21:03 jberger since the user can make them themselves
21:03 jberger you don't need the back and forth
21:04 crab oh? how does that work?
21:04 jberger https://github.com/jberger/Mojolicious-Command-nopaste/blob/master/lib/Mojolicious/Command/nopaste/Service/gist.pm
21:05 jberger in your user options on github you can generate tokens and give them a scope
21:05 mst I believe ingy's 'git hub' does that automatically on first run or so
21:06 sri not the token i mean
21:06 sri i really mean the csrf token used for the anon gist form
21:06 mst ohh
21:06 jberger sri: my command doesn't need it
21:06 jberger oh, right anon
21:06 jberger nm
21:07 Zoffix Is it possible to make it so I don't get errors like "Global symbol "$login_failed" requires explicit package name"? I got this code http://fpaste.scsys.co.uk/469467 and when it's in 'GET', the $login_failed used in the template isn't set...
21:08 sri http://mojolicio.us/perldoc/Mojolicious/Guides/Rendering#Stash-data
21:09 Zoffix Thanks a lot.
21:23 good_news_everyon joined #mojo
21:23 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/hvPP
21:23 good_news_everyon mojo/master 09c3a36 Sebastian Riedel: mention the performance cost of optional stash values
21:23 good_news_everyon left #mojo
21:26 * pink_mist tends to add a ->declare() helper that basically just does $self->stash($_ => undef) for @_; return $self
21:27 meshl joined #mojo
21:27 good_news_everyon joined #mojo
21:27 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/hvXZ
21:27 good_news_everyon mojo/master b6100f9 Sebastian Riedel: fix typo in stash example
21:27 good_news_everyon left #mojo
21:28 sri in case anyone wants to see why or work on a better solution, just set MOJO_TEMPLATE_DEBUG=1
21:29 sri we managed to get rid of helper boilerplate in templates last year... so who knows, maybe there's a clever solution here too
21:30 jberger sri: that was a fun day
21:30 sri indeed
21:32 sri one of the most significant changes ever in mojolicious and most users will never know :)
21:34 jberger FREE HELPERS FOR EVERYONE!!! YOU GET A HELPER AND YOU GET A HELPER!!!
21:34 jberger EVERYBODY GETS A HELPER!!!
21:34 * jberger is done now
21:35 sri \o/
21:36 jberger hmmm, on second thought, should have used a meme
21:36 sri obviously
21:38 sri http://cdn.meme.am/instances/58830227.jpg
21:43 jberger purl: no, obviously is <reply>http://cdn.meme.am/instances/58830227.jpg
21:43 purl okay, jberger.
21:53 punter joined #mojo
21:53 good_news_everyon joined #mojo
21:53 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/hvSk
21:53 good_news_everyon mojo/master a286cd7 Sebastian Riedel: just do nothing in the form_for example
21:53 good_news_everyon left #mojo
21:54 sri :)
21:54 Zoffix :)
22:00 good_news_everyon joined #mojo
22:00 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/hv9m
22:00 good_news_everyon mojo/master e0e23e4 Sebastian Riedel: explain how the confirmation message works
22:00 good_news_everyon left #mojo
22:00 jberger sri: obviously
22:00 purl http://cdn.meme.am/instances/58830227.jpg
22:00 jberger \o/
22:00 sri http://www.quickmeme.com/img/0f/0f013d102581b62cb410ae0d1d53d4f033132f652c0c8f6ac920a5ea39daf0a0.jpg
22:01 Zoffix "your" >_<
22:03 mst its not the most annoying mistake
22:03 jberger I need to watch more Archer
22:03 jberger well, tbh, s/more//
22:03 mst honestly, it's grammar is pretty reasonable
22:03 * Zoffix twitches
22:05 crab thanks alot, now i won't be able to sleep.
22:05 crab on the other hand, maybe it's not worth loosing sleep over.
22:07 jberger crab: no, thats a whole nother problem
22:08 * jberger wonders how much more it will take before Zoffix pops)
22:08 lb a few more grammer misstakes
22:09 crab jberger: well, it needs fixed anyway.
22:09 mst Zoffix: http://trout.me.uk/ocd.png
22:09 lb mst: argh
22:09 Zoffix mst, I hate you :)
22:09 Zoffix :D
22:09 pink_mist it's spelled CDO! the letters need to be alphabetised
22:12 * jberger wonders why Zoffix used a bare : before closing mst's horrific blunder
22:13 Zoffix :)
22:13 jberger pink_mist: the letters are clearly ordered by circularity, where line completeness is less important than curvature
22:14 Zoffix His blunder also included not capitalizing all the words correctly! :D
22:14 Zoffix And questionable use of the hyphen.
22:27 melo joined #mojo
22:30 juikuen joined #mojo
23:05 marty does anybody have suggestion or experience with how to do rate limiting with hypnotoad.  Specifically, I'd like to implement a "leaky bucket" algorithm.
23:39 nicomen marty: I have no idea, but I wonder if that is something that belongs in a specialized rate limiting front server?

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