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

IRC log for #mojo, 2015-06-01

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

All times shown according to UTC.

Time Nick Message
00:08 nicomen joined #mojo
00:39 jberger are there really only 2 Mojo talks at YAPC?
00:40 Adura It's so easy to understand you barely need to talk about it.
00:42 pink_mist I expect most Mojo talkers were aiming for Mojoconf, and then when that fell through, a lot of them couldn't reschedule for YAPC
00:49 nicomen yapc where?
00:50 jberger sorry, ::NA
00:50 nicomen ah
00:57 richardino joined #mojo
00:59 richardino hi... I am trying to get visitor's IP address with $self->req->headers->host
01:00 richardino but when I run the code on the server , I get only "::1"
01:00 richardino instead of ip4 address
01:00 richardino mojo is behind Apache
01:00 sri that's an ipv6 address
01:00 richardino any suggestions?
01:01 nicomen two, req->headers->host gives you the HTTP Header Host, which is what something asks for on your server. Not the ip connecting to it.
01:01 richardino how cna I get ip4 address of visitor when mojo is behind apache??
01:01 sri http://mojolicio.us/perldoc/Mojolicious/Guides/Cookbook#Apache-mod_proxy
01:01 nicomen so when I go to github.com my client will set "Host: github.com"
01:03 richardino is it due to that mojo is behind Apache?
01:03 nicomen richardino: if you weren't behind apache: $self->tx->remote_address - since you are behind apache, apache needs to set extra headers, check the docs sri posted
01:03 richardino is there a workaround, in order to get the correct visitor IP
01:04 nicomen yes, many, there are conventions, check the docs sri pasted
01:04 richardino let me check my apache settings
01:04 remarbach joined #mojo
01:04 absolut_todd joined #mojo
01:06 mattastrophe joined #mojo
01:17 jberger sri: ping to query
01:38 klapperl_ joined #mojo
01:39 richardino Hello Sri
01:39 richardino mod_proxy setting is correct
01:40 richardino i cant get $self->tx->remote_address
01:42 richardino i use morbo . may it be the reason?
01:55 Grinnz richardino, yes, morbo does not follow forwarded headers
01:55 richardino should I run hypnotoad instead of morbo
02:04 csson joined #mojo
02:07 Grinnz richardino, i believe you can set the env var MOJO_REVERSE_PROXY=1 for it to work for any server
02:08 richardino i set proxy true at hypnotoad config
02:08 richardino it looks like working
02:08 Grinnz hypnotoad config only works for hypnotoad
02:08 richardino app->config(hypnotoad => {
02:09 richardino proxy => 1
02:09 richardino });
02:09 richardino so, if i set MOJO_REVERSE_PROXY=1, then will it work with morbo?
02:10 Grinnz it should
02:10 richardino wl try
02:10 Grinnz i think i did this for a project at work
02:18 richardino Grinnz .... right, morbo worked grabbed ip address when MOJO_REVERSE_PROXY=1 set
02:19 richardino is Morbo or Hypnotoad better to run?
02:19 Adura Morbo is for development...
02:20 mst richardino: morbo for development, hypnotoad for deployment
02:20 mst richardino: putting morbo behind a proxy is WEIRD
02:21 richardino it looks hypnotoad handles simultaneous connections
02:22 mst richardino: development versus deployment
02:22 mst richardino: stop inventing other reasons!
02:22 mst morbo on your laptop
02:22 mst hypnotoad on your server
02:22 richardino hypnotoad has a lot config options...
02:23 mst servers require reading the manual
02:23 mst you can always ask a sysadmin to do it for you
02:24 richardino thanks a lot . for all the help
02:41 noganex_ joined #mojo
03:10 bin_005 joined #mojo
03:27 basic6 joined #mojo
03:28 damaya_ joined #mojo
03:35 mattastrophe joined #mojo
04:04 kaare joined #mojo
04:08 mattastrophe joined #mojo
04:36 inokenty-w joined #mojo
04:52 mattastrophe joined #mojo
05:59 dod joined #mojo
06:02 dod joined #mojo
06:09 hshong joined #mojo
06:11 dod joined #mojo
07:04 trone joined #mojo
07:22 lestrrat joined #mojo
07:35 McA joined #mojo
07:35 kaare joined #mojo
07:35 basic6 joined #mojo
07:35 Repaster joined #mojo
07:35 Grinnz_ joined #mojo
07:35 bpmedley joined #mojo
07:35 D4RK-PH0ENiX joined #mojo
07:35 Nemix_ joined #mojo
07:35 btyler joined #mojo
07:35 bayashi joined #mojo
07:35 cosimo joined #mojo
07:35 inokenty joined #mojo
07:35 Mikey joined #mojo
07:35 kwa joined #mojo
07:35 hernan604 joined #mojo
07:35 odc joined #mojo
07:35 sri joined #mojo
07:35 LordVorp joined #mojo
07:35 Snelius joined #mojo
07:35 jnbek joined #mojo
07:35 mtths joined #mojo
07:35 go|dfish joined #mojo
07:35 stephan joined #mojo
07:35 Foxcool joined #mojo
07:35 stephan48 joined #mojo
07:35 mst joined #mojo
07:35 bjoernfan joined #mojo
07:37 trone joined #mojo
07:37 klapperl_ joined #mojo
07:37 nicomen joined #mojo
07:37 frederico joined #mojo
07:37 kyshtynbai joined #mojo
07:37 vmbrasseur joined #mojo
07:37 batman joined #mojo
07:37 pink_mist joined #mojo
07:37 salva joined #mojo
07:37 damaya joined #mojo
07:37 marcus joined #mojo
07:37 dotan joined #mojo
07:37 al joined #mojo
07:37 marmez joined #mojo
07:37 dustinm joined #mojo
07:37 oetiker joined #mojo
07:37 jzawodn joined #mojo
07:37 Eke joined #mojo
07:37 gabiruh joined #mojo
07:37 marcusr joined #mojo
07:37 romel joined #mojo
07:37 Jonis joined #mojo
07:37 rwp joined #mojo
07:37 dabudabu joined #mojo
07:37 jabberwok joined #mojo
07:37 crab joined #mojo
07:37 augensalat joined #mojo
07:37 bc547 joined #mojo
07:37 murre joined #mojo
07:37 Andreas joined #mojo
07:37 stryx` joined #mojo
07:37 espen joined #mojo
07:37 abracadaniel joined #mojo
07:37 shadowpaste joined #mojo
07:48 ashimema joined #mojo
07:48 eseyman joined #mojo
07:52 ashimema joined #mojo
07:53 fhelmbe__ joined #mojo
07:53 Vandal joined #mojo
08:03 fhelmber_ joined #mojo
08:28 bin_005 joined #mojo
08:52 ToApolytoXaos joined #mojo
09:11 bin_005 joined #mojo
09:18 fhelmber_ joined #mojo
09:51 marmez joined #mojo
09:57 damaya_ Is there a way to remove all <a> elements from the dom? I tried $dom->find('a')->remove, but can't do that on a Mojo::Collection object.
09:58 buu damaya_: have you considered.. a loop
09:59 buu Although I'm kinda surprised you can't call ->remove on a Collection
10:01 damaya_ Can't locate object method "remove" via package "Mojo::Collection"
10:02 damaya_ Hm, is there a better way to strip html from input boxes?
10:02 buu s/</&lt;/g
10:05 damaya_ I am using HTML::Strip, just wanted to see if there was a way with Mojo::DOM, et al
10:05 damaya_ etc
10:05 damaya_ haha
10:10 kwa joined #mojo
10:13 Snelius damaya_: True Hacker!
10:14 damaya_ I've always thought I was, now I know I am :D
10:15 damaya_ I was actually interested if I could pass things in like <%= time %> in a textbox, if that would work. Turns out it doesn't. Awesome.
11:02 fhelmber_ joined #mojo
12:05 neilhwatson joined #mojo
12:07 absolut_todd joined #mojo
12:07 mattastrophe joined #mojo
12:17 fhelmber_ joined #mojo
12:27 fhelmber_ joined #mojo
12:30 frederico joined #mojo
12:32 frederico joined #mojo
13:02 nicomen how do I add unescaped content to a Mojo::DOM node?
13:05 pink_mist https://metacpan.org/pod/Mojo::DOM#append ?
13:07 pink_mist I guess I'm not sure what you mean by unescaped
13:08 pink_mist but if you need to escape stuff, there's https://metacpan.org/pod/Mojo::Util#xml_escape
13:10 pink_mist https://metacpan.org/pod/Mojo::DOM#content also, perhaps this is more what you mean?
13:16 zivester joined #mojo
13:18 nicomen I'
13:19 nicomen m trying to reproduce with a small test. it seems that when I extract JS content with ->content, and put it back it ends up extra escaped
13:19 nicomen I will come back whenever I manage, so just ignore me in the meantime. Sorry and thanks ;)
14:04 punter joined #mojo
14:08 sh4 joined #mojo
14:13 lluad joined #mojo
14:26 buu joined #mojo
14:29 fhelmber_ joined #mojo
14:31 fhelmber_ joined #mojo
14:37 zackiv31 joined #mojo
14:45 mattastrophe joined #mojo
14:54 mattastrophe joined #mojo
15:02 mattastrophe joined #mojo
15:03 PryMar56 joined #mojo
15:44 mgrimes joined #mojo
15:55 vmbrasseur joined #mojo
15:58 vmb joined #mojo
16:12 tempire joined #mojo
16:34 mattastrophe joined #mojo
16:42 Ptolemarch joined #mojo
16:49 disputin joined #mojo
16:56 sh4 joined #mojo
17:42 mattastrophe joined #mojo
18:04 mattastrophe joined #mojo
18:10 trone joined #mojo
18:15 trone_ joined #mojo
18:28 bin_005 joined #mojo
18:30 dod joined #mojo
18:41 berov joined #mojo
18:49 bin_005 joined #mojo
19:00 marmez joined #mojo
19:05 * sri wishes hearthstone had better endgame content
19:06 _dave_ never bet on endgame content =P
19:10 sri not with blizzard games at least :S
19:10 _dave_ I can't think of a single game dev who hasn't burned out once they got to endgame
19:11 Grinnz_ it's a constant struggle.. you need to make more stuff to keep people engaged but not take too long where people leave first
19:11 Grinnz_ people play through content much faster than it can be developed by orders of magnitude
19:12 lb "a single game dev" about a AAA title is meaningless
19:12 Grinnz_ not necessarily
19:12 Grinnz_ even the AAA titles have one team that works on at least one part of the endgame
19:13 lb that was also meaningless
19:13 Grinnz_ but there's content, art, and engineering, the last is probably the most visible cause they fix the bugs
19:15 lb "yeah, sure, our website has terrible credit card transactions, but our developers were burnt out at that point"
19:15 lb meaningless
19:15 purl meaningless is existentialism ...
19:15 Grinnz_ ??
19:16 lb AAA is broad software engineering
19:16 lb it's planned
19:16 Grinnz_ endgame isn't a fixed plan, it goes on forever
19:16 Grinnz_ until the game dies
19:16 lb burnout happens primarily in the middle with random features getting far too little attention, but not being cut
19:18 lb AAA didn't exist when i did games development, but it sure as hell was easy to see where it was going back then
19:21 amon joined #mojo
19:24 * sri is specifically talking about blizzard though... they always follow the same pattern, make a really fun game that keeps people engaged for a few days, then tack on a leaderboard to keep them playing
19:24 _dave_ bliz is formula gaming to be sure
19:25 lb there's nothing burnouty about the execution of blizzard games
19:27 lb spreadsheets, focus groups and polish
19:27 lb and a metric shit ton of marketing
19:28 disputin joined #mojo
19:33 mattastrophe joined #mojo
19:37 sri oh
19:37 sri perl 5.22 is out \o/
19:37 sri enjoy your 30% faster mojolicious
19:38 * Grinnz_ fires up perlbrew and perl-build
19:39 _dave_ argh, stuck at 5.18
19:39 genio ooooh
19:41 Kogurr joined #mojo
19:43 disputin joined #mojo
19:48 bin_005 joined #mojo
19:54 jberger where does that 30% come from?
19:54 jberger nested structure access?
19:55 lb the only thing i know about 5.22: method lookup cache
19:56 Grinnz_ method call optimization would be a serious boost
19:57 lb i have a benchmark i want to run tomorrow, should be interesting
19:57 lb (for me, not necesarilly you :) )
19:59 sri method calls and nested structures would be my guess
20:00 sri if your app spends most of its time in DBI you won't notice anything of course ;p
20:00 sri i've been profiling minimal apps and the http stack
20:01 sri but even things like Mojo::Base accessors got faster
20:02 sri which is not very suprising i suppose, since stuff like $_[0]{$attr} should be using the new deref op
20:03 Ptolemarch joined #mojo
20:06 jberger I don't understand the method lookup cache, how can it cache method lookup and not break dynamic scoping?
20:07 lb again, speaking completely without knowing any of the details, because of one of the two hard problems of computer science
20:08 sri hmm, so far LWP and Coro failed to install
20:09 Grinnz_ heh
20:09 ribasushi sri: Coro is a known issue, LWP is not p5 related (it's the libopenssl debacle)
20:10 sri ah, Coro didn't surprise me
20:12 ribasushi jberger: it's not one huge improvement
20:12 ribasushi jberger: there is a slew of little opetimizations, each engaging in very specific circumstances
20:13 ribasushi jberger: together they deliver a unoformly faster method dispatch (but nothing close to 30% FASTAR all the time)
20:13 jberger ah
20:13 ribasushi jberger: clone the p5 repo, fire `git log` and look for commits by syber@crazypanda.ru
20:14 jberger FASTAR, HIGHAR, STRONGAR!!!
20:14 ribasushi jberger: each has a relatively approachable commit message detailing it
20:14 sri mojolicious is pretty much all objects, so we benefit a lot
20:15 * lb installs Devel::NYTProf on an empty perl
20:15 lb aens passes
20:15 lb +o
20:22 sri Devel::Cover failed too
20:24 lb boo, not much difference between and 5.20.0 and 5.22.0 for this bench
20:25 * lb has the impossible dream of tail recursion in perl
20:26 sri t/e2e/auncoverable.t ........ Failed 1/1 subtests
20:34 Grinnz_ dammit GeoIP2, why you gotta bring in LWP
20:34 lb 1st rule of software
20:34 lb nothing ever goes away
20:35 sri guess you can foce install LWP
20:35 jberger lb: tail recursion?
20:35 purl tail recursion is sub f { ....;  goto &f } or sub f { while(1) { ... }} or see tail recursion or A dog chasing its tail or something that a compiler can detect and optimize away at compile time; the underlying VM doesn't need to know about it at all
20:35 * Grinnz_ has had a rule lately: HTTP::Tiny or Mojo::UA all the things
20:35 jberger that's right purl
20:35 sri just the robot tests fail here
20:36 lb jberger: goto isn't tail recursion, and while takes massive refactoring
20:36 Grinnz_ the tests don't fail on my f22 box, but i should hope not, f22 was released a week ago
20:36 jberger how is goto & not tail recursion?
20:36 Grinnz_ goto & is
20:36 sri lb: totally is
20:37 Grinnz_ goto itself isn't
20:37 jberger note that python will never have tail recursion, because the BDFL doesn't think you need it
20:37 asarch joined #mojo
20:38 lb sub foo { my $n = shift; foo($n - 1) if $n; } -> sub foo { $_[0]--; goto &foo if $_[0]; }
20:38 lb hardly as readable
20:38 vmbrasseur joined #mojo
20:38 lb and also different, which isn't easy to spot :)
20:38 sri but it exists
20:40 lb fine
20:40 * lb has the impossible dream of convenient tail recursion in perl
20:40 lb ffs
20:41 jberger purl doesn't have a factoid for ffs? ffs!
20:41 purl jberger: huh?
20:41 lb purl: ffs?
20:41 purl somebody said ffs was ufs enhanced or faster with softupdates.. why not just use ffs in linux? or Flash File System or for fuck's sake or fringe field switching
20:41 lb need that silly little character at the end ;)
20:43 * jberger slaps purl with a fish
20:43 * purl slaps jberger with comically large fish in return
20:43 lb *splash*
21:08 bin_005 joined #mojo
21:10 frederico joined #mojo
21:11 Phil21 joined #mojo
21:11 claudio joined #mojo
21:15 Grinnz_ huh, LWP::Protocol::https installed successfully in 5.22.0 on my centos 6 box, did they fix that?
21:15 Grinnz_ cause my openssl on here is certainly not new
21:16 Ptolemar_ joined #mojo
21:17 pink_mist I thought it was newer openssl that introduced the problem..?
21:17 Grinnz_ it's mozilla's new CA stuff...
21:17 Grinnz_ they killed a root cert or something, i dont remember
21:19 marcusr oh my god, they killed mozilla, those bastards!
21:21 * Grinnz_ installs half of cpan/Dist::Zilla
21:24 lb Grinnz_: install mojomojo to get the other 2/3
21:24 * lb glares meaningfully at marcusr
21:25 Grinnz_ hehe
21:25 Grinnz_ i haaven't yet installed Catalyst on anything :P
21:25 lb that just means you know less
21:30 PryMar56 joined #mojo
21:42 Anon021 joined #mojo
21:46 Repaster joined #mojo
21:47 Grinnz_ Repaster now running on 5.22.0 :P
21:57 absolut_todd joined #mojo
22:38 mattastrophe joined #mojo
22:40 marcusr lb: Heavy 100
22:42 batman Devel::Cover is really annoying when it doesn't work. i really have no idea how that tool works :(
22:43 batman cover -test ; ... working ... only reports on half of my modules in lib/
22:47 batman \o/ works on perl 5.16.1
22:47 cpan_mojo Mojo-IRC-0.23 by JHTHORSEN https://metacpan.org/release/JHTHORSEN/Mojo-IRC-0.23
22:56 vmbrasseur joined #mojo
22:56 nicomen lb: know less of the world's cruelty...
23:34 damaya_ Hey all, using Mojolicious and Mojo::Pg here. I don't want to use a table's primary key in the url (e.g., /post/2), I'd much rather generate some sort of base36 uuid. Anyone done this? How did you accomplish this?
23:37 damaya_ My question is not "How to create base36/64 random string," but rather how others have tackled this.
23:50 punter joined #mojo
23:54 Grinnz damaya_, just add a unique key which is a string you generate before inserting or with a trigger
23:54 Grinnz then you can lookup by the unique key
23:54 damaya_ Something like this https://github.com/norman/friendly_id for mojolicious
23:55 damaya_ I've added a function that takes the surrogate key and creates an 8 character string out of it.
23:55 damaya_ I ask questions a lot of the times after I've solved the problem just to be sure I'm not reinventing a wheel :D
23:59 Grinnz damaya_, i don't think there's a whole lot to it on the database/app side; now "how to make an id friendly for users" is a whole other story

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