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

IRC log for #mojo, 2015-03-12

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

All times shown according to UTC.

Time Nick Message
00:15 Grinnz joined #mojo
00:27 zivester joined #mojo
00:33 asarch joined #mojo
00:52 sri riche: wasn't the call for papers supposed to go up like 2 weeks ago?
00:57 jberger sri: very soon
00:57 Adura joined #mojo
01:02 memowe joined #mojo
01:08 fhelmber_ joined #mojo
01:19 hshong joined #mojo
02:02 memowe joined #mojo
02:05 Grinnz well i just used Mojo::DOM for the first time, to parse some XML from an api
02:05 Grinnz not bad
02:06 Grinnz hopefully i never have to use it again (XML parsing, that is)
02:06 Grinnz but that's too much to ask for ;
02:06 Grinnz ;)
02:07 jberger try though we might, XML isn't going away any time soon
02:08 Adura If they hadn't made it so damn extensible.
02:11 mst XML is useful as a human readable machine parseable interchange format with schemas
02:11 mst YAML would've been better but nothing like XML Schema or SOAP ever existed for it
02:12 mst undocumented random bags of JSON are an improvement on one axis and a disaster on others
02:12 mst it's all trade-offs, as ever
02:19 Grinnz luckily, most JSON apis are thoroughly documented, at least the ones i'm using
02:19 Grinnz mostly because they're dirt simple to document
02:22 Adura joined #mojo
02:23 klapperl_ joined #mojo
02:28 mst Grinnz: sure, but I still wish JSON Schema or rjbs' Rx had got popular
02:49 jnbek joined #mojo
02:51 jnbek joined #mojo
03:04 denny joined #mojo
03:14 sri nothing around http/2 surprises me anymore
03:14 sri there was a big list of implementations that got cited to show what a huge success the project is... turns out almost all of them are bindings for the same C lib
03:14 mst ...
03:15 Adura C seems like the right language for http2.
03:16 sri not that nghttp2 sucks, but the future looks very monoculture https://nghttp2.org/
03:17 sri only other proper implementation i could find was the one for Go, of course done by google folks
03:19 jberger ick and an off-the-shelf octopress site
03:20 sri could be worse
03:20 purl Could be MySQL
03:20 sri botsnack
03:20 purl thanks sri :)
03:20 jberger have you ever tried to run one of those? I have
03:21 jberger it was what caused preaction to write statocles
03:21 sri i have, it was what drove me to tumblr
03:22 jberger hahaha
03:23 noganex_ joined #mojo
03:23 sri and jekyll... it's like the worst web app i've ever used
03:29 jberger I haven't used it by itself, I mean I tried, but ... unsuccessfully
03:34 preaction i've used raw jekyll. not nearly as terrible as octopress
03:34 preaction but also a bit unfriendly
03:37 jberger anyone know why I can't get LIBEV_FLAGS=4 to work on travis?
04:08 * jberger tries =7
04:25 marmez joined #mojo
04:26 * sri wonders if someone will build a Mojo::Pg subclass that adds SQL::Abstract support
04:27 sri should be as easy as overloading Mojo::Pg::db and reblessing the returned value
04:35 ispyhumanfly joined #mojo
05:07 cpan_mojo Mojo-Pg 1.14 by Sebastian Riedel - http://metacpan.org/release/SRI/Mojo-Pg-1.14
05:34 jberger Grinnz++ IPv6
06:13 Averna joined #mojo
06:19 dotandimet joined #mojo
07:12 bramirez joined #mojo
07:15 reneeb joined #mojo
07:32 dotandimet joined #mojo
07:34 Vandal joined #mojo
07:36 kaare_ joined #mojo
07:52 AndrewIsh joined #mojo
07:57 dod joined #mojo
08:03 dod joined #mojo
08:10 eseyman joined #mojo
08:10 memowe joined #mojo
08:14 juikuen joined #mojo
08:24 trone joined #mojo
08:39 bramirez joined #mojo
08:39 marcusr sri: holy I didn't know postgres can do this: https://metacpan.org/pod/SQL::Abstract#Inserting-and-Updating-Arrays
09:23 steven joined #mojo
09:24 steven g'morning.
09:26 steven In the earlier versions of Mojolicious the  param method of a controller returned the names from the used parameters. This has changed. What is the new way to get all the names of the available params?
09:31 niczero Upon the release of v5, there was a Google Discussion list of incompatibilities; might be worth seeing if there's one for v6
09:31 niczero (I haven't been keeping up with the news, but it was v useful last time around so my guess is folks have done the same again)
09:32 niczero crab: You mentioned your approach for keeping 'secrets' out of app.conf
09:32 meshl joined #mojo
09:33 niczero Do you have any tricks for keeping it out of exception reports (in developer mode)?
09:36 fhelmber_ joined #mojo
09:36 niczero I guess I could have different secrets.conf files for dev and live, and maybe have a separate mode (testing) for the bits between dev and uat
09:36 crab niczero: i delete them from %config in startup after i've used them to do $whatever :-)
09:37 niczero ah, interesting
09:40 steven niczero: just glancing over some Google Groups messages. Looks like the my @names = $c->param; was removed due to an sec issue.
10:10 juikuen joined #mojo
10:46 niczero steven: Yeah, doesn't just apply to Mojo
10:49 niczero awww, waited three days for some play time to try out Mojolicious::Command::generate::bootstrap_app...
10:49 niczero and it doesn't work
10:49 purl It's a Y2K error!  Panic!  Sue!
10:50 niczero "Can't locate object method "new" via package "Mojo::Loader""
10:50 * niczero wants a refund
10:50 jabberwok double your money back
10:50 steven niczero: Indeed. I'm  trying to work around it atm with the help of the $c->req->params object.
10:58 bpmedley niczero: Do you still have some time for Mojo?
10:59 bpmedley niczero: https://metacpan.org/pod/Mojolicious::Plugin::Bootstrap3 <— I’ve used this
11:02 meshl joined #mojo
11:02 niczero bpmedley: thanks for the tip
11:02 * niczero starts the playtime stopwatch
11:03 niczero On an entirely separate note...  has anyone played with gephi.github.io for big data?
11:03 niczero it's rather mad and rather fun :)
11:13 cpan_mojo Mojolicious-Plugin-Model 0.03 by Andrey Khozov - http://metacpan.org/release/AVKHOZOV/Mojolicious-Plugin-Model-0.03
11:14 reneeb niczero: I'd really like to play with gephi. Do you know if there's a really good tutorial...
11:42 neilhwatson joined #mojo
12:02 bramirez joined #mojo
12:23 tencendur joined #mojo
12:27 niczero sorry, reneeb, don't know of one
12:34 niczero I don't understand that Model plugin at all
12:36 nicomen I added a favicon.ico file but the mojolicious icon is still showing, is there a way to circumvent that?
12:36 pink_mist nicomen: that would depend on your browser probably -- they usually cache the favicon even when you tell it not to cache anything
12:38 pink_mist navigating to the favicon, invalidating cache, and then restarting your browser has worked for me in the past
12:38 pink_mist s/your/my/
12:38 pink_mist (I didn't restart *your* browser after all :P)
12:47 nicomen I use wget and curl
12:47 nicomen a favicon.ico file is present in the static dir
12:48 pink_mist so what do you mean by "showing" then? I assumed that meant you were looking at it in a browser
12:49 niczero I'd be surprised if public/favicon.ico doesn't have priority
12:49 niczero check for silly things like it's not readable
12:51 pink_mist is your server running under something that isn't morbo? did you restart it?
13:05 mattastrophe joined #mojo
13:13 batman nicomen: have you tried manually visiting http://localhost:3000/favicon.ico ?
13:13 zivester joined #mojo
13:14 batman nicomen: i usually manually set <link rel="icon" href="<%= url_for "/image/favicon.ico" %>" type="image/x-icon">
13:14 batman /favicon.ico is often hijacked by nginx or something in my setup :/
13:15 gryphon joined #mojo
13:15 nicomen batman: yes
13:16 nicomen /script/gonzo_web get /favicon.ico doesn't pick it up
13:16 nicomen | winicontoppm | ppmtoxpm
13:16 nicomen to actually see it
13:16 batman then you have messed up :)
13:16 nicomen ?
13:16 batman try adding foo.txt in the same directory to see if you can fetch that
13:17 nicomen robots.txt works
13:17 nicomen ah wait
13:17 nicomen maybe the file is wron
13:17 nicomen g
13:17 nicomen haha
13:17 ashimema Mojo::JSON doesn't do bools does it..
13:18 ashimema i.e there's no JSON::true for instance like JSON::XS and the likes.. right?
13:18 nicomen yes :-/
13:18 ashimema sure I read it somewhere but can't lay my fingers on it at the minute..
13:18 ashimema cheers..
13:18 * purl jumps up and down
13:18 nicomen ashimema: yes it does bools
13:18 deserted joined #mojo
13:19 ashimema right.. I best go dig out the docs then..
13:20 ashimema pants.. so it does.
13:20 nicomen $ perl -wle 'use Mojo::JSON; print Mojo::JSON::encode_json({ "v" => Mojo::JSON->true })'
13:20 nicomen {"v":true}
13:20 ashimema Now I am confused then.. time for some test scripts :)
13:21 ashimema I must be butchering it somewhere else along the line ;)
13:22 Kripton on a hash {true => \1, false => \0}
13:22 Kripton perl -wle 'use Mojo::JSON; print Mojo::JSON::encode_json({ "true" => \1, "false" => \0 })'
13:23 deserted hey all, quick question because my brain doesn't want to work atm, what's the best way to check if a plugin has been loaded? usual method of inspecting %INC or does Mojolicious have an interface available to check?
13:23 danejx joined #mojo
13:27 amon joined #mojo
13:29 Grinnz steven, $c->req->params->names
13:30 ashimema cheers peeps
13:30 ver joined #mojo
13:36 batman Kripton: i wouldn't suggest using \0 or \1. it's internal structures create by Mojo::JSON->true and ->false
13:36 batman created/used
13:37 Grinnz if you need to be cross compatible with true/false booleans from JSON::XS or Cpanel::JSON::XS then you should use Mojo::JSON::MaybeXS
13:37 Grinnz otherwise the two encoders will not understand each others boolean objects
13:38 jberger \1 and \0 are approved usages
13:38 jberger it's a common idiom in most perl json libraries
13:39 jberger Kripton ^^. cc: batman Grinnz
13:40 jberger documented right in the synopsis: http://mojolicio.us/perldoc/Mojo/JSON#SYNOPSIS
13:40 batman jberger: it is? ok :)
13:40 jberger and in the description below that :-)
13:41 batman good to know
13:42 jberger deserted: I would check to see if it's effect it seen
13:43 jberger for example if it registers a helper, just check to see if the helper is there
13:43 deserted jberger, cheers, was thinking that was probably easiest, but wasn't sure ;)
13:45 jberger http://mojolicio.us/perldoc/Mojolicious/Renderer#get_helper
13:45 jberger app->renderer->get_helper('some_helper_name')
13:45 augensalat I'd like to contribute the following https://github.com/kraih/mojo/compare/0175e4a...augensalat:907c84b
13:46 deserted jberger, perfect :) thanks mate was digging in controller not renderer
13:46 jberger augensalat: you can open a PR
13:47 * augensalat is blocked
13:47 jberger I'm not sure how it would hurt anything to have that in there, but let's see what sri thinks
13:47 jberger blocked?
13:47 deserted lol that was quick
13:48 augensalat jberger: sri knows
13:51 marcusr joined #mojo
14:03 OmarOthman joined #mojo
14:11 asarch joined #mojo
14:20 gtodd joined #mojo
14:21 gtodd if I fetch the dom and look for <a>'s with "hrefs"  like this:
14:21 gtodd perl -Mojo -E ' my $ua = Mojo::UserAgent->new; say $ua->get("http://www.cbc.ca")->res->dom->find("a")->map(attr => "href")->join("\n") ;'
14:22 mishantil [M0
14:22 mishantil T[M3
14:22 mishantil T[M0
14:22 mishantil T[M3
14:22 mishantil Sorry about that.
14:23 gtodd I get   "Use of uninitialized value $_ in string at /home/gtodd/perl5/lib/perl5/Mojo/Collection.pm line 43, <DATA> line 2231"  because some "<a>"'s don't have hrefs I guess and end of empty ... I can't figure out how "mojo www.cbc.ca a attr href" suppresses those ...
14:24 jberger a[href]
14:24 gtodd arg
14:24 gtodd h
14:24 gtodd CSS-ish
14:24 gtodd ok cool thanks
14:24 jberger :-)
14:29 OmarOthman Hi All
14:29 OmarOthman I have a question regarding how Mojo::IOLoop works, and please bear with any basic questions, I'm quite new to event loops in general :-)
14:29 OmarOthman The way I envision event loops is that they have an implicit queue
14:29 OmarOthman In every iteration, they dequeue that queue
14:29 OmarOthman Do the action *synchronously*
14:29 OmarOthman And then reiterate
14:30 Grinnz_ sort of, except it's less of a queue and more of "all of these things should be done now"
14:30 OmarOthman So that whenever I have any "thing" that takes a long time (that "thing" being a blocking I/O operation, unsafe/long network operation, or even a computationally intensive task), I have to do it either outside the event loop asynchronously, or crack it down to many pieces, each doable on a single iteration in the event loop
14:30 OmarOthman I just want to make sure I understand that correctly
14:30 OmarOthman I actually have a Mojolicious application where I want both types to happen (HTTP requests and computationally intensive tasks)
14:30 OmarOthman For HTTP requests, I know about Mojo::UserAgent
14:30 OmarOthman Is there something like that for computationally intensive tasks?
14:30 OmarOthman Like, do method_call() elsewhere, and then register this callback upon finishing, much like how Mojo::UserAgent->get($url, $sub) works?
14:30 OmarOthman And, is this the correct way of thinking about the whole thing?
14:30 Grinnz_ you can't make things magically non-blocking, but you can fork blocking processing so that it doesn't block the current process
14:31 Grinnz_ see Mojo::IOLoop::ForkCall
14:31 OmarOthman OK
14:31 Grinnz_ with the caveat that not everything handles forking well
14:31 OmarOthman What do you mean by "everything"? Every operating system?
14:32 Grinnz_ objects, event loops
14:32 Grinnz_ for one thing make sure you don't try to reuse a database handle from the parent process
14:33 Grinnz_ linux does forking great, it's the things that get forked you have to worry about
14:33 OmarOthman And, conceptually, will Mojo::IOLoop::ForkCall be something like "Do this elsewhere and then execute this sub after finishing"? I want to make sure I get an answer to the generic question before investigating the technical details...
14:34 Grinnz_ it forks a process, runs the subroutine you passed, then sends the return value to the callback
14:34 Grinnz_ in the parent
14:35 OmarOthman So, this call itself is actually blocking!
14:35 Grinnz_ no
14:36 Grinnz_ the code is still blocking, you can't change that, but you can make it block in a different process
14:36 Grinnz_ as far as the parent is concerned it's non blocking
14:36 OmarOthman But where is the return value going to be passed?!
14:36 Grinnz_ to the callback in the parent
14:36 Grinnz_ that's the magic part
14:38 OmarOthman I don't get that at all... that's exactly why I thought of this as being "pushing to a queue"... because the parent (which I understand to be one iteration in the event loop) calls the fork, continues with other code, and then might even finish... then another event loop iteration happens... and then a third one... who cares... and when that forked child finishes working, it pushes a sub -- not a value -- to the event loop's queue
14:38 OmarOthman That is the only way I understand it
14:38 OmarOthman Could you please resolve my confusion here?
14:40 jberger OmarOthman: remember that any processing done in the main loop is blocking
14:40 jberger its the waiting that can be done non-blocking
14:42 OmarOthman OK, but the confusing part is: This is what is happening in the main loop: sub { statement_1; statement_2(forking as you said); statement_3; statement_4; statement_5; (then the fork returns, what does that even mean in this context? where is the value going to be stored?) statement_6; ... }
14:43 Grinnz_ it's not a queue, though
14:43 Grinnz_ the event loop is notified by whatever backend that the pipe is ready, so it executes the callback
14:43 Grinnz_ when it gets there
14:44 Grinnz_ i.e. when it's not in the middle of executing blocking code
14:44 OmarOthman Sorry, I don't understand what you mean by "backend", "pipe" and which "callback" is that. Could you please apply what you are saying on my last statement?
14:45 Grinnz_ the backend is unimportant, all that matters is that something is watching for pipes or sockets to be ready to use
14:45 Vertig0 joined #mojo
14:45 Grinnz_ the pipe is how the processes communicate with each other
14:46 OmarOthman Great, so "pipe is ready" == "fork has finished working"?
14:46 Grinnz_ the callback is what you define for Mojo::IOLoop::ForkCall to call when the fork is done
14:46 Grinnz_ when the forked code*
14:47 Grinnz_ you can think of event loops as a polling mechanism, all of the backends are really some variation of that; it just checks over and over whether things are ready, and if they are, it does the associated actions
14:49 OmarOthman Great, I feel I now get the answer. So, you said at the beginning "you can't make things magically non-blocking, but you can fork blocking processing so that it doesn't block the current process". In order to be able to build upon that, I'll consider that callback that happens after the fork is done working as if it is "a task that was pushed onto the event loop's virtual queue".
14:49 OmarOthman I think that is the answer I'm seeking.
14:49 OmarOthman Every time I want to make something "magically unblocking", I'll fork it, and pass my continuation as a callback.
14:49 Grinnz_ the "parent" is the parent process itself, btw
14:50 Grinnz_ the one running the event loop
14:50 OmarOthman I understand that.
14:50 OmarOthman The question now is: Can this "nest"?
14:51 Grinnz_ that's probably not a good idea
14:51 Grinnz_ "possibly but it will get very messy very quickly"
14:51 OmarOthman Like, if I have a computationally intensive thing to do, and another one that depends on that, and I care about the order... what should I do?
14:51 Grinnz_ however if you want to do more forks in the parent callback, thats perfectly fine
14:52 OmarOthman And how will I order those?
14:52 Grinnz_ Mojo::IOLoop->delay can be useful for that
14:53 OmarOthman Is there something like "join" threading stuff? Like, I don't want this unblocking call to happen except after that unblocking call to finish?
14:53 Grinnz_ that's what you'd use a delay to manage, usually
14:54 OmarOthman OK, I'll read about that...
14:54 OmarOthman Thank you so much for your time, a final question so as not to consume more: Is there an accessible article/talk/whatever that I can understand how the event loop actually works internally other than reading the code?
14:55 Grinnz_ i'm not sure if there's anything comprehensive on the topic, but IMO the source of Mojo::Reactor::Poll is easy to follow and may be a good starting point
14:55 Grinnz_ https://metacpan.org/source/Mojo::Reactor::Poll
14:56 jberger OmarOthman: yes, delay is what you want
14:56 OmarOthman Great, I'll start from there... thanks again!
14:56 jberger I have some examples on my blog, as does tempire IIRC
14:56 OmarOthman jberger: I'll check that also.
14:57 OmarOthman Could you please mention a link to your blog?
14:58 OmarOthman Is that http://convos.joel-berger.com?
14:58 jberger ha, no, that's my irc clinet
14:59 jberger OmarOthman: http://blogs.perl.org/users/joel_berger/2013/10/writing-non-blocking-applications-with-mojolicious-part-1.html
14:59 jberger probably start here
14:59 jberger its a three part series on non-blocking that does eventually get to delays
14:59 OmarOthman OK, sorry, that's the only thing mentioned in your "info". New to IRC... :)
15:00 OmarOthman I'll definitely do.
15:00 jberger in my info?
15:01 niczero irc info
15:01 jberger oh!
15:01 jberger hahaha
15:01 OmarOthman I thought it would be something like a summary of every user where they identify themselves... not something automatic
15:02 OmarOthman Because you mentioned "your blog" without linking to it, so I thought it is something everyone can know... :)
15:02 Grinnz_ OmarOthman: actually that is manually set, "realname"
15:02 Grinnz_ it's just not usually used for anything useful :P
15:03 OmarOthman Cool, so it was not too stupid of an idea to look there... :D
15:03 jberger OmarOthman: yeah, I'm going too fast, I'm supposed to be $work-ing
15:03 jberger I should have linked
15:03 OmarOthman Thank you, I really appreciate taking time aside to help :)
15:03 jberger hmmm a few of the examples are getting a little dated already :s
15:04 jberger and it looks like perhaps I never got to sequential non-blocking calls :(
15:04 Grinnz_ the tribulations of fast moving projects!
15:04 jberger damn, time for another blog post
15:04 Grinnz_ heh
15:04 jberger that who series should be a book chapter
15:04 Grinnz_ doctor who!
15:04 purl i heard doctor who was at http://www.bbc-worldwide-americas.com/Sci-Fi/Dr_Who.html or at http://nitro9.earth.uni.edu/doctor/homepage.html
15:05 jberger why not zoidberg?
15:05 purl (V) (;,,;) (V)
15:05 jberger *whole series
15:19 sh4 joined #mojo
15:25 sri OmarOthman: there's also Minion for computationally intensive tasks
15:26 sri jberger: has the restart problem of Mojo::IOLoop::ForkCall been fixed yet?
15:26 OmarOthman Well, finally the word "queue" mentioned explicitly!! \o/
15:27 jberger OmarOthman: did no one mention Minion yet?
15:27 OmarOthman Not at all...
15:27 jberger shoot, I should have read the backlog more carefully
15:28 jberger the difference being that Minion is more external than ForkCall
15:28 sri the restart problem seems identical to the 3 layer worker problem we had the other day
15:28 jberger sri: you mean Grinnz_'s problem?
15:28 sri manager > worker > forkcall
15:30 jberger I have to admit that I haven't had much time for that issue given mojoconf and fwbm and all
15:30 sri yes, i mean Grinnz's problem
15:30 OmarOthman jberger: Is there any article that documents the differences? Or should the PerlDoc be enough?
15:31 jberger OmarOthman: its a completely different flow
15:31 sri i guess the only reliable way might be to kill('KILL') the worker quickly on when Mojo::IOLoop emits the finish event
15:32 * jberger ponders
15:33 jberger I'm trying to decide if that's always the right thing to do
15:35 jberger I mean, stop gracefully is supposed to wait for existing connections to close
15:35 jberger killing the worker is the opposite of that
15:36 sri only until a timeout runs out
15:36 jberger do I have access to that timeout?
15:36 * jberger reads the source
15:36 sri no
15:36 sri happens in the manager
15:37 Grinnz_ maybe a second event, that means the exit is no longer graceful?
15:37 Grinnz_ at that point you get into race condition issues...
15:38 sri the manager sends a sigkill
15:38 Grinnz_ yeah, cant do anything with that :P
15:39 sri you couls set your own timeout, and make it configurable
15:39 Grinnz_ you mean in ForkCall?
15:39 sri yes
15:39 Grinnz_ that was a thought i had
15:40 jberger I was just thinking that too
15:40 jberger do I know the duration of that timeout?
15:40 sri start it on the finish event, and make it half of the default graceful_timeout or so
15:40 Grinnz_ automatic killing of child processes after a timeout
15:40 Grinnz_ the duration is whatever you set
15:40 jberger right, but if I wanted it to be a few seconds shorter
15:40 jberger no, I don't suppose I have that either
15:41 jberger like sri said
15:41 Grinnz_ you won't know the timeout of the parent no
15:41 Grinnz_ you'd just have to set it based on the default and make it configurable
15:41 jberger right
15:42 sri document how the timeouts relate, and let the user deal with it
15:42 jberger Grinnz_: could you do me a favor and open an issue with a brief summary of what we've just said
15:42 Grinnz_ sure
15:43 zackiv31_ joined #mojo
15:54 steven Grinnz_: Found it. Thanks.
15:55 jberger Grinnz_: thanks for opening that
15:55 jberger I'll try to work something up soon
15:56 Grinnz_ btw, i'm pretty sure all of the "processes hanging" issues i had were because of CGI::Session
15:56 jberger sri: I'm not sure if you are interested, but I put this change in last night for fwbm: https://github.com/TechEmpower/FrameworkBenchmarks/pull/1411
15:56 ispyhumanfly joined #mojo
15:57 jberger round 10 should be coming out soon and of course mongodb craps out just as they are about to start final runs
15:57 jberger none of the queries is very computationally intensive, so I thought better to just use the blocking form
15:58 Grinnz_ nice
16:03 arpadszasz joined #mojo
16:04 Oleg joined #mojo
16:07 Oleg joined #mojo
16:13 sri jberger++
16:14 sri why do you sort in perl instead of in postgres though?
16:14 jberger hmmmm
16:14 jberger oh cause you have to add one
16:15 sri how odd
16:15 jberger part of the test, which is mostly odd
16:16 jberger the "updates" test continued to pass even after mongodb crapped out, because it turns out none of the data for it actually comes from the db
16:17 jberger which is why I spent a while trying to figure out why only that test was passing, rather than just blowing out mongo right away
16:19 Grinnz_ lol
16:20 jberger https://github.com/TechEmpower/FrameworkBenchmarks/issues/1366#issuecomment-77441753
16:20 jberger "@jberger can you think of any reason mojo would not work for URL http://127.0.0.1:8080/queries?queries=2 and http://127.0.0.1:8080/db, but would work correctly for URL http://127.0.0.1:8080/updates?queries=2 - are there substantial differences in how those URLs are handled internally?"
16:22 sri is that version of mongodb they use even supported by mango anymore?
16:23 jberger didn't care to check
16:23 sri yea, Mojo::Pg will be better for benchmarks anyway
16:23 jberger once it was clear that mongo was borked, this was the fix
16:23 jberger yeah
16:23 sri you could try tuning the web server for the new workload though
16:24 sri reduce concurrency, add a few more workers
16:24 sri you know
16:24 arpadszasz joined #mojo
16:24 sri (confirm with benchmarks though)
16:27 sri i guess this means prettify.js might be totally dead too http://google-opensource.blogspot.de/2015/03/farewell-to-google-code.html
16:27 jberger I do number of workers as 2 * `nproc`
16:27 sri :S
16:27 mattastrophe joined #mojo
16:27 sri 2 * nproc is the recommended default for non-blocking apps
16:27 sri for blocking you might get *much* better results with more
16:28 sri but of course, confirm with benchmarking
16:29 jberger if only I had anything like their hardware available to me
16:31 sri just extrapolate from your number of cpu cores
16:32 sri it won't be ideal, but the best you can do (i guess)
16:33 jberger what was that wk invocation you use to test?
16:33 sri well, with what kind of concurrency do they test?
16:34 sri i tend to use wrk -c 100 -d 10s http://127.0.0.1:8080/
16:35 hahainternet i find wrk to be a pretty excellent benchmarking tool
16:35 hahainternet we tried a few others last time we were shooting out options
16:35 hahainternet but i ended up writing one in golang to do the 'variable testing'
16:35 jberger sri: http://www.techempower.com/benchmarks/#section=motivation&amp;hw=peak&amp;test=json
16:35 hahainternet it's probably about the best option you've got in terms of a generic fast testing app
16:35 hahainternet also sri is right about 2*nproc being a good baseline
16:35 jberger see: "the tests #16"
16:38 sri 16,384 oh my
16:39 sri yea... that's funny... you tune completely different for 128 and 16k concurrency
16:39 sri i guess you better keep the defaults and hope for the best lol
16:39 sri maybe increase number of workers a bit
16:40 sri you want to stay blocking though... postgres would go up in flames if you end up with 16k concurrent queries
16:41 sri if epoll doesn't work you're screwed too
16:43 Grinnz_ considering how close poll and epoll were on 100 concurrent connections, i wonder how it would be at 16k
16:46 jberger looks like I'm staturated at 2n already
16:55 mattastrophe joined #mojo
17:21 sri this was actually a rather interesting question https://groups.google.com/d/msg/mojolicious/yxuWH0Np5GE/lCvTEqq23JEJ
17:24 Grinnz_ yeah, i had no idea people did stuff like that
17:31 * jberger has no idea what that is
17:32 jberger could probably google
17:32 ispyhumanfly joined #mojo
17:36 sri know your http!
17:36 sri http://httpstatusdogs.com/wp-content/uploads/100.jpg
17:38 Grinnz_ haha
17:39 sri this explains it kinda well https://support.urbanairship.com/entries/59909909--Expect-100-Continue-Issues-and-Risks
17:40 sri bottom line, it's garbage
17:41 Grinnz_ and this is why WEBSOCKETSSSSS
17:42 Grinnz_ "HTTP Error 417 (Expectation failed)"
17:42 Grinnz_ hahahah
17:50 sri yay windows https://github.com/kraih/mojo/issues/761
17:57 d4rkie joined #mojo
17:57 D4RK-PH0ENiX joined #mojo
18:02 D4RK-PH0ENiX joined #mojo
18:03 Adura But it works on Strawberry, huh.
18:06 Kripton We are migrating our dev team to perl/mojo
18:06 Kripton and I would like to avoid "dialects", enforcing some kind of coding rules/style
18:06 Kripton example:
18:07 Kripton use trailing braces everywhere (if, else, functions )
18:07 Grinnz_ perltidy?
18:07 purl i heard perltidy was a Perl source code reformatter written in Perl, at http://perltidy.sourceforge.net/ or
18:07 Grinnz_ or what?
18:07 Kripton Use this_name_for_functions never use thisNameForFunctions
18:07 Kripton "private" functions start with underscore like _private_function
18:08 Grinnz_ i dont think you could do that automatically, but the other ones you could test for
18:08 Kripton yes
18:08 jberger there is a .perltidyrc in the mojo repository
18:08 Kripton Do you guys have some doc/blog or site with suggestions about coding conventions  perl
18:09 Kripton something like this one: ftp://ftp.idsoftware.com/idstuff/doom3/source/CodeStyleConventions.doc
18:09 jberger perldoc perlstyle
18:10 jberger there is also Perl Best Practices, but a lot of that is outdated anyway
18:10 jberger that also spawned the Perl::Critic app
18:10 Grinnz_ which is not widely agreed on
18:11 jberger correct
18:11 disputin joined #mojo
18:11 jberger but there are plugins from which you can craft a standard for your company
18:12 Grinnz_ perlstyle -> "The most important thing is to run your programs under the -w flag at all
18:12 Grinnz_ times."
18:12 Grinnz_ welp.
18:12 jberger maybe a little dated too
18:12 Grinnz_ hehe
18:13 jberger but the concept isn't wrong, its just spelled "use strict" now
18:13 jberger oops
18:13 jberger use warnings
18:13 purl use warnings is my friend... should always include use warnings
18:13 Grinnz_ it does mention use strict as well... but really this has nothing to do with code style
18:13 Kripton some rules like this:
18:13 Kripton
18:13 Kripton if ( something ) {
18:13 Kripton do_stuff;
18:13 Kripton }
18:13 Kripton never use
18:14 Kripton if (something ) do_stuff;
18:14 jberger Kripton: please don't paste into the channel
18:14 Grinnz_ Kripton: the second is invalid syntax anyway
18:14 Grinnz_ braces are required for perl blocks
18:14 Kripton sorry
18:15 jberger perltidy can handle block brace styling
18:15 Kripton my point was, dont use one line for if  ,
18:16 Kripton we are moving from Java and php to perl/mojo
18:17 Kripton because of performance
18:17 jberger Kripton: nice
18:17 Kripton today is more Java, but perl is unbelievable more fast on the same hardware
18:18 Grinnz_ Kripton: sounds like poorly written java, then
18:20 Kripton we are doing the same job in perl with 16G of memory, of Java with 32G of memory
18:21 Adura Perl does seem pretty good about memory.
18:21 Grinnz_ eh...
18:21 Grinnz_ perl and java can both be pretty bad with memory when used poorly
18:22 OmarOthman joined #mojo
18:22 Kripton we are developing one IPTV middleware in mojo, replacing one written in java
18:23 Kripton looks like a lot more easy to develop a high performance restful server in perl
18:23 hernan604 Kripton: yeah!
18:24 hernan604 indeed much faster to build
18:38 irq joined #mojo
18:39 mattastrophe joined #mojo
18:43 sri perl memory usage is very predictable, compared to java
18:43 sri (in my opinion)
18:49 ispyhumanfly joined #mojo
18:52 Oleg But it is so easy to leak with this circular references...
18:53 mattastrophe_ joined #mojo
18:53 OmarOthman joined #mojo
18:55 hernan604 if memory is concern use lua
18:56 hernan604 lua is nice, im going to invest more time on it
18:56 hernan604 :p
19:04 good_news_everyon joined #mojo
19:04 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/pMk2
19:04 good_news_everyon mojo/master f0f3e91 Sebastian Riedel: just do the exact same thing the server does
19:04 good_news_everyon left #mojo
19:11 Anon021 joined #mojo
19:11 mattastrophe_ joined #mojo
19:13 berov joined #mojo
19:18 disputin joined #mojo
19:22 csson joined #mojo
19:30 dod joined #mojo
19:31 trone joined #mojo
19:34 jberger sri: what are the mojolicious fonts again?
19:34 sri myriad pro
19:34 jberger that's the logo?
19:34 sri yes
19:35 jberger thanks
19:35 jberger is there a preferred body text font?
19:35 sri it's a very popular typeface actually
19:35 jberger ok
19:35 riche joined #mojo
19:35 jberger 🍻
19:35 sri also used in the catalyst logo ;p
19:36 sri apple uses it all the time too
19:36 sri i like helvetica neue for body text
19:36 Grinnz_ oh windows...
19:36 purl well, windows is one hell of an event! or crashing on someone or very pretty when the computer is powered off or rebooting or lacking that tool you want or withering intravenous necrotic deteriorative ostensive weakening syndrome
19:37 jberger "very pretty when the computer is powered off"
19:37 jberger nice
19:37 sri that was fun https://github.com/kraih/mojo/issues/761#issuecomment-78581307
19:38 mattastrophe_ joined #mojo
19:38 sri jberger: also http://www.fastcodesign.com/3028971/whats-the-difference-between-a-font-and-a-typeface
19:39 sri !!!
19:40 crab i can't remember the name any more of the font that i really really loved for body text, but its uppercase Q was so godawful ugly that it could not be tolerated under any circumstances
19:40 crab i liked it so much that i briefly considered never writing a capital Q on my web site again
19:40 jberger I like that you post that to me with three ! and yet the conclusion is "Even type experts agree: Typeface and font can be used interchangeably at this point. But if you come across an annoying pedant who cares deeply about maintaining the distinction for the masses, just remember this: The difference between a font and a typeface is the same as that between songs and an album. The former makes up the latter. Remember that and yo
19:40 jberger :-P
19:40 sri :D
19:41 crab Remember that and your sentences won't be cut off
19:42 Grinnz_ lol
19:42 mst jberger: get a real IRC client, load splitlong.pl
19:42 jberger ah
19:42 Grinnz_ sure, if you want to spam a channel for 30 minutes when you accidentally paste a whole webpage
19:42 Grinnz_ :P
19:43 mst Grinnz_: my paste detection catches that one
19:43 mst I have it on a hair trigger
19:43 jberger did it make it to "annoying pedant", if so that's all we need
19:43 jberger ?
19:43 Grinnz_ right, on weechat enough lines will stpo it from pasting without confirmation
19:43 Grinnz_ yes
19:43 jberger :-P
19:43 sri let me just quickly paste the entire content of wikipedia
19:43 Grinnz_ THE WHOLE WIKIPEDIA
19:44 jberger I damn near never paste text, so I don't think I need all that fancy .... ALL GLORY TO THE HYPNOTOAD
19:44 sri jberger: also... TLDR!
19:46 jberger TLDR; it called you an annoying pendant ;-P
19:46 mattastrophe__ joined #mojo
19:46 jberger note carefully that I didn't, it did
19:47 * jberger casually backs away, but not TOO casually
19:47 Grinnz_ i wanna be a pendant!
19:47 sjn left #mojo
19:48 sri jberger: "The distinction would matter in type design, obviously, but also contexts which involve engineering, like app development or web design."
19:49 sri checkmate
19:49 purl "If we can hit that bull's-eye, the rest of the dominoes will fall like a house of cards.  Checkmate!"
19:49 Grinnz_ purl has been drinking the kool-aid
19:49 purl Grinnz_: huh?
19:49 ispyhumanfly joined #mojo
19:50 jberger http://www.glitters20.com/wp-content/uploads/2013/06/Funny-Chess-43.jpg
19:51 jberger also, I don't know why this is relevant, but I'm sure it is somehow: http://i.imgur.com/O8OOFb2.jpg
19:56 mattastrophe__ joined #mojo
19:56 crab today after two decades of using ircii i decided to switch to irssi because i was tired of broken utf-8 rendering, and when i tried, i couldn't reach irssi.org
19:57 Grinnz_ gogo weechat!
20:06 ams joined #mojo
20:21 sri it seems people have real problems with model abstraction in mojolicious apps
20:21 sri i kinda want to include an example with Mojo::Pg for a full app
20:21 sri it has to be small enough to be easily understood
20:22 sri was thinking a blog without features, but that's almost too big
20:23 sri maybe the classic url shortener
20:24 jberger the shortener could keep access statistics
20:24 sri that's already too much
20:24 sri one controller, one model
20:24 sri illustrate the abstraction
20:25 jberger I was just thinking a counter that increments, gives it some other data to look at than just the url mapping
20:25 sri i mentioned yesterday how Minion is basically a Model, and that didn't seem obvious to some folks
20:25 ams joined #mojo
20:26 jberger doesn't need to be there, just a thought
20:26 mattastrophe__ joined #mojo
20:29 sri blog might make the most sense
20:29 sri without authentication, just crud for posts
20:29 mattastrophe__ joined #mojo
20:30 marcusr image gallery, then you can use minion for resize :)
20:30 kaare joined #mojo
20:30 sri lets just make it a full wordpress close ;p
20:30 sri clone
20:30 mst sri: people have real problems with model abstraction everywhere
20:31 ams huh. if only it would display a list of channels in the statusbar.
20:31 jberger sri++ don't listen to me, do what you think will best teach people
20:32 ams joined #mojo
20:33 crab joined #mojo
20:35 marcusr Those damn scrawny abstract models. Not a gram of fat anywhere on their body. Give me a solid model any day of the week.
20:39 crab great. i switch to irsii for its UTF-8 rendering capabilities, and it can't render the first character in the topic.
20:40 Grinnz_ my terminal can't either way :P
20:40 sri my terminal can
20:40 mst crab: your terminal doesn't handle it then
20:41 mst I attach to this irssi instance from two X11 setups
20:41 mst it renders perfectly on one, and not at all on the other
20:41 mst I don't care enough to find out why though
20:41 genio crab: are you behind screen? if so, that's your problem.  TMUX IT UP
20:41 Grinnz_ tmux++
20:41 crab yes, i'm behind screen.
20:41 crab but it does render other UTF-8 stuff fine.
20:41 genio Screen cannot UTF-8 properly.  it is the cause of your problem
20:41 genio I ran through the same scenario not too long ago
20:41 sri this is what irssi looks like for me right now http://i.imgur.com/fq4II5M.png
20:41 Grinnz_ well, a possible cause.
20:42 crab oh. they're beer mugs? maybe i just don't have a font with beer mugs.
20:42 genio Screen makes assumptions about the size of all unicode data that is not correct
20:42 crab i can live with that for now.
20:43 Grinnz_ screen is also just really old.
20:43 purl okay, Grinnz_.
20:43 crab i wonder when the irssi site will be back up so i can read some, y'know, documentation. instead of just flailing around.
20:43 Grinnz_ lol
20:43 sri it's not much better when the site is up
20:44 crab heh
20:44 Grinnz_ i dont remember much from my brief stint with irssi, but i like weechat's docs
20:44 Grinnz_ for configuration, at least
20:44 genio does google have a cached version of their site?
20:44 sri i so miss scrolling with the touchpad
20:44 crab if i can just get a channel list in the status bar, i'll be happy.
20:44 sri keyboard shortcuts just don't work for me
20:45 sri and i already have scrolling mapped to fn+up/down
20:45 arpadszasz joined #mojo
20:45 genio http://webcache.googleusercontent.com/search?q=cache:1iRafIXgz9oJ:irssi.org/documentation+&amp;cd=1&amp;hl=en&amp;ct=clnk&amp;gl=us
20:46 genio when it appears to hang, hit stop and get an ugly page at least
20:56 disputin joined #mojo
20:57 crab genio: thanks!
21:01 memowe joined #mojo
21:04 mishantil In irssi (in a double tmux-setup) scrolling works for me with pgup/pgdn.
21:06 mishantil By double tmux I mean tmux locally, which holds an ssh session to a remote location where irssi is running in a tmux-session.
21:06 hernan604 mishantil: is it a mac?
21:08 mishantil hernan604: No. Ubuntu on one end, Debian on the other.
21:08 mishantil So yeah, debian.
21:12 hernan604 nice
21:13 crab why do you have a double-tmux setup?
21:14 sri so, what are your favorite crud method names in controllers?
21:14 crab c, r, u, and d
21:15 sri https://c1.staticflickr.com/7/6005/5923467441_6e1ee8d330.jpg
21:16 hernan604 be careful: http://thumbs.dreamstime.com/x/king-crab-plate-15489472.jpg
21:17 sri that escalated quickly
21:18 mishantil crab: all machines I do stuff on run tmux so I can ssh in an quickly resume where I left off.
21:18 mishantil crab: my irssi lives separate from my usual systems, and run tmux as well, so when I ssh into that I find myself with double tmux.
21:19 hernan604 mishantil: that sounds like a tmux inside tmux fractal
21:19 hernan604 do you have different key bindings for each tmux level ?
21:20 mishantil crab: I used to use a terminal and maintain tabs there, but when I started using tmux I saw that it is _far_ superior to the multiplexin-abilities of window-based terminals like terminator etc
21:20 crab hernan: http://files.campus.edublogs.org/sjsdblogs.com/dist/0/369/files/2012/03/horseshoe-crab-in-sand-v5n9qr.jpg <- these things are also called "king crab" in some places, but they're much more weird than the other kind. and they might be the strangest thing i've ever eaten.
21:21 mishantil hernan604: Nope. You can target specific tmuxes by hitting <prefix> correct number of times. So for me ctrl-b ctrl-b d would detach the inner tmux.
21:21 hernan604 thats not a crab at all, its an alien crab
21:22 hernan604 mishantil: cool, i never tried that :D
21:23 hernan604 i use screen. i have tried to get used to tmux but keep going back to screen
21:23 crab me too.
21:23 hernan604 someday i must uninstall screen and leave only tmux to force myself. tmux is much superior than screen
21:23 crab i dunno. it's too complicated for me to understand.
21:24 mishantil tmux has surprised me with it how awesome it is. Spending a little time ironing out the kinks so it fits your taste is well worth it.
21:25 hernan604 i changed tmux default bindings to screen defaults and it works very similar to screen
21:25 jberger they are also seriously ancient
21:25 hernan604 mishantil: plus i3
21:25 hernan604 any i3 user here ? :D
21:26 mishantil My impression is that screen is better suited for those who prefer working in modes like in vi(m), and tmux suits the other people better.
21:33 crab jberger: screen, or horseshoe crabs?
21:34 jberger well both I suppose, but horseshoe crabs have screen beat (by about 450 million years)
21:34 crab hm, maybe that's why it tasted funny.
21:37 disputin joined #mojo
22:06 disputin joined #mojo
22:11 hesperaux joined #mojo
22:11 riche_ joined #mojo
22:15 idegen joined #mojo
22:16 oalders we're preparing to switch to mojo at $work. which server should we deploy with if we want full support for websockets?
22:16 riche joined #mojo
22:19 meshl joined #mojo
22:44 sri hypnotoad
22:44 purl ALL GLORY TO THE HYPNOTOAD!!! or nice running on a raspberry pi. Whenever I'll think about something useful to do with Akron's raspberry, I guess it will be a mojo service ...
22:46 oalders sri: thanks
22:51 punter joined #mojo
22:54 cereal joined #mojo
23:06 disputin joined #mojo
23:06 Grinnz_ tmux, why do you randomly revert out of scroll mode while i'm scrolling and print a bunch of nonsense from my pgup key
23:12 d4rkie joined #mojo
23:13 idegen left #mojo
23:13 mattastrophe joined #mojo
23:19 D4RK-PH0ENiX joined #mojo
23:21 absolut_todd joined #mojo
23:58 disputin joined #mojo
23:59 juikuen joined #mojo

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