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

IRC log for #mojo, 2015-09-22

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

All times shown according to UTC.

Time Nick Message
00:25 Grinnz batman, the issue with the sqlite:// URLs was fixed in URI::db 0.16 fyi
00:34 Zoffix This is valid markup...   <input type="hidden" name="©☺♥" value="24">
00:34 * Zoffix is baffled
00:36 sri mojolicious tests are full of that stuff :)
00:37 sri https://github.com/kraih/mojo/blob/master/t/mojo/dom.t#L381
00:38 Zoffix heh
00:39 sri it's nice how it mostly just works in perl
00:40 Zoffix What I wonder though is this: http://www.w3.org/TR/2012/WD-html5-20121025/the-select-element.html#attr-select-multiple and this: https://github.com/kraih/mojo/commit/75d19900251d1590c5ccf97da6f016916c86ee16#diff-1307e87f8bf3d837a5e322c3e441d09bR2183
00:40 Zoffix Should ->val() return just a single value if multiple is not set?
00:41 sri fair point about the test, but i doubt we have to be strict about it
00:42 Zoffix True. 'cause the only way to handle it is to fail or pick a value at random... Current way is the best solution.
00:44 good_news_everyon joined #mojo
00:44 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/vnEJa
00:44 good_news_everyon mojo/master 8c4e78a Sebastian Riedel: there should be a multiple attribute
00:44 good_news_everyon left #mojo
00:52 Ptolemarch joined #mojo
01:07 zivester joined #mojo
01:09 good_news_everyon joined #mojo
01:09 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/vnEtt
01:09 good_news_everyon mojo/master 7370e5a Sebastian Riedel: a few more val method examples
01:09 good_news_everyon left #mojo
01:11 cpan_mojo Test-Mojo-Role-SubmitForm-1.001002 by ZOFFIX https://metacpan.org/release/ZOFFIX/Test-Mojo-Role-SubmitForm-1.001002
01:26 asarch joined #mojo
01:44 disputin1 joined #mojo
01:46 Ptolemarch joined #mojo
02:23 jberger joined #mojo
02:26 zivester joined #mojo
02:40 Ptolemarch joined #mojo
02:45 noganex joined #mojo
02:45 tempire +1 on val
02:56 disputin joined #mojo
02:58 davido_ joined #mojo
03:01 kaare joined #mojo
03:22 genio I might be reading the tests incorrectly, but it seems that differs slightly from that of jQuery on <select>.  <select> without the multiple attribute (a single selection) returns one value for ->val() (the last value).  With the multiple attribute, it returns an array of selections.
03:22 genio https://jsfiddle.net/4xg5pvn8/
03:23 genio I should have read back before commenting.  if this was already discussed, just tell me to shut it
03:24 genio wow, nevermind.  it was talked about already
03:24 * genio wanders off
03:34 Ptolemarch joined #mojo
04:28 Ptolemarch joined #mojo
04:40 davido_ joined #mojo
04:49 inokenty-w joined #mojo
05:15 cpan_mojo Statocles-0.055 by PREACTION https://metacpan.org/release/PREACTION/Statocles-0.055
05:18 bpmedley joined #mojo
05:23 Ptolemarch joined #mojo
06:03 dod joined #mojo
06:05 batman Grinnz: Does that mean I can revert your PR?
06:07 panshin joined #mojo
06:07 melo joined #mojo
06:08 Onigiri joined #mojo
06:08 dod joined #mojo
06:12 panshin joined #mojo
06:17 Ptolemarch joined #mojo
06:28 Vandal joined #mojo
06:35 sue joined #mojo
06:37 Onigiri joined #mojo
06:51 McA joined #mojo
07:06 PopeFelix joined #mojo
07:08 trone joined #mojo
07:11 Ptolemarch joined #mojo
07:30 berov joined #mojo
07:50 arthas joined #mojo
07:50 marcusr joined #mojo
07:58 berov joined #mojo
08:01 cpan_mojo Mojolicious-Plugin-I18NUtils-0.17 by RENEEB https://metacpan.org/release/RENEEB/Mojolicious-Plugin-I18NUtils-0.17
08:02 eseyman joined #mojo
08:05 Ptolemarch joined #mojo
08:39 t4nk246 joined #mojo
08:40 t4nk246 hello, is a good idea to have just only one instance of Mojo::UserAgent for whole application, or is better to create new instance for each task/request?
08:55 nic left #mojo
08:59 Ptolemarch joined #mojo
09:12 nic joined #mojo
09:19 sue joined #mojo
09:20 stephen joined #mojo
09:22 nic left #mojo
09:23 nic joined #mojo
09:23 batman t4nk246: depends. i have one case where i log in to a remote server with the ua, which again require me to have unique ua for each request
09:23 batman (because of the cookie jar)
09:53 Ptolemarch joined #mojo
09:56 melo joined #mojo
10:12 panshin joined #mojo
10:32 jabberwok joined #mojo
10:47 Ptolemarch joined #mojo
11:08 nicomen batman: now I ran into the issue I mentioned the other day, I can't do a < dbh->do(... mysqldump ...), so had to split on qr/;\n/, then running a CREATE TABLE statement that contains a FOREIGN KEY to a table that isn't created yet fails.
11:09 batman nicomen: oh. i haven't gotten around to release the version supporting that. please see if this could work for you: https://github.com/jhthorsen/dbix-tempdb/commit/218cbfe858bc6d5e94852645264ff0ad0a0aa82e
11:09 nic nicomen: Does "SET foreign_key_checks = 0;" help?
11:10 batman or... sorry, can we do this in a pm? i don't think it's very mojo related...
11:10 neilhwatson joined #mojo
11:11 nicomen nic: oh
11:11 nicomen batman: sure or #dbi ;D
11:39 dvinciguerra joined #mojo
11:42 Ptolemarch joined #mojo
12:21 dhg joined #mojo
12:36 Ptolemarch joined #mojo
12:40 ajr_ joined #mojo
12:42 dhg joined #mojo
12:49 gorfel joined #mojo
12:51 Shaeto joined #mojo
12:58 dhg joined #mojo
13:01 gorfel I'm using the Mojo::JSON to render an array of hashes to JSON, but bool values (true/false/0/1) are rendered as strings. How do I render them as bools (i.e. without the "s)? Is there a way to use the Mojo::JSON true or false functions to acheive this?
13:02 gorfel http://pastebin.com/aTeZA00h
13:02 Repaster Repasted text from gorfel: http://fpaste.org/270092/26939144/
13:04 Grinnz gorfel, where are the "bool values" coming from?
13:05 gorfel Grinnz: From a web form which stores the in a tinyint(1) data type in mysql.
13:06 Grinnz that's a number, not a boolean, but how does that turn into a string?
13:06 gorfel Grinnz: It is retrieved using DBIx::Simple query which outputs an array of hashes.
13:06 Grinnz you want to use Mojo::JSON::true/Mojo::JSON::false, or scalar references to represent true/false
13:07 Grinnz use Mojo::JSON qw(encode_json true false); say encode_json { 1 => true, 2 => false };
13:08 gorfel Grinnz: Thanks! I will give that a go.
13:08 Grinnz from 0 or 1 it's easy to turn that into true/false but its a bit weirder if they're turned into strings...
13:09 jontaylor joined #mojo
13:09 jberger Or constant references \1 and \0
13:09 jberger I don't see how they could turn into strings, there must be something else going on
13:10 nic that's what DBI drivers do by default
13:10 Grinnz DBI drivers don't turn 1/0 into "true"/"false"
13:10 nic "1"/"0"
13:11 Grinnz yeah, that would be fine
13:11 Grinnz but his paste had "true"
13:11 nic oh, I didn't look at that
13:11 gorfel Sorry, I posted a wrong JSON string. Here is the correct one: http://pastebin.com/fFcYrvuQ
13:11 Repaster Repasted text from gorfel: http://fpaste.org/270107/14429275/
13:12 nic yep, that's what we were expecting ;)
13:13 nic you can 'map' over your result set
13:13 Grinnz $_->{allday} = $_->{allday} ? true : false for @$rfc_kal_events;
13:13 nic heh, beat me to it
13:14 Grinnz for > side effect map :P
13:14 nic agreed
13:15 nic I meant 'map' as an abstract operation; using 'for' is my preferred implementation of that
13:18 gryphon joined #mojo
13:21 batman any AssetPack users here? i really want to remove the "in memory asset" feature. does any of you use that?
13:21 Ptolemarch joined #mojo
13:21 gorfel Wow. Thanks Grinnz! I need to read about the default variable and how you utilized it here.
13:22 gabiruh joined #mojo
13:22 dhg joined #mojo
13:27 t4nk246 please can you help me how to synchronize many async user agent calls with delay?
13:27 bpmedley t4nk246: I'll try.  Do you have some example code to start with, or do you want an example?
13:31 genio t4nk246: https://metacpan.org/pod/Mojo::UserAgent   In the synopsis, there is an example of just that.
13:32 genio If you're wanting something different, explain a little about what your goals are and hopefully someone can help
13:32 genio The part in the synopsis I'm referring to is under the comment     # Non-blocking concurrent requests
13:37 Grinnz there are also some examples in the cookbook, like https://metacpan.org/pod/Mojolicious::Guides::Cookbook#Synchronizing-events
13:37 Grinnz that's an example for using delays from an application, where you usually should use the delay helper
13:40 t4nk246 i dont now how to desing method with delay argument
13:41 bpmedley t4nk246: Would you like an example that reads in the URLs via a file?
13:42 t4nk246 i dont know if i should call $delay->begin in method
13:44 t4nk246 or just pass delay to user agent get method
13:44 batman about the assetpack question: https://twitter.com/jhthorsen/status/646318999387643904
13:52 bpmedley t4nk246: https://bitbucket.org/snippets/bpmedley/KA49j <-- Does this help?
13:57 t4nk246 i need to call in loop method a which will call useragent sync get, and in the end of loop wait for all async will finish
13:57 Dandre joined #mojo
13:57 bpmedley t4nk246: Would you pastie some code?
13:59 t4nk246 i will try
14:04 cpan_mojo Test-Mojo-Role-SubmitForm-1.001003 by ZOFFIX https://metacpan.org/release/ZOFFIX/Test-Mojo-Role-SubmitForm-1.001003
14:04 t4nk246 hmm i cant because i dont understand it
14:05 bpmedley Moment
14:07 mishanti1 batman: The in-memory-feature is actually what entices us to use AssetPack. Have not started using it, but that there is one if its most appealing features.
14:08 batman mishanti1: could you explain why?
14:08 Grinnz_ t4nk246: see if this helps: https://metacpan.org/pod/Mojo::IOLoop::Delay#begin
14:09 mishanti1 batman: Because it lets us deploy and not worry about the app having to write stuff elsewhere in the filesystem.
14:09 Grinnz_ t4nk246: essentially, you want to call $ua->get($url, $delay->begin); for each request you want to sync up, all in the first step of the delay
14:09 Grinnz_ t4nk246: then the second step will get the $tx from each request in the order you called $delay->begin
14:10 Grinnz_ t4nk246: it won't call the second step until every $delay->begin callback has been called
14:10 mishanti1 batman: So, it is just a trivial deployment thing, but if we have to deal with that during deployment anyway we might as well skip assetpack have it as a proper deploy-step.
14:10 batman mishanti1: but how can you guaranty that it will work? i mean, the destination system might not have less, sass, riot, coffescript, jsx, ...
14:10 mishanti1 batman: The SCM ensures all needed tooling is installed and available.
14:11 mishanti1 Gah.
14:11 mishanti1 Fingers not cooperating with brain.
14:12 mishanti1 My spelling and punctuation tend to slip up.
14:13 batman mishanti1: what about all the temp files generated by tools such as sass?
14:13 Ptolemarch joined #mojo
14:13 dustinm joined #mojo
14:14 mishanti1 batman: All things that can get cleaned up during deployment, as with automatic builds of other things.
14:14 t4nk246 Grinnz_: and how to get the final end for all calls?
14:14 Grinnz_ what's "the final end"?
14:14 hernanGOA joined #mojo
14:14 t4nk246 when whole loop end
14:14 batman mishanti1: but you're not using the feature yet, right?
14:15 Grinnz_ when the second step is called, all of the requests have ended already
14:15 batman mishanti1: please comment on the mailing list, so i don't forget about it
14:16 batman this sucks. i hope there's not many more people using it :( it's an awful lot of work making it work without bugs, and i don't want to maintain it...
14:16 mishanti1 batman: Nope, not using assetpack yet. Stuck on 3.97, working toward an upgrade. Plan was to start using AssetPack after upgrading mojo.
14:16 batman i still haven't been able to deploy an app with assetpack successfully @ work even once :/
14:17 bpmedley batman: Perhaps just put a "DEPRECATED: Patches welcome" message in the next version?
14:17 batman bpmedley: yeah... need to see if anyone actually been using it successfully first.
14:17 bpmedley t4nk246: Does Grinnz_ explanation and the code snippet help?
14:17 mishanti1 batman: I fully understand your desire to remove it, and I absolutely think that you should remove it if keeping it means perhaps over time making AssepPack unmaintainable.
14:18 batman mishanti1: i still think AssetPack is worth using. starting gulp is too much extra work for me :)
14:18 Grinnz_ i looked at using assetpack, but the frontend guys already have a system set up for that stuff, so i let them handle it ;)
14:18 batman Grinnz_: yeah. if they only do frontend (not starting morbo or whatever) then it's not any reason to change
14:19 jberger batman: we are using assetpack at work, but not the memory asset
14:20 batman jberger: \o/ thanks
14:20 jberger at the moment we are using it very simply for reducing the number of assets transmitted, the front-end dev builds his css from whatever he's using before committing
14:21 jberger but we hope to even start using those features at some point here
14:23 bpmedley jberger: A blocking Mojo::UserAgent will block because its Mojo::IOLoop instance will run to completion before the IOLoop singleton gets to "tick" again.  Is that correct?
14:25 jberger yes
14:25 mattastrophe joined #mojo
14:25 jberger that loop has to stop before the other will get another tick
14:25 jberger not from any magic
14:25 bpmedley Woohoo!  Thanks for the explanation the other day.  I've never understood that.
14:26 jberger its just the extreme case of "never block a running ioloop" done intentionally
14:26 mattastrophe joined #mojo
14:30 jberger hehe: https://twitter.com/xbs/status/626781529054834688
14:42 bpmedley_ joined #mojo
14:48 Onigiri So I was thinking of calling a sub in a controller from a task to perform it, bad idea?
14:49 bpmedley_ Onigiri: I'd have to see a smallish example app.
14:50 Onigiri This was for a minion setup, I was attempting to keep all the code that interacted with a specific offsite webservice in the same file
14:50 Grinnz_ Onigiri: usually even better to factor the common code into a separate module or helpers
14:51 Onigiri Grinnz_: yeah, was just being a bit lazy, I guess
14:52 kanishka joined #mojo
14:53 kanishka joined #mojo
14:53 jberger Onigiri: agreed, this is where helpers shine
14:54 kanishka joined #mojo
15:01 PryMar56 joined #mojo
15:05 disputin joined #mojo
15:27 sh4 joined #mojo
15:29 zackiv31 joined #mojo
15:34 jontaylor joined #mojo
15:34 * sri yawns
15:35 sri so any more thoughts on Mojo::DOM::val?
15:38 dhg joined #mojo
15:39 dvinciguerra joined #mojo
15:40 meshl joined #mojo
15:42 ajr_ joined #mojo
15:44 disputin joined #mojo
15:53 Ptolemar_ joined #mojo
15:53 jontaylor joined #mojo
16:00 sri oh, interesting stuff about the performance of http/2 https://news.ycombinator.com/item?id=10256462
16:00 sri never thought about how a dropped packet will stall the everything
16:01 sri the downside of multiplexing everything over a single socket
16:01 sri s/the//
16:06 Dandre joined #mojo
16:14 jberger "Ironically, the biggest sufferer is Google with a 20.2% increase in ToW for their search homepage"
16:14 jberger nice
16:15 jberger also, I didn't know that computing got published on arxiv
16:35 jontaylor joined #mojo
16:39 Ptolemarch joined #mojo
16:42 vanHoesel joined #mojo
16:43 thowe joined #mojo
16:44 sri allright, so i'm assuming everyone is fine with the current return values of Mojo::DOM::val, arrayref of zero or more strings for <select>, and string/undef for everything else
16:46 sri just to reiterate one last time, the <select> behavior differs slightly from jquery, where it returns an array or null for <select multiple>, and string or null for <select>
16:48 ZoffixWork joined #mojo
16:49 ZoffixWork sri, definite +1 for me. Works great in my SubmitForm test role
16:50 Onigiri Hmm, any way to set a max concurrency per task for the minion jobs?
16:56 batman sri: +1 on val() from me as well
16:59 batman or... maybe return string from select, unless "multiple"
16:59 sri that's a clear majority
16:59 sri eeep
16:59 batman sorry :/
16:59 sri you man string or undef
16:59 sri mean
16:59 batman yes
17:00 dod joined #mojo
17:00 sri that's what i was asking
17:00 pink_mist so, arrayref of zero or more strings for select multiple, and string/undef for everything else?
17:01 ZoffixWork That would leave 3 cases to test for!
17:01 batman i think the most common case is just a string/undef from <select>, so i think i want that to be convenient
17:03 disputin joined #mojo
17:03 batman i don't want array or null though.
17:04 batman but... i guess you can cancel me out since i haven't been part of the discussion
17:04 batman you all probably has fine reasons for returning [], but i hope it's not because of LoC
17:05 ZoffixWork What's LoC?
17:05 batman lines of code
17:06 ZoffixWork No, my reason is always returning an arrayref is 1 predictable value, while doing string/undef/arrayref leaves three possibilities. To figure out what you got
17:07 batman sure, but it would be consistent. returning string because you have one value would not be consistent. returning string because <select> lacks the "multiple" attribute would be
17:08 sri for the record, it costs 2 lines
17:09 batman is that a reason for not doing it or just stating a fact?
17:10 jberger what does jquery do?
17:10 genio As an end-user, I'd prefer that it adhere to the way set by jquery
17:10 ZoffixWork returns null
17:10 jberger it returns null if multiple is set?
17:10 genio <select> without multiple attribute returns string or null.   <select> with multiple attribute returns array or null
17:11 genio and a singular select returns the last value with the selected attribute
17:11 jberger I can get on board with change of behavior with multiple, but I think I'd just want an empty arrayref
17:11 sri patch could look like this https://gist.github.com/anonymous/0a77f093a158137c86db
17:11 jberger my $0.02
17:12 genio jberger: https://jsfiddle.net/4xg5pvn8/  jQuery example
17:12 trone joined #mojo
17:12 batman sri: is ->to_array->[0] the same as ->first?
17:12 sri jquery returns null for a <select multiple> with no selected values
17:13 sri that's a no go for me, i'm changing my vote to -1
17:13 batman sri: you've already changed it to -1 or -1 _if_ we want return undef with no selected values?
17:14 sri i think it's getting too messy again for me
17:14 batman sri: i totally agree on return [] if no selected values and "multiple"
17:14 sri so this might be a general -1
17:14 ZoffixWork I think jQuery's way is good:   for multiple:  return undef on no values/arrayref on values;    for single:  return undef on no values/string on value;
17:14 batman i'm fine with either string return or return [], just wanted to state my opinion.
17:15 ZoffixWork So for singles you're consistent with the rest of the controls and if you are handling multiple values, the "no value" case is still consistent with the rest of the controls, but the multiples is now an arrayref.
17:15 bpmedley_ Onigiri: What you might do is start one minion worker for task A and another for task B.  Then set the concurrency level of each worker.  Does that make sense?
17:16 batman ZoffixWork: that's a -1 from me. i want it to always have the same return value type.
17:16 batman as in scalar vs array ref
17:16 batman that is very consistent with the rest of mojo
17:17 batman sri: just for the record: i'm still +1 on the val() that is already committed to master
17:17 batman but i think i would be +2 on https://gist.github.com/anonymous/0a77f093a158137c86db :)
17:17 Onigiri bpmedley_: That'll get a bit wonky with n tasks though.
17:18 sri batman: that doesn't match your other statements
17:18 bpmedley_ Onigiri: I believe you can listen for multiple tasks.  Would that make things less wonky?
17:18 ZoffixWork batman, but isn't it what I described?
17:18 batman sri: the +1/+2 statement?
17:18 sri there is no patch for undef returned for <select multiple>
17:18 ZoffixWork The +2 commit you linked to
17:18 sri that's what you argued for
17:18 batman ZoffixWork: i thought you said you wanted undef if []
17:19 sri this is the confusion i meant
17:19 batman i don't want undef instead of []
17:19 Onigiri bpmedley_: after the project is wrapped up, sure. Would be awesome to have a flag to do all tasks but the listed ones.
17:19 sri behavior is too complicated, we can't even get straight what people vote for ;p
17:19 genio Actually, thinking about it, I don't see a reason to return undef.  an empty string and empty array ref should be ok.
17:19 ZoffixWork batman, you know what you say makes sense. Then you don't need to test whether you can safely deref it.
17:19 genio it still keeps a string for a single select and an array ref for a multiple, which may be too much.
17:19 batman ZoffixWork: exactly.
17:19 ZoffixWork Then (even though I don't get votes), I'm +1 on the commit batmant +2ed :)
17:20 batman sri: i think the +1 / +2 statement i gave sums up what i mean.
17:21 sri you guys keep referencing earlier statements from each other
17:21 sri it's very confusing
17:21 batman sri: this is my +2: return array ref from <select multiple> and scalar from everything else
17:22 batman +1 is return array ref from <select> and scalar from everything else
17:22 batman array ref = multiple, everything else isn't imho
17:23 bpmedley_ Onigiri: What would the command look like?  Basically, you want -T (handle any task that is not these).  Correct?
17:24 Onigiri bpmedley_: basically, yeah.
17:25 bpmedley_ sri: Would that be a good addition to Minion?  The -T flag?
17:25 sri bpmedley_: i'm kinda busy with the ::val vote here
17:26 sri bpmedley_: so, i have to say no
17:26 bpmedley_ I'd be happy to make a pull request.
17:26 bpmedley_ Irr, I see.  Nevermind.. ;)
17:26 sri reading the backlog again, i really can't figure out who voted for what anymore
17:27 sri sooo many references
17:27 ZoffixWork sri, batman and I voted this: https://gist.github.com/anonymous/0a77f093a158137c86db
17:27 ZoffixWork I'm not sure who else voted
17:28 batman jberger seems not to have voted. not sure what the two cents are for...
17:29 jberger I'm generally for a val() method, I most care about its ability to easily be reused in form =>
17:29 batman jberger: what do you think about 0a77f093a158137c86db above?
17:29 sri btw. it does not have to cost 2 lines https://gist.github.com/anonymous/fed493669bc5ec64706b
17:29 jberger I, like others, think that if select will be handled differently based on multiple, then multiple should always return []
17:30 jberger sri: that one looks nice
17:30 batman who is others?
17:30 jberger sri and you
17:30 jberger for a start
17:31 batman ah. right. so me, jberger and ZoffixWork is +1 on fed493669bc5ec64706b
17:31 sri ok, to sum it up, we have consensus on handling <select> like all the others, returning string/undef, and only making <select multiple> return an arrayref
17:31 sri what we have no consensus on yet, is if <select multiple> should always return an arrayref or arrayref/undef
17:32 ZoffixWork I think we have concensus on that as well.
17:32 ZoffixWork always arrayref
17:32 jberger I know who I would ask about that, but he's been banned from the channel :'(
17:32 sri allright, i'd like to see votes on that then
17:32 batman sri: me, ZoffixWork and jberger are +1 on _always_ returning [] if "multiple"
17:33 genio jberger: You can always ask him outside of this channel :)
17:34 jberger since as sri has mentioned before, form => {my_multiple => []} gets treated correctly, I'm +1 on multiple returning []
17:36 sri i think the main worry here is default values
17:36 sri form => {foo => $foo->val // ['foo', 'bar']}
17:39 sri (this can also be done with no extra lines btw.)
17:40 batman i'm pretty sure i still want []
17:41 ZoffixWork form => {foo => $foo->val->@* ? $foo->val : ['foo', 'bar'] } # doesn't look too bad IMO
17:41 sri that's two invocations for $foo->val
17:41 tcohen joined #mojo
17:41 batman ZoffixWork: means you have to call the val() method twice
17:41 * batman is too slow! :D
17:42 sri actually rather expensive, starting the css selector engine many more times
17:44 batman is form => {my_multiple => []} the same as form => {my_multiple => undef} ?
17:44 ZoffixWork form => {foo => @{[$foo->val->@*, 'foo', 'bar']}[0,1] }
17:44 ZoffixWork :D
17:45 ZoffixWork Oh, there *is* postfix slicing
17:45 sri batman: not currently
17:46 batman ok.
17:46 ZoffixWork sri, what's the difference?
17:46 sri foo => [] results in no pair, while foo => undef results in warnings and foo=
17:47 batman i think return [] is better than undef then
17:47 sri that's short sighted
17:48 sri we could just as well make foo => undef do what we want
17:48 tcohen can anyone take a look at this? http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=42086
17:49 batman true...
17:49 tcohen is it kosher to load it under plack like this? http://paste.koha-community.org/77
17:52 neilhwatson joined #mojo
17:53 berov left #mojo
17:54 sri all it takes to make foo => undef a thing https://gist.github.com/anonymous/9bc635ccd44c56d2817c
17:55 sri oops
17:55 batman sri: the append() change seems strange...
17:55 ZoffixWork :P
17:55 sri no wait, no oops
17:56 sri i was just looking at the wrong patch
17:56 sri batman: how so?
17:56 genio sri: $v->last instead of $v->first, no?
17:57 ZoffixWork genio, doesn't matter, does it? In that case, there should be just one value.
17:57 sri the append() change replicates the behavior for arrrayref
17:57 batman sri: nevermind. i read it wrong :(
17:57 sri which loops over the array and adds pairs
17:59 genio ZoffixWork: I'm probably misreading, but no.  Even if it doesn't have the "multiple" attribute, many <option> tags can have the "selected/checked" attribute.  jQuery returns the last such in that circumstance, not the first.
18:06 ZoffixWork Palemoon also uses the last selected value to set the selected state.
18:07 ZoffixWork Anyway :)
18:07 * ZoffixWork goes back to hacking AutoIt3 scripts.
18:07 good_news_everyon joined #mojo
18:07 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/vn2xz
18:07 good_news_everyon mojo/master 1b35296 Sebastian Riedel: handle select elements a little different
18:07 good_news_everyon left #mojo
18:09 sri this should be equal to jquery now
18:10 genio sri++ \o/
18:13 sri phew... who would have thought that such a tiny method could cause this much headache
18:13 sri and only to end up with the exact same semantics as jquery -.-
18:16 asm35 joined #mojo
18:17 sri although we do not have consensus on the last version yet
18:18 sri i actually think jberger and batman are wrong about always using an arrayref here
18:18 sri because of the default value use case
18:18 sri form => {foo => $dom->val // ['foo', 'bar']}
18:19 sri an empty arrayref adds no value here as far as i can see
18:20 sri and foo => undef is a noop now, just like foo => []
18:20 sri it just gets ignored by the form builders
18:29 jberger I can accept that (with the noop added)
18:31 jberger I would probably like an example like
18:33 jberger for (@{ $dom->at('select[multiple]')->val || [] }) { ... }
18:34 jberger But I can live without it if there isn't a good place to put it
18:35 sri i think the important part is that there's no special case where <select multiple> returns just a string
18:35 sri that's where checks get confusing
18:38 good_news_everyon joined #mojo
18:38 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/vnaml
18:38 good_news_everyon mojo/master b40b945 Sebastian Riedel: no need for redundant examples
18:38 good_news_everyon left #mojo
18:38 sri now it's consistently string/undef or arrayref/undef
18:40 jberger I see what you mean
18:42 sri closest thing to a special case is <textarea>, which is by nature never undef, just an empty string
18:44 sri but that's allright
18:46 jberger yeah, I have no problem with that
18:47 sri i'm +1 on it again, since everything seems consistent to me
18:50 good_news_everyon joined #mojo
18:50 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/vnaGo
18:50 good_news_everyon mojo/master 5b34e33 Sebastian Riedel: mention undef for select with multiple attribute too
18:50 good_news_everyon left #mojo
18:54 KindOne joined #mojo
18:57 ZoffixWork joined #mojo
19:01 batman +1 from me as well.
19:02 KindOne joined #mojo
19:17 ZoffixWork joined #mojo
19:20 panshin joined #mojo
19:32 dvinciguerra joined #mojo
20:01 sri bpmedley_: i don't see much value in a -T option for the worker command
20:03 sri what reason is there to exclude certain tasks?
20:03 Onigiri sri: my specific need is to ensure one task has a max concurrency of 2, another of 1, and the remainder can be whatever.
20:04 Onigiri bp's suggestion was to run multiple workers with -t/-j. The final one would wind up with a rather sizeable -t list.
20:05 sri why?
20:06 Onigiri Resources for schedule generation for limit of 2, and hitting an external web service that's rather picky about multiple connections.
20:08 sri you could use a mutex and keep all but two jobs idle until it is their turn
20:14 disputin joined #mojo
20:17 sri i guess using separate workers does make sense too, but it's not really a common enough use case to desrve its own command line option imo
20:18 Onigiri I've got multiple machines for this already, so separate workers seems the best solution for me.
20:22 hernanGOA joined #mojo
20:24 asm35 joined #mojo
21:04 mattastrophe joined #mojo
21:33 neilhwatson joined #mojo
21:47 dvinciguerra joined #mojo
22:05 good_news_everyon joined #mojo
22:05 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/vnVFg
22:05 good_news_everyon mojo/master 5dd03aa Sebastian Riedel: rephrase description of val method
22:05 good_news_everyon left #mojo
22:08 good_news_everyon joined #mojo
22:08 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/vnVb3
22:08 good_news_everyon mojo/master b42c294 Sebastian Riedel: use val method in test
22:08 good_news_everyon left #mojo
22:44 disputin joined #mojo
23:03 meshl joined #mojo
23:44 disputin joined #mojo
23:45 disputin1 joined #mojo
23:46 disputin joined #mojo
23:48 disputin1 joined #mojo

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