code logs -> 2016 -> Mon, 09 May 2016< code.20160508.log - code.20160510.log >
--- Log opened Mon May 09 00:00:17 2016
00:02 Kindamoody is now known as Kindamoody[zZz]
00:28 gnolam [quassel@Nightstar-t2vo1j.tbcn.telia.com] has quit [[NS] Quit: Z?]
00:31 Crossfire [Z@Nightstar-rshgm5.cust.comxnet.dk] has quit [Ping timeout: 121 seconds]
00:48 Crossfire [Z@Nightstar-r9lk5l.cust.comxnet.dk] has joined #code
00:49 mode/#code [+o Crossfire] by ChanServ
01:40 * McMartin woots
01:40
<&McMartin>
Atrocitron is now, technically, beatable!
01:42
<&Derakon>
There's a .06s vulnerability gap between the World-Ender and the Dance of Blood~?
01:45
<&McMartin>
Not that kind of game
01:51
<&Derakon>
What is it, an IF?
01:53
<&McMartin>
Yeah
01:53
<&McMartin>
It's another collection of Bad Ideas, which is why I started it in Oct 2013 and it's only now gotten to "technically beatable"
01:54
<&McMartin>
I'm still missing most of my room and object descriptions and at least two sets of mechanics not necessary to beat the game but which need to be present.
02:00
<&McMartin>
So it's "technically" beatable in that my walkthrough works and this does end the game with *** You have won ***, but a lot of the text is missing or placeholder
02:00 Turaiel[Offline] is now known as Turaiel
02:22 Reiv [NSwebIRC@Nightstar-q8avec.kinect.net.nz] has quit [Ping timeout: 121 seconds]
02:39
<@celticminstrel>
A collection of Bad Ideas?
02:39
<@celticminstrel>
Sounds curious.
02:40
<&Derakon>
Oh, is this your "let's make an actually good game out of all the classic awful IF puzzles" idea?
02:54 Reiv [NSwebIRC@Nightstar-q8avec.kinect.net.nz] has joined #code
02:54 mode/#code [+o Reiv] by ChanServ
03:01
<&McMartin>
Sort of
03:01
<&McMartin>
More "properties" than "puzzles"
03:03
<&McMartin>
It turned into something that is not-quite-an-IF along the way, so I intend to run the alpha past people who helped out in things like the MIT Puzzle Hunt
03:05 Thalass|KSP is now known as Thalass|bedzZzzZzz
03:38 Crossfire [Z@Nightstar-r9lk5l.cust.comxnet.dk] has quit [Ping timeout: 121 seconds]
03:45 Vornicus [Vorn@ServerAdministrator.Nightstar.Net] has joined #code
03:45 mode/#code [+qo Vornicus Vornicus] by ChanServ
05:10 Derakon is now known as Derakon[AFK]
05:21 Turaiel is now known as Turaiel[Offline]
05:27 catadroid` [catalyst@Nightstar-6spb01.dab.02.net] has joined #code
05:30 catadroid [catalyst@Nightstar-sjsqh6.dab.02.net] has quit [Ping timeout: 121 seconds]
06:19 Reiv [NSwebIRC@Nightstar-q8avec.kinect.net.nz] has quit [Ping timeout: 121 seconds]
06:51 crystalclaw is now known as crystalclaw|AFK
06:52 catadroid` is now known as catadroid
07:07
< abudhabi>
Can someone explain python tuples to me?
07:08
< abudhabi>
It seems a fanciful data structure that I cannot find an immediate use for.
07:09
< pjdelport>
abudhabi: You can think of them as anonymous structs.
07:09
< pjdelport>
Tuples are common in functional languages.
07:10
< abudhabi>
OK, but how do they actually work? The python doc tries to sort of explain that, but I fail to understand.
07:10
<~Vornicus>
A tuple is a list except it's immutable.
07:10
< pjdelport>
abudhabi: You create a tuple like (a, b, c)
07:10
<~Vornicus>
Disadvantage obviously is that it's immutable; advantage is that you can use it as, for instance, an element in a set, or as a key in a dictionary
07:10
< pjdelport>
And you can use destructuring assignment with them, them like (a, b, c) = foo()
07:11
< pjdelport>
Right, they're immutable, but tuples versus lists are not really about mutability.
07:11
< pjdelport>
If you're grouping a fixed number of things together, like an anonymous struct, then you want a tuple.
07:11
< pjdelport>
Often of different types of things.
07:12
< pjdelport>
If it's a variable number of the *same* type of item, then you want a list.
07:12
< pjdelport>
In type system terms, the type of a list is List[A]
07:12
< pjdelport>
While the type of a tuple of (a, b, c) is Tuple[A, B, C]
07:13
< pjdelport>
There's also collections.namedtuple, which gives you tuples whose items you can access as named fields.
07:52
<@celticminstrel>
You don't actually need the parentheses for LHS tuples, I think.
07:52
<@celticminstrel>
a, b, c = foo()
07:52
<@celticminstrel>
^ should work
07:52
<@celticminstrel>
Possibly the same for RHS. I forget.
07:53
<&jerith>
Vornicus: Nonono, *advantage* is that it's immutable.
07:53
<~Vornicus>
well okay
07:53
<@celticminstrel>
Note that, while what pjdelport is basically true (that lists are more useful for homogeneous data), Python lists are actually also heterogeneous, so in practice the two structures are somewhat interchangeable in Python.
07:54
<@celticminstrel>
I say "somewhat" because packing and unpacking still only works for tuples.
07:54
<&jerith>
You don't need the parens at all, but they're usually a good idea.
07:54
<@celticminstrel>
But you can easily convert between a list and a tuple.
07:54
<~Vornicus>
it does make it hard to go, for instance, "this is a minor change on an existing tuple", which i tend to do a lot
07:54
<&jerith>
You can destructure with lists too.
07:54
<&jerith>
[a, b] = (1, 2) works fine.
07:54
<@celticminstrel>
Huh, okay, I thought that didn't work.
07:54
<@celticminstrel>
Alright then.
07:55
<@celticminstrel>
Immutability is certainly an advantage though.
07:55
<@celticminstrel>
Because key-based data structures with mutable keys would cause problems.
07:55
< pjdelport>
celticminstrel: The point is more that while you *can* treat tuples just as immutable lists, it really shouldn't be about that. You should use tuples versus lists to communicate how the data is actually to be used.
07:56
< pjdelport>
And what it means.
07:56
<&jerith>
And yes, in Python the only real difference between tuple and list is immutability.
07:56
<@celticminstrel>
Fair enough, yeah.
07:56
< pjdelport>
This will become more and more important as PEP 484 typing gains traction, especially, and make it no longer just theoretical.
07:56
<@celticminstrel>
...typing?
07:57
<&jerith>
Generally, a tuple is for a fixed-length collection of specific things while a list is for a variable-length collection of generic things.
07:57
< pjdelport>
Right, what I was saying about the type of lists being List[A], and the type of tuples being Tuple[A, B, C]
07:57
< pjdelport>
Those are actual PEP 484 types you can use with Python now.
07:58
< pjdelport>
So you can make your list and tuple usage type-checked.
07:58
<@celticminstrel>
Weird...
07:58
< pjdelport>
So yeah, don't make it about mutability. :)
07:58
<@celticminstrel>
When you say "List[A]" is a type, is it something like there's a class called "List" which overrides the index operator to produce a type-checked list type?
07:59
<@celticminstrel>
Okay, I guess it'd be an object, not a class...
07:59
<@celticminstrel>
Or is this more of a language-level thing?
07:59
< pjdelport>
celticminstrel: Yeah.
07:59
< pjdelport>
Check out https://www.python.org/dev/peps/pep-0484/ and https://docs.python.org/3/library/typing.html
07:59
<@celticminstrel>
I'll assume that means "the former" since it was almost simultaneous with the second question.
08:00
< pjdelport>
So [1,2,3] would have type List[int], for example.
08:00 Kindamoody[zZz] is now known as Kindamoody
08:01
< pjdelport>
(1, 'foo') would have type Tuple[int, str]
08:01
<@celticminstrel>
So then Tuple actually overrides the index operator taking a tuple as the index.
08:02
< pjdelport>
Right, that's how the typing module works, but that's just incidental to the lists versus tuple thing.
08:02
<@celticminstrel>
Of course.
08:02
<@celticminstrel>
Hm, I'm seeing language-level support too, though...
08:03
<@celticminstrel>
Though I'm not sure if that language-level support is specifically for type-checking alone.
08:03
< pjdelport>
The PEP 484 stuff is pretty new.
08:04 * celticminstrel is referring to the "def greeting(name: str) -> str" syntax.
08:06
< pjdelport>
Ah, that's earlier.
08:06
< pjdelport>
Those annotations were general-purpose to begin with, but the idea is to move them more toward being used for typing, as a standard convention.
08:08
<@celticminstrel>
This all seems kind of amazing.
08:13
<@celticminstrel>
It seems to be talking a lot about external type-checkers. Does it not also include runtime type-checking for annotated functions?
08:14 mac [macdjord@Nightstar-r9vt2h.mc.videotron.ca] has joined #code
08:14 mode/#code [+o mac] by ChanServ
08:15
<~Vornicus>
Nope.
08:16
<~Vornicus>
that would be problematic, not least because you don't need to be a thing to act like one
08:16 macdjord [macdjord@Nightstar-r9vt2h.mc.videotron.ca] has quit [Ping timeout: 121 seconds]
08:17
<@celticminstrel>
So really, it's just a detailed system of annotations that can be used by an external tool. Still kind of amazing though...
08:35 celticminstrel is now known as celmin|sleep
09:00
< pjdelport>
celticminstrel: MyPy is the de facto implementation of the typing model, right now.
09:01
< pjdelport>
It's still a bit rough around the edges, and in active development, but it's pretty awesome!
09:04 Kindamoody is now known as Kindamoody|afk
09:04
< abudhabi>
Hm. Maps are called dictionaries in pythN?
09:04
< abudhabi>
*python
09:05
< abudhabi>
>dictionaries are indexed by keys, which can be any immutable type
09:06
< abudhabi>
Can you have a tuple as a key, then?
09:09
<~Vornicus>
Yep.
09:09
<~Vornicus>
also numbers, strings, and frozensets.
09:10
<~Vornicus>
Actually, also *generic objects* -- those hash & compare by ID.
09:29
< abudhabi>
What's a generic object?
09:32
< abudhabi>
Also, can you or can you not modify a list when iterating over it?
09:32
< abudhabi>
This sort of shit gets you candy in Java, but the python manual suggests that it is not impossible (merely unsafe) to do so in python.
09:35
<~Vornicus>
Java tries but sometimes fails to detect it.
09:35
<~Vornicus>
Python doesn't try.
09:38 gnolam [quassel@Nightstar-t2vo1j.tbcn.telia.com] has joined #code
09:38 mode/#code [+o gnolam] by ChanServ
10:10 gnolam [quassel@Nightstar-t2vo1j.tbcn.telia.com] has quit [Connection closed]
10:21 Vornicus [Vorn@ServerAdministrator.Nightstar.Net] has quit [Connection reset by peer]
10:28
< pjdelport>
abudhabi: dict keys are any hashable type; they don't need to be immutable.
10:29
< abudhabi>
That's not what the official doc says.
10:51
<@TheWatcher>
Ahem. http://i.imgur.com/6eHYZxN.jpg
10:56
< abudhabi>
KHAAAAAAN!
11:04
< abudhabi>
How does python do modules in subdirectories? Like, if you don't want all of the scripts lying around chaotically in the same folder.
11:06
<@TheWatcher>
abudhabi: don't you mean ?H?????????!
11:06
<@TheWatcher>
>.>
11:13
<@TheWatcher>
At least this time I think the first was just changing four lines of code... of course, now I'll find that some bizarre and subtle problem has scropped up somewhere utterly unrelated now.
11:13
< simon_>
I'm replacing a bit of very performant C# code that says: this._value[this._offset + ...] with this[...], where public byte this[int index] { get { return this._value[this._offset + index]; } }
11:13
< simon_>
does anyone here know if that will get inlined?
11:15
< simon_>
I'm not even sure the extra method call is that much more expensive. but I'm extending our IppString class that's used extensively throughout the performance-intensive parts so that it accepts both byte[]s and ArraySegment<byte>s (where previously it was only byte[]s).
11:21
<@TheWatcher>
Try it, eyeball the code in Ildasm?~
11:23 thalass [thalass@Nightstar-283.o7s.158.104.IP] has joined #code
11:23 mode/#code [+o thalass] by ChanServ
11:24 gnolam [quassel@Nightstar-lhk.n94.131.88.IP] has joined #code
11:24 mode/#code [+o gnolam] by ChanServ
11:39 thalass [thalass@Nightstar-283.o7s.158.104.IP] has quit [Operation timed out]
11:40
< abudhabi>
OK, dots, that's how it does it.
11:40
<@gnolam>
?
11:42
<@TheWatcher>
Well, that's the non-sequitor of the day~
11:45 Crossfire [Z@Nightstar-r9lk5l.cust.comxnet.dk] has joined #code
11:45 mode/#code [+o Crossfire] by ChanServ
11:45
< abudhabi>
12:04 < abudhabi> How does python do modules in subdirectories? Like, if you don't want all of the scripts lying around chaotically in the same folder.
11:46
<@TheWatcher>
ooooooh
11:46
<@TheWatcher>
Right.
11:57
<@TheWatcher>
(I thought you'd gone a bit dotty for a minute there~)
11:57 catadroid` [catalyst@Nightstar-3sjggg.dab.02.net] has joined #code
12:00 catadroid [catalyst@Nightstar-6spb01.dab.02.net] has quit [Ping timeout: 121 seconds]
12:04
< abudhabi>
http://twistedmatrix.com/users/glyph/rant/python-vs-java.html <- Does this comparison look legit?
12:05 * TheWatcher points at the big, red-and black bordered box at the top of the apge.
12:05
<@TheWatcher>
*page
12:06
< [R]>
Considering the age of it, no.
12:07 * TheWatcher stab and stab and stab people who don't read the fucking documentation
12:07
< [R]>
Since both JITs have had changes since then. (Also it's useful to mention /which/ Python runtime is being tested now. PyPy is generally faster than CPython is.)
12:09
< abudhabi>
TheWatcher: Oh, I pattern-matched that to an advertisement and ignored it completely.
12:10
< [R]>
I did too, wouldn't have noticed it without TheWatcher's comment
12:10
< abudhabi>
Turns out ad blocking saves only bandwidth.
12:11
< abudhabi>
I already run a filter in my brainmeats, apparently.
12:12
< [R]>
I run an ad blocker since reload-hijacking is becoming fucking common
12:13
< simon_>
TheWatcher, yeah, I guess that's what I gotta try.
12:13
< [R]>
(That's where an ad will do a full-page reload and send you elsewhere, generally using a Permenantly Moved causing your browser to dutifully remove the page you wanted from the back/forward history.)
12:13
< abudhabi>
Whereas one of my internets is metered. Not to mention that I highly dislike all manner of tracking cookies, animated banners and autoplay elements.
12:13
< simon_>
[R], so *that's* how they do it!
12:14
< [R]>
The back/forward fuckery?
12:14
< simon_>
yes.
12:14
< [R]>
Yeah
12:14
< [R]>
One of the things I learned about as a PHP dev
12:15
< simon_>
actually I've mostly noticed when they do it poorly, i.e. by temporary redirects where you have to go backwards twice very fast.
12:15
< simon_>
I just haven't done web stuff in a long time.
12:19 Netsplit Kakrafoon.Nightstar.Net <-> Golgafrincham.Nightstar.Net quits: @ErikMesoy, @Alek, ion, @Tamber, @McMartin, pjdelport, starkruzr, @jeroud, @Derakon[AFK], @Reiver
--- Log closed Mon May 09 12:23:56 2016
--- Log opened Mon May 09 12:45:29 2016
12:45 TheWatcher [chris@GlobalOperator.Nightstar.Net] has joined #code
12:45 Irssi: #code: Total of 39 nicks [21 ops, 0 halfops, 0 voices, 18 normal]
12:45 mode/#code [+o TheWatcher] by ChanServ
12:46
< [R]>
Also most ad companies only pay for clicks now
12:46
< abudhabi>
Smart.
12:46 Irssi: Join to #code was synced in 56 secs
12:46
< [R]>
(It's been like that for a long time)
12:47
< abudhabi>
(Yet still the ignorants argue that not downloding the advert that you will summarily ignore is stealing bandwidth from the site owner.)
12:47
< [R]>
Though the ad views does factor into how much is paid out
12:50 emmy [M@Nightstar-9p7hb1.direct-adsl.nl] has quit [Connection closed]
12:52
<@TheWatcher>
Oh, brilliant
12:53 Emmy [M@Nightstar-9p7hb1.direct-adsl.nl] has joined #code
12:53
<@TheWatcher>
User with ΕΎ in name. Works fine through the web interface, stored fine in the database, exports into a csv file as UTF-8 no problems, loads into notepad++ and emacs no problems, load it into excel and splaaagh
12:54
< abudhabi>
[R]: I vaguely recall this thread from before!
12:58
<@TheWatcher>
Oh, great, apparently excel needs a UTF-8 BOM to pick up that the file is UTF-8 because bullshit.
12:59
<@TheWatcher>
Y'know, despite the fact that the unicode standard does not require or recommend it.
13:01
< [R]>
MS EEE standard compliance at its best!
13:03 himi [fow035@Nightstar-v37cpe.internode.on.net] has quit [Ping timeout: 121 seconds]
13:10 himi [fow035@Nightstar-v37cpe.internode.on.net] has joined #code
13:10 mode/#code [+o himi] by ChanServ
13:27
< abudhabi>
OK, so where can I find some benchmarks for various sub-performances of Java vs. Python?
13:27
< abudhabi>
That are current.
13:30
<@gnolam>
If that is an issue, you probably don't want either language.
13:30
< [R]>
I suspect that's a Y problem.
13:31
< simon_>
apparently, there sort-of is an HTTP header equivalent to the <base href="..." /> tag, but https://www.ietf.org/mail-archive/web/apps-discuss/current/msg03219.html suggests how screwed up it is.
13:33
< abudhabi>
[R]: Y problem?
13:33
< abudhabi>
gnolam: I named Java because I am most familiar with Java.
13:33
< abudhabi>
It is the properties of Python I wish to divine.
13:33
< [R]>
http://www.perlmonks.org/index.pl?node_id=542341
13:35
< abudhabi>
If you know of a comparison with C/C++, then that would work too, but more lossily, since I'm less familiar with those.
13:35 celmin|sleep [celticminst@Nightstar-q0f7bb.dsl.bell.ca] has quit [Connection reset by peer]
13:35 celticminstrel [celticminst@Nightstar-q0f7bb.dsl.bell.ca] has joined #code
13:36 mode/#code [+o celticminstrel] by ChanServ
14:01
< catadroid`>
What are you trying to do with it.
14:01
< catadroid`>
?
14:07
< abudhabi>
Nothing yet. I want to determine what it's good for!
14:08
<@TheWatcher>
Arguing over~
14:08
< abudhabi>
Pff.
14:09 * catadroid` wonders what she's actually supposed to be doing
14:09 catadroid` is now known as catadroid
14:11
<@gnolam>
Almost always, execution speed is less important than the speed at which it lets you work.
14:12
<@TheWatcher>
catadroid: try to take over the world!
14:22
< abudhabi>
Is PyPy compatible with Python 3.5?
14:24 gnolam_ [quassel@Nightstar-lhk.n94.131.88.IP] has joined #code
14:26 gnolam [quassel@Nightstar-lhk.n94.131.88.IP] has quit [Ping timeout: 121 seconds]
14:29
<@TheWatcher>
No, just 3.2.5
14:35
< pjdelport>
PyPy3 isn't quite considered general-use ready.
14:35
< pjdelport>
But they're working to change that.
14:36
< pjdelport>
abudhabi: The raw performance of Python is rarely interesting.
14:37
< pjdelport>
In most cases, your bottlenecks are elsewhere, and you use Python to build systems that are flexible enough to avoid hard bottlenecks.
14:37
< pjdelport>
The strength of Python as a building material is its malleability and universality.
15:40 gnolam_ [quassel@Nightstar-lhk.n94.131.88.IP] has quit [The TLS connection was non-properly terminated.]
16:45 gnolam [lenin@Nightstar-t1tbf0.cust.bahnhof.se] has joined #code
16:45 mode/#code [+o gnolam] by ChanServ
16:46 Crossfire [Z@Nightstar-r9lk5l.cust.comxnet.dk] has quit [Ping timeout: 121 seconds]
16:53 himi [fow035@Nightstar-v37cpe.internode.on.net] has quit [Ping timeout: 121 seconds]
16:53 himi [fow035@Nightstar-v37cpe.internode.on.net] has joined #code
16:53 mode/#code [+o himi] by ChanServ
17:22 Kindamoody|autojoin [Kindamoody@Nightstar-0lgkcs.tbcn.telia.com] has joined #code
17:22 mode/#code [+o Kindamoody|autojoin] by ChanServ
17:22 Kindamoody|autojoin is now known as Kindamoody
18:00 Ogredude [quassel@Nightstar-dm1jvh.projectzenonline.com] has joined #code
18:00 mode/#code [+o Ogredude] by ChanServ
18:00 Ogredude [quassel@Nightstar-dm1jvh.projectzenonline.com] has quit [[NS] Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
18:00 Ogredude [quassel@Nightstar-dm1jvh.projectzenonline.com] has joined #code
18:00 mode/#code [+o Ogredude] by ChanServ
18:06 catalyst [catalyst@Nightstar-bt5k4h.81.in-addr.arpa] has joined #code
18:06 catadroid [catalyst@Nightstar-3sjggg.dab.02.net] has quit [[NS] Quit: Bye]
19:01 Vornicus [Vorn@ServerAdministrator.Nightstar.Net] has joined #code
19:01 mode/#code [+qo Vornicus Vornicus] by ChanServ
20:54 JustLurk is now known as JustBob
20:54 mode/#code [+o JustBob] by ChanServ
21:34 thalass [thalass@Nightstar-283.o7s.158.104.IP] has joined #code
21:34 mode/#code [+o thalass] by ChanServ
21:41 Kindamoody is now known as Kindamoody[zZz]
22:04 Crossfire [Z@Nightstar-r9lk5l.cust.comxnet.dk] has joined #code
22:04 mode/#code [+o Crossfire] by ChanServ
22:20 thalass [thalass@Nightstar-283.o7s.158.104.IP] has quit [Ping timeout: 121 seconds]
22:25 thalass [thalass@Nightstar-283.o7s.158.104.IP] has joined #code
22:25 mode/#code [+o thalass] by ChanServ
22:34 Reiv [NSwebIRC@Nightstar-q8avec.kinect.net.nz] has joined #code
22:34 mode/#code [+o Reiv] by ChanServ
22:37 thalass [thalass@Nightstar-283.o7s.158.104.IP] has quit [Ping timeout: 121 seconds]
22:38 thalass [thalass@Nightstar-283.o7s.158.104.IP] has joined #code
22:38 mode/#code [+o thalass] by ChanServ
23:25 thalass is now known as Thalass|omnomnom
23:54 Turaiel[Offline] is now known as Turaiel
23:58 Thalass|omnomnom is now known as Thalass
--- Log closed Tue May 10 00:00:33 2016
code logs -> 2016 -> Mon, 09 May 2016< code.20160508.log - code.20160510.log >

[ Latest log file ]