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

IRC log for #mojo, 2015-08-15

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

All times shown according to UTC.

Time Nick Message
00:23 ZoffixWork joined #mojo
00:55 sopanshewale joined #mojo
01:12 Onigiri joined #mojo
01:16 howitdo joined #mojo
01:29 jberger joined #mojo
01:29 jberger sri: I just had a funny thought
01:30 jberger If we implement :has and email that list, then we might be the typing point for getting it accepted for CSS4
01:31 sri heh, i don't think they care very much about our use case
01:31 sri browser vendors dictate where the specs are heading
01:33 jberger But if the argument of too complex falls apart with an implementation in the wild
01:34 sri i thought we established that it is in fact too complex :)
01:34 jberger I haven't even tried it yet :p
01:35 sri my head hurts trying to think of an implementation
01:38 jberger sri: can you commit your test diff to the branch?
01:38 sri you do it, most of it is yours
01:38 jberger Ok
01:38 jberger I'm still out and about, but I will soon
01:39 jberger Car is fixed
01:40 sri http://www.thesmartlocal.com/images/easyblog_images/2315/handyman.jpeg
01:42 jberger Nice
01:56 good_news_everyon joined #mojo
01:56 good_news_everyon [mojo] jberger force-pushed css_scope from 1f49264 to 59ff376: http://git.io/v39kP
01:56 good_news_everyon mojo/css_scope 59ff376 Joel Berger: enable :scope pseudoclass and relative selectors...
01:56 good_news_everyon left #mojo
02:08 good_news_everyon joined #mojo
02:08 good_news_everyon [mojo] jberger pushed 1 new commit to css_scope: http://git.io/v39LW
02:08 good_news_everyon mojo/css_scope ca7d66e Joel Berger: added some test cases for :scope, including a TODO test for siblings
02:08 good_news_everyon left #mojo
02:21 jberger sri: I'm not sure I agree with the intended result of that test anyway
02:22 jberger oh, nm
02:22 jberger I didn't see the ->at('p') before it
02:22 jberger so p is the :scope
02:24 sri hehe "not a direct child"
02:24 sri like, and indirect child?
02:25 sri 'not a child' would seem more correct
02:27 jberger it reflects my misunderstanding of the situation
02:27 jberger I'll change it
02:27 jberger (its a branch so I'll force push at will here)
02:29 good_news_everyon joined #mojo
02:29 good_news_everyon [mojo] jberger force-pushed css_scope from ca7d66e to e8e2245: http://git.io/v39kP
02:29 good_news_everyon mojo/css_scope e8e2245 Joel Berger: added some test cases for :scope, including a TODO test for siblings
02:29 good_news_everyon left #mojo
02:32 noganex_ joined #mojo
02:36 jberger I think I'm looking at doing a peek in the loop in _match
02:37 jberger if the first selectors of a group are :scope [+~] then use the _sibling match on the the parent of current
02:48 sri jberger: you've not fixed the $pos problem
02:49 jberger not gonna deal with that unless I get this
02:49 sri i had it working
02:49 jberger thats solvable with some thought, this might not be
02:49 jberger oh
02:49 * jberger looks again
02:49 jberger oh the _scope thing
02:49 jberger funny you made that
02:50 jberger I had one in an early implemenation
02:50 sri you test it with a selector like ":scope > p > a"
02:50 genio man, it's going to take me a while to get everything in JSForce implemented.
02:52 KindOne joined #mojo
03:11 buu joined #mojo
03:12 good_news_everyon joined #mojo
03:12 good_news_everyon [mojo] jberger pushed 1 new commit to css_scope: http://git.io/v393a
03:12 good_news_everyon mojo/css_scope 9cb7b1c Joel Berger: fixed more complex :scope ancestor selectors
03:12 good_news_everyon left #mojo
03:12 jberger I have to relearn git add -p every time I use it
03:13 nicomen heh, https://twitter.com/leaverou
03:13 nicomen she might have some answers about the examples
03:13 nicomen (was all over my twitter)
03:31 jberger funny, the selector doesn't even survive to _match in tact
03:31 asm35 joined #mojo
03:31 jberger it gets truncated back to 'p' again
03:32 jberger hunh
03:32 jberger no, its not working at all
03:32 jberger wtf
03:32 jberger sorry, language
03:33 * jberger is shamed
03:35 sri shame!
03:36 Grinnz http://cdn.themetapicture.com/media/funny-cone-of-shame-Dug-Up.jpg
04:43 arpadszasz joined #mojo
04:51 sri jberger: while you're hacking on the css engine, you could also run nytprof against it and optimize a little ;)
04:53 * sri doesn't even remember the last time he has done that
06:04 dod joined #mojo
06:09 dod joined #mojo
06:17 irqq joined #mojo
06:37 melo joined #mojo
07:14 jzawodn_ joined #mojo
07:14 berov joined #mojo
07:34 dotandimet joined #mojo
08:15 Vandal joined #mojo
09:05 marty joined #mojo
09:36 pink_mist is the logic supposed to be changed in that last commit, jberger?  you seem to have converted a (!x) && (!y) into !(x && y) when it should be !(x || y)
09:46 punter joined #mojo
10:06 meshl joined #mojo
10:09 marty joined #mojo
10:09 Craftsmanship joined #mojo
10:54 asm35 joined #mojo
11:00 marty joined #mojo
11:32 d4rkie joined #mojo
11:57 jontaylor joined #mojo
12:26 jontaylor joined #mojo
13:13 Zoffix pink_mist, no, looks right.
13:13 Zoffix perlbot, eval: sub o { (!$_[0]) && (!$_[1]) } sub j { !( $_[0] && $_[1] ) }  sub p { !($_[0] || $_[1]) } [ map [j($_->[0], $_->[1]), j($_->[0], $_->[1]), p($_->[0], $_->[1])], [0, 0], [1, 0], [1, 1], [0, 1] ]
13:14 Zoffix err... Well, if you run you'll see. Took me awhile, but I think the reason it works correctly is due to perl's laziness on AND operators. So even if pure logic would boil down to your example, perl's laziness makes your example behave differently than original, but jberge r's works fine.
13:34 McA joined #mojo
13:41 jzawodn joined #mojo
14:39 amon joined #mojo
15:48 melo joined #mojo
15:58 PryMar56 joined #mojo
16:01 ajr_ joined #mojo
16:15 ZoffixWork joined #mojo
16:59 buu joined #mojo
17:09 dod joined #mojo
17:16 dod1 joined #mojo
17:24 stephen joined #mojo
17:48 buu joined #mojo
18:06 buu joined #mojo
18:13 melo joined #mojo
18:35 Dada joined #mojo
18:47 pink_mist Zoffix: eval: for \my @foo (['foo', 'foo'], ['foo', 'bar'], ['bar', 'foo'], ['bar', 'bar']) { my $correct = ($foo[0] ne 'foo' && $foo[1] ne 'foo');  my $x = !($foo[0] eq 'foo' && $foo[1] eq 'foo'); my $y = !($foo[0] eq 'foo' || $foo[1] eq 'foo');  print $correct == $x ? '' : 'x is wrong'; print $correct == $y ? '' : 'y is wrong'; }
18:47 pink_mist y is never wrong there
18:47 pink_mist x is wrong twice
18:52 ZoffixWork joined #mojo
18:57 pink_mist Zoffix: your code snippet compares j to j and p ... you never invoke o
18:58 pink_mist Zoffix: so of course your code thinks that j compares equal to j
18:59 Dada hi. I'm working on a mojo app, and I'm would like a route for a /something-and-someotherthing, where "something" and "someotherthing" can be any words, but the "-and-" have to be there.. I've look around to find how to do such a thing, but I still don't get it.. Maybe with placeholder, but I don't know how to apply pattern matching on placeholder.. Any ideas? Thanks
19:04 ZoffixWork Dada, $r->get('/:name' => [name => qr/\w+-and-\w+/])->to('foo#bar');  ? Something like that?
19:05 ZoffixWork Haven't tried. This is essentially from here: http://mojolicio.us/perldoc/Mojolicious/Guides/Routing#More-restrictive-placeholders
19:05 ZoffixWork And then you'd just split the placeholder on '-and-' to get the two values
19:07 Dada oh right, looks great indeed. I missed this page while looking for a solution! Thanks men :)
19:10 buu_ joined #mojo
19:11 pink_mist Zoffix: when you think perl's logic operators give different results than logic would demans, take a closer look at your code :P
19:11 pink_mist *demand
19:11 ZoffixWork :P
19:13 kaare joined #mojo
19:22 * sri doesn't like the idea of making select_field even more complicated https://github.com/kraih/mojo/issues/829
19:24 sri perhaps it's even a candidate for removal
19:24 ZoffixWork select_field is candidate for removal?
19:24 pink_mist 0_o
19:25 sri you brought up the point that it causes problems rather commonly
19:25 ZoffixWork Indeed, but then instead of asking about how to set a default, people will be asking where's the select field :P
19:26 sri no, it think you have a point there, and removal should be considered
19:26 sri more complexity does not seem liek the answer
19:28 sri there would be 3! ways to set a default
19:28 sri that's crazy
19:28 ZoffixWork What's the third one?
19:28 sri passing selected => 'selected in the value structure'
19:29 sri like for every other input element
19:29 Dada Hey Zoffix, I wrote $r->get('/secondZone/:names' => [names => qr/[a-zA-Z_-]+-and-[a-zA-Z_-]+/])->to('foo#bar'); , but it don't work.. any ideas? (no route match url when I test with /secondZone/aaa-and-bbb for example)
19:30 ZoffixWork Dada, do you have a template for it to render?
19:33 Dada wow, i'm retarded. I misspelled my controller name :/ Thanks for the help, it works perfectly fine!
19:33 ZoffixWork \o/
19:33 sri Dada: language
19:34 sri this channel is G-rated now
19:34 ZoffixWork Is it? I'm surprised I've not got flagged yet for anything :)
19:35 ZoffixWork Would be helpful to put the G-rating in the topic, for newcomers.
19:35 mst it is in the topic
19:35 ZoffixWork Oh. tis there
19:35 sri *cough*
19:35 * ZoffixWork blushes
19:36 mst though there'll have to be an explicit policy document at some point, I'm sure
19:36 mst while I've no particular object to policing 'ret****d' that seems a separate thing to 'no profane or sexual language' which is usually what G-rated means
19:36 mst *objection
19:37 sri "be nice, listen to the moderators" should work most of the time
19:37 ZoffixWork Is this the reason for the change? http://irclog.perlgeek.de/mojo/2015-08-12#i_11042107
19:37 ZoffixWork I have that vid still open in the browser at home, but haven't had a chance to watch it
19:37 mst sure, but if you're going beyond basic G-rating you should probably warn people of that the first time you point it out to them
19:37 sri lawyering about what's acceptable is mostly a waste of time, you say something by accident, you get a warning, and it's done
19:38 melo joined #mojo
19:39 Dada oh, sorry, didn't thought it was unsafe (specially when I was talking about myself), but whatever, I'll watch my langage next time!
19:40 mst most geek spaces it's long since stopped being a slur, but *shrug* there's certainly a case for avoiding it
19:40 mst and "I'm a gibbering idiot" works just as well and is such a cooler tone of phrase ;)
19:41 mst *term
19:41 * mst glares at his fingers
19:41 bpmedley Does anyone do mobile development with a Mojo backend?
19:41 jontaylor joined #mojo
19:41 Grinnz ewww mobile
19:42 sri mst: language
19:42 mst sri: for what?
19:42 sri for the "idiot"
19:42 Grinnz sri, don't be ridiculous
19:43 ZoffixWork joined #mojo
19:43 ZoffixWork bpmedley, do you mean sites that are "mobile friendly" or mobile apps?
19:43 ZoffixWork bpmedley, if the latter, I just use Bootstrap and it does the job
19:44 ZoffixWork *former
19:44 bpmedley ZoffixWork: Mobile apps.  I want to do a Google calendar replacement since they no longer send me reminders.  I'm using Xamarin currently, not sure of a good way that interacts well with a Mojo/JSON api backend.
19:44 Grinnz google reminders work fine for me o_0
19:45 bpmedley ZoffixWork: Maybe I should do an HTML 5 app for this.  Hrrm.
19:45 bpmedley Grinnz: Do you do use email to text gateways for the reminders?
19:45 ZoffixWork They send me reminders. I've got some sort of calendar app on my phone and I can tell it to either buzz me or send an email
19:45 Grinnz no, i just get them by email or popup
19:45 mst sri: ok, if you're going to outlaw random words then you need to produce an actual list and proposed replacements. can I at least call myself stupid or is that verboten now too?
19:46 bpmedley It could be that either I made a mistake with Google calendar, or they no longer send to the txt gateways.
19:46 mst was kicked by sri: 24 hour timeout
19:46 Grinnz bpmedley, i havent tried with texts no
19:46 Grinnz sri, what the fuck
19:47 Grinnz sorry, language
19:47 irqq joined #mojo
19:47 sri i'm not interested in a fight
19:47 sri he was looking for onw
19:48 Grinnz that's not how it looks from here
19:48 sri is it too much to ask for a nice environment to talk about mojolicious?
19:49 sri does everyone have to challenge everything?
19:49 Grinnz nothing he has said endangered that, can we please be reasonable about this?
19:51 sri mst was looking to establish a precedent for acceptable curse words
19:52 Grinnz yes, because "curse words" does not include everything you seem to think it does, for everyone
19:52 * sri is quite disappointed
19:54 pink_mist bpmedley: google calendar no longer does sms things indeed; since last month or so iirc
19:55 bpmedley pink_mist: That burned me at work.  I missed a deadline.. :(   Therefore, I need a replacement.  Perhaps I can code one with Minion/Mojog/Pg, etc...
19:56 pink_mist ah, found the sms I got from them informing me: 2015-06-24: "Starting on 27 June, Google Calendar will no longer send SMS notifications. Learn more at https://goo.gl/Qkd60x"
19:57 sri Grinnz: jberger will settle it
19:57 bpmedley Sure, not saying they didnt' tell me.. Just that I didn't realize my emails using the sms gateways were in that list.  I just wasn't sure and I had gotten a few emails after the 27th, so I was confused.
19:57 pink_mist (of course, amusingly I then got an sms notification on the 28th :P)
19:59 Grinnz calling someone an idiot is rude and fine to disallow. the word "idiot" in itself is not a curse word in any way and does not worsen the environment, and disallowing words like that is a very vague area, which is why mst was asking for clarification
20:16 meshl joined #mojo
20:19 jberger I'm inclined to be a little more lax when being self-deprecating
20:21 jberger Perhaps it's a native speaker thing but I would also cautiously say that the word idiot is not in and of itself offensive, though since many many uses of it are, so let's keep it to a minimum
20:22 jberger Again imo the goal is to be respectful at ALL times
20:23 jberger This has been a very pleasant few days, let's keep it going
20:23 sri yea, i was very happy until this moment
20:24 jberger I also agree with you, let's both not lawyer up which word are ok or try to find the line
20:24 jberger Just always be respectful
20:25 sri thing is... next we'll have "that is idiotic", "that is retarded"... and "it was not directed at a person... and so on and so on"
20:26 Grinnz i disagree, those are rude things to say
20:26 jberger Again respectful
20:28 jberger I still don't especially care about "I'm an idiot" but we aren't playing find the line
20:28 sri "i'm a fucking idiot"
20:29 Grinnz i feel that we are capable of policing disrespect and real curse words, without outright banning any unhappy language
20:30 jberger See that language still isn't g rated
20:33 ZoffixWork joined #mojo
20:35 pink_mist jberger: did you see my comments in here about http://git.io/v393a ?
20:36 ZoffixWork I think an easy way to find what acceptable is imagine the conversation taking place at a board room, with customers. Not having grown up in an English-speaking country, term "G-rated" is extremely vague to me. But, as an adult, I can imagine what my conversation would be like if I'd be talking in a professional setting.
20:36 jberger pink_mist: see that ne changed to eq too
20:36 pink_mist jberger: that's the point
20:36 sri if jberger decides i'm overstepping that's allright, i certainly will at times, because i'm very motivated to make this work, if it doesn't, i'll be gone from irc for good
20:36 pink_mist jberger: $foo ne 'x'   is what I described as (!x)
20:36 jberger And a ! went in the conditional
20:37 * sri wants this channel to be like it was the last few days
20:37 Grinnz ZoffixWork, "with customers" makes that work, yeah
20:37 pink_mist jberger: yes
20:37 pink_mist jberger: my point still stands; your logic changed
20:37 jberger sri: I do see your point and your slippery slope is a good one
20:37 jberger As a native speaker "I'm an idiot" is pretty mild
20:38 jberger But I too worry about the trend it might set
20:38 jberger Let's keep that to a minimum
20:38 sri add different cultures to the mix
20:40 pink_mist jberger: my only question is whether you /meant/ for the logic to change; there's no question that it did.
20:41 ZoffixWork Yeah, we already had two snippets to see the logic changed.
20:44 jberger pink_mist: in this context given the data structure imo it is equivalent logic
20:44 pink_mist it is not
20:44 pink_mist I assure you
20:45 pink_mist you also said it didn't work correctly
20:45 Dada Is it possible to use capital (aside frome the first letter) or underscore in controller names? (I've tried and failed, but maybe I just missed something..)
20:45 ZoffixWork jberger, here's one of the snippets. In the return arrayrefs: 1st value is how it were originally, 2nd value is your version right now, and 3rd value is pink_mist's correction: http://fpaste.scsys.co.uk/497125
20:45 bpmedley Dada: Would you give a specific example for a controller name?
20:46 jberger Dada: you don't need to do the decamelized names
20:46 Grinnz Dada, https://metacpan.org/pod/distribution/Mojolicious/lib/Mojolicious/Guides/Routing.pod#Special-stash-values
20:46 Grinnz see also https://metacpan.org/pod/Mojo::Util#camelize
20:46 * Grinnz thinks we need a raptorize
20:47 ZoffixWork :)
20:47 sri ZoffixWork: "with customers" is also relative... local customs can vary greatly, resulting in stuff like this http://www.postgresql.org/message-id/86y4oa6u4o.wl-slynko@pgtech.ru
20:47 Grinnz hahaha
20:47 jberger If I'm at a root or "scope" element and I'm not considering a pseudoclass op with the value scope
20:47 ZoffixWork hahahaha
20:48 ZoffixWork sri, yes, you're right
20:49 pink_mist jberger: the original code will return true only for one instance: if both values being checked don't match; the revised version will return true when any value checked doesn't match
20:50 pink_mist that's three instances as opposed to one
20:52 jberger So which one agrees with the logic I just gave in word form
20:52 jberger ?
20:52 Dada thx bpmedley, jberger and grinnz, i tried again, it works fine, I don't know what what the problem the last time I tried, but it's fine now
20:53 bpmedley Dada: Gremlins are at the wheel of that phantom ship.. ;)
20:53 sri pink_mist: the new logic has tests, i'd assume it is correct
20:53 pink_mist sri: but then he said http://irclog.perlgeek.de/mojo/2015-08-15#i_11061480
20:54 pink_mist jberger: I'm sorry but I can't map your words to the code in question; either version ... all I'm really asking is whether you /meant/ for the logic to be changed or not
20:55 sri he did
20:55 pink_mist alright then, my question has been answered =)
20:55 sri he merged my changes into his branch
20:55 jberger Sorry I have two things going on here and one thing in the real world
20:56 jberger I'm going to just say that the final logic passes the tests
20:56 jberger So it is what I intend
20:56 jberger But thank you for the review
20:56 ZoffixWork I just mapped the code to the word logic; it matches
20:56 ZoffixWork \o/ yey codes
20:56 jberger \o/
20:59 sri perhaps someone has an idea for a select_field replacement that is less complex? https://github.com/kraih/mojo/issues/829
21:00 sri Zoffix: actually, looking at the code, i have no clue if selected => 'selected' works in all cases
21:00 gryphon joined #mojo
21:01 ZoffixWork joined #mojo
21:01 sri all cases being, no value, matching value, different value, one of many values matching, none of many values matching...
21:01 ZoffixWork sri, all the more reason to consider removal of select_field :)
21:03 ZoffixWork <select> tag itself and <optgroup> can be typed by hand, I think and <option>s could be handled by a helper. So we're reducing the complexity of the bundle of select+optgroup+option to just having a helper for a single tag (<option>), just as it's a single tag with other helpers.
21:03 pink_mist honestly, the issues with people asking about this could probably be better answered if the documentation mentioned the selected attribute
21:03 sri i mean, it's not like it's any easier in other languages :S http://www.padrinorb.com/api/Padrino/Helpers/FormHelpers.html#select_tag-instance_method
21:03 ZoffixWork yikes
21:04 ZoffixWork I think it can be simplified to have a helper generate multiple <option> tags and control which one is the selected one
21:04 ZoffixWork and the actual <select><optgroup> tags would be written by hand
21:07 sri that conflicts a bit with the idea of tag helpers
21:08 sri also, having to pass the helpers that generates <option> tags the name of the <select> is rather ugly
21:08 ZoffixWork True. Also, would have the problem of having to have to specify <select>'s name="" for each option group
21:09 sri :)
21:09 ZoffixWork heh
21:09 ZoffixWork Maybe just documenting this method is all that's needed: https://github.com/kraih/mojo/issues/829#issuecomment-130378993  at least for now.
21:12 sri btw. passing another argument to select_field is not consistent with other tag helpers like check_box
21:13 sri it's all using the generic param() idiom
21:15 sri hmm, i guess there is only one way to do defaults properly for selected/checked using elements
21:16 sri for other input elements it just works because the value is replaced
21:16 sri but unchecking a checkbox does not just work
21:16 sri surprisingly complex problem
21:23 sri perhaps the generic solution could get better
21:23 sri % param country => 'germany' unless param 'country';
21:24 sri it's very readable though
21:26 sri Zoffix: oh, the <select> tag is also important for validation
21:26 sri adding the field-with-error class and stuff
21:54 Adura joined #mojo
21:56 sri i think something like this would make checked => 'checked' and selected => 'selected work https://gist.github.com/anonymous/de1ccb15f11d365b0a0b'
22:15 sri i might just make all tag helpers consistent
22:29 good_news_everyon joined #mojo
22:29 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/v35sY
22:29 good_news_everyon mojo/master a244d56 Sebastian Riedel: improve check_box, radio_button and select_field tag helpers to handle the attributes "checked" and "selected" correctly
22:29 good_news_everyon left #mojo
22:31 sri the examples are pretty big though :( http://mojolicio.us/perldoc/Mojolicious/Plugin/TagHelpers#select_field
22:31 sri if two could be removed it would be better
22:36 jzawodn joined #mojo
22:43 good_news_everyon joined #mojo
22:43 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/v35nW
22:43 good_news_everyon mojo/master 9448d4c Sebastian Riedel: no need for separate examples
22:43 good_news_everyon left #mojo
22:43 sri a little better
23:06 theo
23:07 sri theo just reminded me of something
23:07 sri instead of swearing, can't we just use emoji? :)
23:07 sri ????
23:08 jberger ????
23:08 * Grinnz can't see either of those in this font and is offended! ☺
23:11 jberger Seriously, what font are you using?
23:12 * jberger hugs in browser irc
23:14 Adura Boxes with numbers in them are now cursewords, gotcha.
23:14 Adura
23:15 jberger Surely a perl programmer can figure out what the emoji were
23:15 jberger (And stop calling me Shirley)
23:16 Adura Fear my boxes! 清昌创叮咚
23:34 dave Golly geepers everyone!
23:36 preaction look at them peepers
23:40 bpmedley joined #mojo
23:52 inokenty joined #mojo
23:59 jontaylor joined #mojo

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