Camelia, the Perl 6 bug

IRC log for #mojo, 2013-10-14

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

All times shown according to UTC.

Time Nick Message
00:16 basiliscos joined #mojo
00:24 tba_ joined #mojo
01:07 laouji joined #mojo
02:03 basic6 joined #mojo
02:58 dotandimet joined #mojo
03:30 russum joined #mojo
03:47 preflex_ joined #mojo
04:59 kanishka joined #mojo
05:39 kanishka left #mojo
05:48 batman i wonder what the difference between save() and update({_id:...},{...},{ upsert:true}); is...
05:52 kanishka joined #mojo
05:54 crab one makes you feel silly by typing "upsert"
05:55 Lee joined #mojo
05:55 batman :P
05:56 tianon save is a complete replacement, where upsert can be an update of only certain properties but insert with said properties if the _id doesn't exist yet
05:57 tianon basically, you can't use update operators like $set or $inc in ->save()
05:58 tianon ie: $db->nicks->update({ _id => 'tianon' }, { '$inc' => { mentions => 1 } }, { upsert => true });
05:58 tianon the first time, that'll create a document with _id tianon, and a mentions value of 1
05:58 tianon the second (etc.) time, it'll just add one to the mentions value already in the database
05:59 tianon and then if I add other fields to _id tianon, they don't get blased away if I run that line again, because I used an update operator instead of replacing the whole object
05:59 crab wow, an actually useful answer. /me hangs his head in shame
05:59 dabudabu joined #mojo
06:00 * tianon feels useful for half a second, then remembers that sri already set him on fire, and burns again
06:01 rem_lex|pivo joined #mojo
06:01 batman tianon: yeah, i know you can't use operators. that's why i was thinking i would use update(...) under the hood in mandel
06:02 batman i think it's a really bad idea actually, but maybe i should add {upsert:true} to my patch() method.
06:03 tianon indeed - operators are useful for little stuff, but especially for preserving fields you might not have even known about yet at the time you wrote the initial bit of code
06:03 tianon I wish I had a dollar for every time I forgot to use $set and wiped out data
06:04 tianon now I just force my coworkers to proofread any ad-hoc queries for little mistakes like that :)
06:04 KindOne joined #mojo
06:04 batman yeah, that's what i'm thinking. i want to (ab)use '$set'
06:05 Vandal joined #mojo
06:05 batman do you know if there's any (major) penalty for doing upsert ?
06:16 batman jberger: https://github.com/jhthorsen/mandel/commit​/bbfb160f35fc28b3b09da1951717363c2c9e5e4e # i think this makes more sense
06:23 batman and https://github.com/jhthorsen/mandel/commit​/d3b8efa57f9a7915a9454dc853524ae10d5bec3d#​diff-1d0d82da654eeb5f4bde7dde119cf010R191
06:23 batman feedback are more than welcome
06:23 batman tianon: ^
06:35 batman i think ::Collection->patch() makes a lot more sense now. having a collection method only working on a single document..? that was crazy :)
06:44 trone joined #mojo
06:45 davido joined #mojo
06:49 highflying joined #mojo
06:57 buu_ joined #mojo
07:04 hummeleBop joined #mojo
07:15 kanishka joined #mojo
07:41 Dandre1 joined #mojo
07:53 basiliscos joined #mojo
08:16 themage joined #mojo
08:22 dod joined #mojo
08:31 * sri yawns
08:38 sri marcus: i like airmail btw
08:39 dod joined #mojo
08:52 Dandre joined #mojo
08:53 sri and this is why we keep the expires value in the session cookie http://maverickblogging.com/logout-is-broken​-by-default-ruby-on-rails-web-applications/
09:01 crab well, that doesn't totally eliminate the problem, does it? there's still a window between when you logout and the earlier cookie's expiration time when the server can't detect if someone just resends the earlier value
09:03 crab and if they do so, we'd advance expired and send a new cookie
09:03 sri which is why we default to 1 hour expiration
09:12 maxhq joined #mojo
09:23 d4rkie joined #mojo
09:39 fhelmber_ joined #mojo
09:45 jpn joined #mojo
10:03 root joined #mojo
10:03 root joined #mojo
10:09 kanishka joined #mojo
10:19 maxhq joined #mojo
10:27 maxhq joined #mojo
10:28 maxhq joined #mojo
10:29 maxhq joined #mojo
10:32 mire_ joined #mojo
10:34 maxhq joined #mojo
10:35 fhelmbe__ joined #mojo
10:44 k0xa joined #mojo
10:45 mire__ joined #mojo
10:54 maxhq joined #mojo
10:57 maxhq joined #mojo
10:58 maxhq joined #mojo
11:04 maxhq joined #mojo
11:08 maxhq joined #mojo
11:31 f-hauri joined #mojo
11:41 mire__ joined #mojo
12:17 hrupp joined #mojo
12:39 rhaen hep mojo
12:40 kwa joined #mojo
13:13 D4RK-PH0ENiX joined #mojo
13:31 tianon batman: sorry, just got a chance to review - the changes make sense tome
13:32 batman no problem :)
13:32 batman thanks for the feedback
13:32 asarch joined #mojo
13:33 tianon batman: but in the context of MongoDB _performance_, it makes the most sense to have lots of small documents - inserts are almost always going to be faster than updates, due to the sequentially-written journal
13:34 dqw10 joined #mojo
13:34 tianon if you do it right, inserts can be practically free, while updates require an index/table scan, and potentially even allocating more memory for the document
13:34 batman i thought it depended on the size of the document before/after the update. wouldn't it be quite fast to change {"age":25} to {"age":26} ?
13:34 tianon it would certainly be faster than adding the field, yes
13:35 batman but adding {"life_story":"..."} where "..." is 2MB text string would be slow?
13:35 batman right
13:35 tianon but inserting a new document with either of those would be basically free, because the disk heads are already at the end of the journal file
13:35 batman that's why i'm adding defaults to all my documents: avoiding changing the size too much
13:36 tianon indeed, that sounds prudent to me
13:36 batman oh. could it even be faster to delete+create?
13:36 batman than update?
13:36 tianon not necessarily, because you've still got to scan for the data to delete it
13:36 tianon and it makes things a little harder to understand, too
13:37 batman ok :)
13:37 tianon and if you were going to do that, you might as well just switch to save() :)
13:37 batman sounds like i'm on the right path then.
13:37 batman true
13:37 tianon because that's exactly how save() works :P
13:37 tianon delicate balance between flexibility, magic, and performance
13:38 batman :)
13:41 bluescreen joined #mojo
13:44 btyler joined #mojo
14:00 kanishka joined #mojo
14:01 punter joined #mojo
14:20 gryphon joined #mojo
14:29 abhishekisnot joined #mojo
14:37 sh4 joined #mojo
15:14 mire__ joined #mojo
15:22 kanishka joined #mojo
15:34 rem_lex| joined #mojo
15:41 jberger_ joined #mojo
15:41 dqw10 joined #mojo
15:42 dqw11 joined #mojo
15:43 jberger_ mst or anyone: does SQL::Abstract have a LIMIT clause?
15:45 batman jberger_: { rows => 60, page => 1 } # not sure if this is dbic or sql-abstract...
15:46 jberger_ I have seen that in the dbic manual, but I can't find it in SQL::Abstract, I wonder if DBIC hacks that on top
16:00 TheCrimsonRadish joined #mojo
16:11 kanishka joined #mojo
16:19 d4rkie joined #mojo
16:25 TheCrimsonRadish joined #mojo
16:31 crab joined #mojo
16:33 asarch joined #mojo
16:34 d4rkie joined #mojo
16:51 dvinciguerra__ joined #mojo
17:22 alnewkirk jberger_: https://metacpan.org/module/DBIx​::Class::SQLMaker::LimitDialects
17:36 mire__ joined #mojo
17:38 dvinciguerra__ joined #mojo
17:55 buu_ I just installed mojo on my router =]
17:58 TheCrimsonRadish joined #mojo
18:13 basiliscos joined #mojo
18:14 batman https://github.com/jhthorsen/mandel/commit​/b0094e736f71d8cb65c7542a8f85b084fe553fcd#​diff-1d0d82da654eeb5f4bde7dde119cf010R205
18:14 batman ^ any idea how to make #123 simpler?
18:18 batman sri: could i do local $data->{_id}; delete $data->{_id}; instead? will mango do a deep copy of the structure when i call update() ?
18:24 batman no... doesn't seem to work
18:30 good_news_everyone joined #mojo
18:30 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/8YrEMg
18:30 good_news_everyone mojo/master 13c0507 Sebastian Riedel: improved IIS compatibility of Mojo::Server::CGI (closes #546)
18:30 good_news_everyone left #mojo
18:32 good_news_everyone joined #mojo
18:32 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/_5lxuA
18:32 good_news_everyone mojo/master ee519e0 Sebastian Riedel: comment tweaks
18:32 good_news_everyone left #mojo
18:46 psimanx1 joined #mojo
18:49 kanishka1 joined #mojo
18:59 dod joined #mojo
19:16 Mike-PerlRecruiter_ joined #mojo
19:17 dotandimet joined #mojo
19:27 bowtie_ joined #mojo
19:31 marcus joined #mojo
19:32 wsri joined #mojo
19:37 TheCrimsonRadish joined #mojo
19:38 dotandimet joined #mojo
19:43 gryphon joined #mojo
19:45 ascent joined #mojo
20:36 lukep joined #mojo
21:05 rem_lex|pivo joined #mojo
21:19 * sri wonders how usable chrome for ios is, could be nice for bookmark syncing
21:20 TheCrimsonRadish joined #mojo
21:20 howitdo is it possible to render and have output saved to a scalar versus being sent to the browser?
21:26 howitdo i'm trying to figure out a good way to save a render form to be displayed later. E.g. display_form -> submit button pressed -> display_confirmation_screen -> "make changes" button pressed -> redisplay filled in form
21:26 howitdo s/render/rendered/
21:35 sri batman: shouldn't is_changed be called has_changed?
21:37 bpmedley howitdo: http://mojolicio.us/perldoc/Mojolicio​us/Guides/Rendering#Partial_rendering
21:38 howitdo bpmedley: yes, thanks for reminding about that function!
21:40 batman sri: not sure actually... should it?
21:43 bpmedley buu_: What router?
21:44 buu_ bpmedley: rt-ac68u
21:44 bpmedley Nice
21:46 dvinciguerra__ joined #mojo
21:55 bpmedley https://github.com/brianmed/spa​rky/blob/master/sparky.pl#L609  <-- Do I have an error in my __DATA__ for the jquery.mobile-1.3.1.css?
22:12 russum joined #mojo
22:27 bpmedley Fixed it..
22:32 batman sri: a friend of mine only use chrome on iOS
22:33 batman And I think "has" is better than "is".
22:33 batman Too bad I'm not a native speaker.
22:58 denisboyun joined #mojo
23:02 TheCrimsonRadish joined #mojo
23:06 denis_boyun__ joined #mojo
23:10 denisboyun joined #mojo
23:15 basic6 joined #mojo
23:20 buu joined #mojo
23:24 sri oh
23:25 sri turns out our tls defaults are currently rather insecure, since IO::Socket::SSL didn't actually support perfect forward secrecy until a few days ago
23:26 sri to turn it on we would have to set a ecdh curve... but if we do that we require openssl 1.0+
23:26 sri a hard dependency
23:26 asarch joined #mojo
23:28 da5id joined #mojo
23:29 batman Could you make it optional for now? By use Mojo::IOLoop 'ssl1.0'; or something?
23:29 sri how?
23:29 batman Not that, but you get the idea.
23:29 sri no i don't
23:30 batman Thought you said something about defaults... I thought it was a question of back compat...
23:30 batman I think security is more important than compatibility.
23:31 rhaen joined #mojo
23:33 basiliscos joined #mojo
23:33 batman I need to get some sleep :/
23:34 batman Take care
23:41 good_news_everyone joined #mojo
23:41 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/zvxJFA
23:41 good_news_everyone mojo/master 3c78471 Sebastian Riedel: improved compatibility with IO::Socket::SSL 1.955
23:41 good_news_everyone left #mojo
23:42 sri this is more a guess... only real world testing can show how well it works
23:42 jnbek joined #mojo
23:42 sri guessing when it comes to security sucks... but IO::Socket::SSL is to blame for this situation
23:49 good_news_everyone joined #mojo
23:49 good_news_everyone [mojo] kraih tagged v4.47 at 4da1210: http://git.io/kB9iMQ
23:49 good_news_everyone left #mojo
23:50 rhaen joined #mojo

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