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

IRC log for #mojo, 2015-04-13

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

All times shown according to UTC.

Time Nick Message
00:13 jberger preaction: https://github.com/kraih/mojo/blob/master/Changes#L49
01:25 marty joined #mojo
01:38 mattastrophe joined #mojo
01:40 jnbek joined #mojo
01:40 klapperl_ joined #mojo
01:50 slackpac joined #mojo
01:57 asarch joined #mojo
02:09 inokenty-w joined #mojo
02:12 noganex_ joined #mojo
03:06 basic6_ joined #mojo
03:17 crab joined #mojo
03:18 slackpac joined #mojo
03:25 mattastrophe joined #mojo
03:39 irq joined #mojo
04:06 jberger the internet has been WAYYY to quiet lately
04:07 * jberger assumes everyone else is getting ddosed by China
04:27 _dave_ by what metric are you measuring "too quiet"?
04:30 kaare_ joined #mojo
04:35 mattastrophe joined #mojo
04:37 hshong joined #mojo
05:03 preaction IT MEANS WE NEED TO BE LOUDER
05:03 _dave_ lol
05:48 dabudabu Speak up Sonny! Grandma can't hear you!
05:55 melo joined #mojo
06:12 Lee joined #mojo
06:19 melo1 joined #mojo
06:22 bramirez joined #mojo
06:25 dod joined #mojo
06:25 berov joined #mojo
06:27 dotan1 joined #mojo
06:30 dod joined #mojo
06:45 hshong joined #mojo
07:04 AndrewIsh joined #mojo
07:15 eseyman joined #mojo
07:22 bjoernfan joined #mojo
07:22 trone joined #mojo
07:23 eseyman hello, all
07:41 odc joined #mojo
07:44 bramirez joined #mojo
07:50 amon joined #mojo
07:58 Vandal joined #mojo
08:09 tomboh joined #mojo
08:17 irq joined #mojo
08:27 batman hey
08:32 theo joined #mojo
08:40 marcusr hey
08:51 punter joined #mojo
10:07 mattastrophe joined #mojo
11:03 risugg joined #mojo
11:13 ver joined #mojo
11:32 fhelmber_ joined #mojo
11:35 Kripton joined #mojo
12:03 neilhwatson joined #mojo
12:03 Kripton joined #mojo
12:16 bramirez joined #mojo
12:37 bramirez joined #mojo
12:37 irq joined #mojo
12:54 mattastrophe joined #mojo
13:07 mattastrophe joined #mojo
13:19 ajr_ joined #mojo
13:24 asarch joined #mojo
13:36 gryphon joined #mojo
13:49 doby joined #mojo
13:53 mattastrophe joined #mojo
13:56 kej joined #mojo
14:02 jb360 joined #mojo
14:03 dotan joined #mojo
14:20 logioniz joined #mojo
14:21 logioniz Hi. Can Mojolicious work asynchronously when it deploy with Plack?
14:26 PotatoGim^Home joined #mojo
14:26 odin22 joined #mojo
14:30 jberger logioniz: no
14:31 jberger you can run the IOLoop during a request, meaning that you can fetch several asynchronous resources simultaneously is possible
14:39 McA joined #mojo
14:42 McA joined #mojo
14:53 logioniz jberger: Thanks
14:55 * sri thinks he might have chosen the wrong topic for his mojoconf talk
14:56 fhelmber_ joined #mojo
14:56 sri an http/2 talk would have been much more entertaining
14:59 jberger give it at YAPC::NA?
15:00 sri not going to yapc::na
15:00 purl not going to yapc::na is, like, (2007 edition) Alias :( or mmlj4 cuz he's broke
15:00 jberger I know, it was a not-so-subtle suggestion :-)
15:12 cfedde_ is there a way to tell what directory the mojolicious::lite app is in?
15:12 jabberwok In developing a new plugin, I do 'mojo generate plugin Bork' from my mojo program's root, which creates Mojolicious-Plugin-Bork/lib/Mojolicious/Plugin/Bork.pm -- but using »plugin 'Bork'« in my Lite program, for example, doesn't look there... what's best way to add my development path or otherwise work while writing a plugin?
15:13 jabberwok since:  »plugin 'Mojolicious-Plugin-Bork/lib/Mojolicious/Plugin/Bork';« or any other variation like that does not seem to work either.
15:14 bc547 cfedde_: http://perldoc.perl.org/FindBin.html
15:16 Samysam joined #mojo
15:16 jberger jabberwok: move the the generated file so that the path starts at lib and put it in the same lib as your application\
15:17 jberger MyAppRoot/lib/Mojolicious/Plugin/Bork.pm
15:17 jberger where you also have MyAppRoot/lib/MyApp.pm
15:17 jberger and MyAppRoot/script/app.pl
15:18 sri just don't use the generator
15:18 cfedde_ bc547: apparently that returns the path where morbo or hypnotoad is located.
15:18 sri http://mojolicio.us/perldoc/Mojolicious/Guides/Cookbook#Adding-a-plugin-to-your-application
15:19 jabberwok o ... right.  i alternately feel a genius and a n00b with all this 'new' object oriented stuff.  much obliged
15:21 Samysam Hi guys! Is there a way to work with server-stored session using Mojolicious::Session, or should I use Mojox::Session ?
15:23 genio cfedde_: http://mojolicio.us/perldoc/Mojolicious/Guides/Cookbook#Running-code-against-your-application
15:24 cfedde_ genio: awesome!
15:24 sh4 joined #mojo
15:25 genio and app->home->lib_dir is useful as well
15:27 genio Although I think you probably really wanted app->home->to_string
15:29 jabberwok half the problem with Mojo is that, after looking at Ruby-on-Rails for awhile, you imagine everything working in a spooky fun-house-mirror danger-behind-every-doorway horror-movie kind of way
15:29 Grinnz_ jabberwok: i thought that was PHP
15:29 jabberwok indeed it is, Grinnz_
15:30 Grinnz_ Samysam: Mojolicious::Session is just for cookie-stored sessions; i don't know about that module but a server side session is simple enough to implement, just store
15:30 Grinnz_ oops, my ssh broke
15:30 Grinnz_ just store a session id in the session cookie
15:31 Samysam Grinnz_ ok, thank you
15:34 punter joined #mojo
16:04 disputin joined #mojo
16:07 disputin joined #mojo
16:18 mattastrophe joined #mojo
16:19 Oleg joined #mojo
16:34 Mikey joined #mojo
16:48 Kripton joined #mojo
17:09 sri no mojolicious commit in 4 days... i think that might be a record
17:09 sri :o
17:10 memowe joined #mojo
17:11 sri anyway, to make my talk more fun, is there anything specific about mojolicious internals anyone here would like to have me explain in detail?
17:13 sri bonus points if it's easy to explain with memes
17:16 sri ...and too late!
17:19 trone joined #mojo
17:23 trone_ joined #mojo
17:24 ajr_ joined #mojo
17:25 marcusr :p
17:28 marcusr http://www.slideshare.net/yusukebe/inside-bokete-web-application-with-mojolicious-and-others
17:29 odin22 joined #mojo
17:30 punter joined #mojo
17:40 gryphon joined #mojo
17:50 ribasushi joined #mojo
18:11 disputin joined #mojo
18:12 hernan604 bokete web /
18:12 hernan604 hahahahah
18:12 purl LOLCON 4.5 reached.
18:13 hernan604 bokete = sexual stuff in portuguese
18:13 Grinnz_ o.O
18:14 genio "boquete" == "blow job"
18:15 hernan604 yeah
18:16 juikuen joined #mojo
18:17 juikuen joined #mojo
18:17 genio hernan604: You're brazilian?
18:17 hernan604 yup
18:17 hernan604 im brasilian living in sao paulo
18:18 hernan604 http://farm4.static.flickr.com/3164/2362624944_ff0444d675_o.jpg
18:19 hernan604 thats são paulo
18:19 hernan604 but much bigger
18:19 genio I need to hang out with Brazilians more.  I'm forgetting portuguese.  It's been about 15 years since I've spoken on a daily basis
18:21 genio ... I also need to learn to not speak like a thug.  I sound like all of my friends from Salvador
18:22 gabiruh genio: colé de mermo, meu fi?
18:23 hernan604 colé de merma
18:23 mattastrophe joined #mojo
18:23 hernan604 genio: why did you live in salvador ?
18:23 hernan604 salvador is great
18:24 hernan604 i want a remote job soon then i will move to salvador. my wife is from salvador
18:28 ribasushi joined #mojo
18:30 dod joined #mojo
18:35 batman weeee! i've been wanting this for so long: my(undef, $card_num, (undef)x3, $count) = split /:/; :)
18:38 genio hernan604: I've actually never been to Brasil.  My first roommate in college was baiano and didn't speak a word of English.  I learned Portuguese, he learned English.  He was also the capoeira instructor.  So, I spoke Portuguese all day every day for a little more than a year.
18:39 genio but, like an uneducated person as I was 18-19 and learning Portuguese from other 18-19 year-olds who never even finished high school and lived in a pretty bad area in Boca do Rio
18:45 genio I haven't been around Brazilians much lately though.  I'm slowly forgetting Portuguese and it's being replaced with French (my wife's fault).
18:46 asarch joined #mojo
18:47 mattastrophe joined #mojo
18:48 hernan604 cool =)
19:09 ZoffixWork joined #mojo
19:11 ZoffixWork batman, why lol? Why not this? :D    my ($card_num, $count) = (split /:/)[1,5];
19:11 batman ZoffixWork: huh? "lol"..?
19:11 batman i was serious.
19:12 ZoffixWork s/why\K/?/; # punctuation fail :)
19:12 ZoffixWork Why were you wanting undef overload for so long? :)
19:14 batman overload?
19:14 purl overload is the DEVIL!
19:15 ZoffixWork botsnack
19:15 purl :)
19:15 batman it's not something i need frequently, but it's just one of those small things that bugged me when i couldn't.
19:15 batman nevermind
19:15 purl Well piss off then, batman
19:16 ZoffixWork I guess I don't know why you couldn't :)
19:18 batman ah. i got confused about the "lol", so i didn't read all that you wrote :P
19:18 batman i don't think it's the same though... let me see...
19:21 batman that's weird. i was sure split was aware of how many elements i wanted on the left side.
19:23 genio $sf->query("select ".join(', ', map {$_->{name}} @{$sf->describe('Account')->{fields}})." from Account where IsDeleted=false and Id='0015000000OqJEi'")
19:23 genio bah, sorry.
19:23 ajr_ I'm reading through a Mojo-generated app, and I can't see where the "startup" subroutine gets executed. Does start_app do that automatically somehow?
19:25 batman ZoffixWork: "In time-critical applications, it is worthwhile to avoid splitting into more fields than necessary. Thus, when assigning to a list, if LIMIT is omitted (or zero), then LIMIT is treated as though it were one larger than the number of variables in the list; for the following, LIMIT is implicitly 3:"
19:25 batman ($login, $passwd) = split(/:/);
19:25 ZoffixWork ajr_, https://metacpan.org/pod/Mojolicious#startup
19:26 batman ajr_: it's called by Mojolicious->new()
19:27 batman ajr_: so... the short answer is "yes", since the command object has an "app" attribute, which again holds and instance of your application, which again has startup()
19:27 dvinciguerra joined #mojo
19:27 ajr_ Thanks; I'll read up on that. (Sometimes, a pointer to the right bit of TFM is needed.)
19:28 vmbrasseur joined #mojo
19:28 irq joined #mojo
19:29 mst ajr_: when I'm suspecting I should've already found it, I've got great results from asking a question in the form of "which FM do I R for find out <thing>?"
19:32 batman ajr_: but why do you care?
19:34 ZoffixWork batman, oh, I wasn't aware of that magic. Impressive difference too: http://fpaste.scsys.co.uk/472154
19:35 ZoffixWork I wonder how does it know how many variables are expected... Is that information available to normal perl subs?
19:35 ZoffixWork batman, what perl version are you using? Your version was failing with Can't declare repeat (x) in "my"
19:35 batman ZoffixWork: yeah... well, you almost never care about the difference :)
19:36 ZoffixWork :)
19:36 batman it's perl. some things are magical.
19:36 batman ZoffixWork: to be honest, i didn't even know i could do my ($foo, undef, $bar)
19:37 Grinnz_ heh
19:37 batman i have no idea what weird typo i had in the past that messed that up.
19:37 batman i'm actually pretty confident i've tried that syntax many times :(
19:38 batman ZoffixWork: i got 5.20.2 on my laptop and i *think* we have 5.14.1 at work.
19:38 batman could be 5.16 at work... can't remember :(
19:38 batman have my ($foo, undef, $bar) been supported forever..?
19:39 ZoffixWork Pretty sure.
19:39 purl pretty sure is the case, I did one of the early versions of ->populate and as I recall it was like that
19:40 batman i really wish that's not true :/
19:41 Grinnz_ batman: it is missing from the "my" perldoc until 5.20.0, but i'm using it now and it works on at least this 5.14.2
19:42 Grinnz_ batman: just tried on my 5.10.1 and works there
19:42 batman you're killing me :/
19:42 Grinnz_ heh
19:42 ZoffixWork :)
19:44 batman just today i wrote (my $foo, undef, my $bar) which annoyed me a lot, and i though: "i wish i could write my($foo, undef, $bar)... that would make my day"
19:44 batman :/
19:44 batman brain--
19:52 _dave_ Since there was postgres advocacy in this channel, is there a link which explains the technical differences of postgres vs mysql?
19:52 mst batman: and then you remembered you can, and were happy?
19:52 _dave_ I should add "scientifically and objectively" of course :D
19:53 Grinnz_ _dave_: that would be a length document
19:53 batman mst: it has been annoying me for many years. i've just given up on trying.
19:53 Grinnz_ lengthy*
19:53 batman mst: but now i know !!!!!!
19:53 _dave_ maybe that's why I'm not finding one on google
19:53 Grinnz_ _dave_: mostly, the entire design philosophy is different ;)
19:53 mst _dave_: http://grimoire.ca/mysql/choose-something-else
19:54 _dave_ thanks mst :) I'll look this over
19:55 mst that's a good canonical list of "reasons to hate mysql"
19:55 Grinnz_ _dave_: mysql was originally made for profit, and is now owned by oracle; postgresql was open source from the start
19:55 Grinnz_ that may explain a lot of the differences
19:55 _dave_ a geek rant to be sure ... I am also looking for something objective, but personally I love geek rants
19:55 mst the main thing is mysql was an SQL-ish interface to the ISAM record score system
19:55 mst whereas postgresql was designed to be an RDBMS from the ground up
19:56 _dave_ Grinnz: that alone convinces me but I've learned to be more open minded in my old age
19:56 _dave_ if I can find out that multi-master postgres exists and is viable (dont shoot me), it's a smoking gun
19:56 batman _dave_: pg can alter table in transactions.
19:57 Grinnz_ i don't think "smoking gun" means what you think it means
19:57 _dave_ perhaps, but I haven't given you context either
19:57 cfedde _dave_: why do you think you need multi-master?
19:58 batman _dave_: pg has support for json types, so you can use it as a document database if you like.
19:58 _dave_ redundancy and failover issues mostly
19:58 _dave_ if one server goes down, the other takes over...easy stuff like that
19:58 cfedde so HA?
19:58 _dave_ more failure resiliency
19:59 _dave_ HA yes
19:59 batman _dave_: pg has support for "pub/sub"
19:59 _dave_ people think HA means scalability too, I have to be careful with terms
19:59 cfedde yeah.
19:59 _dave_ you may not be those people
20:00 _dave_ This audience in this channel tends to be smarter than what I normally deal with :)
20:00 cfedde this is one of those things that makes client conversations confusing.
20:00 _dave_ TELL me about it lol
20:01 cfedde people seem to think that multi-master makes the database faster.
20:01 _dave_ it can't really can it?
20:01 cfedde it kind of does if you do it the mysql key offset technique.
20:01 _dave_ see that's the issue
20:01 _dave_ One word: PHP
20:02 _dave_ years of naive programmers
20:02 Onigiri So can I make routes based on ? type variables? I've only found examples with :foo place holders.
20:02 mst _dave_: pg's streaming replication is amazing
20:02 Onigiri mst: slony?
20:02 purl i guess slony is a shot at open source postgres replication. http://slony.info. The developers think they have good documentation, but it sucks. If you want to do anything even a little more complex than 2-3 linear nodes expect huge headaches and at least six hours of fishing with a friend.
20:02 mst Onigiri: no, the built in streaming replication feature
20:02 mst Onigiri: the one called streaming replication
20:02 Onigiri How recent is it?
20:03 mst Onigiri: 9
20:03 Onigiri I did replication early on with 8.x and slony, and man it was an ordeal
20:03 mst yes, the reason they called 9.0 9.0 was because streaming replication landed
20:03 mst before that I just did warm standby and WAL shipping
20:04 Onigiri I needed to load balance some junk, so had around 5 or 6 desktops serving up stuff.
20:05 sri apparently postgres 9.5 will even support sharding natively
20:07 sri lots of interesting stuff happening around postgres
20:07 _dave_ you folks are certainly pro-postgres
20:07 sri kinda crazy that no other rdbms has done native json support with proper indexing yet
20:08 Onigiri _dave_: it's what happens when you want your data in to be the same data out.
20:08 sri the thing about postgres is that its just really well designed
20:08 _dave_ lol
20:08 Onigiri I mean comon, Feb-30? pfft
20:08 _dave_ lol! I remember that
20:08 Grinnz_ _dave_: if you start using it, and you're used to mysql, you'll hopefully see how much more sense everything makes
20:09 sri i certainly have things to complain about... but mostly... everything just works
20:09 _dave_ that's the thing, I've avoided as much mysql as I can because I hate working with it
20:09 mst learning postgresql is an exercise in discovering that most of what you thought was "database knowledge" is "stupid workarounds for mysql"
20:09 _dave_ so of course, like most humans, I judge SQL by MySQL
20:09 sri i mean, how can you even get work done without transactional ddl?
20:09 batman this is cool: http://erppy.co/
20:11 _dave_ I didn't even know transactional ddl existed. I tend to just use a database to store stuff and retrieve it.
20:12 sri biggest disappointment for me with postgres were advisory locks i guess, not being able to use them in a where clause was really annoying
20:13 sri _dave_: and then you have a migration with 20 alter statements, with a typo in the middle...
20:14 sri with postgres, i just get a rollback, fix the typo, and try again
20:14 _dave_ point taken :)
20:14 Onigiri For me, I couldn't see a way to exclusive lock a function that was in plperl.
20:15 _dave_ I've worked around mysql with shared memory before ;)
20:15 _dave_ didn't trust mysql locking
20:15 sri working around stuff is something you very rarely do with postgres
20:16 Onigiri So basically is there a way to set a different route for /foo?bar=baz then just /foo ? I'm seeing a way to route /foo/bar vs /foo but nothing with url params
20:17 Grinnz_ Onigiri: have the action for /foo call a different action method if bar=baz
20:17 Grinnz_ (if same controller)
20:18 Onigiri Grinnz_: I was afraid of that... in this case baz doesn't matter, just the presence of bar.
20:18 Grinnz_ then if (defined $self->param('bar'))
20:18 _dave_ can you use under() to distinguish?
20:18 Grinnz_ there might be other ways
20:18 Grinnz_ but generally... routes don't involve the query string
20:19 Onigiri Grinnz_: yep, was hoping to deal with it before it got that far.
20:19 _dave_ I've been abusing under() recently :D Sorry.
20:20 _dave_ http://pastebin.com/RAf0KVyV
20:25 Grinnz_ looks reasonable to me
20:25 sri better done like the documentation says
20:25 sri http://mojolicio.us/perldoc/Mojolicious/Guides/Routing#Hooks
20:27 _dave_ better as in "faster" or "more maintainable"?
20:27 sri as in actually works
20:28 _dave_ I've tested that code. It works. I'm interested to know how it will break though.
20:28 sri it doesn't work for anything that is not in that route tree
20:28 _dave_ ah yeah
20:28 sri like static files
20:29 _dave_ static files have a route I can't get to?
20:29 berov joined #mojo
20:29 _dave_ hm also that won't work for a HEAD request
20:32 Grinnz_ right, i use under for that because i actually don't want it to affect static files
20:33 _dave_ In some of what I will be using mojo for, it won't matter because I'll have nginx in front of it. But it's a valid point.
20:33 _dave_ Two things
20:33 purl Two things are sorta separate but maybe not bad idea to address in one go since its all part of a redo of all these ideas and what to use for controlling my application on a per environment basis as apposed to when you want application control flags that cut ACROSS environments.
20:33 _dave_ Why do I get the feeling I'm brain and purl is pinky?
20:33 Grinnz_ purl: _what_
20:33 purl i guess _what_ is still wrong?
20:33 Onigiri Hmm, is there a way I can get Mojo::Pg to fire off a couple set's on each dbh it opens? Basically want to have a particular timezone/search path, and I'm not seeing a way to set them via connection options.
20:34 _dave_ First, some sort of flow diagram of mojolicious hooks and routes might be a great aid to understanding. So I can look at a request and follow all the places (and mini-APIs) it goes through
20:35 jberger purl: no, two things are surprise and fear
20:35 purl okay, jberger.
20:35 _dave_ The other thing is: the documentation fights itself. There's an emphasis on "simple and get it up and running, ease of use" ... but then there are all these fine points in the docs you miss when you are trying to "simply get it up and running". :)
20:36 _dave_ I'm not sure how to fix that, or if you even think it needs fixing. Just pointing it out.
20:37 Grinnz_ _dave_: it's inevitable, there will always be complexities, but the hope is they won't bite you until you're doing something complex
20:37 _dave_ At the moment I'm fairly committed to mojolicious, so I'll eventually get past this point and not be able to see it clearly. :)
20:40 sri this is your daily reminder that we still need a book
20:40 _dave_ lol
20:40 _dave_ even your commentary is minimalist :)
20:41 _dave_ O
20:41 _dave_ I'm going to learn a lot from this adventure
20:50 melo joined #mojo
20:57 * jabberwok chants: book… book…
21:39 Onigiri bork bork bork
21:39 * purl puts de chickee in de pot.
21:46 dvinci joined #mojo
21:46 dvinciguerra__ joined #mojo
21:56 mattastrophe joined #mojo
22:03 memowe joined #mojo
22:26 Stealth joined #mojo
22:36 punter joined #mojo
22:58 riche joined #mojo
23:09 mattastrophe joined #mojo
23:34 disputin joined #mojo

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