--- Log opened Wed Jun 08 00:00:32 2016 |
00:04 | | Derakon[AFK] is now known as Derakon |
00:05 | | gnolam [quassel@Nightstar-t2vo1j.tbcn.telia.com] has quit [[NS] Quit: Z?] |
00:20 | | Reiv [NSwebIRC@Nightstar-q8avec.kinect.net.nz] has quit [Ping timeout: 121 seconds] |
00:22 | | Reiv [NSwebIRC@Nightstar-q8avec.kinect.net.nz] has joined #code |
00:22 | | mode/#code [+o Reiv] by ChanServ |
00:30 | | Turaiel[Offline] is now known as Turaiel |
00:42 | | Vornicus [Vorn@ServerAdministrator.Nightstar.Net] has quit [Connection reset by peer] |
00:52 | | Shady [ShadyGuru@Nightstar-ut3scg.t132.ptd.net] has joined #code |
01:43 | | thalass [thalass@Nightstar-283.o7s.158.104.IP] has joined #code |
01:43 | | mode/#code [+o thalass] by ChanServ |
05:06 | | Derakon is now known as Derakon[AFK] |
05:10 | | catadroid` [catadroid@Nightstar-ugedcl.dab.02.net] has joined #code |
05:12 | | catadroid [catadroid@Nightstar-s5gesh.dab.02.net] has quit [Ping timeout: 121 seconds] |
05:18 | | Turaiel is now known as Turaiel[Offline] |
05:31 | < Shady> | Hello. I currently use HexChat, and I wanna recommend it to someone else. Does anyone have the download link? |
05:34 | | Reiv [NSwebIRC@Nightstar-q8avec.kinect.net.nz] has quit [Ping timeout: 121 seconds] |
05:57 | | * Shady forgot he posted here, used google already, found it |
05:58 | <&McMartin> | Hooray |
06:07 | < Shady> | Almost have her here :P |
06:07 | < Shady> | Well, a different channel |
06:15 | | * catadroid` spins |
06:15 | | catadroid` is now known as catadroid |
06:15 | < Shady> | Wow, massive change, I don't even recognize you now o.o |
06:15 | | Alek [Alek@Nightstar-9qtiqv.il.comcast.net] has quit [Ping timeout: 121 seconds] |
06:16 | <@celticminstrel> | XD |
06:18 | < catadroid> | ... |
06:19 | | catadroid is now known as elayne |
06:54 | <@abudhabi> | You can obtain electricity with an appropriate device and putting it next to a power line, by induction, yes? |
06:57 | < elayne> | What's your base case? |
06:57 | <@ErikMesoy> | This sounds like the start of a bad idea. |
06:58 | <@abudhabi> | My coworkers were talking about somehow making a drone recharge from landing on power lines. |
06:59 | <@abudhabi> | I argued that it probably would involve very heavy transformers for the high voltage lines, but I'm not 100% sure I'm right. |
07:01 | | Crossfire [Z@Nightstar-r9lk5l.cust.comxnet.dk] has quit [Ping timeout: 121 seconds] |
07:01 | <@ErikMesoy> | Sounds like a slightly less bad idea, but definitely possible if you throw enough engineers at it. |
07:36 | | Shady [ShadyGuru@Nightstar-ut3scg.t132.ptd.net] has quit [[NS] Quit: Yay, he's gone] |
07:46 | | elayne [catadroid@Nightstar-ugedcl.dab.02.net] has quit [[NS] Quit: Bye] |
10:30 | <@ErikMesoy> | Is there a particular encouraged way to store a lot of boolean flags in Python? It looks a little odd to just declare UserProfile.flag1=True, UserProfile.flag2=True etc. as I'm doing now. |
10:33 | <@pjdelport> | What's the context? |
10:33 | <@pjdelport> | That should be fine for your average thing, unless you need something like a bitmap instead? |
10:33 | <@abudhabi> | Why not use a collection of some sort? |
10:40 | <@TheWatcher> | bitwise operators time!~ |
10:40 | <@ErikMesoy> | Context is measuring stuff user has done/set/found/unlocked/toggled, and intuitive collections seemed like pointless overhead. |
10:41 | <@ErikMesoy> | Bitwise operators sound like a great way of confusing code maintainer down the line (probably also me). |
10:42 | <@pjdelport> | ErikMesoy: Do you want a dict or set, perhaps? |
10:43 | <@ErikMesoy> | pjdelport: Maybe what I should be asking is "what do dicts or sets get me here?" other than overhead? |
10:43 | <@ErikMesoy> | Besides, python. Everything is a dict anyway. _Ã |
10:44 | <@pjdelport> | Well, you probably shouldn't worry about overhead unless you're optimising for something and benchmarking. Intuition can lead you astray. :) |
10:44 | <@pjdelport> | Sets can be more memory-compact, if that's what you're worried about. |
10:44 | <@pjdelport> | They avoid having both keys and values. |
10:44 | | Vornicus [Vorn@ServerAdministrator.Nightstar.Net] has joined #code |
10:44 | | mode/#code [+qo Vornicus Vornicus] by ChanServ |
10:44 | <@ErikMesoy> | I mean coding overhead. Performance be damned. |
10:45 | <@pjdelport> | Oh, then yeah, same thing. Sets can lead to very compact code. |
10:45 | <@pjdelport> | (I love Python's sets, and wish more languages had them as natively.) |
10:45 | <@ErikMesoy> | Hmm. sets. |
10:45 | <@pjdelport> | It depends entirely on what you're actually doing, though. |
10:46 | <@pjdelport> | How does the code use it, and what kind of operations do you need on the flags? |
10:46 | <~Vornicus> | <3 sets |
10:47 | <@ErikMesoy> | I need operations of set flag, clear flag, check flag. This is supposed to be a load of booleans for e.g. first time info popups, user toggles. |
10:47 | <@ErikMesoy> | if flag, display help, else do nothing. |
10:48 | <@ErikMesoy> | If verbose flag, display long message, else display short message. |
10:50 | <@pjdelport> | Command line flags? |
10:50 | <@pjdelport> | Shouldn't you just be using argparse or something rather than maintaining your own flags for that? |
10:51 | <@ErikMesoy> | No. |
10:51 | <@ErikMesoy> | Well, some of these could theoretically be passed by command line, but mostly they're supposed to be user-modifiable from within the program |
10:52 | <@ErikMesoy> | User should be able to toggle "verbose mode" without having to restart the program and give a new argument at the command line. |
10:53 | <@ErikMesoy> | Maybe "show/hide tooltips" is a better comparison. Checkbox stuff. |
10:53 | <@pjdelport> | Ah, so settings? |
10:53 | <@pjdelport> | You probably want to use a settings backend of some sort. |
10:53 | <@pjdelport> | There's ConfigParser built in, but it's not the most convenient API. |
10:54 | <@ErikMesoy> | Right. I think I'll maybe stick with raw object properties for now and come back and ask again when I have more use cases and a more pressing need to drive the refactor tractor and learn a backend, because this is getting a little out there for what's at present just one setting and me trying to future-proof. |
10:55 | <@pjdelport> | There are a bunch of projects that give you more convenient APIs, and should avoid the need to manually manage attributes like that. |
10:55 | <@ErikMesoy> | But future-proofing may be spilling into premature optimization here. |
10:55 | <@pjdelport> | You should be able to declare your schema, and then just access flags through the appropriate interface. |
11:27 | <@TheWatcher> | Horay, I now need to use 4 dimensions for this diagram. |
11:27 | <@TheWatcher> | (killmenow) |
11:35 | <@abudhabi> | TheWatcher: https://i.warosu.org/data/tg/img/0459/44/1457759085223.jpg |
11:40 | <@pjdelport> | Hah, awesome |
12:12 | <@TheWatcher> | ACtually, more https://www.youtube.com/watch?v=FnbYcB9ctu8 |
12:26 | <@ErikMesoy> | I just want to say that anonymous lambda functions are not only magic, they are magic in ways it would have been hard for me to predict I would have needed or wanted in the way I am currently using some. |
12:27 | <@abudhabi> | Aren't lambdas in Python extremely limited? |
12:28 | <@abudhabi> | I mean, they're only one statement. |
12:29 | <~Vornicus> | Sure, but that's often enough |
12:29 | <@ErikMesoy> | That's kinda the point here - they are *small* and can be inlined. |
12:31 | <@pjdelport> | abudhabi: lambdas and defs are just different syntax for the same thing, in Python. |
12:31 | <@ErikMesoy> | Right now I'm using them as dict values so that I can do "when given key X, run function corresponding to X" and that function does not need to be defined anywhere else. |
12:32 | <@ErikMesoy> | The dict basically goes {x: lambda: function(argument)} |
12:32 | <@pjdelport> | So it's more a lexical question than one of functionality. If you need statement syntax, you need a def; if you only need expression syntax, you can use a lambda. |
12:32 | <@pjdelport> | The def style is generally encouraged for readability, which makes sense in Python. |
12:32 | <@pjdelport> | lambdas tend to be more obscuring in that paradigm. |
12:33 | <@pjdelport> | (And I say that as a Haskeller, where lambdas are ubiquitous, so I'm not biased against them.) |
12:37 | <@abudhabi> | ErikMesoy: Ah, you're storing functions in a map. That's pretty cool. |
12:37 | <@ErikMesoy> | abudhabi: And now you have me thinking how to sneak in more than one statement. |
12:40 | <@pjdelport> | You can wrap the usual statement syntax things into defs, and then just build up expressions with that. |
12:40 | <~Vornicus> | storing functions in a map is amazingly useful. |
12:40 | <@pjdelport> | But that's the kind of thing you see in obfuscated Python code contests, not in real code (hopefully :). |
12:47 | | catadroid [catadroid@Nightstar-r7d8vk.dab.02.net] has joined #code |
13:02 | <@TheWatcher> | pjdelport: I have to admire your optimism~ |
13:08 | < catadroid> | My colleague appears to have beaten the msvc compiler into deducing a reference as a pointer |
13:08 | < catadroid> | ...I'm not going to play compiler golf with this, I'm not going to play compiler golf with this... |
14:07 | <@TheWatcher> | Yes you are~ |
14:23 | <@abudhabi> | Does "object" have any special meaning in Python? |
14:24 | <@pjdelport> | abudhabi: It's the default base type. |
14:26 | <@abudhabi> | OK. Need to open a thesaurus. :V |
14:27 | <@pjdelport> | Basically, "class foo: ..." is short for "class foo(object): ..." |
14:27 | <@pjdelport> | Normal classes are all subclasses of object. |
14:49 | < catadroid> | I'm averaging four lines of commenting per loc |
14:49 | < catadroid> | Optimising containers, everybody |
14:51 | | Emmy [M@Nightstar-9p7hb1.direct-adsl.nl] has joined #code |
14:51 | | mode/#code [+o Emmy] by ChanServ |
15:06 | | Crossfire [Z@Nightstar-r9lk5l.cust.comxnet.dk] has joined #code |
15:06 | | mode/#code [+o Crossfire] by ChanServ |
15:13 | <@simon_> | someone here linked to a blog post about some Rust type system problems some weeks ago. was it Vornicus, jerith, McMartin? |
15:13 | <~Vornicus> | I think it was mcm; he was going on about traits. Let me search the second sight |
15:14 | <@simon_> | Vornicus, awesome. yeah, I think it was mcm, too. |
15:17 | <~Vornicus> | no luck. :( |
15:19 | <@simon_> | nah, me neither. not even on hn.algolia.com (hacker news search engine) |
15:20 | <@TheWatcher> | https://starforge.co.uk/irclogs/code/code.20160526.log.html#m2108-0 |
15:21 | <@TheWatcher> | No blog post. though |
15:21 | <@TheWatcher> | Not sure if that's what you meant. |
15:21 | | * TheWatcher continues hunting |
15:22 | <@simon_> | TheWatcher, that's not it, but thanks for looking. it's ok, I'll probably run into the blog post again. |
15:22 | | Emmy [M@Nightstar-9p7hb1.direct-adsl.nl] has quit [Ping timeout: 121 seconds] |
15:30 | | * TheWatcher eyes his new schema diagram |
15:32 | | Derakon_ [chriswei@Nightstar-5mvs4e.ca.comcast.net] has joined #code |
15:34 | | Derakon[AFK] [chriswei@Nightstar-5mvs4e.ca.comcast.net] has quit [Ping timeout: 121 seconds] |
15:36 | <&ToxicFrog> | simon_: possibly http://smallcultfollowing.com/babysteps/blog/2016/04/27/non-lexical-lifetimes-in troduction/ ? |
15:50 | <@simon_> | ToxicFrog, exactly! thanks! |
17:07 | | Shady [ShadyGuru@Nightstar-ut3scg.t132.ptd.net] has joined #code |
17:07 | | Emmy [M@Nightstar-9p7hb1.direct-adsl.nl] has joined #code |
17:07 | | mode/#code [+o Emmy] by ChanServ |
17:08 | | crystalclaw|AFK is now known as crystalclaw |
17:15 | < catadroid> | Sometimes I feel like a wizard |
17:15 | <@Azash> | Hmm? |
17:16 | < catadroid> | I'm implementing bit twiddle operations to make this hash map as fast as possible |
17:16 | | * Vornicus wizard hats catadroid |
17:16 | <@Azash> | Vornicus: Don't try to robe catadroid into anything untoward now |
17:17 | | * Vornicus is not bloodninja. |
17:30 | | * ErikMesoy cracks knuckles, begins migration from Python 2 to 3. |
17:30 | | * Azash mutters "at least it's not rails 2 to 3" |
17:31 | <@Azash> | A friend of mine often says about coding work that everyone has their personal vietnam experience |
17:32 | <@Azash> | For me it was spending about 15 months with the occasional week or two doing other stuff on migrating a rails project, written to be heavily coupled into rails and active<component> internals, from early 2 to late-ish 3 |
17:32 | <@Azash> | Alone, confused and with no documentation |
17:32 | <@Tamber> | "You weren't there, man. You weren't there." |
17:37 | <&McMartin> | 4 months now that I haven't been able to get a produced binary from Xcode that meets my standards |
17:37 | <&McMartin> | Though I've learned a few new tricks |
17:37 | <&McMartin> | Things that were less obnoxious: that time I was working on debugging a crash that only happened if you ran as administrator |
17:38 | <@TheWatcher> | ... wat |
17:39 | <&McMartin> | There was some trampoline code being generated at build time and then being injected into place... |
17:39 | <&McMartin> | ... and it was using a 32-bit relative jump for a call. |
17:39 | <&McMartin> | A call in a different DLL |
17:39 | <&McMartin> | A DLL subject to ASLR when run as administrator. |
17:39 | <&McMartin> | Thus putting it more than 2GB away |
17:39 | <@TheWatcher> | >.< |
17:39 | <&McMartin> | We had to replace the generated trampoline code with assembly code with a 64-bit absolute jump. |
17:41 | <@TheWatcher> | That must've been great fun to find! |
17:41 | < catadroid> | ...I can now intuitively implement move constructors |
17:41 | < catadroid> | Am I a monster? |
17:42 | <@Azash> | Tamber: It was a Project, really |
17:42 | <@Azash> | My favourite part was the bespoke RBAC |
17:43 | <@Azash> | Consisting of a long string literal with interpreted variables in it that was then passed to ruby's method creating method |
17:43 | <@Tamber> | ;_; |
17:45 | <@Azash> | Tamber: Also things like activerecord_base_extensions.rb, or increase_rack_key_space_limit.rb |
17:45 | <@Azash> | Oh oh let me tell you about the second one |
17:45 | <@Azash> | Basically it also had a bespoke JS frontend framework |
17:45 | <@Azash> | yes, a bespoke framework |
17:45 | <@Azash> | Which among other things did not do things the REST way |
17:45 | | Emmy [M@Nightstar-9p7hb1.direct-adsl.nl] has quit [Ping timeout: 121 seconds] |
17:45 | <&McMartin> | catadroid: I've probably spent too much time staring into the abyss myself to map that... |
17:46 | <&McMartin> | ... but isn't a move constructor a copy constructor that lets you trash the place on the way out? Is there some other trick? |
17:46 | <@Azash> | Rather, CRU was done by passing around the entire current page/document, in essentially serialized JSON format |
17:46 | <@Azash> | Which eventually caused the problem that some pages featured too many objects and ended up exceeding Rails' POST body size limit |
17:47 | <@Azash> | Not size as in actual size |
17:47 | <@Azash> | Size as in the amount of keys in a single nested JSON structure that Rack would accept |
17:48 | <@Azash> | The last fix upgraded the Rack limit to a 1,048,576 key JSON structure |
17:48 | <@Azash> | It's been stable for a while |
17:48 | <@Azash> | So here's hoping |
17:50 | <@ErikMesoy> | Hmm. Error at "import wx", which worked for Py2 and not for Py3. That's a nonobvious place to err. |
17:53 | <@ErikMesoy> | wxwidgets for python apparently not fully ported to 3 yet, needs Wx Project Phoenix. I sense yak shaving ahead... |
17:56 | < catadroid> | A move constructor lets you trash the input instance, although that instance needs to be valid to destruct |
17:57 | <&McMartin> | ... so, you can trash the place but you can't take out any load-bearing walls. >.> |
17:57 | < catadroid> | Which means you can steal the internal representation instead of needing to copy it |
17:57 | < catadroid> | Heh, yeah |
17:57 | <@ErikMesoy> | ...wxPythonPhoenix's installer page tells me how to install it for/with Python *2*! |
18:01 | <&jerith> | ErikMesoy: Why are you proting from 2 to 3? |
18:01 | <&jerith> | *porting |
18:02 | <&[R]> | Because Python 2 is deprecated? |
18:02 | <@TheWatcher> | Tell that to lots of library maintainers~ |
18:03 | <@ErikMesoy> | jerith: Maybe I'm not, after all. >_> But I figured I should, would have to eventually, and I was gradually seeing more Py3 results on Stack Exchange when I went to look shit up. |
18:03 | <&jerith> | But Python 2.7 will still be supported for a very long time. |
18:03 | <&jerith> | For a lot of existing stuff, porting really isn't worth the effort. |
18:03 | <&jerith> | For new stuff, py3 probably makes sense. |
18:04 | <&jerith> | For libraries, supporting py2 and p3 makes sense. |
18:04 | <&jerith> | If you want decent performance, stick with py2 and use pypy. :-) |
18:04 | <@ErikMesoy> | What does it mean for me that Python 2.7 "will be supported"? |
18:04 | <@ErikMesoy> | I haven |
18:04 | <&jerith> | Security fixes, mostly. |
18:05 | <&jerith> | And the interpreter isn't going to go away or anything. |
18:05 | <@ErikMesoy> | I haven't ever contacted anything like official support. And unofficial support, as mentioned, is me seeing answers for Py3 popping up. |
18:06 | <&jerith> | I meant "py2 isn't being abandoned". |
18:06 | <&jerith> | It can't be, there's just too much existing code that will never be rewritten in py3. |
18:10 | | catadroid` [catadroid@Nightstar-co9dqb.dab.02.net] has joined #code |
18:11 | | * ErikMesoy shakes head |
18:12 | <@ErikMesoy> | "Just because Py3 is eight years old doesn't mean you should update. Just because wxPython for Py3 is two years old doesn't mean it's anywhere near ready." |
18:12 | <@ErikMesoy> | This feels really strange. |
18:13 | | catadroid [catadroid@Nightstar-r7d8vk.dab.02.net] has quit [Ping timeout: 121 seconds] |
18:16 | <&jerith> | The thing about py3 is that it's basically a different (but very similar) language. |
18:17 | <&jerith> | It's *really* hard to write C extension modules that support both without a lot of ugly #ifdefery. |
18:17 | <@ErikMesoy> | Very very similar indeed. 2to3 says my current project needed no changes. |
18:18 | <&jerith> | (Which is why all sensible people use cffi to interface with C code these days.) |
18:18 | <@ErikMesoy> | No changes in *my* code at least. Seems a lot of changes required in what I'm importing though. >_> |
18:19 | <&jerith> | 2to3 only knows about syntax and stdlib. |
18:20 | | * McMartin eyes his email |
18:20 | <&McMartin> | Apparently there was action on a bug I posted to Apache nine years ago |
18:25 | <&jerith> | It's generally not that hard to write new code that is compatible with both py2 and py3. |
18:26 | <@ErikMesoy> | But here I hadn't been trying to do that. It just happened. *shrug* |
18:27 | <~Vornicus> | mcm: man |
18:34 | <&[R]> | McMartin: at least they didn't do what the Quassel guys did |
18:34 | <&[R]> | Which was close every bug that was over a year old, regardless of wether or not it was fixed. |
18:35 | <&[R]> | Bugs and feature requests. |
18:35 | | * [R] got 13 emails from their tracker all at once as a result |
18:36 | <&McMartin> | Yeah, actually, I think this one may have been fixed back then, and some confused person added a pull request to it |
18:39 | | Emmy [M@Nightstar-9p7hb1.direct-adsl.nl] has joined #code |
18:39 | | mode/#code [+o Emmy] by ChanServ |
18:43 | <&jerith> | I had a bug I reported (and provided a patch for) fixed about six years later. |
18:43 | <&jerith> | Bugs I fixed in Python also took multiple years to be merged. |
18:49 | <&jerith> | (I do not have a very high opinion of the core python devs.) |
19:16 | | Emmy [M@Nightstar-9p7hb1.direct-adsl.nl] has quit [Ping timeout: 121 seconds] |
19:48 | <@TheWatcher> | [R]: ... wat |
19:49 | <@Tamber> | That's the CADT model of stopping the bug-tracker looking terrible, I think. |
19:50 | <@TheWatcher> | Can't be Arsed Doing This? |
19:51 | <&McMartin> | Cascade of Attention-Deficit Teenagers. |
19:51 | <@pjdelport> | https://www.jwz.org/doc/cadt.html |
19:52 | <@TheWatcher> | I'd laugh, but... yeah |
19:54 | <&[R]> | From what I've heard, it's not any better with priorietary shit |
19:54 | <&[R]> | Eitherway though, it's not excusable |
19:58 | <&[R]> | http://bugs.quassel-irc.org/issues/788#change-2550 |
19:59 | | Netsplit Krikkit.Nightstar.Net <-> Deepthought.Nightstar.Net quits: @ErikMesoy, @Ogredude, @Vornicus, @macdjord, @celticminstrel, ricer, @^Xires, @Azash, @[R], @Turaiel[Offline], (+2 more, use /NETSPLIT to show all of them) |
20:00 | | Netsplit over, joins: @Turaiel[Offline], @Azash, @^Xires, @macdjord, ~Vornicus, @pjdelport, @ErikMesoy, @celticminstrel, ricer, @crystalclaw (+2 more) |
20:01 | <@ErikMesoy> | ooaoooaooooaoaoaoooooaoooooooo! |
20:02 | <&McMartin> | There's "excusable" and then there's "explainable", though |
20:02 | <@ErikMesoy> | The mode assignments remind me of https://i.imgur.com/l8fiWQ6.jpg |
20:02 | <&McMartin> | If you hit your truck factor - and with high enough turnover, you always will - it's probably less work to do the rewrite |
20:03 | <&McMartin> | But if they had component/systemic tests, keep them |
20:04 | < catadroid`> | It saddened me how few unit tests we had until I started writing a lot |
20:14 | <&jerith> | I'm trying to write fewer tests these days. |
20:14 | <&jerith> | (But better ones.) |
20:30 | | Alek [Alek@Nightstar-9qtiqv.il.comcast.net] has joined #code |
20:30 | | mode/#code [+o Alek] by ChanServ |
20:31 | <@Alek> | yo, visit GoG Galaxy to get System Shock 2 free. |
21:03 | | Shady is now known as Shady|afk |
21:05 | | ion [Owner@Nightstar-6grqph.vs.shawcable.net] has quit [Ping timeout: 121 seconds] |
21:05 | | ion [Owner@Nightstar-6grqph.vs.shawcable.net] has joined #code |
21:05 | | mode/#code [+o ion] by ChanServ |
22:05 | | Reiv [NSwebIRC@Nightstar-q8avec.kinect.net.nz] has joined #code |
22:05 | | mode/#code [+o Reiv] by ChanServ |
22:39 | | crystalclaw is now known as crystalclaw|AFK |
23:21 | | catadroid` is now known as catadroid |
23:46 | | Vornicus [Vorn@ServerAdministrator.Nightstar.Net] has quit [Connection reset by peer] |
--- Log closed Thu Jun 09 00:00:25 2016 |