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

IRC log for #mojo, 2015-09-04

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

All times shown according to UTC.

Time Nick Message
00:00 Grinnz ah yes, actually i did put them in a plugin :)
00:01 sri and as it happens, there you see $self and $app together
00:01 sri $self is just an instance of the current class
00:02 sri while $app is the application, which gets passed along as an argument to register()
00:02 Grinnz plugins are actually where i get $self confused the most... luckily plugins tend to break when you call anything other than register on them
00:02 PopeFelix jberger, You think intercept_request rather than rewrite_url?
00:02 sri jberger actually used to like passing around instances of plugins :)
00:03 sri $app->helper(my_plugin => sub {$self})
00:03 sri $c->my_plugin->foo()
00:03 Grinnz that's something i'm playing with for my bot framework actually
00:03 sri sub foo {...} being a method in the plugin
00:03 Grinnz not quite like that though
00:04 Grinnz i'm struggling to figure out the best paradigm to use for my bot's plugins
00:04 sri nested helpers have replaced most of those hacks now
00:07 jberger sri: I still like it, I just haven't had much need of it lately
00:07 Grinnz i tried refactoring them to mojo-style but it became a mess because a lot of them have to keep state
00:08 jberger I really only use that if I want the plugin to have attributes
00:08 Grinnz yeah thats exactly it... i'm using attributes on the plugins
00:08 jberger So do as sri said, closer over the instance
00:08 thowe hmm.  I love it when I refactor a bunch of code and it works perfectly on my first try  :)
00:08 jberger See my ppi pluggin
00:08 Grinnz i'll try that next
00:09 thowe Thanks guys.  Logging is now a helper \o/
00:09 Grinnz \o/
00:09 PopeFelix joined #mojo
00:09 PopeFelix well, that was annoying.
00:10 PopeFelix probably ought to plug this thing in.
00:10 jberger https://metacpan.org/source/JBERGER/Mojolicious-Plugin-PPI-0.07/lib/Mojolicious/Plugin/PPI.pm#L66
00:10 jberger thowe++
00:10 Grinnz yeah, the problem i kept running into was accessing the plugin object again, so that should work
00:12 Grinnz probably doesn't get used much in web apps because web apps are generally stateless
00:13 Grinnz or if there is state, you put it in a database
00:13 Grinnz or the session, or...
00:18 thowe OK, beer and home.  Thanks again guys.
00:22 kmx joined #mojo
00:27 mattastrophe joined #mojo
01:21 asarch joined #mojo
02:08 noganex_ joined #mojo
02:26 ivi joined #mojo
02:30 ivi joined #mojo
02:35 ivi joined #mojo
02:35 ivi joined #mojo
02:37 x86 joined #mojo
02:45 ivi joined #mojo
02:48 kaare joined #mojo
02:56 Repaster joined #mojo
02:56 PopeFelix joined #mojo
04:19 melo joined #mojo
04:24 inokenty-w joined #mojo
04:32 x86 joined #mojo
05:33 sri intriguing http://pyparallel.org/
05:36 sri https://github.com/pyparallel/pyparallel#overview
05:38 sri how it beats Go in HTTP benchmarks is quite impressive
05:40 sri hehe, it's windows only for now because pthreads are bad
05:45 sri hmm, looks like Go was fighting with GC in the benchmarks
05:46 dod joined #mojo
05:53 dod joined #mojo
06:08 x86_ joined #mojo
06:54 AndrewIsh joined #mojo
07:06 eseyman joined #mojo
07:16 Vandal joined #mojo
07:22 rwp joined #mojo
07:24 trone joined #mojo
08:01 meshl joined #mojo
08:05 trone joined #mojo
08:51 berov1 joined #mojo
09:15 amon joined #mojo
09:26 mattastrophe joined #mojo
09:51 jontaylor joined #mojo
09:53 melo joined #mojo
10:41 melo joined #mojo
10:51 icjs joined #mojo
10:53 icjs hola, anyone know why "carton exec 'morbo script/foo --listen http://0.0.0.0:8080'" always seems to resist being killed with ctrl-c
10:55 Zoffix icjs, never used carton, but in my experience, morbo refusing to die is because (a) it reloads the server due to SASS errors in files used by AssetPack plugin (b) I tell it to listen a directory that is being constantly refreshed
10:57 icjs Zoffix, i dont recognize that plugin - how can i tell if i'm using it?
10:59 mattastrophe_ joined #mojo
11:48 kwa icjs: You'd know if you're using it as you need to explicitly add it to the startup().
11:54 icjs kwa, ok thanks - i cannot see it and a grep of the codebase does not find "assetpack" either
12:30 absolut_todd joined #mojo
13:26 hernanGOA joined #mojo
13:36 ajr_ joined #mojo
13:37 charsbar joined #mojo
13:42 charsbar joined #mojo
13:48 asm35 joined #mojo
14:06 PopeFelix joined #mojo
14:08 PopeF joined #mojo
14:08 jberger icjs: does the same happen for the daemon
14:08 jberger ?
14:19 stephen joined #mojo
14:50 * sri yawns
14:52 * batman survived the swagger talk! :)
14:52 genio \o/
14:54 inokenty joined #mojo
14:55 batman no one has contacted me regarding convos though... i guess i need a course in marketing.
14:57 batman marcus: ^
14:59 sri i like the apple marketing strategy, "shiny always wins"
15:00 PopeFelix macs are nice.  I say this as a decades-long Linux desktop user.
15:02 sri think the problem apple now has is that the brand got too strong, so they're getting away with bad products like the watch
15:03 sri but
15:03 sri "shiny always wins"
15:05 sri btw. i've been trying Grinnz's Unicode::UTF8 branch a bit, benchmarking stuff like json api responses, and the results are a bit meh
15:06 PopeFelix yeah, I know nothing about the watch. or iPhones. But my macbook is nice.
15:06 * sri stands by his -1 vote
15:06 * PopeFelix shrugs
15:07 PopeFelix I have a CLI that's UNiXy enough that I know how to get around, vim, and a nice GUI.
15:08 PopeFelix Plus I can play KOTOR2 on it.  It's a win in my book.
15:11 sri well, they've gone a bit too far with the new macbook, it's not good
15:11 sri that said... <3 my macbook air
15:15 PopeFelix I don't know how new mine is.  My work just sent it to me.
15:16 spicyjack they're trying to create a market with the watch
15:16 spicyjack they sort of did the same thing with the iPhone/iPad, but people actually realized they liked these things
15:16 PopeFelix Everybody wants to be Dick Tracy.
15:16 spicyjack I ride the bus every day to work
15:17 PopeFelix OK, mine is "Mid 2014".  So I don't know how new that is.  Probably not that new.
15:17 spicyjack I always see people playing on their phones
15:17 spicyjack not so much watches
15:17 * spicyjack works on his laptop in the back of the bus
15:17 PopeFelix yeah, I don't entirely know what the point of a smart watch is.
15:18 PopeFelix actually, I don't know at all what the point of a smart watch is.
15:18 spicyjack PopeFelix: it's actually kind of interesting to watch the watch, as it were
15:18 spicyjack will it be successful?
15:18 spicyjack or not?
15:18 PopeFelix Tune in next week to The Adventures of Dick Tracy!
15:19 * PopeFelix is apparently hung up on Dick Tracy at the moment.
15:19 spicyjack I admire the engineering that went in to it
15:19 spicyjack but if I want the time, I look at my phone
15:20 PopeFelix yeah, me too.
15:20 tencendur joined #mojo
15:28 jberger the idea is notifications without having to pull out your phone
15:29 jberger which I think is an admirable goal in social contexts
15:29 jberger but at the price of the watch I don't think its worth it
15:29 * jberger isn't an "apple guy" though
15:29 jberger I do have a Macbook Pro, from work
15:29 jberger and I do love its battery life
15:30 sri i meant this one http://www.apple.com/macbook/
15:30 jberger right, the "one usb C port" mac
15:30 sri yea, it's just bad
15:30 jberger (even though nobody makes usb C devices yet)
15:31 sri i do like the colors though, and i bet many folks will buy them just because of that
15:31 jberger "want to charge it AND use any other port? its a bulky hub for you then! there goes your sleek portable system!"
15:32 jberger I guess that becomes more and more possible as more data is just sent via the cloud
15:32 jberger usb keys are going to go the way of the dodo too
15:32 sh4 joined #mojo
15:33 jberger maybe the idea is that you leave a hub on your desk with your external monitor and speakers all wired in to it, then attach when you sit down?
15:33 genio I can't quite believe USB-C has become a thing.  *glares evilly at Apple*
15:33 jberger so its more like a doc
15:33 jberger ?
15:33 jberger dock?
15:34 berov left #mojo
15:35 jabberwok i love mojo.  coworker was messing with nodejs+express trying to get a minimal json rest server going.  i took https://github.com/groovy9/sqlite4ember/ , kept just the query route, added another query, changed db name and added a hypnotoad listen config line, and voila... done.
15:36 jberger no fan at all on that macbook?
15:36 jberger guess that means you aren't playing 3d games or compiling anything on it
15:36 jberger jabberwok++
15:37 disputin joined #mojo
15:37 jberger who is groovy9?
15:37 jberger Mojo::SQLite is pretty new to already be being adopted outside of this circle
15:38 Grinnz_ heh, he emailed me about that script
15:39 Grinnz_ i don't know anything about ember *shrug*
15:39 * sri wonders if there's a nive CORS api somewhere for us to steal https://github.com/groovy9/sqlite4ember/blob/master/sqlite4ember.pl#L48-L50
15:39 sri s/v/c/
15:40 sri this isn't it :S https://github.com/expressjs/cors
15:41 jabberwok groovy9's simple code is not without vuln, he builds some of the queries from strings without stripping/validating them. but it's a good base.
15:42 Onigiri Wow, I didn't realize minion was so featureful
15:44 sri jabberwok: i see what you mean :o https://github.com/groovy9/sqlite4ember/blob/master/sqlite4ember.pl#L93
15:45 Grinnz_ heh
15:45 Grinnz_ that's a jaw dropper
15:45 pink_mist oh lord
15:46 Grinnz_ at least sqlite doesn't process multiple statements by default, so there's that :P
15:47 jabberwok well, $table _is_ from a placeholder so it's not quite as bad as it could be.
15:47 Grinnz_ ehh it's pretty bad
15:47 Grinnz_ the # placeholder can contain anything except / iirc
15:47 jabberwok O
15:47 sri or dot
15:47 genio get tables list on startup to hold onto, check the placeholder against the tables list and it's somewhat better.
15:48 pink_mist how is it possible to miss something like that though 0_o
15:48 sri oh wait, it's a # placeholder
15:48 sri Grinnz is right
15:48 Grinnz_ genio: yeah.
15:49 genio I don't have the care to fork and create a pull request ATM though
15:50 jabberwok i might as well do so, genio.
15:51 genio he's already got the code in the / route to get the list of table names
15:54 sri Onigiri: should be comparable to most commonly used job queues :)
15:57 Onigiri sri: not mine :P
15:57 Onigiri Mine's a pos :D
15:58 Onigiri Mainly because I wrote it in an afternoon with nothing thought out.
15:58 Onigiri Yay for "have it by end of day" junk
15:59 Onigiri But now the guy they hired to "help" because I was "too slow" got his ass fired. Yay
15:59 Onigiri So now I have to deal with a ui tech stack I know nothing about ~_~
16:09 kivilahtio joined #mojo
16:10 asm35 joined #mojo
16:10 asarch joined #mojo
16:21 disputin joined #mojo
16:25 ZadYree joined #mojo
16:25 ZadYree Hello there!
16:27 ZadYree As always, I'm coming with a question: When providing the hypnotoad configuration, I would like not to generate a pid_file. A nice workaround was specifying "/dev/null" as a pid_file path but it's pretty dirty. Anything better? undef won't obviously work.
16:28 pink_mist why?
16:29 ZadYree pink_mist, I assume you're wondering why I find this dirty... right?
16:29 Grinnz_ ZadYree: an empty string as pid_file might work?
16:29 hernanGOA ZadYree: just pass in the options
16:30 pink_mist no, I don't wonder why you find it dirty at all ... it's quite obviously dirty
16:30 pink_mist I'm wondering why you don't want the pid file?
16:31 Grinnz_ actually nevermind...
16:31 ZadYree pink_mist, I am using it within a docker I have to reuse
16:32 ZadYree So when it gets brutally stopped for some reason, it is unable to restart
16:32 ZadYree because of this very file
16:32 Grinnz_ so you're SIGKILLing it?
16:33 ZadYree Grinnz_, unwillingly, it gets stopped/killed, yes.
16:35 ZadYree I would have been for re-creating a container, but unfortunately, we're switching to production mode in few days
16:40 pink_mist batman: Convos ... does it support running plugins or something like irssi scripts on either or all of the backend, the core, or the frontend?
16:40 meredith i'd lean toward recreating personally, but i think /dev/null is the least dirty option -- it makes it clear to anyone looking that you mean to toss it out. anything else i imagine would be something like "/tmp/hypnotoad-$$.pid" which will eventually have someone coming along thinking it's meant to work as normal.
16:40 Grinnz_ there is not really anything you can do about allowing for SIGKILLs, that is always unexpected
16:40 pink_mist batman: should I join some convos-related channel? =)
16:40 Grinnz_ note that hypnotoad will be unable to restart itself if you don't have a proper pidfile
16:40 meredith you could also just wrap the entry point of your container in a script that does rm pidfile; hypnotoad...
16:41 Grinnz_ yeah i think removing its pidfile when you create it again after SIGKILL is a better idea
16:41 pink_mist agreed
16:43 disputin joined #mojo
16:51 dod joined #mojo
16:57 PryMar56 joined #mojo
16:59 batman pink_mist: can you join #convos on freenode?
16:59 pink_mist ah, sure =)
16:59 batman cool
17:01 absolut_todd joined #mojo
17:04 sri hypnotoad/prefork actually kill(0) the pid from the file to check if it is still valid
17:05 sri https://github.com/kraih/mojo/blob/master/lib/Mojo/Server/Prefork.pm#L27-L39
17:07 spicyjack sri: the first few gens of Macbook Airs weren't that great, they're a lot better now
17:07 spicyjack sri: backlit keyboard is the big one for me
17:07 sri spicyjack: true, the first one was very underpowered, but nowhere as bad as the new macbook
17:07 spicyjack sri: I expect the new Macbooks to grow the same way
17:07 ZadYree meredith, aaah right :)
17:08 sri lack of active cooling seems to be a huge problem, judging by reviews
17:09 jontaylor joined #mojo
17:09 sri hypnotoad features actually depend on the pid file, so using /dev/null will make stuff not work correctly
17:09 sri https://github.com/kraih/mojo/blob/master/lib/Mojo/Server/Hypnotoad.pm#L90-L98
17:10 Grinnz_ yeah, i wouldn't try to use prefork or hypnotoad w/o a pidfile
17:10 sri so, what you want is a customized prefork, not hypnotoad
17:10 sri prefork should be ok-ish
17:10 ZadYree hmmmmm
17:12 Grinnz_ if you can, solving it at whatever level is killing off the process would be cleaner
17:12 Grinnz_ and you'd still get to use pid file features
17:15 jberger ZadYree: remember that the difference between prefork and hypnotoad is the hot-reloading
17:15 Grinnz_ and configuration
17:15 jberger if you are force-killing things in a docker, you might not want that
17:15 jberger Grinnz_: hmmm true
17:37 PopeFelix Non-mojo question: Where do I go to ask dzil questions?  I'm trying to figure out why my company's custom dzil profile isn't generating the files it ought to.
17:38 Grinnz_ #distzilla on this server
17:40 PopeFelix I could have sworn I looked for that channel...
17:40 PopeFelix OK, I have no idea why I couldn't find it before.  Thanks.
18:15 Kogurr joined #mojo
18:19 dod joined #mojo
19:05 gryphon joined #mojo
19:09 PryMar56 joined #mojo
19:21 mattastrophe joined #mojo
19:21 mattastrophe_ joined #mojo
19:26 * genio feels dirty  https://github.com/genio/www-salesforce-nb/blob/master/lib/WWW/Salesforce/Connector.pm#L121-L131
19:35 ajr_ joined #mojo
19:41 disputin joined #mojo
19:57 asm35 joined #mojo
20:15 neilhwatson joined #mojo
20:38 trone joined #mojo
20:44 jberger_ joined #mojo
20:47 berov joined #mojo
21:00 ajr_ joined #mojo
21:05 Adura_ joined #mojo
21:06 mattp_ joined #mojo
21:07 mattastrophe joined #mojo
21:08 bjakubski_ joined #mojo
21:09 mattastrophe_ joined #mojo
21:10 buu joined #mojo
21:10 ssm joined #mojo
21:11 ashleyde1 joined #mojo
21:11 Lucas1 joined #mojo
21:14 mikegrb joined #mojo
21:14 disputin joined #mojo
21:15 jwang joined #mojo
21:17 Phil21 joined #mojo
21:18 dvinciguerra joined #mojo
21:18 roy joined #mojo
21:23 charsbar joined #mojo
21:24 gabiruh joined #mojo
21:26 SmokeMachine joined #mojo
21:27 phillipadsmith joined #mojo
21:29 lestrrat joined #mojo
21:33 jb360 joined #mojo
21:35 tianon joined #mojo
21:47 ZoffixWork joined #mojo
21:47 ZoffixWork genio, well, then all you need is some SOAP!
21:47 ZoffixWork ...oh...wait
21:52 mst programming: the one place where dropping SOAP is a really good idea.
21:55 jnbek joined #mojo
21:57 garu joined #mojo
22:02 garu_ joined #mojo
22:05 ZoffixWork mst++
22:06 * PopeFelix snickers at mst.
22:06 * PopeFelix is going to have to deal with some SOAP next week. :\
22:07 BinGOs joined #mojo
22:25 meshl joined #mojo
22:37 sri mst: please refrain from that kind of jokes around here
22:37 * sri pokes jberger
22:37 ZoffixWork Good point.
22:53 bpmedley joined #mojo
22:55 mst sri: can we please swtich from G-rated to 'no swearing, no innuendo' or something as a definition? that seems to be what you're going for and would I think be clearer without being enough of a definition to induce extra rules lawyering
23:01 sri mst: please drop this argument immediately
23:02 sri there will be a followup in private with jberger
23:02 mst sri: you said questions were welcome. that was a question. if you're reading it as an argument, I apologise for any confusion causaed and will endeavour to use more than one question mark next time.
23:12 sri rape jokes are completely unacceptable, i'm furious
23:20 genio wow
23:35 mst I'm very sorry, in the usual usage over here it's more a nod towards straight-male-culture-latent-homophobia than anything else :/
23:42 mattastrophe joined #mojo

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