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

IRC log for #mojo, 2015-04-23

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

All times shown according to UTC.

Time Nick Message
00:00 sri i like this one more https://metacpan.org/requires/distribution/Mojolicious?sort=[[2,1]]
00:01 Zoffix 466 results :) \o/
00:02 * sri is a little ashamed to admit that seeing mojolicious beat all the other perl frameworks in the benchmark makes him feel all warm and fuzzy... https://www.techempower.com/benchmarks/#section=data-r10
00:03 sri (even if it is meaningless!)
00:04 sri hahaha... of course the first benchmark uses "Content-Type: application/json; charset=UTF-8"
00:04 sri charset=UTF-8 wherever i look
00:05 sri i do wonder if we should also have that space in between though
00:16 hernan604 soon i will implement something in openresty/lua
00:16 hernan604 also python wsgi is not bad.. faster than many languages
00:19 * jberger feels all warm and fuzzy that his efforts on TFBM weren't in vain
00:20 sri wsgi is mostly C though
00:22 sri basically runnign inside nginx, similar to openresty actually
00:24 hernan604 aha good info
00:24 hernan604 ngx_mruby also did good
00:24 sri oh wait, i just assumed it was uwsgi
00:25 hernan604 also looks like its C
00:25 hernan604 ngx_mruby: https://github.com/matsumoto-r/ngx_mruby/tree/master/src
00:26 sri i was wrong, platform is defined as Meinheld http://meinheld.org/
00:26 sri (for wsgi)
00:26 sri that is actually impressive
00:28 sri 650k rps, with a python server
00:28 hernan604 indeed
00:29 sri hahahaha
00:29 purl LOLCON 4 reached.
00:29 sri lots of cheating, that's how
00:29 sri https://github.com/mopemope/meinheld/tree/master/meinheld/server
00:29 hernan604 lots of cheating ?
00:29 sri all C
00:29 hernan604 so its C after all
00:40 sri oh my
00:40 * sri completely missed that Catalyst is now 10 years old :o
00:40 sri "3.00  2005-02-16 20:00:00"
00:40 sri (it started with 3.0)
00:43 mattastrophe joined #mojo
00:44 jabberwok ** bakes a cake **  (any excuse is a good excuse to bake)
00:50 hshong joined #mojo
01:03 vmb joined #mojo
01:05 hernan604 yeah you are old
01:06 Grinnz sri, i think the space before charset would be the bikeshed of the century
01:07 Zoffix "bikeshed"?
01:07 Grinnz http://bikeshed.com/ i didnt know this website existing hahaha
01:07 Grinnz existed*
01:27 klapperl_ joined #mojo
01:37 jberger Grinnz: hahaha did you reload the page?
01:38 jberger sri: man you are old!
01:38 jberger also, why did it start at 3.0?
01:39 sri :(
01:39 sri because it started as maypole 2.99
01:40 Grinnz jberger, no, rofl
01:40 sri and then evolved into a rewrite
01:40 jberger sri: I didn't know that
01:41 sri marcus is old too, he's been around since maypole
01:41 jberger so mojo is really the second rewrite of maypole then
01:41 sri yea
01:42 jberger that at least keeps with the M theme
01:45 sri Matalyst
01:45 Grinnz maypole, junepole, julypole
01:45 Grinnz mojolicious is julypole!
01:45 asarch joined #mojo
01:45 Grinnz TIL maypole is an actual word
01:45 sri maypoles are a tradition around here
01:51 jberger almost maypole time iiuc
01:53 jberger and related, I'm building the Brandenburg Gate in lego atm
02:03 noganex_ joined #mojo
02:56 sri that's a new one :o http://www.cpantesters.org/cpan/report/9382f34e-e946-11e4-a1d1-8536eb4f9f07
03:00 noganex joined #mojo
03:00 jberger nice
03:02 Grinnz can't fork; try spoon
03:17 jberger *CORE::GLOBAL::fork = sub { CORE::fork while CORE::fork }
03:24 basic6_ joined #mojo
03:26 disputin joined #mojo
03:27 Kripton joined #mojo
04:05 cereal__ joined #mojo
04:24 inokenty-w joined #mojo
04:28 Zoffix joined #mojo
05:08 kaare joined #mojo
05:13 batman Age is just a number.
05:14 batman At least that's what I'm telling my gf so she won't run away...
05:14 batman :)
05:18 cereal_ joined #mojo
05:33 oetiker joined #mojo
05:41 likhatskiy joined #mojo
06:19 bramirez joined #mojo
06:22 batman Cool idea: https://metacpan.org/release/FRACTAL/Object-Instant-0.100
06:35 cpan_mojo Mojolicious-Command-migration-0.11 by LIKHATSKI https://metacpan.org/release/LIKHATSKI/Mojolicious-Command-migration-0.11
06:36 Snelius poor idea
06:43 amon joined #mojo
06:44 batman Snelius: how come?
06:45 Snelius i think we should use a just true classes then :)
06:49 batman yeah, for "true things" i would use "true classes"
06:49 batman but it sounds fun for mocking things in tests
06:50 batman like Object::Instant->new(sub { shift @{$testdata{$_[1]}} }); or something
06:50 berov joined #mojo
06:51 dp_ joined #mojo
06:51 dod joined #mojo
06:57 dod joined #mojo
06:58 eseyman joined #mojo
06:59 Lee batman: Test::MockObject ?
06:59 purl rumour has it Test::MockObject is fairly evil as it univerally monkeypatches the can method in a retarded manor
06:59 Lee haha
07:00 Lee TIL...
07:05 AndrewIsh joined #mojo
07:06 eseyman joined #mojo
07:08 marcus sri: I'm ancient, really.
07:09 Snelius 30 years ? :)
07:12 marcus Snelius: born in 76
07:13 Snelius 39
07:13 marcus by christmas :)
07:13 Snelius :)
07:13 batman i can't remember how old crab and tempire are... me and jberger are 32.
07:14 Insane does ayone have any experience making makefile.pl for Mojo? I want 'make' to somehow install required modules from CPAN. how to do this?
07:14 * Snelius 34
07:15 batman Insane: i use App::git::ship which generates the Makefile.PL from cpanfile.
07:15 batman i think the cpanfile is a lot simpler to manage
07:15 Snelius Insane: i think you need some install.sh instead makefile then :)
07:15 batman Insane: the other alternative is simply to copy/paste some random Makefile.PL from some well known project on cpan and take it from there
07:23 batman Anyone that can help me with this failing test? http://www.cpantesters.org/cpan/report/de25bbdc-6bfb-1014-a9ee-48514a7bb9c2
07:24 batman I don't get "The getpwuid function is unimplemented" (Win32) since i try to avoid it: https://github.com/jhthorsen/mad-mapper/blob/master/t/Helper.pm#L5
07:27 marcus batman: iirc they are somewhere between you and me
07:28 batman marcus: ok
07:39 bc547 joined #mojo
07:44 bramirez joined #mojo
07:46 likhatskiy joined #mojo
07:50 dp_ joined #mojo
08:07 Vandal joined #mojo
08:37 dod joined #mojo
08:44 irq joined #mojo
08:45 gatitskiy joined #mojo
09:46 likhatskiy joined #mojo
10:02 bramirez joined #mojo
10:18 dod joined #mojo
10:32 dp_ joined #mojo
11:13 trone joined #mojo
11:22 neilhwatson joined #mojo
11:22 Snelius joined #mojo
11:40 Snelius joined #mojo
11:56 mattastrophe joined #mojo
12:11 guru joined #mojo
12:20 noganex joined #mojo
12:20 Kripton joined #mojo
12:27 Kripton joined #mojo
12:33 mattastrophe joined #mojo
12:35 bramirez joined #mojo
12:37 jberger batman: hey I haven't had my birthday yet! 31
12:37 batman haha! ok :)
12:38 moritz jberger: so you'll soon have a round one
12:38 moritz (in binary, at least :-)
12:38 jberger also I have been thinking about releasing my object thingy
12:38 jberger moritz: indeed 0x20
12:39 batman jberger: what object thingy?
12:39 moritz 0b1000 looks even rounder :-)
12:39 moritz erm, 0b100000
12:39 moritz whatever
12:39 purl whatever is probably left over I just deal with myself, or something
12:39 jberger Oh nice
12:39 jberger batman: https://github.com/jberger/Class-Anonymous
12:40 jberger mine has more bells and whistles
12:41 Bender joined #mojo
12:42 batman jberger: $_->('BUILD')->($self, @_) for @isa; <-- how does this work?
12:42 garu joined #mojo
12:42 jberger hehe
12:42 jberger magic
12:43 jberger actually
12:43 BinGOs joined #mojo
12:43 jberger each entry in isa is a code ref
12:43 jberger more than one is how inheritance works
12:43 mst joined #mojo
12:44 batman it's a weird that isa() returns a list of coderefs... (if i read the code correctly)
12:44 jberger when called without arguments
12:45 batman not sure if that's a good idea to redefine that behavior.
12:45 jberger when called with an argument it returns true or false
12:45 batman why not define a new method?
12:45 batman i would probably add a utility method so i don't pollute the $class namespace
12:45 jberger why reserve another method name?
12:46 batman see next sentence :)
12:46 batman i think meta() in general is a very bad idea. i don't get why an object has a meta object... it should be the other way around imo
12:46 batman not saying you have meta(). just saying i would define inspection elsewhere
12:47 garu_ joined #mojo
12:47 jberger it's about data privacy really, auxiliary functions would need some way to get at private data
12:47 batman @coderefs = $class->isa; # probably something you will regret later.
12:47 batman @coderefs = Class::Anonymous::get_isa_refs_for($class);
12:48 batman or whatever
12:48 purl whatever is left over I just deal with myself, or something
12:48 jberger batman: that behavior is essentially the @ISA array
12:48 jberger I don't see how that is problematic
12:49 batman ok
12:50 jberger though the name implies that anonymity is the main feature (and it is one), data privacy is the main driver of this module
12:51 jberger there is no way to implement the function that you are describing
12:51 batman right. then i cave. i've never cared about data privacy. i think it's really annoying.
12:52 jberger well that's the reason I haven't released it
12:53 jberger I'm not sure I care enough either
12:53 jberger I was just curious if I could
12:53 batman :)
12:53 jberger prompted by some of the moe discussion a while back
12:53 batman that's cool :)
12:54 misty_g3ar joined #mojo
13:47 gryphon joined #mojo
13:49 absolut_todd joined #mojo
14:04 bramirez joined #mojo
14:09 ajr_ joined #mojo
14:33 absolut_todd joined #mojo
14:37 odin22 joined #mojo
15:02 davido_ joined #mojo
15:09 Zoffix batman, I guess there's no easy way to make AssetPack regenerate sprites if you added or changed pics?
15:10 batman oh. i thought it just worked :/
15:10 Zoffix No, had to nuke /packed/
15:10 batman well, that's a bit excessive though.
15:10 batman should at least be enought to do rm public/packed/*png
15:11 Zoffix *nod*
15:11 batman what's your environment? i mean, how do you start your application when it doesn't regenerate the png asset?
15:11 batman that is the problem right...? it's not the css? or both?
15:12 Zoffix Actually, deleting just *png isn't enough. Need to delete the sprite CSS file too
15:13 Zoffix I start it with  morbo -w . App.pl
15:13 Zoffix and environment? Dunno. Regular development.
15:14 batman -w . ..? so you have to reload your app twice on each time you change an asset. i wouldn't bother to wait for that...
15:15 Zoffix No idea if it's twice, but it's fast enough that I see change right away :)
15:16 Zoffix Is China DoSing github again? :)
15:17 jzawodn_ joined #mojo
15:18 batman Zoffix: oh crap. i need to confirm, but i don't see how assetpack is recreating anything now...
15:19 Zoffix It is recreating SCSS files when I modify them...
15:19 batman ah! you're right. it's because of the scheme://.
15:19 batman goodie. i'll fix it up soon.
15:22 jzawodn joined #mojo
15:23 Zoffix Sweet :)
15:23 Zoffix And I'm now using it on a "production" site: http://xtatik.org/  (the 'powered by' icons and github forkme ribbon are sprites)
15:25 batman i'm not sure how to test it...
15:25 batman it's available on github. can you try it out for me?
15:25 Zoffix Sure
15:27 Zoffix batman, yeah, works now.
15:28 batman i'm not proud of it, but i'm still releasing without additional tests :(
15:28 Zoffix :)
15:29 vmb joined #mojo
15:32 disputin joined #mojo
15:34 absolut_todd joined #mojo
15:37 disputin joined #mojo
15:38 vmbrasseur joined #mojo
15:42 asarch joined #mojo
15:44 PotatoGim^Home joined #mojo
15:46 asarch In the first attempt, I had an URL "/students" but then after a review, I had to change it to "/school/students" and now the are asking "/admin/school/students". TT had c.uri_for('students'). Does Mojolicious have something similar?
15:47 Zoffix asarch, likely this: https://metacpan.org/pod/Mojolicious::Controller#url_for
15:47 asarch Thank you Zoffix
15:47 asarch Thank you very much :-)
15:48 batman Zoffix++
15:48 batman :)
15:49 jberger asarch: there is a large section in the guides about named routes
15:49 sri sections
15:49 purl it has been said that sections is an array or hash ref right?
15:49 sri like, in every guide
15:50 jberger http://mojolicio.us/perldoc/Mojolicious/Guides/Routing#Named-routes
15:50 jberger but yeah, as sri says, its everywhere
15:50 jberger purl: forget sections
15:50 purl jberger: I forgot sections
15:53 asarch <%= uri_for('students') %>: Undefined subroutine &Mojo::Template::Sandbox::f036447ea25c39794e368734ea875283::uri_for called at...
15:54 Zoffix asarch, it's url not uri
15:54 sri where in the documentation did you see uri_for?
15:54 asarch D'oh!
15:55 asarch Sorry, sorry
15:55 asarch The side effect of getting old :'-(
15:56 sri i know a lot of older people who still read documentation
15:58 batman :)
16:02 asarch How can you get the current URL address in EP?
16:02 jberger asarch: $c->tx->req->url
16:03 romel maybe url_for('current') ?
16:03 Zoffix :S
16:05 absolut_todd joined #mojo
16:05 disputin joined #mojo
16:06 mattastrophe joined #mojo
16:06 punter joined #mojo
16:11 geheimnis` joined #mojo
16:12 jberger romel: there is a current_route: http://mojolicio.us/perldoc/Mojolicious/Plugin/DefaultHelpers#current_route
16:12 jberger but then you would have to use the current stash values too
16:18 romel i see
16:21 ajr_ joined #mojo
16:26 sri jberger: romel was right actually, there is a special route name "current"
16:26 Zoffix 0.o
16:26 jberger :o
16:27 sri it's equivalent with a url_for() without arguments
16:27 sri meant for helpers that require a route name (when more advanced argument magic is not possible and so on)
16:28 jberger but couldn't those helpers use $c->current_route instead?
16:28 sri then they couldn't support other routes easily
16:30 sri like "form_for current => {id => 23} => begin"
16:30 sri if you want to always require a route name
16:31 * sri just wanted to add more docs for "current", but all the appropriate places already mention it :o
16:33 jberger well then shame on me
16:33 ToApolytoXaos joined #mojo
16:34 jberger time for another reread, I might actually absorb everything this time, my first reread since I've been using Mojolicious in my day job
16:35 cpan_mojo Mojolicious-Plugin-AssetPack-0.54 by JHTHORSEN https://metacpan.org/release/JHTHORSEN/Mojolicious-Plugin-AssetPack-0.54
16:38 punter joined #mojo
16:39 stryx` joined #mojo
16:40 stryx` joined #mojo
16:40 stryx` joined #mojo
16:41 stryx` joined #mojo
16:44 jantore joined #mojo
17:11 ajr_ joined #mojo
17:18 irq joined #mojo
17:33 Kripton joined #mojo
17:35 Kripton joined #mojo
17:35 asarch joined #mojo
17:40 batman Zoffix: ^
17:49 Oleg joined #mojo
17:51 Zoffix joined #mojo
17:52 misty_g3ar joined #mojo
18:09 mattastrophe joined #mojo
18:19 asarch I do: $r->get('/foo/bar/baz')->to('foo-bar#baz');. How could I get the address of 'bar' with url_for from sub baz { ... }?
18:26 Oleg joined #mojo
18:31 asarch Because if I do $self->redirect_to($self->url_for('bar')) from sub baz { ... }, I get "/foo/baz/bar/baz"
18:35 asarch (Or even just 'baz')
18:36 cpan_mojo Mojolicious-Plugin-HostMeta-0.19 by AKRON https://metacpan.org/release/AKRON/Mojolicious-Plugin-HostMeta-0.19
18:48 trone joined #mojo
19:07 odin22 joined #mojo
19:24 berov joined #mojo
19:29 mattastrophe joined #mojo
19:35 absolut_todd joined #mojo
19:35 cpan_mojo Mojolicious-Plugin-BlogSpam-0.09 by AKRON https://metacpan.org/release/AKRON/Mojolicious-Plugin-BlogSpam-0.09
20:21 melo joined #mojo
20:32 disputin joined #mojo
20:35 cpan_mojo Mojo-JWT-Google-0.01 by RICHE https://metacpan.org/release/RICHE/Mojo-JWT-Google-0.01
20:38 sri marcus: rematch old man!
20:41 disputin joined #mojo
20:44 mattastrophe joined #mojo
21:00 Zoffix batman++ # Using sprites is now so seamless :) I don't even know that I'm using them :)
21:06 batman Zoffix: Cool. Glad it worked out :)
21:06 batman Too bad the API is awful. But I guess that doesn't matter as long as it works, hehe
21:07 batman Zoffix: Are you happy with the class names?
21:07 Zoffix API? You mean using sprites:/// thing? I think it's brilliant. Perfectly simple.
21:07 Zoffix batman, yeah, since I have full control over them :P
21:08 batman Awesome :)
21:08 batman I was thinking about the AssetPack to Handler API
21:09 batman There's so much internal method "leakage".
21:10 batman Zoffix: what about the default CSS? Are you happy with display: inline-block?
21:11 batman Anything missing in the CSS..?
21:11 batman I tried to keep it to a bare minimum.
21:12 Zoffix CSS looks good. Inline-block is good, since it's likely the most common option to use (for icons and stuff)
21:12 batman Yeah. I kind of stole it from font awesome :)
21:13 batman I was also considering making another CSS, where the png is base64 encoded in the CSS, but I'm not sure if that's useful.
21:14 batman Haven't really benchmarked how much extra bandwidth that would take.
21:16 * batman is off.
21:16 batman Let me know if there's anything.
21:19 * jberger heads to chicago.pm
21:19 jberger o/
21:25 Zoffix batman, I think that would lead to browser issues. For example IE8 supports data url only up to 32KB. Based on google search, Safari has 128KB limit and Opera 600-something KB.
21:27 Zoffix And the few icons I got on XTaTIK.org already end up with a 45,384-byte data url
21:27 sri batman: not worth it, data urls are too inefficient with all browsers
21:40 sri batman: big problem is that data urls can't be cached
21:43 sri batman: where are sprites documented? i wanted to make a tweet
21:46 Zoffix I don't think they are yet.
21:46 sri :(
21:46 Zoffix Experimental and what not.
21:47 Zoffix sri, oh, there's this, actually: https://metacpan.org/pod/Mojolicious::Plugin::AssetPack::Handler::Sprites
21:48 sri not something you'd want to link to from a tweet
21:48 Zoffix Nope. Doesn't mention 'sprites://' thing
22:04 mattastrophe joined #mojo
22:22 absolut_todd joined #mojo
22:23 hasan joined #mojo
22:24 hasan if I submit a form with method "get" and action="/submit" I only see /submit in my url bar. how can I preserve the query string?
22:24 hasan like /submit?q=mysearchterm in the url bar.
22:24 Grinnz_ if the form is actually submitted with get, the query string is the only way it will be able to submit
22:24 hasan I get the params with $self->req->query_params. and can access them in my template. but they are missing in my url bar in the browser.
22:27 punter joined #mojo
22:27 hasan Grinnz_: of course. but why do I not see anything in my url bar then?
22:27 Grinnz_ i don't know. check your browser's dev console to see what it's actually submitting
22:27 Zoffix hasan, what browser is it?
22:27 hasan firefox
22:28 hasan Grinnz_: dev console shows me only /submit being "GET"ed.
22:28 Zoffix hasan, got code to show?
22:28 hasan ok it seems my html form does not work
22:28 Grinnz_ heh
22:28 Zoffix heh
22:29 Grinnz_ hasan: make sure the inputs have "name"s to use for submission
22:29 hasan Grinnz_: damn. just saw it. had value in them only.
22:29 Grinnz_ they're submitted as name=value so thats kind of important ;)
22:30 Zoffix How is this even possible then? <hasan> I get the params with $self->req->query_params. and can access them in my template.
22:30 Grinnz_ you can still access them if they're undef!
22:31 hasan Zoffix: I tested directly on /submit by typing manually some queries like "arg=1" and could access $stash->{queries}->{arg} in my template
22:32 hasan they werent passed by the form so to speak.
22:32 hasan now it works with "name" in my inputs.
22:33 hasan it works now. but with '"' in the values. they are surrounded by "
22:33 hasan double quotes.
22:33 purl double quotes are interpolating the $
22:33 Grinnz_ can you show the code/template?
22:34 hasan sure
22:34 hasan ah just fixed it. the $ of stash was it. removed it now it works.
22:35 Grinnz_ eh?
22:35 hasan $stash->{queries}->{arg} needs to be stash->{queries}->{arg}
22:35 hasan to have the value of "arg" without double quotes.
22:35 absolut_todd joined #mojo
22:36 Grinnz_ that doesn't look right
22:36 hasan ok let me paste the code
22:36 hasan nopaste.info shut down? oO
22:36 hasan any other than pastebin.com?
22:36 Grinnz_ http://paste.scsys.co.uk/mojo
22:37 shadowpaste "hasan" at 217.168.150.38 pasted "% layout 'intro'; % title 'Cre" (152 lines) at http://paste.scsys.co.uk/473730
22:37 hasan line 34
22:38 Grinnz_ well, without $ is correct anyway (stash is a helper)
22:38 Zoffix hasan, I'm pretty sure you need enctype="multipart/form-data" on that form
22:38 Grinnz_ no, it's a query string form
22:38 Grinnz_ i dont think thats needed
22:38 mattastrophe joined #mojo
22:38 Zoffix Oh, right... I just say "<input type="file" id="projectInputFile">"
22:39 Zoffix *saw
22:40 hasan thanks
22:41 Grinnz_ oh, this isn't the same form
22:42 Grinnz_ yeah for file upload you definitely need a multipart enctype
22:43 Grinnz_ i'm not sure what the javascript is doing though, it may be covering that
22:58 hasan Grinnz_: yes. the js at the bottom (file upload plugin) does that for me
22:58 hasan beside the knockout.js part.
22:59 Zoffix hasan, what is it exactly? Looks like something that makes file uploads sane... and I might be needing something like that for a site at $work
22:59 Zoffix the maxFileCount: 5, bit
23:00 hasan <script src="/js/fileinput.min.js"></script>
23:01 Zoffix hasan, bootstrap?
23:01 hasan http://plugins.krajee.com/file-input
23:01 hasan yes
23:01 Zoffix Sweet. Thanks
23:23 guru joined #mojo
23:57 sri interesting, apparently the slack os x app is actually using the atom shell
23:59 * sri thinks this might have a bright future http://blog.atom.io/2015/04/23/electron.html

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