Camelia, the Perl 6 bug

IRC log for #mojo, 2013-09-18

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

All times shown according to UTC.

Time Nick Message
00:05 marty og01:  You can do either but I usually find under/bridge to work well
00:10 og01 i've sussed under
00:10 og01 how does bridge work?
00:14 og01 marty: hmm infact both seems to work, but what is the difference?
00:15 shmuel joined #mojo
00:15 marty under is used in lite apps.  Bridge is used in full apps.  (same thing)
00:16 og01 marty: hmmm thats confusing, especially since i can use $r->under in a full app and it seems to work
00:16 sri under is the new high level api, bridge the primitive its built around
00:17 sri i'm sure you've noticed that all documentation for under says that it generates bridges
00:18 og01 well yes, kinda, but I was coming form the other direction
00:19 sri what other direction?
00:19 og01 as in i had read about under, and then saw bridge
00:19 og01 without any prior knowledge of what the concept of bridge was
00:20 sri there is only one direction, you learn about under from the tutorial and that it generates bridges... and later on what bridges actually are
00:22 sri http://mojolicio.us/perldoc/Mojolicious/Lite#Under
00:22 sri the words have been chosen very carefully
00:22 og01 yes this is what i was reading
00:22 og01 but it doesnt say what a bride is...
00:22 og01 *bridge
00:22 sri at that point it doesn't matter
00:23 sri you know under has something to do with bridges... that's more than enough
00:29 og01 when you say the new high level api what are you refering to?
00:30 og01 all the Lite stuff or?
00:53 laouji joined #mojo
01:28 btyler joined #mojo
01:31 jamesw_ joined #mojo
01:58 duncanthrax2 joined #mojo
02:00 asarch joined #mojo
02:09 zeep joined #mojo
02:15 laouji_ joined #mojo
02:17 laouji joined #mojo
02:26 d4rkie joined #mojo
02:31 btyler joined #mojo
02:41 selim joined #mojo
03:06 preflex_ joined #mojo
03:34 good_news_everyone joined #mojo
03:34 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/0h8dHQ
03:34 good_news_everyone mojo/master 3804022 Sebastian Riedel: tags are more common than root nodes
03:34 good_news_everyone left #mojo
03:34 heytrav joined #mojo
04:04 kil0byte joined #mojo
04:06 bjoernfan joined #mojo
04:06 good_news_everyone joined #mojo
04:06 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/7a_yGw
04:06 good_news_everyone mojo/master 5fdd258 Sebastian Riedel: mention that Mojo::DOM parses fragments
04:06 good_news_everyone left #mojo
04:13 good_news_everyone joined #mojo
04:13 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/fMsNHA
04:13 good_news_everyone mojo/master 9873b65 Sebastian Riedel: mention fragment more often
04:13 good_news_everyone left #mojo
04:32 dvinciguerra joined #mojo
04:44 KindTwo joined #mojo
05:03 basic6 joined #mojo
05:05 dqw joined #mojo
05:09 dotandimet joined #mojo
05:19 d4rkie joined #mojo
05:22 dqw joined #mojo
05:32 dotandimet joined #mojo
05:44 dotandimet1 joined #mojo
05:52 denisboyun joined #mojo
05:56 denis_boyun__ joined #mojo
06:08 d4rkie joined #mojo
06:28 shmuel joined #mojo
06:45 HtbaaPi joined #mojo
06:47 Lee joined #mojo
07:12 dod joined #mojo
07:30 hrupp joined #mojo
07:38 dod joined #mojo
07:41 dpetrov_ joined #mojo
07:41 zeep left #mojo
07:43 KindOne joined #mojo
07:44 punter joined #mojo
07:48 trone joined #mojo
07:50 arthas joined #mojo
07:54 basiliscos joined #mojo
08:06 punter joined #mojo
08:12 Vandal joined #mojo
08:13 Vandal joined #mojo
08:44 selim joined #mojo
08:47 mire__ joined #mojo
08:54 maxhq joined #mojo
08:54 nicolaas joined #mojo
08:55 nicolaas good to know, Open Shift offers Mojolicious app easy-deployment https://www.openshift.com/developers/perl
08:55 nicolaas do you know other PaaS offering Mojolicious ?
08:56 rem_lex| joined #mojo
08:56 alnewkirk joined #mojo
09:31 fhelmber_ joined #mojo
09:35 moritz nicolaas: there are some that offer PSGI, which should be good enough. For example dotcloud, iirc
09:35 nicolaas moritz ok thanks ! I'll take a look
09:36 fhelmbe__ joined #mojo
09:36 moritz nicolaas: also heroku
09:37 moritz https://devcenter.heroku.com/a​rticles/third-party-buildpacks lists PSGI
09:41 jwang joined #mojo
09:46 perlite joined #mojo
09:57 jwang joined #mojo
09:57 selim joined #mojo
10:00 fhelmber_ joined #mojo
10:15 fhelmbe__ joined #mojo
10:16 denisboyun joined #mojo
10:49 Adura joined #mojo
11:24 bowtie_ joined #mojo
11:24 dqw joined #mojo
11:26 howitdo joined #mojo
11:32 icjs joined #mojo
11:33 icjs hi, i'm reading thru the mojo guide but dont get something, can someone explain the change to the code in http://mojolicio.us/perldoc/Mojolici​ous/Guides/Growing#Application_class
11:33 denis_boyun joined #mojo
11:33 icjs i dont get what "$r->any('/')->to('login#index')->name('index');" relates to, or how it is formed from the previous step
11:34 icjs i mean, i ave a clue ofc, but want a thorough understanding
11:39 sixBB joined #mojo
11:44 batman icjs: do you get any '/' => sub {}; ?
11:44 batman s/get/understand/
11:47 icjs batman, yep, it means http://<app url with no path info> fires that route
11:48 icjs iie.e the root of the app
11:48 batman yes. and it does not care about GET/POST/...
11:48 icjs ok
11:48 batman because of "any"
11:48 batman "login#index" means call the method "index" in the controller "login". "login" is then expanded to MyApp::Login
11:48 dod joined #mojo
11:49 icjs batman, ok superb. ok so you dont need to define anywhere that "login" maps to MyApp::Login, it seems automagic
11:49 batman name('index') is just to make a named alias for the route. useful when constructing links later on. like url_for('index') vs url_for('/');
11:50 batman it's not "automagic". it's based on default variables defined elsewhere. https://metacpan.org/module/​Mojolicious#controller_class
11:50 batman oops!
11:50 batman sorry. wrong link
11:51 batman https://metacpan.org/module/M​ojolicious::Routes#namespaces
11:51 batman if you want to "see it", you can do warn "controller namespace: $_" for @{ $self->routes->namespaces }; # inside startup()
11:52 icjs ok, i get it now, thanks
11:52 batman cool :)
11:54 icjs i dont normally have to worry about namespaces though right? i can just count on "foo" mapping to MyApp::Foo in which i have got "use Mojo::Base 'Mojolicious::Controller';"
11:54 batman no, you don't need to worry about namespaces
11:55 batman i never worry about namespaces.
11:55 icjs yeah youve got all those criminals in gotham to worry about no?
11:55 batman just works, because mojo has sane defaults :)
11:56 batman haha! yeah. and they aren't even sane criminals :P
11:56 icjs cool, i may be back with questions later
11:56 batman well... i don't really worry about them either. after all. i am batman.
11:56 batman ;)
11:56 batman sure. i might be here to answer them :)
11:57 batman no idea why i said that...
12:25 sixBB if I want to display a posted variable when the page is rendered, do I always have to do this?           $self->stash(username => $self->param('username');
12:27 asarch joined #mojo
12:27 batman sixBB: just do this in you template: <%= param 'username' %>
12:27 sixBB ahh
12:27 sixBB thought so :D  thanks
12:28 batman go|dfish: i have not considered local_address, but a patch is welcome
12:28 go|dfish batman: ok, thanks :)
12:29 batman no. thank you, if you submit a patch
12:29 batman :)
12:36 denisboyun joined #mojo
12:55 mire__ joined #mojo
12:59 n0n joined #mojo
13:02 dpetrov_ joined #mojo
13:08 batman are there any limits on how much data a http header can take?
13:13 batman nevermind. found another solution.
13:31 batman sri: Complex regular subexpression recursion limit (32766) exceeded at Mojo/DOM/HTML.pm line 82
13:31 batman got binary data as input. sorry for not being able to send you the input :(
13:31 batman Mojolicious 4.30
13:32 zivester joined #mojo
13:38 batman go|dfish: u no github?
13:43 go|dfish batman: i can do if that's the preferred!
13:45 go|dfish Sorry, should have asked first.
13:46 rem_lex|pivo joined #mojo
13:56 dqw2 joined #mojo
14:02 sixBB joined #mojo
14:03 go|dfish batman: Hopefully i've done that correctly.. it's my first time submitting anything.
14:03 sixBB is there something similar to layouts that would allow me to insert a chunk of HTML into a template, such as a login form?  I want to define it once and then use it repeatedly throughout the site
14:04 batman go|dfish: yes. i'm a big fan of github.
14:04 tianon sixBB: http://mojolicio.us/perldoc/Mojolicious/Gu​ides/Rendering#Including_partial_templates
14:05 batman create github user, fork the repo (https://github.com/marcusramberg/mojo-redis), modify, send pull request
14:05 sixBB ah thanks tianon
14:05 n0n joined #mojo
14:06 batman go|dfish: but... i will look the rt issue anyway. that's like one million times better than nothing :)
14:06 go|dfish batman: I just did a pull request there also, thanks for the instructions
14:06 batman go|dfish: that is awesome!
14:11 marty joined #mojo
14:12 themage joined #mojo
14:17 btyler joined #mojo
14:24 sh3 joined #mojo
14:30 fhelmber_ joined #mojo
14:30 fhelmber_ joined #mojo
14:37 gryphon joined #mojo
14:50 batman go|dfish: i've assigned the pull request to marcus, but please comment on my comment...
14:57 go|dfish batman: hmmmm, I'm not sure I follow. this is for Mojo::IRC, not Mojo::Redis ?
15:03 batman go|dfish: huh?
15:03 basiliscos joined #mojo
15:04 batman haha!
15:04 batman i'm _not_ drunk
15:04 * batman fix the comment
15:05 go|dfish haha
15:05 go|dfish maybe i'm drunk
15:06 batman i wouldn't know... hehe
15:06 batman i updated my comment now
15:06 batman and i don't need to involve marcus.
15:17 sri batman: if you don't tell me how to replicate the problem i won't be able to fix it
15:19 batman sri: okidoki. unfortunately i don't have the file :(
15:23 yko sri: you use a mac to translate your thoughts in a code, correct?
15:23 sri yko: yes
15:25 yko does it hurt? :)
15:25 sh4 joined #mojo
15:26 yko I mean perl vs mac. Does perl require a lot of workarounds or just works?
15:26 btyler perlbrew works great
15:26 yko thank you much
15:27 * sri uses perlbrew too... and it just works
15:27 sri you basically have a bsd with a nice gui
15:29 yko sri: thanks
15:31 btyler the only bump I've run into was installing Term::ReadLine::Gnu, where you need to temporarily link gnu readline, install the module, and unlink it again so it doesn't interfere with system readline. that would have been an issue for any lang or gnu-readline related lib, though.
15:31 btyler and was easily handled with homebrew
15:31 sri http://brew.sh # this is the package manager everybody uses for unix stuff
15:31 sri heh, was about to mention homebrew
15:40 dqw joined #mojo
15:40 marty yko:  I made the switch from ubuntu to a macbook pro about 1 year ago and have not had many issues.  The experience has been quite good.  In fact, I switched everyone in my company over to macs (less support work for me) :)
15:41 marty it took a while to get used to the development environment but not to much work.
15:53 Adura joined #mojo
16:26 icjs if i go to a tech conference, 95% developers will have macs, personally i hate them - debian forever. /offtopic
16:29 crab do you hate the developers or the macs?
16:30 icjs macs, developers like the latest shiny-shiny stuff, not gonna change that
16:31 icjs on the plus side i love crab food, especially in sandwiches
16:32 sri haters gonna hate
16:33 crab haters gonna eat
16:36 denisboyun joined #mojo
16:38 d4rkie joined #mojo
16:44 marty Saying that developers like the latest shiny stuff proves either 1) icjs is not a developer or 2) the statement is false.   :)
16:45 sri he said that in a perl channel for crying out loud lo
16:45 sri ;p
16:46 icjs marty, 3) he said it for comedy vale and it is true?
16:47 marty Speaking for myself, I never gave macs much thought until my wife got one.  I don't care about shiny, I care about usability and user experience.  And right now, I think apple have a pretty good (expensive) product but I'd switch in a minute if something else was better.
16:47 gtodd joined #mojo
16:48 marty Ahhh ok. (in my best Mork voice)  Oh, Humor, arrr arrr arrrrr
16:48 marty I thnk I just dated myself with that one.  :)
16:49 tianon Nanu nanu!
16:54 d4rkie joined #mojo
17:09 yko thanks guys. I think I'll give it a try
17:22 dvinciguerra joined #mojo
17:30 HtbaaPi joined #mojo
17:41 mire__ joined #mojo
18:03 highflying joined #mojo
18:06 n0n joined #mojo
18:28 sixBB Mork, grand inquisitor?
18:38 selim joined #mojo
18:46 mib_3pkcnb joined #mojo
18:47 mib_3pkcnb Hi I am making a call to req->body which is not being returned as utf-8. is there a way to force it to do so?
18:49 sri if the content was sent as utf-8 it certainly still is after it got returned by ->body
18:53 mib_3pkcnb I will dump the content type to see if it is set correctly
18:53 sri i don't see the relevance
18:57 mib_3pkcnb well my ajax call is certainly passing utf8 content into the call.
19:31 batman i'm sort of making an cms where you can upload images and other files. do you think it's a bad idea to store those in mongodb?
19:31 batman should i store it directly on the file system instead?
19:31 batman i'm thinking filesystem is a good idea, since nginx and friends are good at serving files, but most people use a reverse proxy anyway...?
19:32 batman s/an/a/
19:37 tianon GridFS \o/
19:43 jnbek joined #mojo
20:00 marty batman:  I'm storing all our images in mongo (via mango) and so far it's working wonderfully.  Not many images, couple of thousand.  Since all are under 5mb I don't have to use gridfs.
20:00 batman marty: ok. cool :)
20:00 marty I use perl Imager module to resize on the fly and store the resized image in the mongo.
20:00 batman so you're storing them directly in the object??
20:01 batman s/object/document/
20:02 marty yep, as a mango bson_bin data type.  I store the image raw data in a "raw" field and then sizes get stored in like "100x100" etc fields.  That way can query mongo and only return the fields I need to keep the data over the wire to a minimum
20:02 * marty hugs mango
20:03 batman that's crazy :)
20:03 batman i like it!
20:03 tianon but you have to make sure they stay smaller than 16mb if you do that, since your max document size is 16mb total :P
20:03 marty \o/
20:03 tianon not a big deal, but important to be aware of :)
20:03 marty and then of course I cache everything behind an nginx reverse proxy
20:03 batman tianon: yeah, but most images for web should be small...
20:03 batman marty: yeah. i'm using cloudflare :)
20:03 tianon or resized directly upon upload :)
20:19 mib_3pkcnb ok so I have confirmed that if I call req->params->to_hash I receive utf8 characters, if I call req->body it is not utf8. Anyone know a solutions for accessing the body as utf8?
20:21 batman marty: have you considered base64 encoding them instead of storing as binary?
20:22 batman mib_3pkcnb: $body = Mojo::Util::encode('UTF-8', $req->body) ?
20:22 * batman is partially guessing
20:22 mib_3pkcnb let me try that one.
20:24 mib_3pkcnb although I preceive that is the opposite. I assume it is coming in as bytes
20:25 sri utf8 characters is not a thing... you either have utf-8 bytes *or* characters in perl
20:26 punter joined #mojo
20:30 marty batman:  No I have not.  Once I got the images going in/out I stopped experimenting.  :)
20:30 batman :)
20:30 batman i think it's a bad idea, but i'm testing anyway.
20:32 mib_3pkcnb what benefit would you receive?
20:34 mib_3pkcnb encode didn't help.
20:35 sri why store a 2mb image as binary when you can also inflate it to 4mb... BIG DATA!
20:37 tianon HADOOP! for great Customer Experience!
20:38 mib_3pkcnb filesystem is probably the best way to go when it comes to static images. kis
20:39 mib_3pkcnb just make sure your filepath structure is bucketed properly, and account for future disk space
21:16 batman sri: :D
21:25 good_news_everyone joined #mojo
21:25 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/Px1SjQ
21:25 good_news_everyone mojo/master b09b45a Sebastian Riedel: mention that multipart content gets automatically downgraded
21:25 good_news_everyone left #mojo
22:04 dvinciguerra joined #mojo
22:04 mire__ joined #mojo
22:31 rem_lex joined #mojo
22:43 tianon joined #mojo
23:01 asarch joined #mojo
23:09 marty joined #mojo
23:20 dotan joined #mojo
23:44 marty joined #mojo

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