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

IRC log for #mojo, 2015-03-10

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

All times shown according to UTC.

Time Nick Message
00:00 sri if it makes tests fail it is kind of something to worry about
00:00 jberger is it making tests fail?
00:00 bpmedley Let me take a screenshot, gimme a few minutes
00:00 sri wait, is that just a warning?
00:00 sri :S
00:01 jberger it usually happens to my modules during global destruction
00:02 bpmedley It’s from the “my $tmpdir = tempdir CLEANUP => 1” in file_lite_app.t, I think.
00:02 sri do the tests fail or pass?
00:04 bpmedley http://bmedley.org/testing_oddity.png  <— PASS with oddity
00:05 bpmedley Tryign 1.10 again
00:05 sri ok, that's all i really care about
00:05 sri clean pass on windows is just a nice to have
00:09 bpmedley 1.10 is similiar
00:09 davido__ joined #mojo
00:11 zackiv31 joined #mojo
00:16 bpmedley http://pastie.org/10013241 <— I ran this in Win 7 with File backend.  It worked!!
00:18 Grinnz "working usually" is all we can really ask for on windows :P
00:22 meshl joined #mojo
00:22 bpmedley sri: Anything for minion you want worked on?
00:25 cfedde joined #mojo
00:29 good_news_everyon joined #mojo
00:29 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/plHz
00:29 good_news_everyon mojo/master 6cd7658 Sebastian Riedel: added daemon attribute to Mojo::Server::Morbo
00:29 good_news_everyon left #mojo
00:29 sri bpmedley: can't think of anything
00:30 bpmedley What about rc scripts?   Can some primitives be added to make them easier?
00:31 sri that's not really stuff for the core distribution
00:31 bpmedley Understood.  Perhaps a reference rc script for contrib, then?
00:33 sri i do of course want something like this for minion, but that's mostly just gui design work https://pypi.python.org/pypi/flower
00:33 bpmedley jberger has something like that; perhaps I can try and spend some time on that
00:34 jberger bpmedley: with this, multiple jobs per process it should get easier
00:34 sri the sidekiq dashboard is pretty sweet https://raw.githubusercontent.com/mperham/sidekiq/master/examples/web-ui.png
00:34 Averna joined #mojo
00:35 jberger oh you meant the gui
00:35 sri yea
00:35 jberger yeah, its in my github under Minion-Monitor
00:35 jberger (I saw the comment about rc scripts)
00:36 jberger https://github.com/jberger/Minion-Command-minion-monitor
00:36 jberger I was even wrong about the name :s
00:42 asarch joined #mojo
00:53 Adura Do you strip perlbrew binaries?
01:00 quibbit joined #mojo
01:03 good_news_everyon joined #mojo
01:03 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/plxg
01:03 good_news_everyon mojo/master b003260 Sebastian Riedel: more consistent tests
01:03 good_news_everyon left #mojo
01:09 quibbit left #mojo
02:09 good_news_everyon joined #mojo
02:09 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/p8ml
02:09 good_news_everyon mojo/master 849bbca Sebastian Riedel: imports go first
02:09 good_news_everyon left #mojo
02:24 klapperl_ joined #mojo
02:26 sri dammit, i screwed up the minion tests
02:26 sri just got a cpantesters mail with like 50 fails
02:27 mst sri: hey, I'm sorry I made you unduly angry
02:28 mst I get protective about rjbs sometimes after bdfuckwit's bullshit
02:29 mst ironically, I have a blog post - http://shadow.cat/blog/passion-anguish/ - which was driven by my wanting to write up my own mistakes
02:30 mst so, yeah, sorry.
02:30 dmanto joined #mojo
02:30 jberger (http://shadow.cat/blog/matt-s-trout/passion-anguish/)
02:32 hshong joined #mojo
02:33 mst fucking hell, sorry, tired
02:34 mst jberger++
02:35 cpan_mojo Minion 1.11 by Sebastian Riedel - http://metacpan.org/release/SRI/Minion-1.11 (depends on Mojolicious)
02:38 bpmedley omnishambolic: mst++
02:42 dmanto left #mojo
02:46 sri mst: that was a really bad day, lets try not repeating that
02:47 mst sri: agree entirely.
02:52 good_news_everyon joined #mojo
02:52 good_news_everyon [mojo] kraih tagged v6.02 at b85aead: http://git.io/p8c4
02:52 good_news_everyon left #mojo
02:53 good_news_everyon joined #mojo
02:53 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/p8co
02:53 good_news_everyon mojo/master eb9a604 Sebastian Riedel: bump version
02:53 good_news_everyon left #mojo
02:53 Grinnz mst, one thing i came away from your article with is "there are people who think 2-arg open or bareword filehandles are okay, in any context?"
02:53 cpan_mojo Mojolicious 6.02 by Sebastian Riedel - http://metacpan.org/release/SRI/Mojolicious-6.02
02:54 mst Grinnz: 2-org open is AWESOME for user-supplied names that have no security context
02:54 Grinnz quite
02:55 mst and if you believe you must always close your filehandles explicitly, and were writing perl years before strict existed, bareword handles probably aren't as big a deal
02:55 Grinnz i'm dumbfounded at the amount of caps over 1-3 characters of difference
02:56 Grinnz i should probably continue not following the p5p mailing list and such...
02:57 bpmedley jberger: I have never seen a talk with so many live demos work so well.
02:58 jberger bpmedley: that's high praise, thanks
02:58 jberger the first time I gave it, I ran every demo
02:58 jberger it worked, but it got kinda boring, since they all worked :-)
02:58 bpmedley Gaw
03:21 mattastrophe joined #mojo
03:25 noganex_ joined #mojo
03:49 crab 2-org open. heh.
03:55 inokenty-w joined #mojo
04:15 Flying_Squirrel joined #mojo
04:15 jzawodn joined #mojo
04:41 Oleg joined #mojo
05:21 Grinnz joined #mojo
05:34 melo joined #mojo
05:36 marmez joined #mojo
05:54 mattastrophe joined #mojo
06:40 dod joined #mojo
06:46 dod joined #mojo
07:10 bramirez joined #mojo
07:11 fhelmber_ joined #mojo
07:15 McA joined #mojo
07:30 fhelmber_ joined #mojo
07:38 ashimema joined #mojo
07:49 Vandal joined #mojo
07:58 dod joined #mojo
08:00 fhelmber_ joined #mojo
08:03 AndrewIsh joined #mojo
08:09 eseyman joined #mojo
08:09 fhelmber_ joined #mojo
08:13 arthas joined #mojo
08:13 fhelmber_ joined #mojo
08:14 fhelmber_ joined #mojo
08:17 fhelmber_ joined #mojo
08:20 fhelmber_ joined #mojo
08:22 fhelmber_ joined #mojo
08:37 trone joined #mojo
08:48 ashimema anyone know if byterock of mojo::pligin::authorization hangs around here?
08:48 ashimema or anyone else fancy confirming a bug I think i've found in that plugin?
08:53 bramirez joined #mojo
08:59 Flying_Squirrel joined #mojo
09:24 danejx quit
09:25 danejx joined #mojo
09:26 Lee ashimema: the repo is on github but byterock doesn't seem to be responsive to PRs
09:26 ashimema he replied to me once..
09:26 ashimema a fair while back..
09:26 ashimema but i was hoping to just talk to someone as it did take a while ;)
09:26 ashimema are you by any chance leejo on github?
09:27 Lee yes
09:27 ashimema just reading your fork ;)
09:27 Lee i have a copy of the repo here if you've reduced the bug to a testcase?
09:27 ashimema I was about to add the same set of tests for the conditions ;)
09:27 ashimema then I spotted you had
09:27 Lee :)
09:27 ashimema I have a feeling it's the way I'm calling it..
09:28 ashimema my perl is still fairly begginer ish ;)
09:29 ashimema I broke out the sub you have to declare into their own module file..  but I was finding that the params being passed were getting all muddled
09:29 ashimema is_role was the one that confused me to start with..
09:30 ashimema using 'my ( $app, $role, $extradata ) = @_; ' I was finding that when passed as a condition.. i was fding all the params were being shifted over by one.. so app was undefined, role contained app, extradata contained role and so on.
09:31 Lee it's a while since i've looked at it, but IIRC it "worked" but just had a couple of annoyances and lacked test coverage
09:31 ashimema tihnk it must be my misunderstanidn of how to break the code blocks out into their own module?
09:31 Lee yes perhaps
09:31 Lee can you nopaste the code you've broken out?
09:31 ashimema yeah.. I reckon it's my misundertaning of perl rather than the module at this point :(
09:31 Lee and how you're calling it
09:34 shadowpaste "ashimema" at 217.168.150.38 pasted "module" (90 lines) at http://paste.scsys.co.uk/469270
09:35 kwa joined #mojo
09:36 shadowpaste "ashimema" at 217.168.150.38 pasted "call" (28 lines) at http://paste.scsys.co.uk/469271
09:37 ashimema first is how I borke out the code.. (with the current lot of horrible warns in whilst I tired to work out what on earth was going on)
09:37 ashimema second is my mojo full app startup code.. stripped down to just show the relevant lines
09:37 Lee i think 'has_priv'   => sub { return Authorization->has_priv(@_); }, is the problem
09:38 Lee i think that will pass an extra argument to the has_priv method
09:38 ashimema ahh.. of course!
09:38 ashimema I'm a muppet!
09:38 ashimema that'll pass 'Authorization' as the first argument.
09:38 Lee ya
09:38 Lee easy mistake to make :)
09:38 ashimema i've made that mitsake before.. years back
09:39 ashimema cheers Lee..
09:39 * ashimema feels rather silly now
09:39 Lee np
09:42 ashimema and now it all works lovely..
09:42 ashimema would be nice to have your extra tests in the released module at some point :)
09:43 ashimema hope he responds to your branch soon ;)
09:43 RelatingData joined #mojo
09:43 Lee if he's at the Swiss perl workshop again this year i'll bug him about it :)
09:44 Lee he may well make it to mojoconf given it's on his side of the pond
09:47 ashimema cool..  that's somthing I'd love to attend.. but it's the wrong side of the pond for me ;)
09:47 ashimema may see if I can talk work into sponsoring me to go though.. there's still hope
09:49 RelatingData joined #mojo
09:52 ashimema joined #mojo
09:56 ashimema joined #mojo
09:59 fhelmber_ joined #mojo
10:35 riche joined #mojo
10:55 alnewkirk joined #mojo
11:01 cpan_mojo SVG-Fill 0.08 by Jens Gassmann - http://metacpan.org/release/JEGADE/SVG-Fill-0.08 (depends on Mojolicious)
11:45 Flying_Squirrel joined #mojo
11:48 bramirez joined #mojo
12:08 Anon021 joined #mojo
12:09 cpan_mojo SVG-Fill 0.09 by Jens Gassmann - http://metacpan.org/release/JEGADE/SVG-Fill-0.09 (depends on Mojolicious)
12:14 asarch joined #mojo
12:19 csson joined #mojo
12:22 neilhwatson joined #mojo
12:38 amon joined #mojo
12:42 dotan joined #mojo
13:02 memowe joined #mojo
13:10 gryphon joined #mojo
13:20 bowtie_ joined #mojo
14:09 mishantil Nice. The failraptor went away from mojoconf.org . :)
14:13 genio not here.  He's barfing rainbows
14:14 marcusr use mojoconf.com instead
14:14 mishantil Oh yeah, seems to be happening randomly.
14:28 niczero joined #mojo
14:35 HtbaaPi is there a way to prioritize routing conditions?
14:43 zackiv31 joined #mojo
14:46 niczero "routes match in the order in which they were defined"
14:47 HtbaaPi I meant conditions you provide with ->over()
14:47 HtbaaPi but it seems my issue is not with prioritizing
15:23 punter joined #mojo
15:27 rj11 joined #mojo
15:30 rj11 Can I use $app->renderer to render a template without a controller? I.e. use it to generate e.g. nginx configuration files.
15:31 good_news_everyon joined #mojo
15:31 good_news_everyon [mojo] kraih pushed 2 new commits to master: http://git.io/pRnI
15:31 good_news_everyon mojo/master b64b673 Michael Jemmeson: fix POD links to Mojo::Cookie::* classes
15:31 good_news_everyon mojo/master 9b88064 Sebastian Riedel: Merge pull request #757 from mjemmeson/pod-mojo-cookie-fix...
15:31 good_news_everyon left #mojo
15:33 mst what happened when you tried?
15:34 jberger rj11: you might just want to try Mojo::Template directly
15:40 rj11 jberger: Thanks!
16:19 noganex_ mh.. is there a way to get the "server" name (morbo, hypnotoad, psgi...) under which an app is running?
16:21 Grinnz_ noganex_: closest would probably be to depend on the mode "development" or "production"
16:21 noganex_ :/
16:21 Grinnz_ what do you need to know the invoker for?
16:22 pink_mist rather: "development" or "not development"
16:22 Grinnz_ pink_mist: i mean because hypnotoad sets it to "production" but yeah
16:23 Oleg joined #mojo
16:27 d4rkie joined #mojo
16:27 D4RK-PH0ENiX joined #mojo
16:42 cpan_mojo Mojo-SMTP-Client 0.02 by Oleg G - http://metacpan.org/release/OLEG/Mojo-SMTP-Client-0.02
16:49 sri wow, the latest expert reviews of http/2 are pretty devastating
16:49 sri https://lists.w3.org/Archives/Public/ietf-http-wg/2015JanMar/0525.html
16:49 sri of course the official answer to the review is "you're too late, maybe next time!"
16:51 mattastrophe joined #mojo
16:53 jberger sri: that really means a vote of no confidence in the working group
16:53 jberger they had plenty of people saying this stuff, they just ignored it
17:00 jberger the first reply is equally scathing: https://lists.w3.org/Archives/Public/ietf-http-wg/2015JanMar/0526.html
17:05 trone usually we have one route that can spread in differents $r0 = under(/a); $r1->(/1) # /a/1 ; $r2->(/2) # /a/2
17:05 trone there is any mechanism to make converge multiple route towards only one ?
17:05 trone (I'd like share the stash)
17:05 Oleg btw, there is http 2 server on cpan https://metacpan.org/pod/Shuvgey
17:06 trone my idea is to have different elaboration that share the same view
17:07 trone elaboration <- route + action chain
17:07 trone probably I don't need a "view" route, but just the "view" template and all the elaboration routes go there.
17:13 Oleg trone: I didn't understand what you need :D
17:15 Grinnz_ trone: make a method of the controller that both actions can call when they're done
17:16 trone Oleg: I'm thinking about a  final action that follow other actions. This final action is "common"  to all the other, so a sort of reversed under. (and meanwhile I write, I think about the plan :-P )
17:17 Oleg May be you need some hook: https://metacpan.org/pod/Mojolicious#HOOKS
17:18 Grinnz_ hook may be a little too global depending what you're trying to do
17:18 trone Grinnz_: yep, a simple method you mean? In past whan I started to do this, I messed up the controller. :-P
17:19 Grinnz_ trone: it's just an object method
17:19 trone Grinnz_: yep.
17:19 Grinnz_ there is nothing to mess up, just don't name it something that will be called by the routing system
17:20 trone Oleg: yep, hooks are an idea. indeed they are global as grinnz says. however, thanks for chatting.
17:20 trone *thnaks for chatting to both. I got a more clear idea about my needs
17:22 Oleg may be you can make this action in sub DESTROY {} of the controller :-p
17:22 Grinnz_ oh god
17:22 Grinnz_ don't ever do that
17:22 Grinnz_ lol
17:22 trone mmm.. :D
17:22 Oleg cool idea, i think :D
17:23 Grinnz_ DESTROY is never a cool idea
17:23 Grinnz_ it's a "well if i have to"
17:23 trone Surely I'll send a plugin. ^_^ Plugin::DestroyTrick
17:25 Grinnz_ DESTROY is why we had this whole mess with IO::Socket::SSL and ForkCall
17:28 mst DESTROY is a great idea, provided it's done carefully
17:28 mst but probably not for what trone has in mind
17:28 mst trone: you never told us *what* the 'final action' was though
17:28 mst trone: so it's impossible to give you a useful answer
17:28 mst trone: because you've refused to tell us what the question us
17:28 mst trone: fix that first please
17:29 Grinnz_ "share the same view" implied that it would be rendering something
17:31 trone mst: the different starting action are search (in different way and with different params), the "final action" is a sort of  "augmenter" (it could to do elaboration useful for all the search-actions) to the previous actions and renderer.
17:31 mst trone: ok, that's -slightly- less vague
17:31 mst trone: now explain what it actually is
17:31 mst augment how?
17:31 trone (I could use a simple shared method # as Grinnz_ say)
17:32 mst yeah, $self->render_search is starting to sound like the right plan
17:32 trone mst: I would add data to the stash, and this data could be indipendnt from results (as time() ) or dependent from results (delayed elaboration from search is done)
17:32 mst I just prefer not guessing until I've got somebody to ask the actual blooming question
17:33 mst trone: I think then a method that does that and the rendering is probably going to be the nicest idea
17:34 trone mst: so a simple method (not binded to a route) called from the other one that "add" the render part ?
17:34 trone methods in controller share the same stash until route is solved?
17:35 mst sub render_search { my ($self, @args) = @_; <do some stuff>; $self->render(@args) }
17:35 trone (without under, I mean)
17:35 mst sort of thing
17:35 trone mst: yep.
17:37 trone I think was the original idea from Grinnz_ .
17:37 trone Indeed I always make the render after the called-action.
17:37 * sri hates DESTROY
17:37 sri it's just badly designed
17:38 Grinnz_ its problems alsmot always arise from either forking or global destruction
17:38 sri makes people depend on a specifc garbage collection strategy
17:39 sri perl6 phasers are better https://perl6advent.wordpress.com/2012/12/15/day-15-phasers-set-to-stun/
17:42 sri and yea... DESTROY + global destruction is always a nightmare
17:43 sri as seen earlier today with the Minion test problem on windows where destruction order prevented a temp file from getting cleaned up
17:44 Grinnz_ oh god... add windows to the mix and there's a whole new set of fun
17:45 mst sri: temp file cleanup normally happens during END before GD starts
17:48 sri not the case with File::Temp though https://metacpan.org/source/DAGOLDEN/File-Temp-0.2304/lib/File/Temp.pm#L1606
17:50 martin joined #mojo
17:50 sri specific problem here was that Minion::Backend::File held a DBM::Deep object which held an open handle for a file in a tempdir, which on windows prevents the removal
17:51 martin feeling I have another silly question coming up..
17:52 martin been writing an api.. using 'return $self->render( json => $body, status => 200 );' for instance as my return from requests
17:52 sri the Minion::Backend::File object was in turn held by the Mojolicious app, which is never explicitly destroyed
17:52 sri so it became a global destruction race between closing the file and cleaning up the tempdir
17:53 martin then whilst looking for how to set the location in a 201 created response I found Mojo::Message.. remind me what Mojo::Message is for?
17:54 sri http://mojolicio.us/perldoc/Mojo/Message#DESCRIPTION
17:54 martin i'm suddenly doubting my render and wondering if I souhld be using messages
17:54 mst sri: ah, right, I stick to having my top level object in a lexical so it goes out of scope at end-of-toplevel-script before END time
17:54 mst at least for code I've written more recently
17:54 martin reading the RFC's now to remind myself what they actually mean ;)
17:54 mst I'm sure the older stuff is all sorts of wrong :)
17:55 sri eeep, using lexical scopes like that in tests seems icky
17:56 sri martin: http://mojolicio.us/perldoc/Mojolicious/Controller#res
17:56 martin cheers sri
17:56 sri martin: actually, this is where you should have learned that http://mojolicio.us/perldoc/Mojolicious/Guides/Tutorial#HTTP
17:56 dod joined #mojo
17:57 disputin joined #mojo
17:58 martin i'm less far off than I thought..
17:58 martin few..
17:58 martin thanks sri.. think i need to re-read the docs regularly.. keep forgetting the basics.
18:02 Grinnz_ martin: the return value doesn't actually matter (except for unders etc), what matters is that render is called, it sets up the response message
18:02 Grinnz_ martin: though i do "return $self->render..." a lot as a way to skip out of a method early
18:02 martin yeah.. that's actually how i'm using mostly Grinnz_
18:03 martin thanks for the pointer though
18:03 martin though I was aware of the unders tidbit..
18:04 martin I've not used 'under' much at all yet..
18:04 martin still very much a learner mojo user ;)
18:04 martin 'tis an awesome piece of kit.. sri++
18:04 martin et al.. ++
18:07 jabberwok http://blog.wlindley.com/2015/03/zero-to-mojolicious-part-3-wp-api/    WordPress's json api still isn't quite "there" yet but we can already pull content from it with Mojo and display in our template.
18:20 maxhq joined #mojo
18:21 maxhq Hi, I am really desparate and wonder if anyone can help: I have a Mojolicious 6.01 application on Perl 5.20.2 that crashes (seg fault) every time a special request is routed to any controller. Routing to a callback works fine, but never any code in a controller is reached. I guess it must be some plugin that uses a hook or any other thing out of my scope. Is there a way to debug the steps Mojolicious does? If I add logging in the routing
18:25 jabberwok instead of «morbo script/myprogram» you can do: «perl -d script/myprogram daemon» to run the Perl debugger
18:25 mst maxhq: 'special request' ?
18:29 sri hs to be pretty special to cause a segfault :)
18:29 sri s/hs/has/
18:34 marmez left #mojo
18:43 Oleg maxhq: try to run with MOJO_NO_NDN environment variable set to true, however i hope this is not what causes this crash :D
18:43 sri we don't even know the mojo version output yet
18:44 Oleg yes, will be good to see
18:56 punter joined #mojo
19:10 disputin joined #mojo
19:31 maxhq Thanks for all your suggestions... I'll now try them. With "special" I mean a certain request.
19:46 Grinnz_ well, we're now running perl 5.18, mojo 6.01 and moo 2.0
19:46 Grinnz_ it's the future
19:47 jberger Grinnz_++
19:47 * Grinnz_ just spent like 10 minutes removing "use warnings NONFATAL => 'all'" from half the source
19:48 mattastrophe joined #mojo
19:50 asarch joined #mojo
19:56 bzero joined #mojo
20:19 berov joined #mojo
20:22 lb 5.18? ancient!
20:22 mst Grinnz_: yeah, I'm going to have to run a regexp at some point adding 'use strictures 2;' to a bunch of files :)
20:23 lb we've started packing perl-apps into a self-contained carton-controlled perlbrew debian package, and the ops guys are loving it
20:23 Grinnz_ mst: use Moo::Strict? :P
20:24 mst Grinnz_: most of my projects already have a 'Foo::Class' actually
20:24 Grinnz_ lb: i'm rather glad we got to 5.18
20:24 mst so it's just a question of adding the relevant import::into call
20:24 Grinnz_ mst: convenient
20:24 purl convenient is still convenient
20:24 mst and on projects where that isn't the case
20:24 mst it's time to slap myself and fix that
20:25 mst the other thing I'm pondering is experimenting with activating strictures via App::MyPerl instead
20:26 sri lb: write about it!
20:27 kaare joined #mojo
20:27 lb sri: i didn't do it, i do architecture, not deployment :)
20:27 lb but i'll suggest it
20:27 sri lb: make someone write about it!
20:29 lb i think we should just go full docker, but things don't move that fast ;)
20:29 sri wait, isn't it cool to hate docker now?
20:30 lb it's also cool to hate perl, but here we are
20:30 Grinnz_ lol
20:31 Grinnz_ i'd take any hate perl gets over what php gets (and deserves)
20:33 fhelmber_ joined #mojo
20:35 jberger lb: I'd like to see a blog post about that stuff, get one of the ops guys on it!
20:35 Grinnz_ blog about it!
20:36 Grinnz_ hmm i thought purl had a response to something like that
20:36 lb ops guys don't know shit about it, which is the nice bit ;)
20:37 fhelmber_ joined #mojo
20:37 lb (jenkins pretty much does all the work if we tag stuff in git correctly)
20:38 fhelmber_ joined #mojo
20:40 * lb passed the ball, we'll see what happens
20:40 lb tomorrow nordic pgday
21:02 sri soo
21:02 sri speaking of pg, does anyone know if the channel passed to LISTEN needs to be quoted with quote() or quote_identifier()?
21:04 jabberwok joined #mojo
21:04 sri whole thing is a bit odd
21:04 mishantil sri: doesn't that depend on wether or not you want to preserve casing of the channel name?
21:04 sri what i know is that "LISTEN channel;" is just unquoted in examples, while the signature of pg_notify is (TEXT, TEXT)
21:05 mishantil notify foo == notify FoO, but notify "foo" != notify "FoO"
21:05 mishantil as far as I can remember
21:06 sri oh, actually the docs for NOTIFY say "channel: Name of the notification channel to be signaled (any identifier)."
21:07 mattastrophe joined #mojo
21:08 sri for the record, it is in fact quote_identifier()
21:08 Adura joined #mojo
21:08 Grinnz_ identifiers get lowercased unless they're quoted iirc
21:08 sri LISTEN 'foo'; does not work
21:08 Grinnz_ double quotes for identifiers
21:08 Grinnz_ single quotes are strings
21:09 sri the confusing part to me is pg_notify(TEXT, TEXT)
21:09 sri i guess it has grown like that over time, and wasn't designed
21:10 mishantil sri: they are just two very different things. :)
21:11 sri it's inconsistent
21:13 mishantil Is it really?
21:14 sri i'm wondering if the notify method should be using NOTIFY of pg_notify() https://github.com/kraih/mojo-pg/blob/master/lib/Mojo/Pg/Database.pm#L66
21:14 sri s/of/or/
21:15 Grinnz_ sri: oh, i get it now. NOTIFY uses an identifier but pg_notify uses a string as the channel name
21:15 Grinnz_ it looks like that was done on purpose, imo
21:16 Grinnz_ i.e. if you want you can pass a parameter as a channel name to pg_notify, but not to NOTIFY
21:17 Grinnz_ sri: in the case you linked, i would definitely stick with pg_notify
21:19 Grinnz_ strange that they don't have a pg_listen()
21:19 sri that's what i thought as well ;p
21:19 sri and pg_unlisten()
21:19 Grinnz_ right
21:20 Grinnz_ a text channel name is certainly more convenient
21:21 sri oh, chrome is goinf typescript :o https://developers.google.com/v8/experiments
21:24 sri and talking about databases... your daily mongodb horror story :) http://developer.olery.com/blog/goodbye-mongodb-hello-postgresql/
21:24 jabberwok Perl 6, meanwhile, regretting the renaming of '.' for concatenation, will now select high-order Unicode codepoints for all operators.
21:25 Grinnz_ lol
21:26 jabberwok very good to see more strictness within eczema^H^H^H^H javascript.  and this looks a good read on mongo
21:26 cpan_mojo Mojolicious-Plugin-BModel 0.04 by Alexander Ruzhnikov - http://metacpan.org/release/BCDE/Mojolicious-Plugin-BModel-0.04
21:27 Grinnz_ postgres++
21:27 sri we just need bigger keyboards for unicode
21:29 berov unicode++
21:29 sri http://www.weirdomatic.com/wp-content/pictures/2009/keyboards/largest_keyboard_world_textile_4.jpg
21:30 Grinnz_ hahaha
21:30 jabberwok more fun than a 7-bank Wurlitzer
21:31 Grinnz_ well nosql does have its uses, like easy deployment for a single app, as i'm playing with redis for
21:31 Grinnz_ but postgres is so much nicer, and not that difficult to set up at least compared to mysql
21:32 berov joined #mojo
21:34 jabberwok aschematic data is certainly useful for collection phases, but i've never grokked how anyone expects mere software to fathom how to pull meaningful stuff out of it. -- the small additional pain of learning postgres is well worth it.
21:35 Grinnz_ it's generally up to how much correctness your software will require
21:35 Grinnz_ sometimes it doesn't raelly matter if something is just missing
21:35 jabberwok pfft, correctness isn't webscale!
21:36 Grinnz_ anyway, i'm planning on making a second backend for this app to use postgres, it shouldn't be too hard to switch between the two when all is said and done
21:36 Grinnz_ just with postgres, i'll have to add something to create the initial schema
21:36 sri i think the appeal of mongodb is more about the query language, which is just a plain old data structure that works well in all programming languages
21:37 Grinnz_ yeah redis doesnt have much of a query language heh
21:37 jabberwok btw, pm.org did change the moribund Gainesville FL group to inactive, thanks
21:37 sri which also happens to be very composable
21:38 sri with sql it can quickly get out of hand
21:39 Grinnz_ MongoDB: Too Bad About The Performance
21:39 sri MongoDB: Too Bad About Your Data
21:39 Grinnz_ haha
21:40 jberger MongoDB: ....
21:41 jberger (sorry, wire protocol broke during query)
21:42 sri i miss the query language much more than the schema-less part
21:42 jberger tbh I never learned it well enough to get into the query language
21:42 mishantil For me the query language never became comfortable.
21:43 jberger I can basically replace my use of it with DBM::Deep and Mojo::Redis2 (depending on use-case)
21:43 mishantil I read a couple of books on the subject, but still it just seemed like a poor substitute for sql.
21:43 sri ->find({foo => {'$in' => [qw(foo bar baz)]}, bar => {'$exists' => 1}})
21:43 mishantil (might be that the books were bad, what do I know..)
21:43 sri i mean, it's not exactly pretty
21:43 sri but easy to work with and composable
21:44 jberger sri: I get your point, its easier to build a query programmatically
21:44 Grinnz_ i need to look into DBM::Deep sometime
21:44 Grinnz_ it might be useful for some stuff i'm working on
21:44 mishantil sri: isn't that sort of composability what DBIx::Class has centered around?
21:44 jberger sri: do you think DBM::Deep could be made to be fork-safe, internally?
21:45 sri mishantil: you can't really compare that to a full blown ORM imo
21:45 Grinnz_ there's a difference between composing queries and composing object relationships
21:45 jberger mishantil: its more like SQL::Abstract
21:45 sri and there is also no disconnect between the code you write and the query that is actually executed by the server
21:46 sri it actually uses the data structure and gives you good errors
21:46 Grinnz_ at this point though i've written so much mysql any abstraction is just another layer of potential weirdness
21:48 mishantil I'mactually pretty pleasantly surprised at how well dbix::class composes queries. Most always it outputs queries like I would write them if I did it manually, except cleaner and more consistent.
21:49 sri still find it hilarious that postgres is better at pub/sub than mongodb though
21:49 Grinnz_ hehe
21:49 mishantil postgres is silly-good at so many things.
21:50 sri they just don't care https://jira.mongodb.org/browse/SERVER-9580
21:50 sri not that the api for it is particularly good, but at least they didn't have to suck so bad at it
21:51 sri in redis terms, mongodb pub/sub is more of a blpop
21:52 sri but it eats cpu like crazy due to bugs
21:56 zivester joined #mojo
21:59 Grinnz_ hah
22:06 maxhq Sorry for beeing off-topic, but: is there a sideeffect-free way in Perl to bundle "use ...; use ...;" boilerplate into one module, so in my project modules I can replace several use-statements with only one?
22:07 d4rkie joined #mojo
22:15 jabberwok maxhq: yes. see O'Reilly's "Perl Hacks" by chromatic, hack #34 "Create a Standard Module Toolkit"
22:16 jabberwok https://metacpan.org/pod/Filter::Macro   gives the answer also
22:17 maxhq jabberwok: thank you very much!
22:18 jabberwok most welcome
22:21 mattastrophe joined #mojo
22:22 jberger maxhq: eeeeee
22:22 jberger that's using Filter::Simple I think we can do better than that
22:27 maxhq jberger: okay... I just fund another module: https://metacpan.org/pod/ToolSet - Maybe that's better?
22:31 Grinnz_ https://metacpan.org/pod/Import::Into
22:40 maxhq Grinnz_: yeah... thanks a lot! That finally worked. I tried with Scope::Upper::reap before but that gave strange results.
22:40 Grinnz_ maxhq: there are lots of ways to do stuff on cpan, and lots of ways not to do stuff on cpan
22:40 Grinnz_ ;)
22:41 maxhq Grinnz_: oh so true. I love CPAN, and I hate it ;-)
22:48 jberger https://metacpan.org/pod/Import::Base
22:49 marty joined #mojo
22:49 Grinnz_ that's also a good one, which uses Import::Into itself
23:45 absolut_todd joined #mojo
23:51 mattastrophe joined #mojo
23:53 marmez joined #mojo

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