code logs -> 2012 -> Fri, 08 Jun 2012< code.20120607.log - code.20120609.log >
--- Log opened Fri Jun 08 00:00:47 2012
00:00
< Rhamphoryncus>
yeah
00:01
< Rhamphoryncus>
My off by one involved this line:
00:01
< Rhamphoryncus>
invariant(x + y + z == N, "Indexes do not add up to size: %i+%i+%i != %i", x, y, z, N);
00:01
< Rhamphoryncus>
Needless to say I was confused by not getting a final value printed
00:02
< RichyB>
Hrmn? What is wrong with that? The counts all come out right.
00:03
< celticminstrel>
Why are you forced to use printf?
00:03
< Rhamphoryncus>
terminate called after throwing an instance of 'InvariantFailure'
00:03
< Rhamphoryncus>
what(): Indexes do not add up to size: 0+0+0 !=
00:03
< Rhamphoryncus>
that's what it'd actually print out
00:03
< RichyB>
oh
00:03
< Rhamphoryncus>
celticminstrel: cout is incredibly crude for the same line
00:03
< RichyB>
I see what you mean.
00:04
< celticminstrel>
How so?
00:04
< RichyB>
Thought you meant the line itself was wrong.
00:04
< Rhamphoryncus>
RichyB: nah
00:04
< Rhamphoryncus>
celticminstrel: for starters it doesn't have format strings
00:04
< celticminstrel>
But you're not even using them there.
00:04
< Rhamphoryncus>
I use them 4 times
00:04
< RichyB>
celticminstrel, if, invariant(x +y + z == N) << "Indexes do not add up to size: " <<x << "+" << y << "+" << "z" << " != " << N << "\n";
00:04
< celticminstrel>
Besides, it does have format flags, though I suppose they're a bit clunkier.
00:05
< RichyB>
I mean Jesus I got so bored typing that.
00:05
< Rhamphoryncus>
RichyB: that's not even sufficient. You need to tell whatever magic object invariant() returns that you're actually done and it can raise the exception now
00:06
< RichyB>
Oh aye, you can't exactly land a hook on the semicolon.
00:06
< Rhamphoryncus>
The equivalent to endl. Which is error prone (very easy to miss and make your check a no-op)
00:06
< celticminstrel>
Huh?
00:06
< celticminstrel>
Oh, right.
00:06
< celticminstrel>
I see what you mean.
00:07
< Rhamphoryncus>
It should be possible to do it right in C++11 via variadic templates, but I tried and they were a PITA. Not worth the time to get working
00:07
< celticminstrel>
You mean like a variadic template version of printf?
00:08
< Rhamphoryncus>
My intent was to allow this: invariant(x + y + z == N, "Indexes do not add up to size: {}+{}+{} != {}", x, y, z, N);
00:08
< RichyB>
Hrmn. Something like, invariant(x + y + z == N, _1 << "Indexes to not add up to"...); using boost::lambda or something.
00:08
< RichyB>
But really, to Hell with operator<<.
00:09
< celticminstrel>
I like operator<<
00:09
< Rhamphoryncus>
Conceptually it's not that hard, except it's done via functional-style recursion (head of your "list" and tail, pass tail to yourself recursively), and printing a string as you go is ugly
00:10
< RichyB>
It's more like a continuation pass up the line of << operators but still. Oh god the syntax.
00:10
< Rhamphoryncus>
Having a type-safe way of printing a single object that doesn't require declaring the specific format? That's good. Everything else about it? Bad.
00:10
< celticminstrel>
Everything else? :P
00:11
< Rhamphoryncus>
RichyB: I mean variadic templates are recursive
00:11
< celticminstrel>
(Back in a moment.)
00:11 celticminstrel [celticminst@Nightstar-5d22ab1d.cable.rogers.com] has quit [[NS] Quit: KABOOM! It seems that I have exploded. Please wait while I reinstall the universe.]
00:11 celticminstrel [celticminst@Nightstar-5d22ab1d.cable.rogers.com] has joined #code
00:11
< Rhamphoryncus>
<RichyB> celticminstrel, if, invariant(x +y + z == N) << "Indexes do not add up to size: " <<x << "+" << y << "+" << "z" << " != " << N << "\n";
00:11
< celticminstrel>
Didn't I see that?
00:11
< Rhamphoryncus>
That's par for operator<<. Actually it's a little better because the line was already fairly long
00:12
< RichyB>
Hrmn.
00:12
< RichyB>
Actually, if you had proper macros, you could do a *really* nice printf library.
00:13
< Rhamphoryncus>
Usually I have something like this: printf("Coord: %ix%i\n", x, y); and it gets replaced with std::cout << "Coord: " << x << "x" << y << std::endl;
00:15
< RichyB>
mprintf("%f, %f, %s, %s, %s", a, b, c, d, e); and have it generate a bunch of invocations of static methods (overloaded on arguments' classes), and even pass the information (e.g. the precision bits) from the escape code into the methods, possibly also in a way that shows up in the type system.
00:15
< Rhamphoryncus>
RichyB: C++11 variadic templates do allow that. It's just agony, that's all
00:16
< RichyB>
*calls to static methods. I accidentally a sentence fragment.
00:16
< celticminstrel>
Isn't C11 adding a form of overloading?
00:16
< Rhamphoryncus>
No idea about C
00:17
< Rhamphoryncus>
Revising C is language necromancy :P
00:17
< celticminstrel>
XD
00:18
< celticminstrel>
It's funny how the two languages are adding some of the same things in different ways, though.
00:26
<~Vornicus>
oh right, torchlight has all these awesome modding tools. I wonder precisely how powerful they are.
00:29
< Rhamphoryncus>
const int entries = N * (N+1) / 2;
00:29
< Rhamphoryncus>
that took way too long to figure out x_x
00:30
< celticminstrel>
Don't worry, I took forever to figure out which portion of the screen to draw when scrolling was constricted.
00:31
< Rhamphoryncus>
That's the number of entries in a 5x5 triangle. Stored as a right triangle
00:31
< celticminstrel>
Oh hey, it does look familiar.
00:32
< celticminstrel>
(Note, I said "screen" where I meant "level".)
00:32 Derakon[AFK] is now known as Derakon
00:33
< Rhamphoryncus>
This I don't feel so bad about, since it took me much longer and doesn't feel so obvious:
00:33
< Rhamphoryncus>
int offset = x*(x-1) / 2;
00:33
< Rhamphoryncus>
Which is.. calculate the usual x*N + y, then subtract offset for the non-existent entries
00:33 io|driving is now known as iospace
00:37 Vash [Vash@Nightstar-241cb5d4.wlfrct.sbcglobal.net] has joined #code
00:37 mode/#code [+o Vash] by ChanServ
00:47
< Rhamphoryncus>
So, got my triangle indexing done.. only to realize it's specifically for vertices and I need a function for faces too
00:49
< Rhamphoryncus>
Which is complicated because there's two orientations for the faces
00:50
< Rhamphoryncus>
starting at a ratio of 3:1 and approaching 1:1 as the subdivision gets larger
00:51
<~Vornicus>
Fortunately face direction is a simple parity check
00:52
< Rhamphoryncus>
hmm?
00:53
<~Vornicus>
the in-row index of your face, mod 2, tells you which direction the face points.
00:53
< Rhamphoryncus>
ah, yes
00:54
< Rhamphoryncus>
But how should I present it? mixed rows? Alternating rows? All one direction, then all the other direction?
00:54
<~Vornicus>
I'd say mixed rows
00:55
< Rhamphoryncus>
My immediate use is to generate a random heightmap for the faces, then to produce a vertex heightmap using the average of the surrounding faces
00:56
< Rhamphoryncus>
Which.. would want mixed rows, but also an inverted form of mixed rows
00:56
< Rhamphoryncus>
no, wait :P
00:57
< Rhamphoryncus>
9 rows of vertices, 8 rows of faces. That's just the two adjacent mixed rows
00:59
< Rhamphoryncus>
A vertex may get as little as 1 face or as 6 faces each from a different heightmap
01:01
< Rhamphoryncus>
and if I tried pushing that calculation to the GPU I'd need 15 heightmaps in texture units just to render one
01:05
< Rhamphoryncus>
Which is a pretty good justification for precalculating them for the GPU
01:06
< Rhamphoryncus>
I only have 16 texture image units to work with. Or 32, I still haven't figured that out
--- Log closed Fri Jun 08 01:19:05 2012
--- Log opened Fri Jun 08 01:30:34 2012
01:30 TheWatcher[zZzZ] [chris@Nightstar-3762b576.co.uk] has joined #code
01:30 Irssi: #code: Total of 26 nicks [7 ops, 0 halfops, 0 voices, 19 normal]
01:30 mode/#code [+o TheWatcher[zZzZ]] by ChanServ
01:31 Irssi: Join to #code was synced in 39 secs
01:43 Attilla [Obsolete@Nightstar-b906080b.as43234.net] has quit [Ping timeout: 121 seconds]
01:48 Attilla [Obsolete@Nightstar-67f26902.as43234.net] has joined #code
01:56
< Rhamphoryncus>
hrm mixed rows means 3 different methods of indexing
02:08 Attilla [Obsolete@Nightstar-67f26902.as43234.net] has quit [Ping timeout: 121 seconds]
02:10
< celticminstrel>
Hm. Is a static variable in a member function equivalent to a class instance variable or a class static variable?
02:10 Kindamoody[zZz] is now known as Kindamoody
02:12
< RichyB>
The most logically-consistent answer is class-static variable.
02:15
<~Vornicus>
oh, right, that's why I didn't ever get around to doing modding on torchlight - there's so much going on.
02:21
<&Derakon>
Howso?
02:23 Kindamoody [Kindamoody@Nightstar-6154a72a.tbcn.telia.com] has quit [[NS] Quit: I'll be back soon.]
02:35 Kindamoody|afk [Kindamoody@Nightstar-6154a72a.tbcn.telia.com] has joined #code
02:35 mode/#code [+o Kindamoody|afk] by ChanServ
02:36 Kindamoody|afk is now known as Kindamoody
02:42
<~Vornicus>
I guess most of it is I forget how much data you need to make something like this. there's the functions that generate strength values for affixes, the arcana that is the map generator, the absolutely gargantuan transmute tables
02:46
< Rhamphoryncus>
yeah
02:47
< McMartin>
Belated: Yeah, class-static
02:47
< McMartin>
Also: Don't Do That, Use A Class-Static.
02:48
< Rhamphoryncus>
That's still global state, just out of the global namespace. Better to make it local state
02:59
< McMartin>
Global state is underrated
03:00
< celticminstrel>
I seem to remember getting errors before when having multiple declarations of a variable, where all but one are declared extern. It seems to work now though. Is that a new thing?
03:00
< McMartin>
It's the Zero-One-Infinity rule, not the Zero-Infinity rule.
03:00
< McMartin>
celticminstrel: Yoy may be accidentally namespacing some of them. That should still be a linker error.
03:01
< celticminstrel>
I don't think I was.
03:01
< celticminstrel>
I recall doing some preprocessor trickery to exclude the extern definition from the file that had the non-extern definition.
03:01
< celticminstrel>
But this isn't a project I looked at recently.
03:01
< celticminstrel>
So I can't remember too clearly...
03:16
< Rhamphoryncus>
I can't remember how that works either
03:20
< celticminstrel>
Why on earth is SDL_PollEvent causing a segfault.
03:20
< Rhamphoryncus>
not initialized/already cleaned up.. wrong thread..
03:21
< celticminstrel>
Pretty sure it's none of those. It's the main thread, and it's after the init call and before the cleanup.
03:22
< celticminstrel>
And the event being passed for it to write to is a local variable.
03:25
< celticminstrel>
The actual location of the crash is an Objective-C runtime function.
03:27
< celticminstrel>
On an unrelated note, why am I even using shared_ptr if I need to call reset() to free it manually?
03:50 McMartin [mcmartin@Nightstar-3a3f32ba.pltn13.sbcglobal.net] has quit [Ping timeout: 121 seconds]
04:08 AnnoDomini [annodomini@Nightstar-354a8bcb.connect.netcom.no] has joined #code
04:08 mode/#code [+o AnnoDomini] by ChanServ
04:30 Derakon is now known as Derakon[AFK]
04:47 Derakon[AFK] is now known as Derakon
05:00 RichyB [MyCatVerbs@Nightstar-3b2c2db2.bethere.co.uk] has quit [[NS] Quit: Leaving]
05:07 McMartin [mcmartin@Nightstar-f74d663f.pltn13.sbcglobal.net] has joined #code
05:07 mode/#code [+ao McMartin McMartin] by ChanServ
05:25 ToxicFrog [ToxicFrog@ServerAdministrator.Nightstar.Net] has quit [Operation timed out]
05:26 ToxicFrog [ToxicFrog@ServerAdministrator.Nightstar.Net] has joined #code
05:26 mode/#code [+o ToxicFrog] by ChanServ
05:28 iospace is now known as iospacedout
05:30 McMartin [mcmartin@Nightstar-f74d663f.pltn13.sbcglobal.net] has quit [Connection reset by peer]
05:33 McMartin [mcmartin@Nightstar-21ffa35f.pltn13.sbcglobal.net] has joined #code
05:33 mode/#code [+ao McMartin McMartin] by ChanServ
05:44 Vash [Vash@Nightstar-241cb5d4.wlfrct.sbcglobal.net] has quit [[NS] Quit: I lovecraft Vorn!]
06:27 McMartin [mcmartin@Nightstar-21ffa35f.pltn13.sbcglobal.net] has quit [Ping timeout: 121 seconds]
06:34 McMartin [mcmartin@Nightstar-21ffa35f.pltn13.sbcglobal.net] has joined #code
06:34 mode/#code [+ao McMartin McMartin] by ChanServ
06:35 Derakon is now known as Derakon[AFK]
06:41 McMartin [mcmartin@Nightstar-21ffa35f.pltn13.sbcglobal.net] has quit [Ping timeout: 121 seconds]
06:47 McMartin [mcmartin@Nightstar-12b6d0ce.pltn13.sbcglobal.net] has joined #code
06:47 mode/#code [+ao McMartin McMartin] by ChanServ
07:18 Rhamphoryncus [rhamph@Nightstar-5697f7e2.abhsia.telus.net] has quit [Client exited]
08:10 himi [fow035@Nightstar-5d05bada.internode.on.net] has quit [Ping timeout: 121 seconds]
08:18 himi [fow035@Nightstar-5d05bada.internode.on.net] has joined #code
08:18 mode/#code [+o himi] by ChanServ
08:28 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!]
09:25 You're now known as TheWatcher
10:06 McMartin [mcmartin@Nightstar-12b6d0ce.pltn13.sbcglobal.net] has quit [Ping timeout: 121 seconds]
10:19 Attilla [Obsolete@Nightstar-67f26902.as43234.net] has joined #code
11:51 himi [fow035@Nightstar-5d05bada.internode.on.net] has quit [Connection closed]
11:54 Attilla [Obsolete@Nightstar-67f26902.as43234.net] has quit [Ping timeout: 121 seconds]
12:00 Attilla [Obsolete@Nightstar-a597bcab.as43234.net] has joined #code
12:08 himi [fow035@Nightstar-5d05bada.internode.on.net] has joined #code
12:08 mode/#code [+o himi] by ChanServ
12:11 himi-cat [fow035@Nightstar-5d05bada.internode.on.net] has joined #code
12:14 himi-wr0k [fow035@Nightstar-5d05bada.internode.on.net] has joined #code
12:15 himi-cat [fow035@Nightstar-5d05bada.internode.on.net] has quit [[NS] Quit: Leaving]
12:15 himi-wr0k [fow035@Nightstar-5d05bada.internode.on.net] has quit [Connection closed]
12:29 himi-cat [fow035@Nightstar-5d05bada.internode.on.net] has joined #code
12:30 himi-cat [fow035@Nightstar-5d05bada.internode.on.net] has quit [[NS] Quit: Leaving]
12:43 Kindamoody is now known as Kindamoody|out
13:35 Attilla [Obsolete@Nightstar-a597bcab.as43234.net] has quit [Ping timeout: 121 seconds]
13:40 Attilla [Obsolete@Nightstar-0d3e48c2.as43234.net] has joined #code
14:03 celticminstrel [celticminst@Nightstar-5d22ab1d.cable.rogers.com] has joined #code
14:03 himi [fow035@Nightstar-5d05bada.internode.on.net] has quit [Connection closed]
14:05 himi [fow035@Nightstar-5d05bada.internode.on.net] has joined #code
14:05 mode/#code [+o himi] by ChanServ
14:07 himi [fow035@Nightstar-5d05bada.internode.on.net] has quit [Connection closed]
14:07 himi [fow035@Nightstar-5d05bada.internode.on.net] has joined #code
14:07 mode/#code [+o himi] by ChanServ
14:40 iospacedout is now known as iofficespace
15:18 * TheWatcher hairpulls at doxygen and its tagfiles
15:20
< iofficespace>
having fun are we?
15:29
<@TheWatcher>
If by "fun" you mean "massive frustration", yes.
15:31
< iofficespace>
just remember
15:32
< iofficespace>
you could be running 60+ page long test docs
15:32
<@TheWatcher>
No
15:33
<@TheWatcher>
I'd write a fucking script to do that for me
15:33
< iofficespace>
oh i would too but most of it is "ok, get handle #X and use it in command Y"
15:35
< iofficespace>
aka shit that's not easily automated
15:39 himi [fow035@Nightstar-5d05bada.internode.on.net] has quit [Client closed the connection]
15:50 himi [fow035@Nightstar-5d05bada.internode.on.net] has joined #code
15:50 mode/#code [+o himi] by ChanServ
15:59 AnnoDomini [annodomini@Nightstar-354a8bcb.connect.netcom.no] has quit [[NS] Quit: Going to play some more Ottomans!]
16:07 himi [fow035@Nightstar-5d05bada.internode.on.net] has quit [Connection closed]
16:08 himi [fow035@Nightstar-5d05bada.internode.on.net] has joined #code
16:08 mode/#code [+o himi] by ChanServ
16:13 himi [fow035@Nightstar-5d05bada.internode.on.net] has quit [Connection closed]
16:16 himi [fow035@Nightstar-5d05bada.internode.on.net] has joined #code
16:16 mode/#code [+o himi] by ChanServ
16:20 himi [fow035@Nightstar-5d05bada.internode.on.net] has quit [Client closed the connection]
16:21 himi [fow035@Nightstar-5d05bada.internode.on.net] has joined #code
16:21 mode/#code [+o himi] by ChanServ
16:21 himi [fow035@Nightstar-5d05bada.internode.on.net] has quit [Connection closed]
16:30 himi [fow035@Nightstar-5d05bada.internode.on.net] has joined #code
16:30 mode/#code [+o himi] by ChanServ
16:32 himi [fow035@Nightstar-5d05bada.internode.on.net] has quit [Connection closed]
16:33 himi [fow035@Nightstar-5d05bada.internode.on.net] has joined #code
16:33 mode/#code [+o himi] by ChanServ
16:39 himi-cat [fow035@Nightstar-5d05bada.internode.on.net] has joined #code
16:45 Rhamphoryncus [rhamph@Nightstar-5697f7e2.abhsia.telus.net] has joined #code
16:46 himi-wr0k [fow035@Nightstar-5d05bada.internode.on.net] has joined #code
16:46 himi-wr0k [fow035@Nightstar-5d05bada.internode.on.net] has quit [[NS] Quit: Leaving]
16:50 himi-cat [fow035@Nightstar-5d05bada.internode.on.net] has quit [Client closed the connection]
16:50 himi [fow035@Nightstar-5d05bada.internode.on.net] has quit [Connection closed]
16:51 himi [fow035@Nightstar-5d05bada.internode.on.net] has joined #code
16:51 mode/#code [+o himi] by ChanServ
16:53 himi [fow035@Nightstar-5d05bada.internode.on.net] has quit [Connection closed]
16:53 himi [fow035@Nightstar-5d05bada.internode.on.net] has joined #code
16:53 mode/#code [+o himi] by ChanServ
17:05 ToxicFrog [ToxicFrog@ServerAdministrator.Nightstar.Net] has quit [Operation timed out]
17:21 ToxicFrog [ToxicFrog@ServerAdministrator.Nightstar.Net] has joined #code
17:21 mode/#code [+o ToxicFrog] by ChanServ
17:42 Derakon[AFK] [Derakon@Nightstar-a3b183ae.ca.comcast.net] has quit [Operation timed out]
18:09 Attilla [Obsolete@Nightstar-0d3e48c2.as43234.net] has quit [Ping timeout: 121 seconds]
18:14 Attilla [Obsolete@Nightstar-29d43c09.as43234.net] has joined #code
19:45 Atreus is now known as Tarinaky
19:45 McMartin [mcmartin@Nightstar-e57bcc72.pltn13.sbcglobal.net] has joined #code
19:45 mode/#code [+ao McMartin McMartin] by ChanServ
19:49 Vornucopia [NSwebIRC@D49C05.CF8142.A46A7A.8BFC54] has joined #code
19:50 Kindamoody|out is now known as Kindamoody
19:59 Vornucopia [NSwebIRC@D49C05.CF8142.A46A7A.8BFC54] has quit [Ping timeout: 121 seconds]
20:14 Vornucopia [NSwebIRC@D49C05.CF8142.A46A7A.8BFC54] has joined #code
20:21 Vornucopia [NSwebIRC@D49C05.CF8142.A46A7A.8BFC54] has quit [[NS] Quit: Page closed]
20:21 Vornucopia [NSwebIRC@D49C05.CF8142.A46A7A.8BFC54] has joined #code
20:31 Kindamoody is now known as Kindamoody[zZz]
20:36 Vornucopia [NSwebIRC@D49C05.CF8142.A46A7A.8BFC54] has quit [Ping timeout: 121 seconds]
22:21 iofficespace is now known as io|afk
22:29
< celticminstrel>
Hm, so, can I use boost::lexical_cast to save and restore the state of a random number generator?
--- Log closed Fri Jun 08 22:54:49 2012
--- Log opened Fri Jun 08 22:54:55 2012
22:54 TheWatcher [chris@Nightstar-3762b576.co.uk] has joined #code
22:54 Irssi: #code: Total of 23 nicks [6 ops, 0 halfops, 0 voices, 17 normal]
22:54 mode/#code [+o TheWatcher] by ChanServ
22:55 Irssi: Join to #code was synced in 40 secs
22:56 Vash [Vash@Nightstar-241cb5d4.wlfrct.sbcglobal.net] has joined #code
22:56 mode/#code [+o Vash] by ChanServ
23:18 Attilla [Obsolete@Nightstar-29d43c09.as43234.net] has quit [Ping timeout: 121 seconds]
23:21 Vash [Vash@Nightstar-241cb5d4.wlfrct.sbcglobal.net] has quit [[NS] Quit: I lovecraft Vorn!]
23:24 Attilla [Obsolete@Nightstar-308f5cce.as43234.net] has joined #code
23:36 Attilla [Obsolete@Nightstar-308f5cce.as43234.net] has quit [Ping timeout: 121 seconds]
23:41 Attilla [Obsolete@Nightstar-52ef0425.as43234.net] has joined #code
--- Log closed Sat Jun 09 00:00:08 2012
code logs -> 2012 -> Fri, 08 Jun 2012< code.20120607.log - code.20120609.log >

[ Latest log file ]