code logs -> 2013 -> Mon, 24 Jun 2013< code.20130623.log - code.20130625.log >
--- Log opened Mon Jun 24 00:00:42 2013
00:02 Typherix is now known as Typh|offline
00:41 himi [fow035@D741F1.243F35.CADC30.81D435] has joined #code
00:41 mode/#code [+o himi] by ChanServ
00:54 * McMartin reads about hand-hacking DLL linkage.
00:54
< McMartin>
This would normally be black magic, except that since this is the only way to get LD_PRELOAD like effects in Windows, it is in fact a basic if slightly obscure sorcery.
00:56 Vornicus [vorn@ServerAdministrator.Nightstar.Net] has quit [[NS] Quit: Leaving]
00:56
<@Tarinaky>
Linux's ld is mental in its own way though.
00:59
< McMartin>
Linking is kind of black magic all around, yeah
01:00
< McMartin>
One of the funnier bits about PE32/PE32+ is that there is replicated information in it because the expectation is that you'll be loading the thing in by mmap()ing it, more or less
01:09 RichyB [RichyB@D553D1.68E9F7.02BB7C.3AF784] has quit [[NS] Quit: Gone.]
01:13 RichyB [RichyB@D553D1.68E9F7.02BB7C.3AF784] has joined #code
01:47
< McMartin>
Aha!
01:47
< McMartin>
OK, I have discerned the logic flaw here, I think.
01:58
< McMartin>
Was it froztbyte asking about ASLR? It looks like either PE32 or COFF has everything be PIC via "relative address offset from module base" and the generated object code respects that too; ALSR just sticks modules wherever and the relevant code is then sitting pretty.
02:29 VirusJTG [VirusJTG@Nightstar-09c31e7a.sta.comporium.net] has quit [[NS] Quit: Program Shutting down]
02:37 Vorntastic [Vorn@Nightstar-533931b6.sub-70-211-11.myvzw.com] has joined #code
02:40 Karono is now known as Karono[shower]
02:41 Turaiel[Offline] is now known as Turaiel
02:57 celmin|away is now known as celticminstrel
03:07 Karono[shower] is now known as Karono
03:23 Orthia [orthianz@3CF3A5.E1CD01.B089B9.1E14D1] has quit [Ping timeout: 121 seconds]
03:29 Turaiel is now known as Turaiel[Offline]
03:40 Karono [Karono@Nightstar-03f66622.optusnet.com.au] has quit [Connection closed]
03:40 Karono [Karono@Nightstar-03f66622.optusnet.com.au] has joined #code
03:41 Derakon [Derakon@Nightstar-a3b183ae.ca.comcast.net] has quit [Ping timeout: 121 seconds]
03:41 Derakon [Derakon@Nightstar-a3b183ae.ca.comcast.net] has joined #code
03:41 mode/#code [+ao Derakon Derakon] by ChanServ
03:43 Vornicus [vorn@ServerAdministrator.Nightstar.Net] has joined #code
03:43 mode/#code [+qo Vornicus Vornicus] by ChanServ
03:44 Vorntastic [Vorn@Nightstar-533931b6.sub-70-211-11.myvzw.com] has quit [[NS] Quit: Bye]
03:54 k2 [Karono@Nightstar-03f66622.optusnet.com.au] has joined #code
03:54 Karono [Karono@Nightstar-03f66622.optusnet.com.au] has quit [NickServ (GHOST command used by k2)]
03:54 k2 is now known as Karono
03:56 VirusJTG [VirusJTG@Nightstar-09c31e7a.sta.comporium.net] has joined #code
04:01 gnolam [lenin@Nightstar-b2aa51c5.cust.bredbandsbolaget.se] has quit [Client closed the connection]
04:01 gnolam [lenin@Nightstar-b2aa51c5.cust.bredbandsbolaget.se] has joined #code
04:01 mode/#code [+o gnolam] by ChanServ
04:11 Kindamoody[zZz] is now known as Kindamoody
04:19 Turaiel[Offline] is now known as Turaiel
04:36 Tarinaky [tarinaky@Nightstar-dd7e4a05.net] has quit [Ping timeout: 121 seconds]
04:42 Tarinaky [tarinaky@Nightstar-dd7e4a05.net] has joined #code
04:42 mode/#code [+o Tarinaky] by ChanServ
04:46 Derakon [Derakon@Nightstar-a3b183ae.ca.comcast.net] has quit [Ping timeout: 121 seconds]
04:46 Derakon [Derakon@Nightstar-a3b183ae.ca.comcast.net] has joined #code
04:46 mode/#code [+ao Derakon Derakon] by ChanServ
04:48 VirusJTG [VirusJTG@Nightstar-09c31e7a.sta.comporium.net] has quit [[NS] Quit: Program Shutting down]
05:10 Derakon [Derakon@Nightstar-a3b183ae.ca.comcast.net] has quit [Ping timeout: 121 seconds]
05:10 Derakon [Derakon@Nightstar-a3b183ae.ca.comcast.net] has joined #code
05:10 mode/#code [+ao Derakon Derakon] by ChanServ
05:16 Derakon is now known as Derakon[AFK]
05:27 Derakon [Derakon@Nightstar-a3b183ae.ca.comcast.net] has joined #code
05:27 mode/#code [+ao Derakon Derakon] by ChanServ
05:28 Orthia [orthianz@3CF3A5.E1CD01.B089B9.1E14D1] has joined #code
05:28 mode/#code [+o Orthia] by ChanServ
05:31 Derakon[AFK] [Derakon@Nightstar-a3b183ae.ca.comcast.net] has quit [Ping timeout: 121 seconds]
05:45 Derakon [Derakon@Nightstar-a3b183ae.ca.comcast.net] has quit [Ping timeout: 121 seconds]
05:45 Derakon [Derakon@Nightstar-a3b183ae.ca.comcast.net] has joined #code
05:45 mode/#code [+ao Derakon Derakon] by ChanServ
06:14 Derakon [Derakon@Nightstar-a3b183ae.ca.comcast.net] has quit [Ping timeout: 121 seconds]
06:14 Derakon [Derakon@Nightstar-a3b183ae.ca.comcast.net] has joined #code
06:14 mode/#code [+ao Derakon Derakon] by ChanServ
06:29 * Vornicus tries to figure out if it's possible to use a for loop on a bool.
06:30 ErikMesoy|sleep is now known as ErikMesoy
06:59 Kindamoody is now known as Kindamoody|afk
07:02
<@gnolam>
"use a for loop on a bool"?
07:02
< McMartin>
For loops are just while loops with slightly different syntax
07:02
<@gnolam>
You can put whatever statements you want in there.
07:02
<@gnolam>
E.g. the vile "for (;;)"
07:03 himi [fow035@D741F1.243F35.CADC30.81D435] has quit [Ping timeout: 121 seconds]
07:03
<~Vornicus>
What I'm looking to do is consider both false and true; since there's only two things in a bool, neither state is acceptable as 'I can stop now'.
07:05
<~Vornicus>
(I'm filling in a table based on all possible values for several things; one of those things is a bool)
07:06 Turaiel is now known as Turaiel[Offline]
07:10
<@gnolam>
If the question is if "for (bool foo = true; foo; foo = false)" is valid, then yes.
07:10
<~Vornicus>
It's not whether it's valid, it's whether it will actually cover both true and false, and from what I know, it won't.
07:12
<@gnolam>
Well, then it's just a question of how evil you want the code to be.~
07:13
<~Vornicus>
for (bool b = false, bool b_halt = false; b_halt; b_halt = b, b = !b) { // this is what I ended up with.
07:15
<@gnolam>
For a quick and dirty version, I'd do something like "for (int i = 0; i < 2; i++) { foo[i] = (i == 0); }"
07:15
<@gnolam>
For a readable version I'd probably prefer lists of values to pick from.
07:17
<@gnolam>
(With the "fill a table with all possible values" use case)
07:37
< ktemkin>
Sounds messy, anyway.
07:37
< ktemkin>
If it's relatively self-contained code, you might consider refactoring the body into an inline function and then just calling it with false and true.
07:38
< ktemkin>
It really depends on what you're trying to accomplish.
07:40
< ktemkin>
"I'm filling in a table based on all possible values for several things" <-- That sounds like you'd want to create lists of the things that you want to iterate over, and then iterate over all of the permutations of those lists.
07:47 AverageJoe [evil1@Nightstar-4b668a07.ph.cox.net] has joined #code
08:08 celticminstrel [celticminst@Nightstar-8403057e.dsl.bell.ca] has quit [[NS] Quit: And lo! The computer falls into a deep sleep, to awake again some other day!]
08:10
<~Vornicus>
yay, worky
08:10
<~Vornicus>
(I switched to for (int i = 0; i < 2; i++) {bool b = (bool) i; ...}
08:13
< ktemkin>
The (i != 0) notation is better than the cast-to-bool.
08:13
< ktemkin>
IIRC, some compilers throw a warning on a cast-to-bool.
08:18
<~Vornicus>
this one didn't, so I'm not going to worry about it. Only person who sees this code, really, is me
08:20 * Vornicus tries to figure out what's next. Oh, right, /that/ part
08:22
<~Vornicus>
The part where I need to figure out how the tags /start/, so I can figure out how to merge them later.
08:35 AverageJoe [evil1@Nightstar-4b668a07.ph.cox.net] has quit [[NS] Quit: Leaving]
08:45
<@froztbyte>
McMartin: yeah it was me wondering about it
09:02 Karono [Karono@Nightstar-03f66622.optusnet.com.au] has quit [Client closed the connection]
09:33 Karono [Karono@Nightstar-03f66622.optusnet.com.au] has joined #code
09:37 himi [fow035@Nightstar-5d05bada.internode.on.net] has joined #code
09:37 mode/#code [+o himi] by ChanServ
10:42 * TheWatcher eyes the cygwin installer
10:43
<@TheWatcher>
"118% - Cygwin Setup"
10:44
<@TheWatcher>
That's, um, brilliant.
10:45
< ktemkin>
It's just going the extra mile for you.
10:45
< ktemkin>
I guess it'd have to, considering its programmers never learned basic algebra.
10:51
<@froztbyte>
hee
--- Log closed Mon Jun 24 12:10:13 2013
--- Log opened Mon Jun 24 17:49:24 2013
17:49 TheWatcher [chris@Nightstar-3762b576.co.uk] has joined #code
17:49 Irssi: #code: Total of 35 nicks [16 ops, 0 halfops, 0 voices, 19 normal]
17:49 mode/#code [+o TheWatcher] by ChanServ
17:49 Irssi: Join to #code was synced in 38 secs
17:59 Turaiel[Offline] is now known as Turaiel
18:00
<@froztbyte>
Azash: woo cluelessness!
18:01
<@celticminstrel>
The sentence doesn't actually make any sense to me, but I'm guessing that was the point of posting it here...
18:01
<@Azash>
I read bravely on after posting it and turns out what he wants is a solution to, uh, filter out iframes from hijacked sites
18:02
<@celticminstrel>
Huh?
18:02
<@Azash>
Your guess is as good as mine
18:03
<&ToxicFrog>
SGOS can do something similar to that, except actually useful
18:04
<&ToxicFrog>
(i.e. strip flash, malicious JS, and inlines of known compromised sites before passing the rest of the page to the browser)
18:58
<@froztbyte>
Azash: see, unfortunately I('m pretty sure that I) know what he means, because I've had to spend sufficient time decoding idiot
18:58
<@froztbyte>
"I want a way to block iframes that load up content from hijacked sites" or "I want to prevent iframes that are a result of hijacked sites"
18:59
<@froztbyte>
and glhf to them for that ;p
18:59
<@froztbyte>
(also, I'm presuming a him based on the terms you used)
19:15 Derakon [Derakon@Nightstar-a3b183ae.ca.comcast.net] has joined #code
19:15 mode/#code [+ao Derakon Derakon] by ChanServ
19:19 Kindamoody|afk is now known as Kindamoody
19:40 Derakon [Derakon@Nightstar-a3b183ae.ca.comcast.net] has quit [Ping timeout: 121 seconds]
19:41 Derakon [Derakon@Nightstar-a3b183ae.ca.comcast.net] has joined #code
19:41 mode/#code [+ao Derakon Derakon] by ChanServ
19:42 Kindamoody is now known as Kindamoody[zZz]
19:50
< ErikMesoy>
Just had one of those calls. "You are technical wizard. Make technical magic happen."
19:50
< ErikMesoy>
My grandmother calls me because there's a buzzing sound in her telephone and asks me to please fix the buzzing sound for her.
19:52
< ErikMesoy>
I love her very much, but this is 1. outside my field, as I have no clue how telephones work, and 2. outside my reach, because I can't even attempt to get a clue because the telephone in question is far away.
19:52
< ErikMesoy>
After I explain that I have no idea, she asks if she can call me back once I've figured it out. >_>
19:54
< ktemkin>
Put a low-pass filter on the speaker
19:55
< ktemkin>
After your efforts to take apart her phone and solder a capacitor in there end with her phone not quite going back together correctly, she won't ask again.
19:57
< ErikMesoy>
ktemkin: Your first suggestion sounds like technical wizardry (I will pass it on, but what do I do if she asks for an explanation?) , and your second suggestion sounds like the sort of thing I refuse to do to people who make cakes for me.
19:58
< ktemkin>
I said that wrong, anyway. You want a high-pass filter to pass everything except for the low buzzing.
19:58
<@froztbyte>
ErikMesoy: acquire a POTS filter
19:58
<@froztbyte>
see if it helps
19:58
<@froztbyte>
they're pretty cheap, too
19:59
<@froztbyte>
(it's just a frequency filter for DSL and such, but help for other stuff at times)
19:59
< ktemkin>
froztbyte: A DSL filter is a band-pass filter, which contains both a high-pass and low-pass filter. It could remove the buzzing on a line, presuming it's not in the passband.
20:00
<@froztbyte>
ktemkin: yes, I know
20:00
<@froztbyte>
ktemkin: but it's also one with the sockets prewired, which is in ErikMesoy's favour ;p
20:00
<@froztbyte>
and because they're so cheap, it's worth a try
20:00
< ktemkin>
I mis-tabbed that; I meant to prefix that with ErikMesoy.
20:00
<@froztbyte>
the more annoying one would be if the noise is EM buildup on the line
20:00
<@froztbyte>
ktemkin: ah
20:02 Turaiel is now known as Turaiel[Offline]
20:02
< ktemkin>
You could grab one of the ferrite beads from an old USB cable and wrap the line going to the phone around it.
20:02 Turaiel[Offline] is now known as Turaiel
20:04
< ktemkin>
It's not /really/ going to do much, but it's easy (and free, assuming you have a thousand of those useless USB cables that come with almost everything these days).
20:05
<@froztbyte>
hmm, I haven't seen those loose lately
20:05
<@froztbyte>
only the inline packaged ones
20:05
<@froztbyte>
I suppose if you don't care (much) about the cable you could just chisel it open
20:05
< ktemkin>
The ones I see commonly snap apart.
20:06
<@froztbyte>
heh
20:06
<@froztbyte>
we have the somewhat-molded ones here
20:06
< ktemkin>
Though it's the kind of modern snap-apart where you have to stick a really tiny flathead between the case crack and hope for the best.
20:07
<@froztbyte>
haha
20:07
<@froztbyte>
hmm, can you use chloroform to weaken those bonds?
20:10
< ktemkin>
Sure, if you don't mind explaining to everyone involved why you keep chloroform on hand. =P
20:10
< ktemkin>
It dissolves many plastics, so I assume you'd take the insulation off your cable, too.
20:11
<@froztbyte>
yeah but if you don't care about the cable in question, no worries
20:11
<@froztbyte>
anyway, I need to go home, via some place that supplies food
20:11 * froztbyte waves
21:01
<&ToxicFrog>
Python, what in the entire fuck
21:01
<&ToxicFrog>
assert(False) -> AssertionError
21:01
<&ToxicFrog>
assert(False, "not the face!") -> pass
21:01
< AnnoDomini>
What.
21:02 * Azash snickers
21:02
<&ToxicFrog>
...oh, I think I see what's happening
21:02
<&ToxicFrog>
assert is for some reason a keyword, not a function
21:02
<&ToxicFrog>
So assert(False) => assert (False) => assert False
21:03
<&ToxicFrog>
but assert(False, "") => assert (False, "") => assert tuple(False, "")
21:03
<&ToxicFrog>
And tuples are boolean true
21:20
< McMartin>
I was going to say, what you describe would do that in C too, because that is the comma operator
21:21
< McMartin>
(So you put the test last so that it becomes the value of the entire expression~)
21:21
< McMartin>
21:21
< McMartin>
OK, that's not my favorite, but this is a top five
21:21
< McMartin>
http://en.wikipedia.org/wiki/Comma_operator
21:21
< McMartin>
Specifically:
21:21
< McMartin>
| Macros
21:21
< McMartin>
| This section requires expansion.
21:23
< AnnoDomini>
IDGI.
21:24
< McMartin>
Expansion is what you do to macros.
21:24
< AnnoDomini>
Oh.
21:24
<&ToxicFrog>
McMartin: well, in C, assert() is a builtin function that takes one argument and returns nothing.
21:25
<&ToxicFrog>
And my expectation in Python is that it was a function that takes 1-2 arguments and uses the second as the error message if the first is false.
21:25
<&ToxicFrog>
Which is almost true.
21:25
<&ToxicFrog>
(it is a keyword that takes 1-2 arguments etc)
21:25
<&ToxicFrog>
(which means that it must be used as 'assert exp,message', because 'assert(exp,message)' will silently succeed under all circumstances)
21:27
< McMartin>
Ah yes
21:27
< McMartin>
This sounds like one of those things that they would have fixed in Python 3
21:28
<@Azash>
What's the Python starter du jour?
21:28
<&ToxicFrog>
They probably have, but we're still on 2.7
21:28
< McMartin>
"starter"?
21:28
<&ToxicFrog>
(further confusing matters, when I use python at home, I use 3)
21:29
<@Azash>
As in, I remember being recommended Learn Python the Hard Way but it was rather stuck on Python 2
21:29
< McMartin>
Oh
21:29
< McMartin>
That's because Python 2 is kinda still the standard way of things
21:29
< McMartin>
I've generally recommended docs.python.org though
21:29 * Azash redacts his former statement to "Python 3"
21:29
< McMartin>
The official tutorials are quite comprehensive
21:29
<@Azash>
Thanks
21:31
<&ToxicFrog>
I have also seen the uwaterloo Computer Science Circles online course recommended, although I forget which version it uses (and it's targeted primarily at non-programmers, not programmers who don't know python)
21:31
<@Azash>
Hm, might just skip that then
21:40
< McMartin>
At some point I should officially migrate Ophis to Python 3, but I don't feel like I can do that until Python 3 is default-ish everywhere.
21:41
<@froztbyte>
just don't bother
21:42
<@froztbyte>
<Azash> As in, I remember being recommended Learn Python the Hard Way but it was rather stuck on Python 2
21:42
<@froztbyte>
that's fine
21:42
<@froztbyte>
most of the world's code is python 2
21:42
<@Azash>
Sucks to be the world!
21:43
<@froztbyte>
why?
21:43
<@froztbyte>
the world is the one writing the code
21:43
<@froztbyte>
py3 is a result of python-dev grabbing hookers and blow, then trying to impose their silly will on the world
21:46
< ErikMesoy>
When they should have started their own, etc?
21:53
<@froztbyte>
well, they should really just have jumped off some bridges
21:54 himi [fow035@Nightstar-5d05bada.internode.on.net] has quit [Ping timeout: 121 seconds]
21:54
<@froztbyte>
save the rest of the world some trouble
22:07 himi [fow035@Nightstar-5d05bada.internode.on.net] has joined #code
22:07 mode/#code [+o himi] by ChanServ
22:28
< RichyB>
froztbyte: I'm most fond of Ted Dziuba's take on python 3.
22:29
< RichyB>
Lovely idea guys, but while you were busy forgoing backwards-compatibility in the name of slightly nicer syntax, it would've been a good idea to also forgo backwards-compatibility in the name of ditching the bloody GIL.
22:30
<@froztbyte>
yeah pretty much
22:30
< RichyB>
It would have been *much* better of a marketing coup.
22:30
<@froztbyte>
there's a couple of real problems with python 2
22:30
<@froztbyte>
and py3 solves nearly none of them
22:30
< RichyB>
"Let's all switch to Python 3! print() is a function now!" "uhhhh... we should care because...?"
22:31
< McMartin>
"string and octet-vector are correctly labeled now"~
22:31
< RichyB>
vs. "Let's all switch to Python 3! No more GIL!" "Where do I sign up and would you like to share some of this fantastic-smelling cocaine with me?"
22:31
< RichyB>
McMartin: oh god that's THE ONE that kills me on a regular basis.
22:32
< McMartin>
That's the one that I've had to deal with the most, actually, because of Ophis
22:33
<&Derakon>
octet-vector?
22:34
< McMartin>
Group of values between 0 and 255
22:34
< McMartin>
As opposed to group of characters.
22:34
<&Derakon>
Oh, char array.
22:34
< McMartin>
No~
22:34
< McMartin>
Because chars are usually multibyte values~
22:34
<&Derakon>
Byte array, fine. :p
22:35
<&Derakon>
I was using "char" in the C sense.
22:35
< McMartin>
I mean, that's exactly the point of contention.
22:35
< McMartin>
In Py3, unmarked strings are unicode strings, and you have to mark the ones that are "I want a chunk of bytes"
22:35
< McMartin>
As opposed to the other way around
22:36
<&Derakon>
Fairynuff.
22:36
<&Derakon>
I don't think that I've ever using a string as a chunk of bytes directly anyway; that's what ord() and chr() are for.
22:37
< McMartin>
In Python 2 the struct module operates on strings
22:37
<&Derakon>
Oh dear.
22:37
< RichyB>
Python2 accidentally does it all the time, to the point where str.__eq__() will, when called on a "unicode" (i.e. actual text) object, attempt to decode itself as ascii
22:37
<&Derakon>
(I will admit to casting to str instead of unicode all over the place, though)
22:38
< McMartin>
So yeah, this is a place where, while it makes a lot of code I write in python a little more verbose, Py3 very clearly is Doing It Right
22:38
<&Derakon>
Not having the GIL would be a fantastic bullet point though.
22:38
< RichyB>
So you can try "a == b" and it'll throw UnicodeDecodeError because `a` is the byte-vector "m??se" and `b` is the unicode-codepoint-vector u"m??se"
22:39 Vornicus [vorn@ServerAdministrator.Nightstar.Net] has joined #code
22:39 mode/#code [+qo Vornicus Vornicus] by ChanServ
22:39
< RichyB>
To add to the fun, British and American programmers (read: me and my colleagues) will write that specific bug into their software all over the fucking place because the ASCII decoding attempt means that ("moose" == u"moose") returns True instead of throwing TypeError.
22:56 VirusJTG [VirusJTG@Nightstar-09c31e7a.sta.comporium.net] has joined #code
23:07 ErikMesoy is now known as ErikMesoy|sleep
23:19 Turaiel is now known as Turaiel[Offline]
23:19 Turaiel[Offline] is now known as Turaiel
23:20
<~Vornicus>
Oh, duh. Because the tags are dependent on whether the planet-wide enhancer is required to achieve the quoted level, I need to actually generate the tags when I generate the levels.
23:21 Turaiel is now known as Turaiel[Offline]
23:21 Turaiel[Offline] is now known as Turaiel
23:24 Turaiel is now known as Turaiel[Offline]
23:30 AnnoDomini [abudhabi@Nightstar-5c4cbe3a.adsl.inetia.pl] has quit [Operation timed out]
23:39 AnnoDomini [abudhabi@Nightstar-bdf5e4f4.adsl.inetia.pl] has joined #code
23:51 Karono[zZz] is now known as Karono
--- Log closed Tue Jun 25 00:00:21 2013
code logs -> 2013 -> Mon, 24 Jun 2013< code.20130623.log - code.20130625.log >

[ Latest log file ]