code logs -> 2010 -> Wed, 09 Jun 2010< code.20100608.log - code.20100610.log >
--- Log opened Wed Jun 09 00:00:28 2010
00:12 Attilla [Attilla@Nightstar-ce2c02ef.threembb.co.uk] has quit [[NS] Quit: ]
00:17 You're now known as TheWatcher[T-2]
00:26 You're now known as TheWatcher[zZzZ]
00:36
< PinkFreud>
hmmm. having some difficulties in Manufactoria.
00:37
< PinkFreud>
trying to figure out how to rearrange the colors in Rocket Planes!
00:39
< McMartin>
Heh.
00:39
< McMartin>
Reiver had an unrestrainedly awesome solution.
00:39
< PinkFreud>
oh?
00:39
< McMartin>
He was two parts from the absolute minimum possible, I think.
00:39
< McMartin>
You've gotten the basic optimization hints, right?
00:40
< McMartin>
Like, you can enter branches from anywhere, and conveyors can cross, and copy-paste exists
00:40
< PinkFreud>
copy-paste?
00:40
< PinkFreud>
I know I can use the writers to add something to the end.
00:45
< celticminstrel>
I solved Rocket Planes a little while ago, and now I've just solved Soldiers.
00:45
< celticminstrel>
Uh, sorry, Officers.
00:45
< celticminstrel>
I can't figure out how to split the string though.
00:46
< McMartin>
PinkFreud: Copy-paste as in "chunks of machinery".
00:46
< PinkFreud>
problem I'm running into is that the decision modules always pop the next one off the stack, unless it's determined to be null.
00:46
< McMartin>
Yup.
00:46
< McMartin>
This makes having doing a copy-as-you-read a very important technique.
00:46
< PinkFreud>
yeah. I can do that with the writers.
00:46
< McMartin>
Also, any color you aren't branching on counts as null and is read non-destructively.
00:46
< McMartin>
In my solutions my first move was pretty much always "write green".
00:46
< PinkFreud>
McMartin: yep, I know that too.
00:47
< PinkFreud>
I've replaced all blue with green.
00:47
< PinkFreud>
I wound up writing a yellow to mark the end of the string.
00:47
< McMartin>
Hm.
00:47
< McMartin>
That doesn't buy you a lot, I don't think.
00:48
< McMartin>
You want to either bubblesort or do a "if you find a blue this pass, don't copy that one and then prepend it to the next copy" sort of deal.
00:48
< PinkFreud>
I can loop with a yellow/green reader, using the yellow to go back to the main conveyor, or green to rewrite blue.
00:48
< PinkFreud>
the problem comes in dealing with red.
00:49
< McMartin>
Yeah. Reiv's algo was "After seeing a red, don't copy the first blue you see, but copy everything else; then prepend that blue to the next pass. If there *aren't* any blues after the first red, you're done."
00:49
< McMartin>
Which is, come to think of it, an exchange sort
00:50
< PinkFreud>
hmm
00:51
< PinkFreud>
so he didn't use yellow/green at all?
00:52
< McMartin>
He used yellow as his string terminator.
00:52
< PinkFreud>
ahh hah. that's what I'm doing, at least.
00:52
< McMartin>
That's a pretty fundamental technique.
01:05
< celticminstrel>
For the sorting, I simply grabbed the first red, then added it to the end of the string.
01:06
< celticminstrel>
I never thought of bubblesort...
01:08
<@ToxicFrog>
celticminstrel: pretty sure your approach is better than bubblesorting.
01:08
< celticminstrel>
Probably.
01:09
< celticminstrel>
I just have Generals, Police, and Academics left, plus the two unlocked by the latter two.
01:11
< McMartin>
If you've done Officers, Generals should be straightforward
01:11
< McMartin>
Police is Hard (tm)
01:12
< McMartin>
The one unlocked by Academics gives you a cutscene and also unlocks the bonus levels.
01:12
< McMartin>
It does not, as I initially suspected, end the game immediately~
01:14
< celticminstrel>
Police is indeed hard.
01:14
< celticminstrel>
I'm pretty sure I can do generals; I described the algorithm to someone else just last night.
01:16
< McMartin>
I was going about Police the wrong way on my first cut, though
01:16
< McMartin>
It's worth noting that the followup to Police includes the entirety of Police as the first half of the solution.
01:16
< celticminstrel>
Eep.
01:17
< McMartin>
(It is, in fact, Police and the first bonus level strung together, which is weird because while it's *possible* to reach the first bonus level before it, it's kind of unlikely.)
01:18
< celticminstrel>
There are levels that I cannot see?
01:19
< McMartin>
Yes.
01:22 gnolam [lenin@Nightstar-38637aa0.priv.bahnhof.se] has quit [[NS] Quit: Z?]
01:24 Derakon[AFK] is now known as Derakon
01:47 Derakon is now known as Derakon[AFK]
02:05
< PinkFreud>
I gave in and looked at other peoples' solutions for Rocket Planes! and Androids! I managed everything else up to then on my own, though
02:06
< celticminstrel>
I managed everything so far on my own. I think I looked at someone else's solution for Police, which I haven't yet solved, but I can't remember anything from that.
02:06
< celticminstrel>
Police would be the one I'm stuck on. Possibly Academics, though I haven't given that one any thought yet.
02:07
< PinkFreud>
ahh
02:08
< celticminstrel>
Ahh?
02:20
< PinkFreud>
as in, ahh hah
02:20
< PinkFreud>
heh
02:21
< PinkFreud>
I have everything completed through the colum containing Androids/Roborockets/Roboplanes/...
02:21
< PinkFreud>
I also have Rocket Plans completed by virtue of looking it up. It was kicking my ass. :(
02:32
< PinkFreud>
I just upgraded robotoast to 23 parts 14 seconds.
02:32
< PinkFreud>
:)
02:36
<@Vornicus>
Rocket Planes was mean, yeah.
02:36
<@Vornicus>
Reiver's solution is the same as the optimal one.
02:41
< PinkFreud>
23/15 secs on Robotoast
02:41
< PinkFreud>
:)
02:41
< PinkFreud>
That toaster goes the *long* way around
02:44
< PinkFreud>
?lvl=1&code=i13:6f7;c14:5f0;c13:5f3;c14:6f1;i13:7f5;i11:7f4;i11:8f2;c10:8f3;c10: 9f2;c11:9f1;i12:6f5;i11:6f0;c11:5f0;c10:5f3;c10:6f3;i12:7f5;c10:7f2;c14:7f1;c13: 8f2;c14:8f3;c14:9f0;i13:9f2;c12:8f0;
02:53
< Tarinaky>
FFFF- q.q Wall of errors :/
02:54
< PinkFreud>
eh?
02:54
< Tarinaky>
C++ STL.
02:54
< Tarinaky>
Wall of errors.
02:54
< PinkFreud>
heh
02:54 * Tarinaky is just complaining to no-one in particular.
02:56
< Tarinaky>
Specifically std::auto_ptr. I can never get the f-ing thing to work :/
03:04
< PinkFreud>
bleh
03:04
< McMartin>
Oh god
03:04
< McMartin>
The correct way to use std::auto_ptr is to use boost::shared_ptr instead
03:05
< McMartin>
Whatever it is you want, std::auto_ptr is not it.
03:06
< Tarinaky>
:/
03:06
< Tarinaky>
That bad?
03:06
< McMartin>
Its primary feature is that it rewrites itself to become a null pointer when read in certain ways.
03:06
< McMartin>
As, you know, a side effect of reading it.
03:07
< McMartin>
Which can also happen in compiler-generated code with no direct source link.
03:07
< McMartin>
Whatever you want, auto_ptr is not it
03:07
< Tarinaky>
I thought auto_ptr::get() would return just the raw data? :x
03:07
< McMartin>
It dose.
03:08
< McMartin>
*does
03:08
< Tarinaky>
... isn't that... umm... how you read it then?
03:08
< Tarinaky>
Or am I missing something >.>
03:08
< McMartin>
No, it's a smart pointer. If you have an auto_ptr<std::vector> x, for instance, you should be able to read the size with x->size()
03:09
< McMartin>
However, if you then pass x to a function that takes an auto_ptr<std::vector>, x reassigns itself to null as part of the call.
03:09
< McMartin>
But it doesn't if it's an auto_ptr<std::vector>&.
03:09
< Tarinaky>
Ah.
03:10
< McMartin>
Meanwhile, if what you really want is "I want this pointer to be deleted when I leave this scope", that's boost::scoped_ptr<>, and if you want "I want this pointer to be deleted when I stop having live variables referring to it", that's boost::shared_ptr<>.
03:10
< McMartin>
auto_ptr is "I want there to be exactly one pointer to this memory object at any given time, and I will burn every variable I see to enforce this"
03:11
< Tarinaky>
I see.
03:13
< McMartin>
get() also returns the raw pointer, not the raw data, which can be hazardous if you're letting that pointer escape.
03:13
< McMartin>
It could find that the data it thinks should be there has been freed by the memory manager because the auto_ptr left scope.
03:14
< Tarinaky>
I'm avoiding using boost. I just added a couple extra lines to explicitly delete stuff >.>
03:15
< McMartin>
(A pointer "escapes" a function if that function copies it somewhere that will survive the function finishing)
03:15
< McMartin>
Boost::Smart_ptr is a header file that links no libraries. Just sayin'.
03:16
< Tarinaky>
>.> is there a manual for it?
03:16
< Tarinaky>
I just realised I 'missed a spot' wrt delete.
03:17
< McMartin>
Hrm
03:17
< McMartin>
Is this "I'm new()ing it at the start and want to delete() it at the end?"
03:17
< McMartin>
Because there's a much easier solution if there is
03:18
< McMartin>
http://www.boost.org/doc/libs/1_43_0/libs/smart_ptr/smart_ptr.htm is the docs, at any rate
03:19
< Tarinaky>
Depends how you define start. It's for reading data in from files...
03:20
< Tarinaky>
So serialisation/deserialisation. :x
03:21
< McMartin>
So, no.
03:21
< McMartin>
If it were within a single function you could just Not Heap Allocate It.
03:21
< Tarinaky>
Oh no.
03:21
< McMartin>
Also, is the delete() happening at the end of the program?
03:22
< McMartin>
Because if so you can rely on the process shutdown to clean it up.
03:22
< Tarinaky>
No.
03:23
< Tarinaky>
delete is happening when a new save file is loaded.
03:34
< Tarinaky>
The problem I have with shared pointer is if the pointer gets removed from the main list of stuff it won't serialise correctly so I'd rather have the game crash when it tries to dereference at the first available opportunity rather than after it's been potentially written to disk.
03:35
< McMartin>
Right
03:36
< McMartin>
The safest thing to do is have a "valid" bit and set it to false immediately before deletion
03:36
< McMartin>
That way if it somehow sticks around, it can check it if the pointer's memory hasn't been accidentally fucked yet
03:40
< Tarinaky>
Yeah. Thanks.
03:41
< Tarinaky>
But the problem is that it says scoped_ptr isn't safe for use with the stl.
04:03
< McMartin>
That's that you can't have an stl::vector<boost::scoped_ptr<Foo> > - because you'll start deleting internal bits when your added elements leave
04:03
< McMartin>
shared_ptr should be fine though
04:03
< Tarinaky>
Yeah. Especially if I have the valid bit.
04:06
< Tarinaky>
As an aside - does std::map auto balance the tree?
04:08
< Tarinaky>
Although I guess it doesn't matter too much in this case. Hmm.
04:09
< McMartin>
It does.
04:09
< McMartin>
It's a redblack tree, IIRC.
04:09
< McMartin>
Or performance-equivalent to one.
04:10
< celticminstrel>
It's always a redblack tree?
04:11
< celticminstrel>
Or are you referring to a particular implementation of the STL?
04:15
<@Vornicus>
Or performance equivalent
04:15
<@Vornicus>
But there's not all that many other things it could be.
04:25 Thaqui [Thaqui@27B34E.D54D49.F53FA1.6A113C] has joined #code
04:37
< celticminstrel>
There are a handful of tree implementations.
04:37
< celticminstrel>
It could also be implemented as a hash map, though I'm not sure how well that could work...
04:38
<@Vornicus>
Without an actual hash function? Impossible.
04:39
< celticminstrel>
Well, there's the address function.
04:39
< celticminstrel>
But yeah, the lack of a dedicated hash function is why I didn't think that would work well.
04:43
<@Vornicus>
You can make a custom comparator.
04:43
<@Vornicus>
Which removes teh address function as a candidate for hashcodes.
04:49
< celticminstrel>
How does that follow?
04:54
< celticminstrel>
...of course, it doesn't help that the address operator is overloadable, I suppose...
04:56
<@Vornicus>
Simple: the hash code must be equal for things that compare equally.
04:59
< celticminstrel>
Gah!
05:53 * Tarinaky blinks. Inexplicable errors! Yay!
05:55
< celticminstrel>
Yay!
05:55
< celticminstrel>
What are they this time?
05:56
< Tarinaky>
Segfault.
05:57
< Tarinaky>
Ah!
05:57 * Tarinaky facepalms.
05:58
< celticminstrel>
Segfaults are annoying, yes.
05:58
< Tarinaky>
No. Nm. That wasn't the segfault I was trying to fix >.>
06:01
< Tarinaky>
... m_Data.begin() is a non-zero value. So why is it zero on the first iteration of this loop given its been initialised with begin()?
06:02
< celticminstrel>
In my humble opinion, prefixing member names with m_ is totally useless/pointless.
06:03
< celticminstrel>
Okay, rephrase that question?
06:04
< Tarinaky>
"for(data::iterator it = m_Data.begin();it!=m_Data.end();it++) {" after this line it has a value of 0x0.
06:05
< celticminstrel>
I do know that .end() returns 0x0 for a map...
06:05
< Tarinaky>
"print m_Data.begin()" gives me 0x805a7a0 though.
06:05
< celticminstrel>
Hm.
06:06
< celticminstrel>
By "print" I presum you mean "cout <<".
06:06
< celticminstrel>
^presume
06:06
< Tarinaky>
And if I "set it = m_Data.begin()" it chugs along a little more.
06:06
< Tarinaky>
No. By print I mean in gdb.
06:06
< celticminstrel>
Oh.
06:06
< celticminstrel>
Okay.
06:06 * Tarinaky is using a debugger to debug his segfault :p
06:07
< celticminstrel>
I'm at a loss to explain this...
06:08
< celticminstrel>
When did it get set to 0x0?
06:08
< Tarinaky>
That I can't tell you.
06:09
< Tarinaky>
Given it's been declared and initialised as part of the for statement I can only assume I fucked up the for statement.
06:09
< celticminstrel>
You said "print m_data.begin()" shows an address; is this immediately after the for statement is executed?
06:10
< celticminstrel>
And "print it" at the same point shows 0x0?
06:10
< Tarinaky>
Before or after. The loop doesn't modify m_Data in any way.
06:10
< Tarinaky>
Yes. After the for statement line it is 0x0.
06:11
< celticminstrel>
Yet m_Data.begin() is clearly not 0x0 just before that... :/
06:11
< Tarinaky>
If it helps m_Data.begin is really just an inline for std::map.begin()
06:12
< Tarinaky>
*std::map::begin()
06:13
< celticminstrel>
Um. What was your correction?
06:13
< Tarinaky>
Replaced the dot operator for the scope operator >.>
06:13
< celticminstrel>
Oh. Right.
06:14
< Tarinaky>
As an aside, m_Date.begin() is 0x805a7a0, m_Data.end() is 0x0x80555c0.
06:14
< Tarinaky>
Which looks... wrong to me.
06:15
< celticminstrel>
...
06:15
< celticminstrel>
I thought maps ended on NULL.
06:15
< Tarinaky>
Apparently not.
06:15
< Tarinaky>
The manual says the end() iterator points to the element beyond the last.
06:15
< Tarinaky>
Same as any other stl container.
06:16
< celticminstrel>
I suppose technically that'd be implementation-dependent whether NULL or something else is considered the end of a map, but... what else is there?
06:16
< Tarinaky>
"The manual says the end() iterator points to the element beyond the last." :p
06:17
< celticminstrel>
Yeah, but if you consider a standard linked list implementation, the address of the element beyond the last is NULL.
06:17
< celticminstrel>
...maybe I'm getting mixed up, and it's only std::list that has NULL as the .end()... I dunno...
06:17
< Tarinaky>
http://www.cplusplus.com/reference/stl/list/end/ << Not according to this~
06:18
< celticminstrel>
It doesn't say it's null, true.
06:18
< celticminstrel>
But NULL is a logical choice.
06:18
< Tarinaky>
It says it's the element beyond the last.
06:18
< celticminstrel>
Yeah, but by definition that element technically doesn't exist.
06:18
< celticminstrel>
Though I suppose the implementation could instead allocate a dummy element...
06:27
< Tarinaky>
Right. I've removed all the logic so all I'm doing now is iterating through a dummy loop.
06:28
< Tarinaky>
It's throwing a segfault when it increments it for the second time.
06:28 Derakon[AFK] is now known as Derakon
06:28
< Tarinaky>
Which is wrong because there should be two elements in the map. :/
06:30 AnnoDomini [annodomini@Nightstar-824ce12a.adsl.tpnet.pl] has joined #code
06:31 mode/#code [+o AnnoDomini] by 459AAEB09
06:37 Serah [Z@3A600C.A966FF.5BF32D.8E7ABA] has quit [Ping timeout: 121 seconds]
06:45
< Tarinaky>
://////////
06:46 celticminstrel [celticminstre@Nightstar-f8b608eb.cable.rogers.com] has quit [[NS] Quit: *hums* Can't stay now!]
06:47 Derakon is now known as Derakon[AFK]
06:56
< Tarinaky>
Right! I think I got it working now!
06:56 * Tarinaky puts the logic back in!
07:00
<@Vornicus>
Woot
07:02
< Tarinaky>
FFFFF
07:03
< Tarinaky>
Back where we started :/
07:04
< Tarinaky>
o.O
07:04
< Tarinaky>
For some reason it's skipping one of my debug statements.
07:32
< Tarinaky>
Bah.
07:32
< Tarinaky>
I'm going to go do something else for a bit. I don't want to have to rewrite the class I spent all morning on :/
07:33 Tarinaky [Tarinaky@Nightstar-88a320dc.adsl.virginmedia.net] has quit [Client closed the connection]
08:01 cpux [Moo@Nightstar-20a84089.dyn.optonline.net] has quit [[NS] Quit: ChatZilla 0.9.86 [Firefox 3.6.3/20100401080539]]
09:05 You're now known as TheWatcher
11:02 AnnoDomini [annodomini@Nightstar-824ce12a.adsl.tpnet.pl] has quit [Ping timeout: 121 seconds]
11:04 Vornicus is now known as Vornicus-Latens
11:19 Syloqs-AFH [Syloq@NetworkAdministrator.Nightstar.Net] has quit [Connection closed]
11:27 Syloqs_AFH [Syloq@NetworkAdministrator.Nightstar.Net] has joined #code
11:28 Syloqs_AFH is now known as Syloqs-AFH
11:40 AnnoDomini [annodomini@Nightstar-1dc80b48.adsl.tpnet.pl] has joined #code
11:40 mode/#code [+o AnnoDomini] by 459AAEB09
12:03 Syloqs-AFH [Syloq@NetworkAdministrator.Nightstar.Net] has quit [Ping timeout: 121 seconds]
12:18 Tarinaky [Tarinaky@Nightstar-88a320dc.adsl.virginmedia.net] has joined #code
12:34 Thaqui [Thaqui@27B34E.D54D49.F53FA1.6A113C] has quit [Connection closed]
12:54 Syloqs_AFH [Syloq@NetworkAdministrator.Nightstar.Net] has joined #code
12:56 Syloqs_AFH is now known as Syloqs-AFH
13:18 gnolam [lenin@Nightstar-38637aa0.priv.bahnhof.se] has joined #code
13:18
<@ToxicFrog>
Tarinaky: gdb
13:19
< Tarinaky>
ToxicFrog: What was the question?
13:20
<@ToxicFrog>
Your problems with the map last night implied that you weren't using a debugger.
13:20
< Tarinaky>
Oh no. I was.
13:20
<@ToxicFrog>
Then what's all this about debugstatements?
13:21
< Tarinaky>
I wanted to test the for loop without having anything in it.
13:21
< Tarinaky>
I didn't want the compiler to optemise it away... so I put in a call to my logger.
13:21
<@ToxicFrog>
-O0
13:21
< Tarinaky>
Althought bizarrely it still optimised it out which I didn't get :/
13:21
<@ToxicFrog>
Better yet, -O0 -g3 -Wall -Wextra -Werror
13:22
<@ToxicFrog>
So load it up in the debugger, step through it, and see what's causing it to not reach that call.
13:23
< Tarinaky>
-g3?
13:24
<@ToxicFrog>
If you think something that should have visible effects is being optimized away, you're almost certainly wrong; 99.9% of the time either (a) it doesn't actually have visible effects, (b) the program is never reaching it or (c) you're running the wrong binary.
13:24
<@ToxicFrog>
Include maximum debugging information.
13:24
<@ToxicFrog>
-g is actually an alias for -g2.
13:26
< Tarinaky>
I know it's not A or C.
13:27
< Tarinaky>
And B seemed to be implicit because it was, at the time, segfaulting from the third part of the for statement :/
13:28
< Namegduf>
Tarinaky: The program may be crashing without flushing output
13:28
<@ToxicFrog>
Oh hey. Yes, that's (d), which I forgot.
13:28
<@ToxicFrog>
break, step, next, print, and call are your friends.
13:28
< Tarinaky>
Namegduf: Nope. There's a flush statement in the logger function.
13:28
< Tarinaky>
Namegduf: To prevent exactly that~
13:28
< Tarinaky>
ToxicFrog: I know.
13:29
< Tarinaky>
Just because I have all the tools I need to fix a problem doesn't necissarily mean I have the intellect~
13:30
<@ToxicFrog>
Practice practice practice!
13:30
<@ToxicFrog>
More seriously, I am willing to help but right now I need to run to work, so, bbl
13:31
< Tarinaky>
Don't worry, there's no rush.
14:05
< gnolam>
There is only Zuul.
14:09
< PinkFreud>
and Queensryche - but they refuse to disband.
14:28 Serah [Z@3A600C.A966FF.5BF32D.8E7ABA] has joined #code
14:29
<@ToxicFrog>
Whoops, broke the build again
14:29 * ToxicFrog knees Perforce in the groin and starts work on a script to turn git status output into a p4 changelist
14:30 Rhamphoryncus [rhamph@Nightstar-bbc709c4.abhsia.telus.net] has quit [Client exited]
14:34
< Tarinaky>
Oops, I did it again, I played with your source, got lost in the diff, oh baby baby....
14:45
< gnolam>
>_<
14:46 * ToxicFrog knees Tarinaky in the groin as well~
14:47 * Tarinaky sings in a higher-key.
14:56
<@ToxicFrog>
Anyways. How big is this program you're trying to debug?
14:57
< Tarinaky>
898 lines atm.
15:13
<@ToxicFrog>
So too big to easily pastebin.
15:14
< Tarinaky>
I have it up on github but I'm loathe to link it.
15:14
< Tarinaky>
For numerous reasons.
15:14
< Tarinaky>
The least being it's a little bit... Help-vampire-ish.
15:14
< Tarinaky>
(the most being you'll shout at me for bad coding :p)
15:16
< gnolam>
Is it crashing, or what's up?
15:17
< gnolam>
Link it. I have some spare time right now, and I need a good reason to avoid some other work. ;)
15:18
< Tarinaky>
gnolam: I will in a bit when I've got it open myself. I'm looking at something else atm >.>
15:18
< Tarinaky>
Basically though I'm having trouble with std::map and its iterators.
15:18
< Tarinaky>
In the context of a for-loop.
15:18
< Tarinaky>
iirc.
15:18
< gnolam>
For-looping over a map? That sounds a bit... odd, TBH. :)
15:19
< Tarinaky>
Well. The map itself is for serialisation/deserialisation.
15:19
< Tarinaky>
But I'm also using it as a place to store shared_ptrs.
15:24
<@ToxicFrog>
gnolam: what's wrong with iterating over a map?
15:24 * gnolam ponders making a Byzantine war game. You give all the orders, but you never know if your generals are going to follow them!
15:25
< Namegduf>
Haha.
15:26
<@ToxicFrog>
I mean, it's C++ so it's going to be ugly as sin, but the concept is sound~
15:28
< Tarinaky>
The first element in the map is the one with the 'smallest'/'least' key.
15:28
< Tarinaky>
The last element is the one with the biggest...
15:28
< Tarinaky>
It's completely valid!
15:31
<@ToxicFrog>
wait what
15:31
<@ToxicFrog>
So it's an ordered map, then?
15:32
< Tarinaky>
The std::map is a tree.
15:32
< Tarinaky>
std::map and std::set are both trees :x
15:35
< gnolam>
Not necessarily.
15:35
< Tarinaky>
I was of the understanding that it was specified in the std.
15:36
< Tarinaky>
But yeah. It doesn't really matter what order I iterate through the map in this case. I just want to attach each object in the game to its position in the game world.
15:36
< Tarinaky>
So that you know what objects are in any given x-y coordinate pair.
15:37 celticminstrel [celticminstre@Nightstar-f8b608eb.cable.rogers.com] has joined #code
15:38
< gnolam>
... wait, you're not using a /map/ for some sort of tile system, are you?
15:39
< Tarinaky>
No-no.
15:39
< gnolam>
ToxicFrog: What's wrong is that I've found that, generally, when people are for looping over basically anything that isn't a raw array, vector or list, they usually want another data structure or another algorithm. :)
15:40
< Tarinaky>
If '@' is in tile (5,5) I want tile (5,5) to contain a pointer to '@'.
15:42
< gnolam>
And the map comes in how?
15:43
< Tarinaky>
'@' is owned (and eventually deleted) by the map just as a convenient place to keep it.
15:43
< gnolam>
So what's the key for '@' then?
15:43
< gnolam>
And why is it in a map?
15:43
< Tarinaky>
The special features of the map aren't being used at all... but having another container would require having another container.
15:44
< Tarinaky>
Roguelike.
15:44
< Tarinaky>
'@' as in Player Character.
15:44
< Tarinaky>
The map's features are needed for deserialisation.
15:47
< Tarinaky>
http://githuhttp://github.com/Tarinaky/coulomb/blob/master/game.cpp#L49 << Line 49 is where it segfaults atm.
15:47
<@ToxicFrog>
gnolam: I iterate over the contents of maps on a regular basis. "Do something to each entry in this map" is not terribly unusual.
15:48
< gnolam>
That's why it's "generally".
15:48
<@ToxicFrog>
Tarinaky: which features? Why not save/load the tile map?
15:49 Thaqui [Thaqui@27B34E.D54D49.F53FA1.6A113C] has joined #code
15:49
< Tarinaky>
ToxicFrog: Making the tile map own everything would make it harder :/
15:52
< Tarinaky>
Anyway. For some reason iterator it doesn't seem to be taking the value it's initialised with.
15:52
< Tarinaky>
Which is causing -all- kinds of fun.
16:01 * Tarinaky tries compiling with -Wall and gets looooads of warnings ://////
16:02
< Tarinaky>
Ah!
16:03
< Tarinaky>
I'm a gigantic fucking idiot!
16:03
< Tarinaky>
I really need to stop forgetting to add -Wall to my makefiles >.>
16:05
<@ToxicFrog>
...yes.
16:05
< Tarinaky>
For the curious the problem was that I'd forgotten to actually add the keyword 'return' to my inlines.
16:05
< Tarinaky>
Hilarity ensued.
16:06
< Tarinaky>
-.-
16:11
<@ToxicFrog>
Mine are generally -Wall -Wextra -Werror -g3 -O0 for debug builds, and -Wall -Wextra -Werror -O3 for releases.
16:12
< Tarinaky>
Doesn't all include error and others?
16:12
< Tarinaky>
Or is that naive of me?
16:12
< celticminstrel>
What's -Werror?
16:12
<@ToxicFrog>
Treat warnings as errors.
16:12
< celticminstrel>
I wouldn't be surprised if -Wall does not include -Wextra.
16:13
< celticminstrel>
Ah.
16:13
<@ToxicFrog>
-Wextra is "the stuff that is not actually included in -Wall"
16:13
< celticminstrel>
I know there are a few warnings not included in -Wall.
16:13
<@ToxicFrog>
-Werror is "treat all warnings as errors"
16:13
< celticminstrel>
I'd like to use -Werror, but there are some warnings that I'd rather not fix immediately.
16:13
<@ToxicFrog>
Thus, with those three options, it will be extremely paranoid about everything, and furthermore will not compile code unless it can do so without warnings.
16:13 * ToxicFrog baps celticminstrel
16:14
< celticminstrel>
For example, an unused local variable.
16:14
< Namegduf>
I would leave -Wall out of debug builds
16:14
< Namegduf>
To allow development to continue with extra useless variables and such
16:14
< celticminstrel>
If I'm working on a function and make a change such that a variable is no longer used, I'd rather keep it around in case ...
16:14
< celticminstrel>
...well, sort of what Namegduf said, I guess.
16:14
< celticminstrel>
In case I need it again later.
16:14
< Namegduf>
THe big problem is that make is shitty about how the errors are shown
16:15
< Namegduf>
And if it doesn't break the build, you probably won't see the warnings.
16:15
<@ToxicFrog>
...in case you need it later?
16:15
<@ToxicFrog>
What?
16:15
< celticminstrel>
I would recommend using -Wall in debug builds, just not -Werror.
16:15
<@ToxicFrog>
Your stuff is versioned, right? Right?
16:15
< celticminstrel>
No.
16:15 * ToxicFrog weeps
16:15
< celticminstrel>
Except BoE.
16:15
< Namegduf>
Well, my favourite annoyed instance of this is "unused imports are not allowed"
16:16
< celticminstrel>
Unused imports?
16:16
< Namegduf>
Readding and changing imports and function calls and such because, while debugging, I decided to comment out the block that used them
16:16
<@ToxicFrog>
(also, I use the same flags because I feel that if one of the builds succeeds, both should. I should not have a case where it builds in debug mode but not release, or vice versa)
16:16
< Namegduf>
Is a complete pain in the ass
16:17
< Namegduf>
I don't care if it builds in debug but not in live if the only difference is a warning, telling me why.
16:21
<@ToxicFrog>
My main problem with this is that you easily end up with either a noisy build where you don't see the warnings, or a gradually accumulating warning pile and then a tedious task of fixing them all (and re-testing, etc) before release.
16:21
<@ToxicFrog>
I prefer fixing them as they come up.
16:21
<@ToxicFrog>
And since often they warn about actual problems, I'd rather not waste time debugging something that was already flagged by the compiler.
16:21
< Namegduf>
Yeah.
16:21
< Namegduf>
That's the issue.
16:22
< Namegduf>
"make" is terrible, terrible at handling warnings.
16:22
< Namegduf>
Because it doesn't, largely.
16:22
< Namegduf>
I think some IDEs do better, not sure.
16:23
< Tarinaky>
Gah! I just realised I'm out of toilet paper, brb.
16:27
<@ToxicFrog>
I use jedit, which is generally pretty good about picking warning and error messages out of the build system output, even if it's a weird build system (which mine generally is).
16:27
<@ToxicFrog>
Nonetheless.
16:45
< Tarinaky>
I've been really lazy with my git commits lately :/
17:03
< Tarinaky>
Oh crap. :/ I think I might have snookered myself with shared_ptr >.<
17:05
< celticminstrel>
...what on earth does that even mean.
17:07 * Tarinaky hmms.
17:07
< Tarinaky>
celticminstrel: Doesn't matter >.>
17:18
< Tarinaky>
As an aside - why do the stl have functions for removing elements specified by an iterator but not for reverse iterators?
17:21
< celticminstrel>
Do they not work with reverse iterators?
17:21
< Tarinaky>
Apparently not.
17:22
< Tarinaky>
I suspect there's probably a cast that could be done.
17:22
< Tarinaky>
But at this point it's entering the territory of premature optimisation :/
17:22
< celticminstrel>
Well, do reverse iterators have a member function that returns the underlying normal iterator?
17:23
< Tarinaky>
Yes.
17:24
< celticminstrel>
Problem solved?
17:24
< Tarinaky>
But at this point I've stopped caring xD
17:27
< Tarinaky>
Right, time to shower and find some clean clothes.
17:31 Attilla [Attilla@Nightstar-5dd66102.threembb.co.uk] has joined #code
17:31 mode/#code [+o Attilla] by 459AAEB09
17:32
< Tarinaky>
Actually. Sod it.
17:32 * Tarinaky goes to sleep instead.
18:29 celticminstrel [celticminstre@Nightstar-f8b608eb.cable.rogers.com] has quit [[NS] Quit: *hums* Can't stay now!]
18:33 Vornicus-Latens is now known as Vornicus
18:41 Serah [Z@3A600C.A966FF.5BF32D.8E7ABA] has quit [Ping timeout: 121 seconds]
19:29 Serah [Z@26ECB6.A4B64C.298B52.D80DA0] has joined #code
19:43
< gnolam>
Alright, which of you jokers hooked up a USB interface to Australia?
19:43
< gnolam>
http://maps.google.com/maps?f=q&source=s_q&hl=en&q=Waubra Victoria 3352, Australia&sll=-37.571029,143.851835&sspn=0.013912,0.01929&ie=UTF8&cd=1&geocode=F UPuxf0dV8aPCA&split=0&hq=&hnear=Waubra Victoria, Australia&t=h&ll=-37.329014,143.611715&spn=0.006979,0.009645&z=17
19:43
< gnolam>
Sorry, http://maps.google.com/maps?f=q&source=s_q&hl=en&q=Waubra%20Victoria%203352,%20A ustralia&sll=-37.571029,143.851835&sspn=0.013912,0.01929&ie=UTF8&cd=1&geocode=FU Puxf0dV8aPCA&split=0&hq=&hnear=Waubra%20Victoria,%20Australia&t=h&ll=-37.329014, 143.611715&spn=0.006979,0.009645&z=17 .
19:50
<@Vornicus>
hee.
19:59
< gnolam>
I guess their version of "plug & play" is a "No worries, mate" warranty.
20:00 * ToxicFrog flails at felt
20:03
< Reiv[Graduate]>
gnolam: Ahahahahaha.
20:03
< Reiv[Graduate]>
Um. What are they?
20:03
< PinkFreud>
Reiv[Graduate]: looks like buildings + lots of some sort
20:04
< PinkFreud>
http://maps.google.com/maps?f=q&source=s_q&hl=en&q=Waubra+Victoria+3352,+Austral ia&sll=-37.571029,143.851835&sspn=0.013912,0.01929&ie=UTF8&cd=1&geocode=FUPuxf0d V8aPCA&split=0&hq=&hnear=Waubra+Victoria,+Australia&t=h&ll=-37.320986,143.620716 &spn=0.002611,0.009645&z=17&layer=c&cbll=-37.320987,143.620715&panoid=StNvnpusMJ 3xZSeBWnS2Dw&cbp=11,98.55,,2,-1.86
20:04
< PinkFreud>
that's street view of one of them
20:05
< Reiv[Graduate]>
PF: Aha
20:12
< gnolam>
Some kind of... silos?
20:12
< PinkFreud>
looks it
20:16
<@Vornicus>
TF: what the flail?
20:29
<@ToxicFrog>
Vornicus: having a problem with save/load. When I save and restore a table, then right-click on it, it crashes because self.menu is the arguments to the menu constructor, not an actual Menu object
20:29
<@ToxicFrog>
However, if I instrument the table constructor, I can see the menu being created!
20:29
<@ToxicFrog>
So at some point after it gets loaded but before I frob it, it's getting damaged.
20:32
<@ToxicFrog>
...aha. Found it.
20:33
<@ToxicFrog>
felt.loadstate() deserializes the table, then gives the background specifically a new menu, but does it incorrectly.
20:33
<@ToxicFrog>
I really wish love2d could do multiple windows and had some kind of GUI toolkit system.
20:33
<@ToxicFrog>
Or, conversely, that GTK/Qt/insert gui toolkit of choice here had a Canvas-type widget that didn't suck hugely.
20:51
<@ToxicFrog>
What I really want is a bunch of windows, with proper WM decorations and menu bars, and inside each one, a love2d rendering surface.
20:51
<@ToxicFrog>
Or something equivalent.
20:52
<@ToxicFrog>
Qt's Graphics View Framework looks like it has all the features I need, but then I look a bit closer and there's lots of literature on, eg, all the hoops you need to jump through because translation doesn't work properly.
21:07
< McMartin>
Yeah =(
21:11 Thaqui [Thaqui@27B34E.D54D49.F53FA1.6A113C] has quit [Connection closed]
21:19 celticminstrel [celticminstre@Nightstar-f8b608eb.cable.rogers.com] has joined #code
21:22 * gnolam stabs the new Steam client.
21:22
< gnolam>
Goddamnit. I don't want to wade through your marketing bullshit just to find out what's been updated...
21:59
< McMartin>
Are you complaining that it's starting on the Store Page or that you can't jump to the "list only updates"?
22:35
< gnolam>
The latter.
22:35
< gnolam>
There used to be an "update news" button.
22:35
< gnolam>
Now it's just "news".
22:36
< gnolam>
And by "news" they mostly mean "inane bullshit".
22:36
< McMartin>
Yeah, I'm not sure that aggregrating the entire fucking Internet is really a good feature for anyone
22:36
< McMartin>
It's hilarious when the top news item in the store is "this is on sale for cheaper from Direct2Drive this week" though.
22:48 Rhamphoryncus [rhamph@Nightstar-bbc709c4.abhsia.telus.net] has joined #code
23:12
< gnolam>
Well, anyone's cheaper than Steam. :P
23:12
< Namegduf>
But Steam gives games away for FREE
23:17
< Reiv[Graduate]>
Wait, is Steam relatively expensive?
23:19
< McMartin>
It tends to charge MSRP, with GG and D2D often don't.
23:19
< McMartin>
My experience with them is that base price is higher on Steam but that Steam's sales tend to make things temporarily more competitive.
23:19 * gnolam lives in Europe.
23:19
< McMartin>
Oh. Ha ha ha.
23:20
< McMartin>
Yeah, so, assume all their prices in euros are actually the same number of USD.
23:20
< McMartin>
That changes the calculus significantly.
23:20
< gnolam>
Yeah.
23:20
< celticminstrel>
MSRP? GG? D2D?
23:20
< gnolam>
So... there's absolutely no reason for anyone in Europe to buy anything on Steam, ever.
23:20
<@ToxicFrog>
celticminstrel: Minimum Suggested Retail Price, ??, Direct2Drive
23:20
< McMartin>
Manufacturer's Suggested Retail Price, Gamer's Gate, Direct2Drive
23:20 * Namegduf uses it from time to time
23:21
<@ToxicFrog>
gnolam: well, the sales, depending on what's on sale and for how much
23:21
< Namegduf>
Admittably, mostly for Valve products.
23:21
< McMartin>
As I understand it, Steam interferes less with 3rd party publisher prices
23:21
< McMartin>
Which is a two-edged sword. =P
23:22
< gnolam>
ToxicFrog: The sales? You mean, when they sell games at what, 10-20% off? You mean, when they /possibly/ reach actual retail prices?
23:23
< McMartin>
gnolam: I have almost 80 games on steam.
23:23
< McMartin>
I spent more than $10 for one of them.
23:24
< Namegduf>
10-20% off?
23:24
< Namegduf>
You're drastically overestimating
23:24
< Namegduf>
:P
23:24
< Namegduf>
(The price)
23:24
< McMartin>
I don't know what sales look like in .eu but here 50-75% is fairly common.
23:24
< McMartin>
Supreme Commander 2 was $10 last weekend
23:25
< gnolam>
And besides, the whole Euro == USD thing just pisses me off, so I don't want to buy from them out of principle.
23:25
< celticminstrel>
I thought euros were worth less than USD.
23:26
< Namegduf>
More.
23:26
< Namegduf>
A lot more.
23:26
< Namegduf>
You silly. :P
23:26
< celticminstrel>
Oh. Okay then.
23:27
< Reiv[Graduate]>
I tend to buy games when they're 75% off.
23:27
< celticminstrel>
Maybe that carried over from an earlier impression of euros (or it might've been French francs) being worth less than GBP...
23:27
< PinkFreud>
I usually prefer them 100% off.
23:27
< Reiv[Graduate]>
I regret not getting Civ IV; at the time I had presumed it no better than its predecessor
23:27
< Namegduf>
I bought Sam and Max three times. >_>
23:27
< Reiv[Graduate]>
Then McM raved on it a bit and I felt Regret. >_>
23:27
< PinkFreud>
:P
23:27
< Reiv[Graduate]>
PF: I'm actually getting rather fond of Steam.
23:27
< Namegduf>
Twice for friends, once for myself, feeling like it must be good, and having enjoyed an old game.
23:27
< Reiv[Graduate]>
If nothing else, if I lose everything I can just hit redownload :P
23:27
< PinkFreud>
Reiv[Graduate]: I'm sorry. Steam is a, er, steaming pile.
23:28
< Reiv[Graduate]>
PF: Is this the client you object to, or paying for games at all?~
23:28
< Namegduf>
I'm fairly fond of Steam and digital distribution in general.
23:28
< celticminstrel>
I still haven't beaten portal. I got to the final chamber and then didn't play again for awhile.
23:29
< McMartin>
celticminstrel: The GBP is worth more than Euros and much more than USD. They have the "change the currency symbol" problem too.
23:29
< Namegduf>
The final chamber?
23:29
< McMartin>
The only time this hasn't happened in my memory was when Psychonauts went on sale for 1 pound.
23:29
< Namegduf>
That's about halfway through the game.
23:29
< McMartin>
Ssssssh
23:29
< celticminstrel>
I mean the Glados chamber.
23:29
< Namegduf>
Ah.
23:29
< Reiv[Graduate]>
I get to buy in USD.
23:30
< Reiv[Graduate]>
This means I have to ask google first for the actual price, but, y'know~
23:30
< celticminstrel>
Uh, what?
23:30
< PinkFreud>
Reiv[Graduate]: I usually don't have much time for games, so other than picking up the occasional console game, I'm not likely to buy 'em.
23:30
< PinkFreud>
You strafe the train / with the bravery of being out of range /
23:31
< PinkFreud>
-- Roger Waters
23:32
< Reiv[Graduate]>
celticminstrel: Steam, for New Zealand, goes with the USD prices
23:32
< Reiv[Graduate]>
This is fine, but means I have to do the exchange rate myself when doing a purchase.
23:32
< Reiv[Graduate]>
PF: Well, that's fair enough
23:32
< Reiv[Graduate]>
PF: But I've found that if I -do- want a game, I would rather wait till it's cheap and get it for $5-15 on Steam than to futz about with pegleg studios any more.
23:33
< Reiv[Graduate]>
It's become more hassle than it's worth if I can get it for five bucks, including option to redownload as needed in the future~
23:33
< celticminstrel>
Pegleg studios?
23:33
< McMartin>
Pirating it.
23:33
< celticminstrel>
Ah.
23:34
< PinkFreud>
Reiv[Graduate]: true.
23:39 cpux [Moo@Nightstar-20a84089.dyn.optonline.net] has joined #code
--- Log closed Thu Jun 10 00:00:29 2010
code logs -> 2010 -> Wed, 09 Jun 2010< code.20100608.log - code.20100610.log >