code logs -> 2012 -> Tue, 12 Jun 2012< code.20120611.log - code.20120613.log >
--- Log opened Tue Jun 12 00:00:32 2012
00:15 Noah [nbarr@490720.C448F4.12FDC5.2C3558] has quit [Client closed the connection]
00:16 Noah [nbarr@490720.C448F4.12FDC5.2C3558] has joined #code
00:24 Noah [nbarr@490720.C448F4.12FDC5.2C3558] has quit [Client closed the connection]
00:24 maoranma [nbarr@490720.C448F4.12FDC5.2C3558] has joined #code
00:31 * McMartin goes diving into the horrors of CPU feature detection
00:31
<&McMartin>
More systems need something like /dev/cpuinfo, though I'm not sure if it actually is good enough for what I need here
00:32
<&McMartin>
Since "does your chip support this feature" and "did BIOS nerf it" are different things checked in totally different places
00:32
<&McMartin>
I'd blame Windows here but I'm using compiler intrinsics so I think I need to blame Intel and AMD.
01:02 cpux|2 is now known as cpux
01:11
<@ToxicFrog>
Hrm
01:11
<@ToxicFrog>
This error implies that isalnum('a') is returning false
01:20
<@ToxicFrog>
WHAT IS GOING ON HERE
01:20
< Rhamphoryncus>
those are fun
01:21
<@ToxicFrog>
result |= ( bytes[ i ] & 0xff ) << ( 16 - i * 8 );
01:21
<@ToxicFrog>
PI_LOG(" %d %d %d\n", result, bytes[i], isalnum(bytes[i]));
01:22
<@ToxicFrog>
Log output: 0 100 2
01:22
<@ToxicFrog>
i is 0.
01:22
<@ToxicFrog>
Result is 0 entering this loop.
01:27
< Rhamphoryncus>
using the printf __attribute__ on PI_LOG?
01:28
<@ToxicFrog>
It's a macro that expands to a call to printf.
01:28
< Rhamphoryncus>
isn't bytes already a char? What would 0xFF do?
01:29
<@ToxicFrog>
I don't know, this is someone else's code I'm porting to another architecture
01:29
< Rhamphoryncus>
Is it designed for one of the mythical machines with non-8-bit bytes?
01:30
<@ToxicFrog>
Nope. x86.
01:31
<@ToxicFrog>
...hmm. Apparently, (100 << 16) is 0.
01:31
<@Alek>
e(pi) bits per byte.
01:31
< Rhamphoryncus>
hrm. I can't recall what the rules are for signed vs unsigned c har
01:31
< Rhamphoryncus>
Yeah, I just thought of that. It's still a char while you do the shift
01:33
<@ToxicFrog>
Maybe the 0xFF causes an implicit promotion to int?
01:33
<@ToxicFrog>
Except
01:34
< Rhamphoryncus>
doubt it
01:34
<@ToxicFrog>
100 << 8 works
01:34
< Rhamphoryncus>
I *think* the typed variable takes precedence over the literals
01:34
<@ToxicFrog>
Oh wait fuck
01:34
<@ToxicFrog>
I bet it's getting promoted to an int
01:34
<@ToxicFrog>
Which is 16-bit on this system
01:34
< Rhamphoryncus>
.. heh
01:38 maoranma [nbarr@490720.C448F4.12FDC5.2C3558] has quit [Client closed the connection]
01:38 maoranma [nbarr@490720.C448F4.12FDC5.2C3558] has joined #code
01:39
<@ToxicFrog>
\o/
01:39
<@ToxicFrog>
[0] data: 2 3 0
01:39
<@ToxicFrog>
[Error] (PU0) break by StackOverFlow (DMEM)
01:49 maoranma is now known as Noah
01:54
<&McMartin>
I seem to recall we have some 3d modelers in here, so:
01:54
<&McMartin>
http://www.arena.net/blog/arenanet-is-hiring-character-artists
01:55
<@Alek>
"Reading the market analysis about the state of HDDs. Brings new meanings to the word Antediluvian."
01:55
<@Alek>
McM: I've often thought of learning modeling... >_>
01:56 * Alek has a free DAZ4. just waiting to be installed and tried out. or something like Blender. <_<
02:02
<@ToxicFrog>
Symbol is even as we speak doing some hardcore sketchuping.
02:02
<@ToxicFrog>
It's shocking how much better the UI is compared to, well, every other 3d modeling and CAD program I've ever touched.
02:03
<@Alek>
ah? cool.
02:10
<~Vornicus>
Yeah, sketchup is surprisingly easy to use.
02:10
<~Vornicus>
It kind of ruined me forever~
02:11 Kindamoody[zZz] is now known as Kindamoody
02:14
< Rhamphoryncus>
... figures. By converting to VBO I figured out what was wrong with my use of textures
02:15
< Rhamphoryncus>
Which makes it some combination of "yay!" and "aaaaaugh!"
02:35 Attilla [Obsolete@Nightstar-faef4021.as43234.net] has quit [Ping timeout: 121 seconds]
02:51 cpux [cpux@Nightstar-c5874a39.dyn.optonline.net] has quit [Ping timeout: 121 seconds]
02:59 cpux [cpux@Nightstar-c5874a39.dyn.optonline.net] has joined #code
03:25 * Rhamphoryncus invents himself NilType so he can have an x/y/z function that only needs two arguments at a time
03:46 Derakon[AFK] [Derakon@Nightstar-a3b183ae.ca.comcast.net] has quit [Ping timeout: 121 seconds]
03:47 Derakon[AFK] [Derakon@Nightstar-a3b183ae.ca.comcast.net] has joined #code
03:49 himi [fow035@Nightstar-5d05bada.internode.on.net] has quit [Ping timeout: 121 seconds]
03:58 Derakon[AFK] [Derakon@Nightstar-a3b183ae.ca.comcast.net] has quit [Ping timeout: 121 seconds]
03:58 Derakon[AFK] [Derakon@Nightstar-a3b183ae.ca.comcast.net] has joined #code
04:00
< Rhamphoryncus>
If I ever get this triangle world thing done I should sell it as is :P
04:01
< Rhamphoryncus>
Visually it's intuitive. Programatically it's not at all.
04:02 himi [fow035@Nightstar-5d05bada.internode.on.net] has joined #code
04:02 mode/#code [+o himi] by ChanServ
04:13 Derakon[AFK] [Derakon@Nightstar-a3b183ae.ca.comcast.net] has quit [Ping timeout: 121 seconds]
04:13 Derakon[AFK] [Derakon@Nightstar-a3b183ae.ca.comcast.net] has joined #code
04:22
< Rhamphoryncus>
I really should stop doing the 400 line main() function thing
04:24
<~Vornicus>
Probably.
04:32
<@rms>
D:
04:32
<@rms>
150 lines is when I start looking at possibly refactoring a function
04:47
< Rhamphoryncus>
I'm refactoring regularly, but main() is my sandbox. All the new stuff goes there before getting moved to a proper place
04:47
< Rhamphoryncus>
./userinterface.h:21:16: error: expected '{'
04:47
< Rhamphoryncus>
void update();
04:47
< Rhamphoryncus>
^
04:47
< Rhamphoryncus>
Gee clang, such awesome error messages you have
04:55 Kindamoody is now known as Kindamoody|afk
05:21 Vash [Vash@Nightstar-241cb5d4.wlfrct.sbcglobal.net] has quit [[NS] Quit: I lovecraft Vorn!]
05:24 Kindamoody|afk is now known as Kindamoody
05:28 Derakon[AFK] is now known as Derakon
05:28 mode/#code [+ao Derakon Derakon] by ChanServ
05:35 Kindamoody [Kindamoody@Nightstar-6154a72a.tbcn.telia.com] has quit [Ping timeout: 121 seconds]
05:40 io|gone is now known as iospacedout
05:42 Kindamoody|afk [Kindamoody@Nightstar-6154a72a.tbcn.telia.com] has joined #code
05:42 mode/#code [+o Kindamoody|afk] by ChanServ
05:42 Kindamoody|afk is now known as Kindamoody
05:51 Kindamoody is now known as Kindamoody|out
06:22 celticminstrel [celticminst@Nightstar-5d22ab1d.cable.rogers.com] has quit [[NS] Quit: And lo! The computer falls into a deep sleep, to awake again some other day!]
06:31 Derakon is now known as Derakon[AFK]
07:46
< Rhamphoryncus>
hrm function with 14 arguments. Not so good :P
07:47
< Rhamphoryncus>
I suppose I could group it into 8
07:50
< Rhamphoryncus>
Nothing says C++ like a vector of vector pointers
08:46
<&McMartin>
Weakness!
08:46
<&McMartin>
Vector of vectors.
08:47
< Rhamphoryncus>
That'd mean copying them when I pass them in
08:49
<&McMartin>
No, bad McMartin
08:49
<&McMartin>
Stop designing a platformer engine for the C64
08:49
<&McMartin>
That comes *later*, after your five other projects.
08:49
<&McMartin>
Build tools, *then* use tools, otherwise you are a tool
08:49
<@Tamber>
*Only* five other projects?
08:50
<&McMartin>
That are higher priority than that.
08:54
<&jerith>
McMartin: But how will you build tools if you aren't already using them for something?
08:55
<&jerith>
(That's a semi-serious question. I don't generally know what shape my tools need to be until I have a project that needs the tool.)
08:55
<&McMartin>
I already have the experience and the "cousins" to build from
08:55
<&McMartin>
Now it's a case of test coverage and documentation.
08:55
<&McMartin>
I believe the tool to be feature-complete at this point.
08:55
<&McMartin>
There's one obvious "doesn't have" and I'm deliberately not including it because I think it leads to bad practice.
08:55
<&McMartin>
(conditional compilation)
08:56
<&jerith>
Ah. So you're going "that thing would totally have been easier if I had a hammer instead of this Java compiler" and then building a hammer?
08:56
<&McMartin>
Hmm, not quite
08:56
<&McMartin>
This is Ophis, after all
08:56
<&McMartin>
The problem space is pretty well-defined.
08:57
<&McMartin>
And the parts where it's loosely defined I'm pretty carefully telling the rest of the world to fuck off. :D
08:57
<&McMartin>
(Ophis syntax looks more like MIPS or x86 assembler than historical 6502 assembler, because fuck FORTRAN-style significant whitespace, for serious)
08:58
< Rhamphoryncus>
Haw. So despite my bitching that haskell doesn't allow [1, 2, 3,] (i.e. the "extra" trailing comma if you're doing one per line), I'm now tripping over the same thing in C++
08:59
<&McMartin>
... C totally allows this what are you talking about
09:00
<&McMartin>
jerith: That said, the "I think I'll build a hammer" part for Ophis was realizing that I needed to support input from and output to stdin and stdout
09:00
<&McMartin>
So you could have an assembler shell pipeline, and so you could also have the test harness throw strings at it and compare the results *against* strings.
09:00
<&McMartin>
(This code is very Python 2, yes)
09:01
< Rhamphoryncus>
Under most cases, yes, but I'm finding cases it doesn't
09:02
< Rhamphoryncus>
Such as my stupidly long argument list
09:02
<&McMartin>
Ah, yes, arglists won't fly with that.
09:02
<&McMartin>
Just variable length initializers.
09:03
<&McMartin>
(But varargs! Go away, varargs, everyone hates you)
09:04
< Rhamphoryncus>
heh
09:04
< Rhamphoryncus>
variadic templates are worse
09:05
< Rhamphoryncus>
And considering how painful it is to debug templates.. might be more efficient with printf bugs :P
09:06
<&McMartin>
iostream has its place, and it's not *quite* the dustbin of history
09:06
<&McMartin>
But it's an industrial power tool to printf's swiss-army knife.
09:07
< Rhamphoryncus>
isn't it more of a better FILE* than a better printf?
09:08
<&McMartin>
Hm.
09:08
<&McMartin>
Question of semantics and borders
09:08
<&McMartin>
It unifies files, strings, and console output, and it's extensible
09:08
<&McMartin>
It's kind of a better *everything*
09:09
< Rhamphoryncus>
It's not a better printf heh
09:09
< Rhamphoryncus>
It's more of 1 step forward, 5 steps back
09:11
<&McMartin>
61 test cases written, succeeding
09:12
<&McMartin>
Two major feature categories remaining
09:12
<&McMartin>
One known bug that I haven't written tests for yet.
09:12
< Rhamphoryncus>
I've never written a serious program that'd use cin >>. If I'm parsing files then I need real file parsing. cin >> is more of a toy used for toy programs
09:12 You're now known as TheWatcher
09:13
<&McMartin>
I'm referring more to strstream and ofstream here.
09:13
<&McMartin>
Also, istream::get() lets you unify strings, files, console cleanly
09:14
<&jerith>
McMartin: How testable is the code?
09:16
<&McMartin>
jerith: Well, it's an assembler
09:16
<&McMartin>
I'm writing about 80 tiny programs that invoke every pragma, invoke every opcode in every addressing mode, and hit all the corner cases in the binary-transform passes.
09:17
<&jerith>
Hrm. End-to-end rather than unit testing?
09:17
<&McMartin>
Kiiiinda.
09:17
<&McMartin>
This is the "unit testing" but you run the whole app each time.
09:17
<&jerith>
You're testing it from the outside, though.
09:17
<&McMartin>
Yes.
09:18
<&jerith>
So you could potentially blow up in all sorts of unrelated places.
09:18
<&McMartin>
It helps that I started witha basically working application that's ten years old and has been used for several successful projects.
09:18 * jerith nods.
09:18
<&McMartin>
The IR is rock-solid
09:18
<&jerith>
End-to-end tests can be very useful.
09:18
<&jerith>
I use them a lot.
09:18
<&McMartin>
But the IR isn't in a usable form until various functions on it fixpoint.
09:19
<&jerith>
They have less of a code-structure benefit than good unit tests, though.
09:19
<&jerith>
I've never written an assembler, so I have no idea how reasonable that is to implement.
09:19
<&McMartin>
The 6502 has some ugly side effects.
09:19
<&jerith>
"that" being "unit testing of isolated components".
09:19
<&McMartin>
Well, the question is really "what's an isolated component"
09:20
<&McMartin>
I have a debugging mode that will dump the IR after every pass, but the way I do that means the answers are basically guaranteed to be wrong until the last pass is run.
09:21
<&McMartin>
Because there's a circular dependency between what opcodes certain instructions are and the locations of labels they refer to.
09:21
<&McMartin>
(Memory-addressing instructions are 2 or 3 instructions long depending on the length of the address, and it's a different opcode for both. Where the label is is a function of how many instructions behind it have collapsed already. I have to fixpoint.)
09:22
<&McMartin>
(And not all opcodes have both forms, and the ones that don't don't have the same one, so I can't default it halfway through without introducing spurious errors.)
09:22
<&McMartin>
(I can bugcheck the IR at each step but this is less enlightening than one might think.)
09:22
<&McMartin>
It's testing from the outside, but it's extremely whitebox.
09:22 * jerith nods.
09:23
<&McMartin>
Not to mention the passes themselves dispatch on the IR via reflection.
09:23
<&McMartin>
Bugs this has found so far:
09:23
<&McMartin>
- You have to make stdout be binary explicitly on Windows, which Python thankfully exposes already
09:24
<&McMartin>
- The address-collapse pass wasn't properly tracking program counter information
09:25
<&McMartin>
- One of the examples in the manual was wrong
09:26
<&McMartin>
- The address-collapse pass also needs to be able to function backwards, a contingency that was missing from the spec
09:27
<&jerith>
Oh, I wasn't implying that end-to-end testing was bad.
09:28
<&McMartin>
It's just that, well, the lexer is split()
09:28
<&McMartin>
And the assembler pass is a dict lookup.
09:28
<&McMartin>
Actually, the parser is basically also split()
09:28
<&jerith>
It's coarser-grained because it hits a lot of code that you're not intending to test, which means potentially spurious failures.
09:28
<&McMartin>
Oh yeah
09:29
<&McMartin>
I have some abort tests up top
09:29
<&McMartin>
I've split it into "base systemic" and then feature-specific later
09:29
<&jerith>
Unit tests tend to churn more, because they depend on implementation details that change more frequently.
09:29
<&jerith>
I like having both.
09:29
<&jerith>
But if I can only get one, I go for end-to-end.
09:29
<&McMartin>
Yeah
09:30
<&McMartin>
In this case, the implementation details at that level are pretty much fixed in place by a detailed spec
09:30
<&McMartin>
A lot of the unit tests for the lexer/parser/file stuff is actually a single file that just emits everything it can, and on a failure, diffing the hexdump will show you which bit went wrong (the source is tuned to output a monotonically increasing byte stream)
09:31
<&McMartin>
But as for whether the other bits work, well, here's the test case I just finished
09:31
<&McMartin>
'.org $41\n'
09:31
<&McMartin>
'.scope\n'
09:31
<&McMartin>
'_l: .byte _l\n'
09:31
<&McMartin>
'.scope\n'
09:31
<&McMartin>
'_l: .byte _l\n'
09:31
<&McMartin>
'.scend\n'
09:31
<&McMartin>
' .byte _l\n'
09:31
<&McMartin>
And then a .scend which didn't paste in
09:32
<&McMartin>
This runs after base systemic proved that .org worked, and it tests nested namespace environments.
09:32
<&McMartin>
(The output is "ABA")
09:32
<&jerith>
As a style thing, I generally use '\n'.join(['a', 'b', 'c']) instead of implicit string concatenation and literal newlines.
09:33
<&McMartin>
I'm having trouble keeping it under 80 columns -_-
09:46
<&McMartin>
new issue I am not convinced is a bug: "x" and "y" are illegal identifier names
09:46
<&McMartin>
I'm not positive this isn't to make sure your grammar stays unambiguous (those are register names in many other contexts)
09:46
<&McMartin>
On the other hand, "++-+" is totally a legal subtraction, so it's not like I'm not good enough to swing this.
09:47
<&jerith>
Is that according to the spec, or your implementation?
09:47
<&McMartin>
The former is kinda-sorta part of the spec, except that some assemblers also forbid "A".
09:47
<&McMartin>
I don't - cases where you'd use A my assembler takes no argument at all.
09:48
<&McMartin>
++-+ is absolutely intended behavior - strings of +s or -s refer to relatively placed anonymous labels - that expression is the byte distance between the next two anonymous labels.
09:48
<&McMartin>
To do that with the previous two, you'd need to add whitespace, as - - --.
09:49
<&McMartin>
It's officially legal but it's also kind of an abuse; the intended use case of anonymous labels is for extremely tight instruction-skip or simple loops
09:50
<&McMartin>
"lda #$00; ldy #$00; * sta label, y; dey; bne -" being pretty much the canonical example (that zeroes out the page of memory with 'label' at the top)
09:56
<&McMartin>
(I think part of the disconnect here is that in a standard compilation toolchain, end-to-end testing the assembler *is* a unit test)
10:06
<&McMartin>
And there's the two tests I expected to fail failing now that I've written them.
10:31 Rhamphoryncus [rhamph@Nightstar-5697f7e2.abhsia.telus.net] has quit [Client exited]
10:32
<&jerith>
Can I get a sanity check on a (hopefully) concurrency-safe algorithm?
10:32
<&jerith>
Background: I'm using redis to store a sequence number that needs to be incremented by different processes.
10:33
<&jerith>
This number needs to wrap at some point.
10:33
<&jerith>
Redis provides INCR, which is an atomic increment-and-return-new-value operation.
10:34
<&jerith>
Redis also provides EXPIRE, which lets me have a value go away at some point in the future.
10:34
<&jerith>
So, my thought was this:
10:35
<&jerith>
val = INCR counter
10:35
<&jerith>
if val > nearmaxval:
10:35
<&jerith>
flag = INCR lock
10:35
<&jerith>
EXPIRE lock 10
10:36
<&jerith>
if lock == 1:
10:36
<&jerith>
DELETE counter
10:36
<&jerith>
return val
10:36
<&jerith>
(If a key does not exist, INCR initialises it to 0 before incrementing.)
10:36
<&jerith>
I'm reasonably sure that's safe, but I don't really know how to prove it.
10:38 * TheWatcher hrm
10:41 * TheWatcher honestly doesn't know enough redis to say how safe it is
10:42
<@TheWatcher>
Orginarily, I'd be jumpy as hell about doing that without wrapping the whole thing in a mutex, if the aromic incremeent didn't handle wrapping to 0 for me
10:43
<&jerith>
0 is invalid, but that's easy enough to handle.
10:43
<&jerith>
I don't get mutexes unless I implement them myself.
10:44
<&jerith>
(All inter-process communication is async.)
10:44 Attilla [Obsolete@Nightstar-faef4021.as43234.net] has joined #code
10:47
<@TheWatcher>
Anyone ever tried Tickr on linux?
10:58
<&McMartin>
Test cases: written. Broken things: enumerated.
10:59
<&McMartin>
(.incbin was pretty much completely screwed, .charmap is only half implemented, and .require is failing to properly account for different ways of naming the same file - or different files having the same relative path in different files.)
10:59 RichyB [MyCatVerbs@Nightstar-3b2c2db2.bethere.co.uk] has joined #code
11:18 * McMartin :gonk:s up his lexer, heads to bed.
11:19
<&McMartin>
"dey: dey; bne dey" now works >_<
11:33
<@Alek>
well, 0 is invalid, but from what you say, INCR initializes to 0, then immediately increments. meaning it's now nonzero.
11:33
<@Alek>
problem?
11:39
<&jerith>
Alek: No problem there, but it means any solution that involves potentially returning zero needs to handle that case.
11:39
<&jerith>
(Which it can do by checking for zero and retrying if necessary.)
12:07 rms [rstamer@genoce.org] has quit [Operation timed out]
12:19
<@Alek>
ahh. yes.
12:25 iospacedout is now known as iospace
12:41 * McMartin is awakened covered in blood
12:41
<&McMartin>
I guess it's dry tonight
12:44
< gnolam>
o_O ?
12:45
< iospace>
bloody nose?
12:45
<&McMartin>
yeah
12:45
< iospace>
dont get into fights then man
12:46
< froztbyte>
McMartin: apparently you had an issue with yourself and took it outside (the dream)
12:50 * TheWatcher stabs autoconf in the head
13:12
< froztbyte>
heh yeah
13:12
<@ToxicFrog>
jerith: I think you have a race condition there.
13:14
<@ToxicFrog>
Say you have four threads, ABCD.
13:14
<@ToxicFrog>
Threads A and B both INCR, and both get values >nearmaxval.
13:16
<@ToxicFrog>
Oh wait. If lock == 1 should be if flag == 1, shouldn't it?
13:19
<&jerith>
ToxicFrog: So, I've actually modified that a bit.
13:20
<&jerith>
Turns out I have SETNX, which sets a value if the key does not already exist, and then returns True iff the value did not previously exist.
13:20
<@ToxicFrog>
Aah.
13:21
<@ToxicFrog>
(on thinking about it, the code you presented does still have a race condition even if you check flag, but it's harder to bring about)
13:22
<&jerith>
ToxicFrog: Howso?
13:22
<@ToxicFrog>
- A and B INCR
13:22
<@ToxicFrog>
- A INCRs lock, tests flag, resets counter
13:22
<&jerith>
Ah, right.
13:22
<@ToxicFrog>
- C INCRs, gets 0
13:23
<&jerith>
Yes, I fixed that one too.
13:23
<@ToxicFrog>
- entire program gets preempted for long enough for the lock to expire
13:23
<@ToxicFrog>
- B INCRs lock, tests flag, resets counter
13:23
<&jerith>
After locking, I check that the value is still too big.
13:23
<@ToxicFrog>
- D INCRs and gets the same value as C.
13:24
<&jerith>
That lets me delete the lock safely when I'm done and not worry about timeouts.
13:25
<&jerith>
Since the only ways to make the counter smaller are reset (which requires holding the lock) and overflow in redis (which is /far/ away -- 64-bit signed int, and my limit's 32-bit unsigned), I'm safe there.
13:29
<@ToxicFrog>
Hmm. That might still be breakable; I'll see if I can figure out a way while I shower :P
13:31
<&jerith>
ToxicFrog: I'll actually pastebin the code I've written once I have a couple of tests around it.
13:31
<&jerith>
(Turns out I needed to implement a few things in my fake redis first.)
13:38
<@ToxicFrog>
Ok, I can't find a way to break it, but
13:39
<@ToxicFrog>
What's wrong with: return (INCR counter) % (2^32)
14:12
<&jerith>
ToxicFrog: That just pushes the problem farther away. (And makes me handle 0 explicitly.)
14:32 * TheWatcher eyes tickr
14:32
<@TheWatcher>
... how can any remotely modern program that interacts with the internet not support https?
14:33 iospace is now known as iofficespace
14:33
<&McMartin>
Curl doesn't believe in system cert stores
14:36
<@TheWatcher>
It doesn't even use url
14:36
<@TheWatcher>
it uses its own http protocol implementation
14:37
<@TheWatcher>
s/use url/use curl/
14:40
<@TheWatcher>
Which is, these days, frankly madness.
14:41
<&McMartin>
I find it hard to fault people for not using libcurl >_>
14:47
<@TheWatcher>
Sure, but even if they didn't want to do that, wrapping wget and piping the result would give immediate access to far more protocols. All it needs to do is fetch and parse an xml file >.<
14:48
<@TheWatcher>
hell, it oculd wget it, save the file as a local cache, and then parse that!
14:48
<@TheWatcher>
Meh
15:11 himi [fow035@Nightstar-5d05bada.internode.on.net] has quit [Ping timeout: 121 seconds]
15:26 Kindamoody|out is now known as Kindamoody
15:45 celticminstrel [celticminst@Nightstar-5d22ab1d.cable.rogers.com] has joined #code
15:50 * iofficespace has a legit reason for using ping -f
15:50 * iofficespace is not sure if this is a good thing xD
15:50 himi [fow035@Nightstar-5d05bada.internode.on.net] has joined #code
15:50 mode/#code [+o himi] by ChanServ
15:57
<&jerith>
iofficespace: Is mtr not perhaps a better tool?
15:57
< iofficespace>
mtr?
15:58
< iofficespace>
why do i have a feeling that would be like using a sledgehammer when a claw hammer would work just fine :P
15:59
<&jerith>
mtr is a combination of ping and traceroute.
16:00
< iofficespace>
nah
16:00
< iofficespace>
don't need it
16:00
< iofficespace>
just simple ping works here
16:00
<&jerith>
What are you using ping -f for?
16:00
< iofficespace>
i'm testing the interrupts
16:01
<&jerith>
Which interrupts?
16:01
< iofficespace>
MSI... APIC... PIC
16:01
< iofficespace>
:P
16:01 * jerith is asking out of curiosity.
16:02
<&jerith>
Oh, right. You do that kind of thing.
16:02
< iofficespace>
^^
16:02
<&jerith>
It makes more sense now. :-)
16:02
< iofficespace>
:P
16:02
< iofficespace>
it's actually one of the more simpler tests and i can do each ethernet port in 2 minutes or less
16:04
< iofficespace>
the longest part actually is doing the actual ping (-w 60 -f -I)
16:07 * iofficespace ehs at her board
16:25
< iofficespace>
"Ported this code and I don't undertand the comments either."
16:32 Kindamoody is now known as Kindamoody|afk
16:32
<@ToxicFrog>
jerith: how does it "push the problem further away"?
16:36
<&jerith>
ToxicFrog: I don't have to handle wrapping until I hit the 64-bit signed limit redis has.
16:38
<&jerith>
This is what I ended up with: https://github.com/praekelt/vumi/blob/feature/issue-281-txredis/vumi/transports/ smpp/clientserver/client.py#L47
16:40
<@ToxicFrog>
jerith: er. The impression you gave is that redis would wrap it automatically at that p-
16:40
<@ToxicFrog>
Oh wait, signed.
16:40
<@ToxicFrog>
What's the behaviour of modulus of signed integers in this language?
16:41
<&jerith>
It's Python. I'm pretty sure it's sane, though.
16:45
<@ToxicFrog>
>>> -6 % 10
16:45
<@ToxicFrog>
4
16:45
<@ToxicFrog>
Yep
16:45
<@ToxicFrog>
Ok, back to not seeing what the problem is
17:04
<~Vornicus>
modulus of signed integers in python is the same sign as the second number
17:05 * iofficespace swears
17:05
< iofficespace>
somehow i'm building up static more than normal D:
17:05
<~Vornicus>
(Java chooses something different, iirc it's "the magnitude of the modulus is the same regardless of the signs")
17:07
<@ToxicFrog>
Ok, so in that case (INCR counter) % (2^32) should be what you want regardless, where counter is a signed64 that wraps around automatically.
17:07 Vash [Vash@Nightstar-241cb5d4.wlfrct.sbcglobal.net] has joined #code
17:07 mode/#code [+o Vash] by ChanServ
17:08 EvilDarkLord is now known as Maze
18:10
< gnolam>
https://tools.ietf.org/html/draft-tbray-http-legally-restricted-status-00
18:50 Kindamoody|afk is now known as Kindamoody
18:58 Attilla [Obsolete@Nightstar-faef4021.as43234.net] has quit [[NS] Quit: ]
19:01 Attilla [Obsolete@Nightstar-283ec69f.threembb.co.uk] has joined #code
19:08
< froztbyte>
gnolam: interesting, I hadn't seen that one yet
19:18 Attilla [Obsolete@Nightstar-283ec69f.threembb.co.uk] has quit [[NS] Quit: ]
19:18
< RichyB>
451 is definitely the most appropriate number to pick.
19:18 Attilla [Obsolete@Nightstar-faef4021.as43234.net] has joined #code
19:19 Kindamoody is now known as Kindamoody[zZz]
19:23
< celticminstrel>
Whee, text wrapping.
19:35
< celticminstrel>
Just to be sure, "if(string a = get() == 5)" assigns "get()" to a, not "get() == 5", right?
19:35
< celticminstrel>
Or wait.
19:35
< celticminstrel>
It's int, not string. That makes it worse.
19:36
<&jerith>
I'd use parens for clarity.
19:36
< celticminstrel>
It doesn't accept them when there's a declaration.
19:36
<~Vornicus>
it's actually
19:37
<&jerith>
Then I'd split it up.
19:37
<~Vornicus>
a = (get() == 5)
19:37
<&jerith>
What language is this?
19:37
< celticminstrel>
Blargh, that's what I thought it might be. I guess I have to split it!
19:37
<~Vornicus>
Assignment happens after everything else.
19:37
< celticminstrel>
C++
19:39
<~Vornicus>
(specifically: assignment is generally considered a /statement/, which is a container for /expressions/.)
19:39
< celticminstrel>
Actually, an assignment is also an expression.
19:39
< celticminstrel>
This isn't an assignment though; it's an initialization.
19:39
<~Vornicus>
(and all the operators - arithmetic, bitwise, comparison, logical, even the ternary operator - build expressions)
19:40
< celticminstrel>
Which looks the same and works roughly the same way, but is a little different in some ways.
19:55 * iofficespace is about to punt her board out the window
19:55 Maze is now known as EvilDarkLord
19:56
<~Vornicus>
"board"?
19:56
< celticminstrel>
And now I'm making widgets.
19:57
< iofficespace>
Vornicus: yes, board, as in the single board computer i'm working on
20:00
< celticminstrel>
Specifically, text fields and spinners.
20:00
< celticminstrel>
Maybe just text fields. Arrow buttons might be too much work.
20:03
<~Vornicus>
ah
20:06
< celticminstrel>
As a note, is it bad to include SDL side headers directly? For example, SDL_keyboard.
20:18
<@TheWatcher>
No; if you don't need the whole lot, just include what you need, shouldn't make any difference.
20:20
< celticminstrel>
I wish you could define a pure virtual destructor inline.
20:20
< celticminstrel>
Either that or the compiler automatically define it for you if you don't provide a definition.
20:21 Rhamphoryncus [rhamph@Nightstar-5697f7e2.abhsia.telus.net] has joined #code
20:23 RichyB [MyCatVerbs@Nightstar-3b2c2db2.bethere.co.uk] has quit [[NS] Quit: Leaving]
20:36 * McMartin looks at backscroll
20:36
<&McMartin>
Don't assign in tests
20:37
< celticminstrel>
<_<
20:39
< celticminstrel>
Bah, pointers-to-members don't appear to support polymorphic behaviour.
20:41 Attilla_ [Obsolete@Nightstar-5793d088.as43234.net] has joined #code
20:42 Attilla [Obsolete@Nightstar-faef4021.as43234.net] has quit [Ping timeout: 121 seconds]
20:46
< celticminstrel>
Is being able to reference class variables in inline class functions before their declaration a new thing, or was that always the case?
20:47
<&McMartin>
"Always the case" in that the standard has always demanded it
20:47
<&McMartin>
Bear in mind that C++98 didn't have any compliant implementations until like 2005.
20:52
< celticminstrel>
I don't remember it being the case with GCC 4.2, but it was awhile ago; I could be imagining things.
21:16
< Rhamphoryncus>
Haw. My idea if basing each vertex on the height of the surrounding faces is not such a good one. It means an average across 6, so the faces are *very* different from the edges
21:19
< Rhamphoryncus>
Hrm. Reducing it to 3 would be better, but I still don't like the disconnect
21:21
< Rhamphoryncus>
My instinct is that the face's height should dictate the center of that face.. so maybe that and a gradient somehow
21:24
< Rhamphoryncus>
I have a feeling I'm designing myself into a corner
21:32
< celticminstrel>
I'm running out of space for editor controls in my 640x480 window. I think maybe I should upgrade to 1024x768.
21:35
< celticminstrel>
I wish Xcode didn't collapse all project groups when the project file is altered externally.
21:40
<&McMartin>
Wharghbargle
21:40
<&McMartin>
giiiiiiiiiiiiiiiiiiiiiiiiiiit :argh:
21:40
<&McMartin>
That is a ".bin" file
21:41
<&McMartin>
That means you should *not* mangle it
21:41
<&McMartin>
Is there some way to demand git treat files as binary?
21:44
< celticminstrel>
Yay! Just change some constants and nearly everything magically works! Though, 1024x768 might be a bit big... maybe I'll try 800x600...
21:50
< celticminstrel>
That gives me a strip of unused space along the bottom, but perhaps that's a good thing?
21:51
<~Vornicus>
what's this you're making?
21:52
<~Vornicus>
(note: if you hardcode a resolution, you remove part of your userbase. Vash's netbook is 1024x600, of all things)
21:53
< celticminstrel>
Puzzle game.
21:54
<@ToxicFrog>
McMartin: yes, although I don't remember offhand - generally anything that it can't recognize as text (according to file(1) or something) is assumed binary
21:54
<@ToxicFrog>
Furthermore, it should make no difference in any case unless you have installed a precommit hook that prettyprints your code or something
21:54
< celticminstrel>
I imagine hardcoding 640x480 wouldn't be too unacceptable though. :P
21:55
<~Vornicus>
Except that I'd probably go "fuck that's tiny"
21:55
<@ToxicFrog>
Oh, there we go
21:55
< celticminstrel>
Yes, it is.
21:55
<@ToxicFrog>
.gitattributes file, add line "*.bin -text"
21:55
< celticminstrel>
I guess that's why I want to increase it? :P
21:56
<~Vornicus>
So what you'll really want is to allow whatever resolution the user throws at you - if you're not fullscreened you'll almost have to anyway
21:58
< celticminstrel>
The minor thing about that is that increasing the resolution means they can see more of the level at once... which isn't precisely a bad thing, since they see the whole level anyway by pausing and scrolling around, but causes a couple of problems.
21:58 You're now known as TheWatcher[afk]
21:58
< celticminstrel>
Changing the hard-coded resolution is a good start though, since it allows me to see where I assumed a resolution instead of relying on the constants. :P
22:00
< celticminstrel>
Found three already (one of which involves hard-wrapped text).
22:13
< Rhamphoryncus>
hrm. 64 faces -> 45 vertices, but after sharing it's only 32 vertices
22:13
<&McMartin>
13:54 <@ToxicFrog> Furthermore, it should make no difference in any case unless you have installed a precommit hook that prettyprints your code or something
22:14
<&McMartin>
Checking out the .bin files on Windows was turning all the 0x0a's into 0x0d0x0a's, which not surprisingly meant the reference-check part of my test cases failed horribly.
22:15
<&McMartin>
By which I mean seven test cases were failing on Windows spuriously as a result of this~
22:15
<@ToxicFrog>
Aah
22:15
<@ToxicFrog>
I disable CRLF conversion everywhere and just use LF-aware editors even on windows, so.
22:15
<&McMartin>
(The test cases were designed to emit binary that was typable text, so I suspect this confused file(1))
22:16
<@ToxicFrog>
(yeah, it would)
22:16
<@ToxicFrog>
(git doesn't look at the extensions unless you tell it to with a .gitattributes or .gitignore entry)
22:16
<&McMartin>
(Righto then)
22:16
<&McMartin>
(I guess I'd better tell it about .pdf too >_<)
22:17
<&McMartin>
In other news, it turns out that Commodore OS Vision is actually a spin of Linux Mint.
22:17
<@ToxicFrog>
Hee
22:18
<&McMartin>
On the plus side, I believe that means the Ubuntu binaries of the VMware tools should work on it.
22:20
< Rhamphoryncus>
I could use the dual of triangular tessellation, which'd mean hexagonal with 32 entries. Rendering them though would mean chopping them up, probably into 6 triangles, so I actually end up with 196
22:21
<&McMartin>
Also, 92 test cases written, all pass on Linux, Windows, and Pythons 2.7 and 2.3 \o/
22:22
<~Vornicus>
nice.
22:25 * McMartin also resisted making one of the warnings be "You are a terrible person"
22:30
<@ToxicFrog>
your eyebrows cannot protect you now
22:31 Attilla_ [Obsolete@Nightstar-5793d088.as43234.net] has quit [Ping timeout: 121 seconds]
22:31
<&McMartin>
I instead made the warning a description of what they did that made them terrible
22:31
<&McMartin>
"WARNING: using opcode as label"
22:33
< gnolam>
ToxicFrog: you lie - you have no eyebrows!
22:33
<&McMartin>
Also, my lack of permadeath failed to save me -_-
22:34
< gnolam>
(Actual line - at least according to the hilariously Engrish subtitles - from one of the Fong Sai Yuk movies.)
22:34 * McMartin may make one more go at that save but will end up having to delete it because it's saved at an unwinnable point.
22:36 Attilla [Obsolete@Nightstar-d5f09953.as43234.net] has joined #code
22:44
< froztbyte>
uh: http://highscalability.com/blog/2012/6/11/monday-fun-seven-databases-in-song.htm l
23:01
<@ToxicFrog>
Curse C's lack of introspection!
23:02 * ToxicFrog sads as his third 80-line switch statement of the day
23:24 celticminstrel [celticminst@Nightstar-5d22ab1d.cable.rogers.com] has quit [[NS] Quit: And lo! The computer falls into a deep sleep, to awake again some other day!]
23:24 You're now known as TheWatcher
23:39 iofficespace is now known as io|driving
23:47
< gnolam>
froztbyte: heh
23:56
<&McMartin>
TF: Tagged Unions Ahoy?
23:56
<&McMartin>
(aka "Signs you probably should be writing this in OCaml except for the problem domain"~)
--- Log closed Wed Jun 13 00:00:47 2012
code logs -> 2012 -> Tue, 12 Jun 2012< code.20120611.log - code.20120613.log >

[ Latest log file ]