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

IRC log for #mojo, 2015-11-03

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

All times shown according to UTC.

Time Nick Message
00:00 Grinnz_ I hate IRC server designs too much to reimplement my own :P
00:00 preaction if you ever do, though, name it "Smack"
00:00 Grinnz_ i.e. services all separate, the protocol itself requiring all these workarounds...
00:00 Grinnz_ hahah
00:00 preaction or Snack?
00:01 Grinnz_ i like Smack
00:01 preaction services don't have to be separate at all
00:01 Grinnz_ if you really want to make a Slack clone though, it needs to be designed for that first, and IRC second
00:01 preaction most clients will, if given a /command it doesn't know, just send it raw to the server
00:02 preaction the problem with slack is, afaict, it's not client-agnostic. the client is everything
00:02 Grinnz_ slack has an IRC and XMPP interfaces (though theyre kind of lacking)
00:02 Grinnz_ much like twitch's IRC interface these days
00:02 preaction so, yeah, you could build a backend distributed chat system, pop on any kind of protocols you want on top, and let clients figure out how to do, but that's quite a bit of engineering
00:03 Grinnz_ indeed
00:03 Grinnz_ Slack's lackluster IRC support is simply because not many people are going to use IRC with it
00:03 preaction hell, one of the ideas i kind of want to do for mercury is allow different mercury daemons to work as a cluster, and that'd get most of it
00:03 Grinnz_ so they optimize for the more popular usage
00:03 preaction IRC is dead the way Perl and Unix are dead :p
00:04 Grinnz_ heh
00:04 Grinnz_ at least Perl is getting facelifts though :P
00:04 preaction likely shouldn't have the "is Linux a Unix" holy war though ;)
00:32 aborazmeh joined #mojo
00:37 cfedde I have a chunk of xml that has "tags" like "foo.bar.baz.TheThing". That seems to be confusing ->at() unless I escape the dots.  Is there some general "escape this so it does not look like a selector" function that I have not found yet?
00:37 preaction quotemeta might work?
00:40 cfedde seems to in this case.  I wonder if anyone stuffs '#' into xml tags.
00:40 cfedde I guess I'll blow up that bridge when I get to it.
00:53 lluad joined #mojo
01:00 genio Grinnz_: Camilla is a facelift?  (Sorry, nobody else joked about the butterfly, so I had to)
01:02 genio man.  I meant camelia.  If I'm going to pick on something, I should at least check the name first.
01:02 genio genio--
01:07 Grinnz genio, lol I mean perl5 of course.
01:25 asarch joined #mojo
02:15 jantore joined #mojo
02:25 zivester joined #mojo
02:29 kaare_ joined #mojo
02:29 cheesekun joined #mojo
02:54 jantore joined #mojo
02:56 jberger cfedde: o/
03:15 odc joined #mojo
03:24 lluad joined #mojo
03:35 cpan_mojo Mojo-Webqq-1.6.0 by SJDY https://metacpan.org/release/SJDY/Mojo-Webqq-1.6.0
04:37 inokenty-w joined #mojo
06:53 jabberwok joined #mojo
06:56 jabberwok Just looked at Twitter again for the first time in years. It still looks like kernel logfiles mixed with line noise, with two or three occasional intelligible but unconnected words interspersed by accident. What do people see in it?
06:59 sri depends entirely on who/what you follow
06:59 jabberwok well, perlnews writes: "Iron Man: miguel prz (niceperl): (clxxxiii) metacpan weekly report - Mojolicious (miguel prz (niceperl)) - http://niceperl.blogspot.com/2015/10/clxxxiii-metacpan-weekly-report.html …" − is that not entirely gibberish?
06:59 * sri mostly uses it to get tech and breaking news throughout the day
07:00 sri not to me
07:01 jabberwok i see "weekly report" but can't make head or tail of anything else
07:01 sri perlnews appears to be a spam account though
07:01 sri it's the metacpan weekly report, you see the exact same title on the blog aggregators
07:03 sri take this for example, it's a perfectly reasonable news stream to me https://twitter.com/perlironman
07:03 jabberwok basically just someone's bookmarks rss?
07:03 sri titles of recent blog posts
07:04 sri if you're not part of the reddit generation, i guess it doesn't work for you
07:04 * sri shrugs
07:04 preaction the perl ironman is/was an opt-in weekly blog contest
07:04 jabberwok i would have to click each of those links, then
07:05 sri don't you read hackernews?
07:05 preaction i get half my interesting things from twitter
07:05 sri exact same thing
07:05 sri i don't get your problem
07:06 sri https://twitter.com/newsyc20
07:06 sri hackernews in tweet form
07:06 sri same titles, same links, as a feed with only the latest news
07:07 sri it's more efficient than visiting the site every now and then
07:07 jabberwok so, it really is just an rss feed
07:07 jabberwok except even shorter
07:08 preaction the barrier to entry for publishing on twitter is infinitely lower compared to an rss feed
07:08 jabberwok i mean it's all jargon and abbreviations and pointers-to-content, not actual text
07:09 sri are you trolling?
07:09 jabberwok no
07:09 sri or are you just not reading sites like hackernews and reddit?
07:10 jabberwok i read reddit
07:10 jabberwok it has perfectly readable threaded comments
07:10 sri then it should make perfect sense to you
07:10 jabberwok i don't see any actual paragraphs on twitter
07:10 sri and tweets with links have the same!
07:10 sri maybe
07:10 jabberwok right, that's what i think you're saying -- twitter is just an RSS to the content, not the content itself
07:11 preaction get someone to make their real point in 140 characters and it cuts down on the amount of pontificating they can do
07:11 preaction twitter is a text message to the world (back before MMS)
07:12 jabberwok ok.  i don't like text msgs, i would rather just speak to someone.
07:13 sri he said on irc
07:13 preaction audio is so slow. almost slower than video...
07:13 jabberwok yeah but IRC doesn't cost me 10 cents a line to send and 5 cents to receive
07:13 preaction ... wut?
07:14 jabberwok my cellphone is $0 per year but 10 cents/minute talk, 10 cents per msg sent, 5 cents per msg received.  since i rarely use it, it's quite cheap.
07:14 preaction leaving aside that twitter is web data, i've had unlimited text messages for forever
07:15 preaction tracfone?
07:15 jabberwok T-mobile
07:15 sri where i'm from we all just use whatsapp
07:15 preaction okay, they're ripping you off. text messages are basically free for the carriers :p
07:15 jabberwok for $0 a month?
07:15 preaction the old-style SMS at least
07:16 preaction it's not $0/mo, it's $0.10/min. there's a difference
07:17 sri t-mobile is basically the german comcast
07:17 preaction a couple coworkers made me download whatsapp, and it seems nice, but we never ended up using it at all
07:17 jabberwok i'm always near a landline and a normal computer, don't need to pay $150 a month for a redundant mobile phone i rarely use
07:17 jabberwok nor would i want a computer i can't control
07:18 sri http://i.imgur.com/91sn32Q.jpg?fb
07:18 preaction i can't jailbreak my phone?
07:19 jabberwok why would you have to break into a computer you bought?  that's insulting
07:20 jabberwok i mean: why would you give money for a product that insults you but not putting you in control.
07:22 preaction because every choice the computer forces me to make is time and energy out of my life
07:22 sri a cellphone these days it not even just one computer, it's a network
07:22 sri baseband chip and ssd often have their own SoC with cpu, memory, hd and everything
07:23 preaction point being, twitter is a tool. either you find the tool useful or not. i don't find reddit or hacker news useful, but i do find twitter and imgur useful
07:24 jabberwok i worked on touchscreen interactive-videodisc computers in the 80s but i don't find  touchscreens useful. i do find Mojolicious useful! cheers
07:24 preaction since i started cooking more, i've found pinterest a bit useful (but mostly "native adversiting"-laden cesspool...)
07:26 jabberwok i love to cook.  in process of buying a house with a gas range, instead of electric cooktop in apartment. and to have a garden again.
07:27 buu Cooking is like sex, it's way more fun when someone else is watching you
07:27 buu wait
07:28 preaction friend keeps trying to sell me on induction stovetops
07:28 sri thanks for reminding us why it's a bad idea to go off topic...
07:28 buu it is?
07:28 sri lets end this here
07:28 buu =[
07:37 trone joined #mojo
07:37 jabberwok __DATA__
07:39 mattastrophe joined #mojo
08:01 AndrewIsh joined #mojo
08:06 eseyman joined #mojo
08:10 osfabibisi joined #mojo
08:17 Vandal joined #mojo
08:17 trone joined #mojo
08:23 kes joined #mojo
08:32 kes It will be usefull if "mojo/exception.html.ep" in development mode show stacktrace by default
08:40 meshl joined #mojo
08:58 berov1 joined #mojo
09:03 meshl joined #mojo
09:08 kes BUG: http://paste.scsys.co.uk/500819
09:10 bd preaction: after having an induction one for like 3 monts, i never want to go back
09:19 good_news_everyon joined #mojo
09:19 good_news_everyon [mojo] amenonsen pushed 1 new commit to master: http://git.io/vlP6i
09:19 good_news_everyon mojo/master d08d190 Abhijit Menon-Sen: Fix typo
09:19 good_news_everyon left #mojo
09:42 sri tempire: you
09:42 sri are still not in #mojo-core
09:47 kes sri: can you look at: http://paste.scsys.co.uk/500819
09:48 kes ?
09:49 nic tempire: you
09:49 nic are a dancing god
09:49 sri kes: i already have, if i had seen a bug i would have fixed it
09:52 kes What I must supply to redirect_to to be redirected to: /one/login/die ?
09:56 sri kes: for the future, big bugs like that are incredibly rare in mojolicious these days, so starting with the assumption that everything that doesn't work the way you expect is a bug, will end up being a big waste of time
09:57 kes sri: sorry, that is my bad habbit (
09:58 sri and i will not be able to help with psgi problems
09:58 * sri does not use it for anything else than benchmark comparisons
10:00 espent_ joined #mojo
10:00 sri kes: now, look at your report again, do you really think it contains enough information for anyone to be able to help you?
10:01 sri there is nothing at all about the server used, or how it has been configured, or even what the psgi env hash looks like
10:02 kes will working example be sufficient?
10:03 sri you're asking questions that nobody can answer, which is why you're not getting answers anymore
10:03 sri you'll be a lot more successful if you put a little more thought into your questions
10:05 sri i understand that the language barrier is a big problem, but many of us aren't native english speakers either, so try being as specific as possible
10:07 sri generally, include as many details as possible, while avoiding a big wall of text, and make the examples as small as possible
10:07 punter joined #mojo
10:08 sri the more effort you put into the question, the more effort folks will usually put into their answer
10:08 kes I think I put wrong parameter for redirect_to.
10:08 kes http://paste.scsys.co.uk/500823
10:10 kes is it ok in this question?
10:10 espent joined #mojo
10:11 sri i can still only guess
10:11 sri http://mojolicio.us/perldoc/Mojolicious/Guides/Routing#Named-routes
10:15 nic https://github.com/niczero/mojolicious-command-installed
10:15 nic I'm guessing that's not generally useful enough to go on CPAN; just mentioning it in case someone does think it's handy
10:18 * sri uses "perlbrew list-modules"
10:18 nic yeah, I'm guessing quite a few people use the brew
10:22 buu sri: How could this line:  63       $_->at('.greyText.smallText')->all_text =~ /avg rating (\d+\.\d+)/; ever give me an error about calling 'all_text' on an unblessed reference?
10:23 nic first guess: there's no match for '.greyText.smallText'
10:23 nic oh
10:23 nic that would be 'undef' wouldn't it?
10:24 buu I would have thought so!
10:25 espent_ joined #mojo
10:28 crab "ever" is a big word
10:28 crab $_ might be a blessed reference to a package whose 'at' method returns an unblessed reference ;-)
10:30 McA joined #mojo
10:30 buu Oh sorry, it's a mojo-dom item
10:31 buu for( $dom->find('.class')->each ) { $_->at(...
10:41 kes sri: can you inspect? https://github.com/kraih/mojo/compare/master...KES777:develop
10:46 tempire sri: I think I need a password to identify myself to nickserv with.
10:47 sri tempire: you do
10:47 sri if you've registered your nick yet
10:47 tempire I did.
10:47 tempire And apparently I didn't write the password dow.
10:47 tempire *down
10:48 sri tempire: tried RECOVERPASS?
10:49 sri guess you might have to get in touch with an ircop
10:49 tempire You need a recovery phrase
10:50 sri do we have an ircop here?
10:52 sri kes: that doesn't match the style of the surrounding docs
10:52 bd not according to ircops.pl
10:53 kes sri: I have no found any example where is shown 404 error
10:54 kes If you tell me how to style it I will fix
10:54 sri kes: that's because 404 is wrong in the context
10:54 sri examples show the generated stash, which in this case would be undef
10:55 sri 404 is the result of another layer, which migth as well be a catch-all route doing something completely different
10:55 sri and there is in fact already an undef example
10:55 kes # /cats/woof  -> undef
10:56 kes is it right now?
10:56 sri no
10:56 kes ((
10:57 sri sorry, but i have to step back, maybe someone with better english skills can help you instead
10:57 kes you help is useful
10:58 jontaylor joined #mojo
10:58 kes Now I understand what that # /foo -> undef mean
11:12 kes sri: Now I follow the DOC style: https://github.com/kraih/mojo/compare/master...KES777:develop
11:14 nic funny fact... xor_encode($string, q{ }) is almost Rot13
11:15 nic (if you restrict to only [a-zA-Z] then it actually is
11:23 pink_mist cute :P also, rot13 /should/ be restricted to those characters anyway :P
11:25 nic yes, but xor_encode is freeeeeeeeeeeeeee
11:26 nic oh hang on, please erase what I said from the log; it's utter gibberish
11:27 nic what I meant was tr/a-z/A-Z/ + tr/A-Z/a-z/  :P
11:27 nic nothing to do with Rot13
11:29 neilhwatson joined #mojo
11:31 pink_mist no no, I won't do that ... if we do that then my line will look silly since I'd clearly be talking to myself :P
11:37 CandyAngel Who are you talking to pink_mist?
11:38 pink_mist clearly myself :P
11:38 CandyAngel :P
11:38 * CandyAngel camera moves back, revealing only pink_mist and CandyAngel in the room
11:39 nic second camera reveals there's nobody behind the first camera
11:39 nic third camera...
11:40 pink_mist . o O ( if nobody watches the surveilance video, have you really been under surveilance? )
11:42 * nic phones the NSA legal team with a get-out
11:48 aborazmeh joined #mojo
11:56 sri hmm, i guess this is also a nice way to finance a book https://www.indiegogo.com/projects/haskell-web-development-a-freely-available-book#/
12:06 asarch joined #mojo
12:10 sri btw. everything in the mojolicious store is 20% off atm. if you use the code JOY20 ;)
12:38 ajr_ joined #mojo
12:41 buu $6k/mo to write a book seems kinda high
12:46 aborazmeh joined #mojo
12:48 marcusr buu: you seem kinda high! #scnr
12:48 berov joined #mojo
12:51 eitz joined #mojo
12:55 marcusr but yeah, book authorship has been an underpaid and overworked enterprise so far. Would love to see solutions that makes it possible to do it without a huge sacrifice
12:57 * jberger yawns
13:00 HtbaaPi with minion, what's the best way to mark a job as failed. Just call die() or use $job->fail('whatever')?
13:01 sri both are fine
13:01 HtbaaPi both store the message as well?
13:02 sri yea
13:02 HtbaaPi ok, thanks
13:05 hernan605 joined #mojo
13:07 * sri wonders when postgres 9.5 will finally be released
13:12 * sri is still so happy with the job versioning in minion, it made all problems just vanish
13:15 FatalNIX I'm pretty happy with sqlite lately
13:16 nic anything new in the sqlite world?
13:16 romel hey batman. could you please recheck if input args handling is correct here? https://github.com/jhthorsen/swagger2/blob/master/t/blog/lib/Blog/Controller/Posts.pm#L48 i suppose $args won't be defined in case of regular web request so my $validation = $self->_validation($args->{entry}); is wrong here. am i right?
13:17 espent joined #mojo
13:18 nicomen I'm missing SUBSTRING_INDEX in Sqlite ;-/
13:20 nic if it has fullstring indices then there's an obvious workaround
13:22 nicomen not sure, I need some kind of aplit() functionality
13:22 nicomen *split
13:23 espent_ joined #mojo
13:23 * nic hunts around for something that can do 'split'
13:23 nic :)
13:27 jontaylor joined #mojo
13:40 jontaylor joined #mojo
13:54 aborazmeh joined #mojo
14:12 zivester joined #mojo
14:30 marty joined #mojo
14:31 marty_ joined #mojo
14:43 till joined #mojo
14:53 ZoffixW joined #mojo
14:53 ZoffixW You guys seen this? https://metacpan.org/favorite/leaderboard  Mojolicious's popularity beats even perl distro itself :P
14:53 Grinnz yep ;)
14:54 sri hehe, been like that for a long time ;p
14:54 sri 2 years?
14:54 sri for a time moose and mojolicious were switching places every other day
14:55 Grinnz now Moo is taking all its thunder :P
14:55 sri perl is actually pretty new up there
14:55 nic I kept getting false positive search results the other day because Mojolicious and Angular both feature on some github leaderboard too :)
14:56 sri think mojolicious is also the biggest perl project on github by many metrics
14:57 sri we were early adopters though
14:59 sri hmm, i'm only github user 30094 though :/
14:59 sri mojo get https://api.github.com/users/kraih /id
15:00 ZoffixW You're way ahead of my 5747918 though :P
15:00 sri lol
15:00 ZoffixW Or behind
15:00 ZoffixW :)
15:01 jberger eeep 735765
15:01 jberger oh, ZoffixW has another digit
15:02 * nic 407,206
15:02 * nic resisted the move from bzr for way too long
15:02 sri wow, marcusr is user 5526
15:03 nic marcusr++
15:03 nic oh
15:03 nic now he's 5527
15:03 jberger marcusr++
15:03 nic 5528
15:03 Grinnz lol
15:03 jberger nic++
15:03 jberger I was on googlecode for a while
15:04 * Grinnz is late to the githubs
15:07 till I just noticed that there are many duplicate IDs in the mojo docs DOM. Each h2 has an anchor element with the same ID. Is this wanted?
15:07 sri till: link?
15:08 jberger #toc anchor on the text
15:09 jberger till: the doc is all generated from pod
15:09 ZoffixW There's a bunch of them on the mojolicio.us perldoc: https://validator.w3.org/nu/?doc=http%3A%2F%2Fmojolicio.us%2Fperldoc%2FMojo%2FDOM
15:10 till every doc. I think it would be better to make them unique.
15:10 sri till: that's not true
15:10 ZoffixW Looks like the id="" is set both on the <h*> and the <a> inside of them
15:10 sri http://mojolicio.us/perldoc/Mojo/UserAgent#start1
15:10 sri we fix those links
15:10 till or most of them
15:11 sh4 joined #mojo
15:12 sri maybe i'm too burned out for this, but the vagueness here is killing me
15:12 sri anyway, i'm out
15:13 jberger mojo get http://mojolicio.us/perldoc/Mojo/Util '#tablify .permalink' attr href
15:14 jberger actually more like:
15:14 jberger mojo get http://mojolicio.us/perldoc/Mojo/Util 'h2#tablify a.permalink' attr href
15:14 jberger vs
15:14 jberger mojo get http://mojolicio.us/perldoc/Mojo/Util 'a#tablify' attr href
15:15 ZoffixW But the problem is this: mojo get http://mojolicio.us/perldoc/Mojo/Util '#tablify #tablify' text
15:15 ZoffixW The id=""s are duplicated.
15:15 ZoffixW id="" attributes must be unique
15:17 jberger till: https://github.com/kraih/mojo/blob/master/lib/Mojolicious/Plugin/PODRenderer.pm#L70-L71
15:17 ZoffixW Looks like the id => $anchor bit here should be removed: https://metacpan.org/source/SRI/Mojolicious-6.28/lib/Mojolicious/Plugin/PODRenderer.pm#L71
15:18 ZoffixW Actually no
15:18 batman romel: check out sub _validation
15:18 batman pretty sure it works
15:19 ZoffixW Ah yeah.
15:19 till jep, the id on the h2 sufficient
15:19 * ZoffixW submits an issue
15:20 marty joined #mojo
15:21 batman romel: please join #swagger to ask about swagger stuff
15:22 batman but here is the "trick": https://github.com/jhthorsen/swagger2/blob/master/t/blog/lib/Blog/Controller/Posts.pm#L85
15:24 ZoffixW till, thanks. Issue created: https://github.com/kraih/mojo/issues/867
15:34 good_news_everyon joined #mojo
15:34 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/vlDkQ
15:34 good_news_everyon mojo/master b42abdb Sebastian Riedel: the anchor does not need an id (closes #867)
15:34 good_news_everyon left #mojo
15:35 sri Zoffix++ # good issue, as usual
15:39 ZoffixW sri, the my $anchor is probably not needed any more. Just use $e->{id} in the ->fragment(): https://github.com/kraih/mojo/blob/master/lib/Mojolicious/Plugin/PODRenderer.pm#L67-L68
15:40 sri true
15:40 sri want to send a pull request? :)
15:40 sri you write so nice issues, it feels bad not to give you commits
15:41 ZoffixW OK :)
15:47 good_news_everyon joined #mojo
15:47 good_news_everyon [mojo] kraih pushed 2 new commits to master: http://git.io/vlDsP
15:47 good_news_everyon mojo/master a8c946f Zoffix Znet: $anchor variable is no longer needed
15:47 good_news_everyon mojo/master 1fc8c2e Sebastian Riedel: Merge pull request #868 from zoffixznet/fix-variable...
15:47 good_news_everyon left #mojo
15:48 good_news_everyon joined #mojo
15:48 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/vlDGB
15:48 good_news_everyon mojo/master fb79b19 Sebastian Riedel: fix formatting
15:48 good_news_everyon left #mojo
15:50 till thanks zoffix + sri. Can someone replicate this? open http://mojolicio.us/perldoc/Mojo/DOM/CSS and click on link "E:nth-child(n)" nothing happens and a javascript error "Syntax error, unrecognized expression" appears in the console (tested in chrome and safari)
15:51 ZoffixW till, yup, I can.
15:52 till do you have an idea why?
15:52 ZoffixW till, jQuery/JS code on the page
15:52 * ZoffixW looks closer
15:53 ZoffixW A while guess would be not escaping ID attribute's values that are given to a jQuery selector :P
15:53 ZoffixW So it's trying to interpret it as a proper selector instead of just an ID
15:54 ZoffixW s/A while/A wild/;
15:54 jontaylor joined #mojo
15:55 sri if that's the case it will be in lib/Mojolicious/resources/templates/mojo/menubar.html.ep
15:55 ZoffixW I think this is the culprit. In JS code on the page:       var hash   = this.href.split("#")[1]; var target = $(hash);
15:56 till you're right, time for another issue :)
15:57 * ZoffixW could do a PR
15:59 sri do it
15:59 jberger ZoffixW++ # on a roll!
16:01 disputin joined #mojo
16:03 zivester joined #mojo
16:04 sri wonder if he picks the same idiom i would
16:06 sri escaping does fix it btw.
16:08 * ZoffixW laughs
16:09 ZoffixW I'm launching an app, but not seeing my changes propagate :P
16:11 ZoffixW sri, well, I was gonna do var hash   = "#" + encodeURIComponent(this.href.split("#")[1]);
16:11 ZoffixW But I'm having trouble launching a test app to test that.
16:12 ZoffixW sri, so if you fixed it, just push that change :P
16:12 sri i just found something very odd
16:14 ZoffixW What is it?
16:16 sri naming conflict i forgot to resolve earlier
16:16 sri my choice was .replace(/(:|\.|\[|\]|,)/g, '\\$1')
16:16 sri as recommended by the jquery docs
16:17 ZoffixW How come this app (when run in the mojo repo) isn't picking up my changes in lib/Mojolicious/resources/mojo/menubar.html.ep ? http://fpaste.scsys.co.uk/500872
16:20 ZoffixW Weird. Even if I cpanm -vn . in the repo dir, I'm still not seeing the changes :/
16:21 good_news_everyon joined #mojo
16:21 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/vlDMY
16:21 good_news_everyon mojo/master cd547e8 Sebastian Riedel: fix a few bugs in built-in templates
16:21 good_news_everyon left #mojo
16:22 sri ZoffixW: that should fix it all
16:22 ZoffixW Sweet
16:23 sri changes were not picked up because of a leftover mojobar.html.ep i imagine
16:23 ZoffixW Hm, yeah.
16:23 ZoffixW And now it's saying "Template "mojo/mojobar.html.ep" not found"
16:23 ZoffixW (I nuked the Mojolicious dir on my install)
16:24 sri somehow i must have missed that include when i renamed it
16:24 sri one thing though
16:24 sri it now shows a backslash in the link http://127.0.0.1:3000/perldoc/Mojo/DOM/CSS#E\:nth-last-child-n
16:25 * ZoffixW is fine with it
16:25 sri it seems to work fine in chrome and firefox
16:26 ZoffixW sri, doesn't work in IE11
16:26 sri :S
16:27 genio ugh. IE
16:27 till won't $(document.getElementById(anchor)) work?
16:27 ZoffixW I don't see why it should, so I don't blame it
16:28 ZoffixW http://mojolicio.us/perldoc/Mojo/DOM/CSS#E%3Anth-last-child-n works though, as is just the ":"
16:29 ZoffixW So maybe don't .replace(), but keep it as normal and in the $() do what till above showed
16:29 ZoffixW Lunch time \o/
16:29 sri doesn't work in chrome
16:30 till with getElementById you don't need escape
16:32 sri problem is the location.hash = ...
16:32 sri it appears IE wants it percent encoded, while chrome/firefox like the backslash
16:33 till just ignore IE :)
16:34 sri lets look at google analytics
16:34 genio The web would be better if we could
16:34 ZoffixW sri, if I visit this URL in FF/Chrome it works fine: http://mojolicio.us/perldoc/Mojo/DOM/CSS#E%3Anth-last-child-n
16:35 ZoffixW Do you mean it doesn't work in location.hash ? Just stick un-encoded version there
16:36 sri that does not work
16:36 ZoffixW No idea the :/
16:36 ZoffixW genio, well, MS is rebranding it as "Edge", so your dream will soon be a reality :P
16:36 sri chrome 46.0.2490.80
16:37 genio ZoffixW: Same thing, less backwards compatibility (an improvement, for sure).
16:38 till or simply replace : with dash in render
16:39 sri just so we are all on the same page, this is what i tested https://gist.github.com/anonymous/5e766dcdfda31574ba47
16:40 sri oops double $()
16:40 ZoffixW sri, not related to the issue but $($(document.getElementById(anchor))) has an extra $()
16:40 sri doesn't matter
16:49 good_news_everyon joined #mojo
16:49 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/vlyJU
16:49 good_news_everyon mojo/master 57117e4 Sebastian Riedel: just use getElementById
16:49 good_news_everyon left #mojo
16:50 sri that doesn't fix it, just shorter
16:51 sri i find that very confusing actually
16:51 sri it's definitely bad code
16:51 ZoffixW joined #mojo
16:52 sri but now it's just that one line that needs fixing
16:53 ZoffixW fwtw, this does scroll in Firefox, but I'm still getting a JS error (even if I just visit the page with the #.... part in the URL I still get an error): http://fpaste.scsys.co.uk/500882
16:53 ZoffixW Or did you mean the error was there when you said it doesn't work?
16:54 ZoffixW Ah
16:58 cfedde this is almost a feature of jargon. We say the same thing about out doctors and our lawers.
16:58 sri ZoffixW: do you actually know what you're doing with the percent encoding?
16:59 sri because it seems very out of place
16:59 ZoffixW I know, but it works :)
17:00 ZoffixW I actually managed to make everything work in Firefox :)
17:00 ZoffixW Gonna clean up and try in IE
17:00 sri Oo
17:04 till small formatting issue, maybe its negligible: https://github.com/kraih/mojo/blob/master/lib/Mojolicious/Plugin/DefaultHelpers.pm#L102
17:05 sri till: we use perltidy
17:05 till ok sorry
17:05 sri it does weird things sometimes :)
17:08 ZoffixW sri, this seems to work: https://github.com/kraih/mojo/compare/master...zoffixznet:fix-variable?expand=1
17:08 ZoffixW In FF/Chrome/IE
17:08 ZoffixW The only thing I'm noticing is in Chrome/IE it scrolls to the el + height of menu bar and menu bar is hidden. In IE, it scrolls to the el
17:09 ZoffixW And I'm not doing much. I just did the .replace() stuff you originally showed on the two times we're passing id="" value to the jQuery selector.
17:09 sri that link is borked
17:09 sri oops, copypasta issue
17:09 ZoffixW Get a real IRC client :P
17:10 sri like?
17:10 ZoffixW XChat :)
17:11 sri and then i go offline all the time?
17:11 sri so much better! ;p
17:11 ZoffixW :)
17:14 Grinnz_ hexchat*
17:14 Grinnz_ my hexchat never goes offline but thats cause i never turn off that laptop :P
17:14 Grinnz_ also yeah, hexchat is way better at recognizing links than this terminal emulator
17:15 sri ZoffixW: does it work in IE too?
17:15 PryMar56 joined #mojo
17:16 sri ZoffixW: if it does please open a pull request
17:17 sri and isn't escapeId the correct capitalization?
17:20 ZoffixW OK, I'll make a PR and fix the naming. Yes, it does work in IE.
17:48 tempire So where do I find an ircop?
17:51 ZoffixW tempire, ping one of these folks? http://www.irc.perl.org/staff.html
17:51 ZoffixW Seems there's #magnet-srb too (http://www.irc.perl.org/governance.html)
17:52 jberger srb isn't probably what you need for password reset, but you will find the people
17:59 cpan_mojo Clustericious-1.01 by PLICEASE https://metacpan.org/release/PLICEASE/Clustericious-1.01
18:05 cpan_mojo Clustericious-1.02 by PLICEASE https://metacpan.org/release/PLICEASE/Clustericious-1.02
18:09 jontaylor joined #mojo
18:13 jberger sri: I'm surprised that there isn't a Mojo::Log::is_minimum_level($level);
18:14 jberger basically, the internal _now method
18:14 jontaylor joined #mojo
18:19 dhg joined #mojo
18:19 bpmedley_ joined #mojo
18:27 jontaylor joined #mojo
18:28 good_news_everyon joined #mojo
18:28 good_news_everyon [mojo] kraih pushed 2 new commits to master: http://git.io/vlSU3
18:28 good_news_everyon mojo/master 14ef6c3 Zoffix Znet: Fix JavaScript errors when links in TOC have special characters
18:28 good_news_everyon mojo/master 58a5e6a Sebastian Riedel: Merge pull request #869 from zoffixznet/fix-special-ancor...
18:28 good_news_everyon left #mojo
18:28 asarch joined #mojo
18:31 good_news_everyon joined #mojo
18:31 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/vlSkn
18:31 good_news_everyon mojo/master 60eda23 Sebastian Riedel: fix formatting
18:31 good_news_everyon left #mojo
18:31 sri jberger: look again ;p
18:31 jontaylor joined #mojo
18:35 good_news_everyon joined #mojo
18:35 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/vlSqE
18:35 good_news_everyon mojo/master 9bb0716 Sebastian Riedel: slightly better descriptions
18:35 good_news_everyon left #mojo
19:01 disputin joined #mojo
19:03 jontaylor joined #mojo
19:13 trone joined #mojo
19:23 disputin joined #mojo
19:28 disputin joined #mojo
19:33 jberger I want to do this: https://github.com/kraih/mojo/blob/master/lib/Mojo/Log.pm#L62
19:33 jberger if there is some supported way to do that that I'm not seeing, please tell me
19:34 jberger basically I want to subscribe to message and I only want to listen to messages of error or greater, no matter what level the logger is in
19:35 Grinnz nope, just the individual is_foo
19:35 Grinnz that's enough for Contextual::Log though, if you add is_fatal back
19:35 Grinnz as i did in Log::Emitter
19:36 Grinnz hmmm
19:36 stephen joined #mojo
19:36 Grinnz yeah i think that would have to be done custom unless that was exposed again
19:56 disputin joined #mojo
20:02 sri jberger/Grizz: how is it *just* the individual is_foo?
20:02 jb360 joined #mojo
20:02 sri Grinnz
20:03 sri they do *exactly* what you want
20:03 jberger they test the log level
20:03 jberger I want to test the message level
20:03 sri i don't understand
20:04 jberger return unless message_is_at_least('error')
20:04 jberger literally the line I linked to I would like to reuse
20:04 sri sub is_error { shift->_now('error') }
20:06 jberger but you don't pass in the string, its hard-coded
20:06 jberger sub is_level { shift->_now(@_) }
20:06 * sri gives up
20:07 jberger I want something that knows that fatal is worse than error and info is better
20:07 jberger that is the _now method
20:07 jberger which is not exposed
20:08 jberger the logger level is to some degree the property of the default message handler
20:08 jberger if I wanted to recreate exactly the same message handler, I couldn't using public methods
20:09 disputin joined #mojo
20:10 jberger perl -Mojo -E 'app->log->level("fatal")->on(message => sub { say "got: $_[2]" }); app->log->error("boom");'
20:11 sri either i'm growing more impatient or there's many more vague questions than usual now
20:12 jberger sri: I don't know how to be any more clear
20:12 jberger my callback cannot know if it should return early, because it does not know the relationship between error and fatal
20:12 jberger because _now is a private method
20:13 sri only questions i 100% understand for me from now on
20:13 jberger if you are saying that the $LEVEL relationships are a property of the default message handler only and are not to be reused then that's one thing, but it seems odd
20:13 sri hmm, 2 million websockets :o http://www.phoenixframework.org/v1.0.0/blog/the-road-to-2-million-websocket-connections
20:14 preaction jberger: what do you want this for? are you trying to send all errors/fatals to RabbitMQ?
20:14 jberger preaction: yes
20:15 preaction likely at this point i'd drag out MojoX::Log::Log4perl, and there's already a Log::Log4perl::Appender::RabbitMQ
20:20 dave is this the wrong way to write this? $route->webscoket('/foo')->over( headers => { Origin => qr/bar\.com$/ } )
20:20 dave s/cok/okc/
20:22 jberger sri: interersting to see the sysctl settings used
20:22 preaction bad blog post lead-in #26: "If you've been paying attention, you already know about this."
20:23 sri you've clearly not been paying attention
20:24 * jberger decides to just use _now method, as there is no other way
20:26 jberger perl -Mojo -E 'app->log->level("fatal")->on(message => sub { my ($log, $level, $msg) = @_; say "got: $msg" if $log->_now($level);}); app->log->debug("not important");'
20:27 dave if I do write it that way, the websocket works but Test::Mojo's websocket_ok fails
20:28 jberger dave: even if you set the header?
20:29 dave yeah I tried that
20:29 dave $t->websocket_ok('/foo' => { Origin => 'bar.com' })
20:30 dave if I remove the over condition the test above works
20:30 dave so I'm pretty sure it's that over call
20:30 jberger I've never done websockets with headers, but since it is just a GET request I would think it should work
20:32 dave I even tried ... ->over( Origin => qr/./ )
20:37 cpan_mojo Swagger2-0.61 by ASHIMEMA https://metacpan.org/release/ASHIMEMA/Swagger2-0.61
20:42 jberger dave: did you try looking at the test run with MOJO_USERAGENT_DEBUG=1 ?
20:42 jberger see that the headers you think are being sent are actually being sent
20:42 dave didn't even know that was an option :)
20:44 Grinnz_ my two most often used debug vars: MOJO_USERAGENT_DEBUG and MOJO_IRC_DEBUG ;)
20:45 dave IRC?
20:45 Grinnz_ for Mojo::IRC of course.
20:45 dave ah never used that module
20:45 * Grinnz_ will get his bot framework cpan-ready someday, promise!
20:45 ZoffixW joined #mojo
20:45 dave lol
20:46 dave if I'd give up the sys admin and integration stuff I do, I might actually finish software projects
20:46 ZoffixW dave, are you sure you have something to handle that request in the controller?
20:46 dave yes
20:46 ZoffixW $r->websocket('/foo')->to('root#sock')->over( headers => { Origin => qr/bar.com/ } );   .... $t->websocket_ok('/foo' => { Origin => 'bar.com' });
20:46 ZoffixW That passes for me.
20:46 dave the same connection attempt works in the browser
20:46 dave but does not work in testing
20:46 dave wait
20:47 dave you have over -after- to
20:47 dave try it before
20:47 ZoffixW dave, it passes even if I switch those two around
20:47 dave argh
20:47 dave well it was a thought :D
20:48 dave so there must be something different I am doing that isn't the above
20:48 ZoffixW This is my root#sock FWIW: http://fpaste.scsys.co.uk/500907
20:49 dave thanks
20:50 sri jberger: _now() will break
20:50 jberger of course, I know the rules
20:50 jberger but I can't seem to get my point across and the only available functionality is not for this purpose
20:51 * sri thinks it's silly when core members use private apis without even proposing a public api extension
20:51 Grinnz_ i think that's what sub is_level { shift->_now(@_) } was meant as :P
20:51 Grinnz_ and i think that used to be there, but was removed
20:52 sri yes
20:52 sri it was redundant
20:52 jberger I was proposing that, but you just got frustrated and "were out"
20:52 Grinnz_ not completely
20:52 jberger it is not redundant
20:52 sri why have ->is_error if you have is_level('error')?
20:53 jberger is_error relates to the logger's level
20:53 jberger not to the message's level
20:53 sri what does ->is_error bring to the table that's unique?
20:53 Grinnz_ so does _now
20:53 sri so does _now
20:54 jberger https://github.com/kraih/mojo/blob/master/lib/Mojo/Log.pm#L62
20:55 jberger $level is from the message
20:55 Grinnz_ in your message handler, you'd get it from the message to
20:55 Grinnz_ too*
20:56 jberger if I want to write my own message callback, I would like to limit it to logging only the desired levels
20:56 Grinnz_ essentially: my $meth = "is_$level"; if ($log->$meth) { ...
20:56 Grinnz_ but the lack of is_fatal could break that
20:56 jberger zomg
20:56 sri fatal is always active
20:56 Grinnz_ i still needed to add it for Log::Emitter to work with Log::Contextual
20:58 Grinnz_ jberger: oh yes so you wanted to test against an arbitrary level and not the level of the logger
20:58 Grinnz_ hmm i dont think _now can help with that
20:58 jberger I would prefer that, but I suppose I could use your hack
20:59 sri _now can't even do that
20:59 sri none of this makes any sense
21:00 dave why?
21:00 jberger return unless ($log->can("is_$level") || sub { 1 })->();
21:00 Grinnz_ that works
21:00 sri not for arbitrary levels independent of the logger
21:01 jberger yes, that's why I left the secondary test just return 1, it would fire for any of them
21:01 jberger but I don't use them in my app, so ... it doesn't matter
21:01 Grinnz_ would you get arbitrary levels?
21:01 Grinnz_ i dont think any of the public methods let you do that
21:01 espent joined #mojo
21:02 jberger $log->log("my_strange_level" => "my message")
21:02 Grinnz_ doesnt exist anymore
21:02 jberger oh right
21:07 jberger http://pastie.org/10527548
21:08 Grinnz_ aha
21:08 Grinnz_ sneaky
21:13 espent_ joined #mojo
21:16 lluad joined #mojo
21:19 bpmedley joined #mojo
21:22 mattastrophe joined #mojo
21:53 Ptolemarch joined #mojo
22:01 cfedde Mojolicious::Plugin::REST ?
22:34 dhg joined #mojo
22:44 ajr_ joined #mojo
22:59 good_news_everyon joined #mojo
22:59 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/vlHzx
22:59 good_news_everyon mojo/master cc74c0a Sebastian Riedel: test the menu bar
22:59 good_news_everyon left #mojo
23:07 disputin joined #mojo
23:31 mattastrophe1 joined #mojo
23:41 FatalNIX Hmm. How do you guys usually validate JSON data? I was hoping for something simular to the way I would use MooseX::Params::Validate, but ideally it doesn't have to be anything like that.
23:42 FatalNIX maybe JSON::Validator will do, wasn't sure if Mojo has a cool trick up its sleeve for those RESTful APIs
23:55 preaction Test::Deep::NoTest perhaps?

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