code logs -> 2010 -> Fri, 22 Jan 2010< code.20100121.log - code.20100123.log >
--- Log opened Fri Jan 22 00:00:36 2010
00:02 * Derakon[work] borrows a slide from one of the biologists and takes some images that look reasonable.
00:02
< Derakon[work]>
I think I might actually have a fix for the crash bug!
00:02
< Derakon[work]>
(Fingers not uncrossed yet~)
00:03
< TheWatcher>
Good luck!
00:09
< Derakon[work]>
Of course, even if it does work, there's a bunch of minor glitches in this version that would need to be fixed.
00:09
< Derakon[work]>
To wit: the temperature graph is broken; the stage motion limits appear in their own window instead of being contained by the control panel; there's a bunch of deprecation warnings; probably some other stuff too.
00:10
< Derakon[work]>
I love how the deprecation warnings didn't show up until I upgraded Python.
00:11
< Vornicus>
That's because they weren't deprecated yet.
00:11
< Derakon[work]>
Oh, I know why it happens.
00:11
< Derakon[work]>
I still find it amusing.
00:15 Derakon[work] [Derakon@Nightstar-1ffd02e6.ucsf.edu] has quit [[NS] Quit: Leaving]
00:33 You're now known as TheWatcher[T-2]
00:40 You're now known as TheWatcher[zZzZ]
00:50 Derakon[AFK] is now known as Derakon
01:23 Thaqui [Thaqui@27B34E.D54D49.F53FA1.6A113C] has joined #code
02:35 Attilla [Attilla@FBC920.480E8C.CB1862.485F29] has quit [Client closed the connection]
02:36
< celticminstrel>
Sometimes I get my Python and C++ mixed up... 9.9
02:41
< Vornicus>
;_;
02:47
< celticminstrel>
Agh. It's slightly annoying that Python doesn't have a for-loop.
02:48
< celticminstrel>
If you want one, you have to use while.
02:48
< Vornicus>
for k in range(50)
02:48
< celticminstrel>
But that doesn't allow you to advance by a variable amount per iteration..
02:49
< celticminstrel>
It's not a true for loop. It's really a foreach loop.
02:49
< Vornicus>
Well no, but you don't want to do that with a for loop either!
02:49
< celticminstrel>
Of course I would.
02:51
< celticminstrel>
...I did forget that you could omit range()'s lower bound though.
03:42
<@Derakon>
Actually, use xrange.
03:42
<@Derakon>
Which doesn't actually create a list object to iterate over.
03:43
< Vornicus>
Yes. xrange uses constant memory; range actually builds the list and thus uses memory proportional to the number of elements.
03:43
<@Derakon>
Generally doesn't make a huge difference, but it's a good habit to get into.
03:43
< Vornicus>
in python 3 though range has been remade to be awesome.
04:16 Vornicus is now known as Vornicus-Latens
04:38 celticminstrel [celticminstre@Nightstar-f8b608eb.cable.rogers.com] has quit [[NS] Quit: *hums* Can't stay now!]
04:57 Syloqs-AFH is now known as Syloqs_AFH
05:11 * Bobsentme smacks forehead
05:12
< PinkFreud>
oh, good. saves me the trouble of doing it for you.
05:12 * PinkFreud ducks
05:12
< Bobsentme>
First for loop started an array at 1. Second for loop kept searching for 0 key of the array, and returning warnings. Took me an hour to figure it out.
05:13
< PinkFreud>
lol
05:15
< Bobsentme>
Of course, now that I've fixed it:
05:15
< Bobsentme>
OMFG IT WORKS! IT WORKS! MUHAHAHAHAHAHAHAHA!
05:16
< PinkFreud>
...
05:17
< Bobsentme>
dammit, apparently it doesn.
05:17
< Bobsentme>
doesn't.
05:18
< Bobsentme>
oh, wait. Nevermind.
05:18 * Bobsentme expands the loops to run more than twice, and continues testing with his 3 authors. >.>
05:20
< PinkFreud>
lol
05:33
< Bobsentme>
weird behavior coming out of PHP and the for loops.
05:34
< Bobsentme>
Displaying 1 row of results from either row works perfect. More than one row, and I get undefined index warnings.
05:34
< Bobsentme>
But it still displays
05:42
< Bobsentme>
...
05:42
< Bobsentme>
iterations 0 and 2, fine. 1, 3, 4, 5, 6, 7, 8, 9? Errored out.
06:50 Derakon is now known as Derakon[AFK]
07:26
< Kazriko>
one thing the crucial tracer memory has told me: Windows 7 doesn't apparently balance its memory usage out properly to use the most of triple-channel ram...
07:26
< Kazriko>
always accessing one memory stick more than the others...
07:27 gnolam [lenin@Nightstar-38637aa0.priv.bahnhof.se] has joined #code
07:29
< Kazriko>
I always thought my Sonata 2 case was quiet, but this cosmo s case is dead silent sitting next to it.
07:37
< gnolam>
A case called "Sonata" being quiet? Oh, the irony.
07:38
< Kazriko>
yeah, antec has an odd naming scheme.
07:38
< Kazriko>
The new case has something like 9 fans in it...
07:38
< Kazriko>
but all very slow fans.
07:40
< Kazriko>
Might be because I took out some of the bits of the case... *shrug*
07:41
< Kazriko>
(the sonata. It has some features that are left out now because it's too much hassle to remove and put back in...)
07:43 * gnolam can't for the life of him remember what his case is called.
07:43
< gnolam>
But it's really quiet.
07:44
< gnolam>
And looks like a high-end kitchen appliance instead of a bloody Christmas tree.
07:45
< Kazriko>
The only part that looks like a christmas tree on this is the crucial tracer ram...
07:46
< Kazriko>
http://www.coolermaster.com/microsite/Cosmos_S/
07:46
< gnolam>
My normal philosophy is not so much "function over form" as "function, and screw form", but some of the cases being made today? GAH!
07:46
< Kazriko>
i picked that one because of its fans and because it is advertised as quiet. :)
07:48
< gnolam>
So there were some equivalent (space and noise are the only criteria, really), cheaper cases, but I plunked down some more cash to get one that didn't look like a cross between a ricer's Honda and an outdoor rave.
07:48
< Kazriko>
they show more LEDs on it than the actual case seems to have though. none in the front panel or side panel that I can see.
07:48
< Kazriko>
heh.
07:49
< Kazriko>
I liked the 10 5.25 external bays feature of this one...
07:49
< Kazriko>
and the 200mm side fan...
07:49
< gnolam>
It actually did have an annoying blue power LED, but a piece of electrical tape took care of that.
07:50
< Kazriko>
Yeah. I ended up unplugging the power led on my sonata because of that.
07:50
< Kazriko>
too bright.
07:54
< Kazriko>
ugh. can't figure out how to make the xonar dx card do analog mixing.
--- Log closed Fri Jan 22 08:13:43 2010
--- Log opened Fri Jan 22 08:13:50 2010
08:13 TheWatcher[zZzZ] [chris@Nightstar-b4529b0c.zen.co.uk] has joined #code
08:13 Irssi: #code: Total of 23 nicks [6 ops, 0 halfops, 0 voices, 17 normal]
08:13 mode/#code [+o TheWatcher[zZzZ]] by Reiver
08:14 Irssi: Join to #code was synced in 53 secs
08:15 Bobsentme [Bobsentme@Nightstar-79f8b1cd.livnmi.sbcglobal.net] has quit [Connection reset by peer]
09:00 MyCatVerbs [mycatverbs@Nightstar-58acb782.cable.virginmedia.com] has quit [Connection closed]
09:47 Rhamphoryncus [rhamph@Nightstar-a62bd960.abhsia.telus.net] has quit [Client exited]
10:02 You're now known as TheWatcher
10:07 ErikM [erikm@Nightstar-9e58ffe9.opera.com] has joined #code
10:07 Serah [Z@3A600C.A966FF.5BF32D.8E7ABA] has joined #code
10:08
< ErikM>
I heard questions via Reiver about refresh in Opera. Having gotten a job at the place, I might have a better chance of finding someone who can answer.
10:08
< ErikM>
Can I get details and maybe a test case?
10:09<~Reiver> Erik, meet TheWatcher. TheWatcher, meet Erik. (And now that I've hit everyones highlights...~)
10:10
<@TheWatcher>
Just a few - let me make sure I have the latest version installed, just in case.
10:12 Zedidiah [zag@Nightstar-d0088b95.or.comcast.net] has quit [Ping timeout: 121 seconds]
10:15 * TheWatcher checks it still behaves the same way
10:20
<@TheWatcher>
Okay, here's the problem I'm encountering: website that loads a bunch of resources, including a couple of .css files. I go to the page and view it, then change one of the .css files on the server, and reload the page. Despite having Prefs -> Advanced -> History -> Check documents and Check images both set to 'Always', the changes do not show up when refreshing the page. I set up a new keyboard shortcut 'u ctrl' with the action 'Reload
10:20
<@TheWatcher>
stylesheets & Refresh display' and try that, and it still uses the cached version of the stylesheet
10:23
<@TheWatcher>
.... wait
10:23
<@TheWatcher>
now it starts working, wtf?
10:24
< ErikM>
Heissenbug? As soon as someone else observes it, it vanishes?
10:24
<@TheWatcher>
Dunno. But I'll keep poking at it, and if I get a decent replication rate on the issue I'll tell you
10:25
< ErikM>
I'm told they're supposed to be included in Check Images.
10:25<~Reiver> TheWatcher: Did you have to update the version?
10:25<~Reiver> It could well have been a bug in prior versions?
10:27
<@TheWatcher>
Reiver: I updated, checked that the problem happened, typed the above, tried to find out what conditions would force opera to reload it (clear the cache, reload, clear, restart, reload, etc) and then discovered it had started picking up changes to the css as soon as I hit reload
10:28
<@TheWatcher>
Which I'm not /complaining/ about, just a wee bit bloody confused about.
10:29<~Reiver> That is a little odd.
10:30
<@TheWatcher>
Yes, yes it is.
10:32
<@TheWatcher>
I blame PF *nods*
10:32
< ErikM>
Is PF like Neco? (General scapegoat?)
10:33
<@AnnoDomini>
PF is for general stuff.
10:33
<@AnnoDomini>
Syloq is for not enjoying your stay.
10:33<~Reiver> (PF = PinkFreud.)
10:34<~Reiver> If it breaks, it's PFs fault. If you don't like it, it's Syloq.
10:38
<@AnnoDomini>
Something I like about the OOP model is that you can implement a 'good enough for now' solution with a frontend, and if you need to improve the solution, you just change the backend without having to change the frontend.
10:40
<@TheWatcher>
Well, I note you can do that with non-OO code if you take care with it, but yeah, it's often easier.
10:42 * AnnoDomini scratches his head.
10:42
<@TheWatcher>
(and 'take care with it' often ends up effectively using the same sort of concepts that OOP presents explicily, only you do it without that explicit language support...)
10:43
<@AnnoDomini>
It takes up less memory to declare an array of pointers, then assigning dynamically created objects to be pointed at by the array's pointers than just declaring the array of the object type, yes?
10:46
<@AnnoDomini>
I'm not actually sure how declaring an array of pointers works. Isn't an array pointers of itself?
10:58
<@TheWatcher>
AD: if you have Foo bar[10] and Foo *bar[10] with each element of the latter having a dynamically created object, the latter is likely to use more space. The former will be a block of (theoretically) contiguous memory containing one object after another, so if Foo is 20 bytes in size including padding and so on, Foo bar[10] will occupy 200 bytes. But Foo *bar[10] plus 10 `new Foo`s will be (10 * 32 or 64) + (10 * 20).
10:58
<@TheWatcher>
s/32 or 64/4 or 8/
10:58
<@TheWatcher>
I'm awake, really
11:00
<@AnnoDomini>
Are pointers to memory structures fixed-size or does it depend on what the structure is?
11:01
<@TheWatcher>
A pointer is always a fixed size, regardless of what it points to
11:03
<@AnnoDomini>
Cool! I was under the opposite impression, and always wondered how the fuck pointer arithmetic works with that.
11:05
<@AnnoDomini>
foo * pointers[100]; pointers[0] = new foo; // Will this work as intended?
11:05 Tarinaky [Tarinaky@Nightstar-60f1718f.adsl.virginmedia.net] has quit [Operation timed out]
11:06
<@TheWatcher>
Yep.
11:06
<@AnnoDomini>
Cool.
11:08 Zedidiah [zag@Nightstar-d0088b95.or.comcast.net] has joined #code
11:09 Attilla [Attilla@FBC920.0EA685.99523D.9E28A9] has joined #code
11:09 mode/#code [+o Attilla] by Reiver
11:16 Zedidiah [zag@Nightstar-d0088b95.or.comcast.net] has quit [[NS] Quit: ]
11:16 Syloqs_AFH [Syloq@NetworkAdministrator.Nightstar.Net] has quit [Connection reset by peer]
11:20 Tarinaky [Tarinaky@Nightstar-14df8a41.adsl.virginmedia.net] has joined #code
11:23 Syloqs_AFH [Syloq@NetworkAdministrator.Nightstar.Net] has joined #code
11:24 Syloqs_AFH is now known as Syloqs-AFH
11:24
<@AnnoDomini>
Can I use constructors when dynamically creating objects? Like "new foo(stuff);"?
11:25
<@TheWatcher>
Yep
11:30
<@AnnoDomini>
I'm pondering whether it's worthwhile to make a class for every type of creature, or just put all that stuff in data files somewhere, and make the Creature class handle the specifics of what a creature is and stuff.
11:34
<@AnnoDomini>
Hmm. I want to return the pointer from the array of pointers. "return &pointers[i];"?
11:34
<@TheWatcher>
If you're going to have a lot of creatures with similar behaviours and statistics, having a class for each type and if they need any special behaviour tweak the settings based on data files would be easier to maintain overall.
11:35
<@TheWatcher>
Foo *ptr = pointers[i];
11:36
<@TheWatcher>
then, for example, int result = ptr -> function(arg, bar);
11:37
<@AnnoDomini>
But I wanted something like "creatureVector.retrive(i)->ai();". Is my approach wrong?
11:38
<@TheWatcher>
just do 'return pointers[i]' in retrive() then
11:39
<@AnnoDomini>
Okay.
11:44
<@AnnoDomini>
Hmm. I think I'll do this with a class for the type (like HUMANOID, INSECT, FISH and stuff) and put subtype/specific (ZOMBIE, HUMAN, BEE) handling stuff in data files.
11:45
< Tarinaky>
Personally I intend to handle as much as possible in data files. :/
11:48
<@TheWatcher>
Well, one way around it is to have one set of data files that define creatures attributes, lua files that define their behaviour, and then load those, and then create instances on the fly
11:49
< Tarinaky>
Yup.
11:49
< Tarinaky>
Mind. I'm a -long- way from that.
11:49
< Tarinaky>
:/
11:53
<@AnnoDomini>
Can child classes use constructors of parent classes?
11:54
< Tarinaky>
Yes.
11:54
< gnolam>
They /will/ use them, in fact.
11:55
< Tarinaky>
child_constructor(arguments):parent_constructor(subset_of_arguments);
11:55
< Tarinaky>
If you need a particular constructor or no default constructor exists.
12:10
< ErikM>
TheWatcher: I received an addendum suggestion if the problem should reoccur: find stylesheet's URL, go to that, reload.
12:11
<@TheWatcher>
Righto, I shall try that. Thanks :)
12:13
<@AnnoDomini>
Hmm. I'm getting a warning about having virtual functions but no virtual destructors. Should I care? y/n?
12:16
<@TheWatcher>
Yes.
12:16
< ErikM>
I am amused.
12:17
< Tarinaky>
Okay. I have a list of class pointers. What is wrong with "(contents.back)->draw();" It gives me error map.cpp:52: error: invalid use of member (did you forget the & ?)
12:17
< Tarinaky>
map.cpp:52: error: base operand of -> is not a pointer
12:17
< Tarinaky>
Oh. Wait.
12:17 * Tarinaky is a moron.
12:17
< Tarinaky>
Nm.
12:18
<@TheWatcher>
AD: If you don't have a virtual destructor in the base class, and you delete a drived object through a base class pointer, the behaviour is undefined.
12:18
<@TheWatcher>
(see also: Effective c++ item 14)
12:19
<@AnnoDomini>
So the fix is to add 'virtual' before the destructor in the base class?
12:20
<@TheWatcher>
Yep.
12:21
<@TheWatcher>
(also, if you don't have a copy of Effective c++, I strongly recommend beg/borrow/steal/obtaining it - it's a very useful little book to have)
12:22
<@AnnoDomini>
Uhuh.
12:22
<@AnnoDomini>
"s Roguelike\globals.h|11|error: storage class specified for field `messageDevice'|" <- What does that mean?
12:26
<@AnnoDomini>
(I fixed it, by removing a syntax error, but I'd like to know what it means.)
12:35 * Reiver ponders. Needs to learn Java, and /properly/, by the start of march.
12:36 * Reiver ponders the feasibility of doing a dicebot in it, for the sake of having something he gives a shit about to work on.
12:37<~Reiver> The problem overall: I've already /learned/ java once, but then atrophied my skills by hating the language with a passion whilst studying stuff that didn't need me to maintain it.
12:37<~Reiver> So I keep getting leeging annoyed over needing to learn to walk, when my brain insists I run~
12:46
<@AnnoDomini>
How does 'delete' work? Does it just free up the object, or does it also null-ify the pointer?
12:48
<@AnnoDomini>
AWRIGHT.
12:48
<@AnnoDomini>
My creatureVector thingie works.
12:48
<@TheWatcher>
It just frees the object
12:49
<@TheWatcher>
Reiver: you can't use something other than Java?~
12:50
< Tarinaky>
"typedef pair<entity_type,int> alpha_pair;" is giving me "entity.cpp:9: error: expected initializer before < token"
12:50
< Tarinaky>
What am I doing stupidly >.<
12:51
< Tarinaky>
Ah! Forgot the namespace.
13:00
<@AnnoDomini>
Argh. I somehow broke the ai(), so now the critters will not move.
13:00
<@TheWatcher>
aie!
13:03
<@AnnoDomini>
Fixed! I was name conflicts. I was using a local variable that was the same name as a class member, and it caused conflicts.
13:03
< ErikM>
Ai ai ai ai. This waltz.
13:04
<@AnnoDomini>
http://i49.tinypic.com/eg2ypj.jpg <- Zombies can't get in. :D
13:05 * TheWatcher vaguely wonders whether he could ever set up a situation where he has to call ia -> ia -> shub_niggurath(thousand_young)
13:05
<@TheWatcher>
Heh, looking good, AD :)
13:06
< ErikM>
Can you shoot out at zombies through arrow slits in wall?
13:07
<@AnnoDomini>
26050 characters in 928 lines.
13:07
< ErikM>
TheWatcher: I'd expect the last part of the call to look something more like shub_niggurath.spawn_young(1000) if it were to have a realistic chance of being called for something else than a pure gag...
13:07
<@AnnoDomini>
ErikM: Attacking not yet implemented. Fortifications not yet implemented.
13:08
<@AnnoDomini>
ErikM: No, no, you have to use pointers!
13:08
<@AnnoDomini>
Else it's not mad enough.
13:08
< ErikM>
In what way?
13:08
< ErikM>
oH.
13:08
< ErikM>
It'll only be properly mad if you use GOTO!
13:09 * TheWatcher shudder
13:10
< ErikM>
Also, scatter random print("Hastur") statements at various places and try to avoid them. :P
13:11
<@TheWatcher>
snrk
13:13
<@AnnoDomini>
Hmmm. I'm thinking of implementing mortality. My first thought was to put it in ai(), then I realized that's silly, but then I realized it's awesome.
13:13
<@AnnoDomini>
Creatures only die when they realize they are dead.
13:14
< ErikM>
"You cast Owl's Wisdom on the zombie. It dies." ?
13:15
<@AnnoDomini>
No, not like that.
13:15
<@AnnoDomini>
Suppose you're very hasted, and surrounded by zombies.
13:15
<@AnnoDomini>
You hack once at each of them, but they die simultaneously when their turn eventually comes.
13:16
< ErikM>
I thought my idea was awesome too.
13:18
<@AnnoDomini>
I'm probably going to do it another way.
13:20 * AnnoDomini lols at getDead().
13:26
< Tarinaky>
Bring out yer dead.
13:27
<@TheWatcher>
you'll need a getting_better() function >.>
13:27
< ErikM>
That would be the Resurrect spell.
13:28
< Tarinaky>
... WTF? I thought ncurses KEY_PPAGE (et al) included the keypad PgUp key?
13:28 * Tarinaky -swears- it worked in the old version o.O
13:30
<@AnnoDomini>
Hmmmm. Can I use 'return;' to exit a void function? If so, should I or should I alter the logic so the function reaches its end naturally?
13:31
< ErikM>
goto end;
13:31
< Tarinaky>
AnnoDomini: You can return from a void function.
13:32
< Tarinaky>
Does anyone know how to use my numpad arrow keys?
13:32
< Tarinaky>
:/
13:32
< Tarinaky>
In ncurses.
13:32 * TheWatcher unleashes the velociraptors at eric
13:32
<@AnnoDomini>
Tarinaky: I implemented an ascii-code decoder.
13:33
<@AnnoDomini>
So it only works when Num Lock is on, but whatever.
13:33
< Tarinaky>
... ncurses getch() has keys for everything :/
13:33
<@AnnoDomini>
Well, I've had no problems with just parsing ASCII.
13:34
<@TheWatcher>
Tarinaky: http://osdir.com/ml/bug-ncurses-gnu/2009-07/msg00008.html
13:34
<@AnnoDomini>
Especially since it manages to parse my Dvorak layout correctly. :D
13:36
<@TheWatcher>
Tarinaky: I think you need to call keypad(win, 1) to force it to use the directions
13:36
< Tarinaky>
keypad(stdscr,true); ? Already there :/
13:36
<@TheWatcher>
Blugh
13:36 * ErikM unleashes the COMEFROM statement at the velociraptors
13:37
< Tarinaky>
I can give you a link to the code but parts are still kinda a mess.
13:37
< gnolam>
Pfft. Dvorak.
13:38
<@AnnoDomini>
What?
13:38
< ErikM>
One day I want to try programming with that language that implemented Come from.
13:39
<@AnnoDomini>
ErikM: I think you could do that, with some doing, in Prolog.
13:39
<@AnnoDomini>
I'm not certain, as I've only had pretty basic Prolog classes.
13:40
< ErikM>
I wonder what it does if two come from statements call the same line. Fork?
13:40
< Tarinaky>
Cry probably.
13:41
< ErikM>
No, that's what the debugger does when he sees it.
13:41 * TheWatcher suspects that your code is just really forked.
13:41
< ErikM>
Ha ha ha.
13:44
< ErikM>
I'm off.
13:45 ErikM [erikm@Nightstar-9e58ffe9.opera.com] has left #code []
14:01 * AnnoDomini starts testing the collision detection stuff.
14:01
<@AnnoDomini>
It sorta works, but it has the problem of forbidding everyone to move if there's a collision present.
14:09 Bobsentme [Bobsentme@Nightstar-79f8b1cd.livnmi.sbcglobal.net] has joined #code
14:09
< Bobsentme>
excuse me, just gotta do something.
14:09
< Bobsentme>
HOLY HELL IT WORKS! YAY!!!!!
14:09 * Bobsentme now returns you to your regularly scheduled coding, already in progress.
14:15
< Tarinaky>
"map.cpp:22: error: no match for operator+ in ((tile*)this)->tile::<anonymous>.entity::location() + MOVE_N" :/
14:16
< Tarinaky>
position.hpp:14: note: candidates are: position position::operator+(position&)
14:16
< Tarinaky>
I'd like everyone to note that MOVE_N is a constant position(0,-1,0) :/
14:18
<@AnnoDomini>
Did you define how adding positions works?
14:18
<@AnnoDomini>
Or is it a built-in thing?
14:18
< Tarinaky>
inline position operator+(position& that) {
14:18
< Tarinaky>
position posTmp(
14:18
< Tarinaky>
this->z+that.z,
14:18
< Tarinaky>
this->y+that.y,
14:18
< Tarinaky>
this->x+that.x);
14:18
< Tarinaky>
return posTmp;
14:18
< Tarinaky>
}
14:18
<@TheWatcher>
Tarinaky: shown me the definition for MOVE_N
14:18
< Tarinaky>
const position MOVE_N(0,-1,0);
14:20
<@TheWatcher>
hm. Change your addition operator to take a const position &
14:21
<@TheWatcher>
That's the first thing that comes to mind
14:21 * Tarinaky facepalms.
14:21
< Tarinaky>
Yeah. That'd do it.
14:21
< Tarinaky>
>.>
14:24 Thaqui [Thaqui@27B34E.D54D49.F53FA1.6A113C] has quit [Connection closed]
14:24
< Tarinaky>
No. Still falling over.
14:24
< Tarinaky>
Just with a more complicated error >.<
14:24 * Tarinaky tries a different approach.
14:31 Zedidiah [zag@Nightstar-d0088b95.or.comcast.net] has joined #code
14:33
<@AnnoDomini>
Huh. What's return code 3 mean?
14:35
<@TheWatcher>
Windows return code?
14:35
<@TheWatcher>
can't find the path specified, IIRC.
14:35
<@AnnoDomini>
Not sure. Maybe.
14:36
<@AnnoDomini>
I'm on Windows and this is running as a Windows console application.
14:37
< Tarinaky>
If there's one thing I've spent most my time on it's drawing 'pretty' walls >.<
14:37
<@AnnoDomini>
Your walls are pretty, but your doors are ugly.
14:38
< Tarinaky>
Seriously?
14:38
<@AnnoDomini>
Yeah.
14:40
< Tarinaky>
I don't understand what's making this thing throw :/
14:41
< Tarinaky>
Ah!
14:41
< Tarinaky>
Yes I do.
14:41 * Tarinaky facepalms.
14:43
<@TheWatcher>
?
14:44
< Tarinaky>
Offset.
14:44
<@TheWatcher>
Well, if you insist.
14:46
< Tarinaky>
AnnoDomini: How would you advise making the doors less ugly?
14:50
<@AnnoDomini>
Use a representation that matches your walls.
14:51
<@AnnoDomini>
As it is, these two styles do not match.
14:51 AbuDhabi [annodomini@Nightstar-3c8b7a3f.adsl.tpnet.pl] has joined #code
14:51
< Tarinaky>
What's wrong with using a '+' for a door?
14:52
<@AnnoDomini>
It does not match the style of the pretty walls.
14:52
<@AnnoDomini>
Have you looked at your own printscreens?
14:52
< Tarinaky>
Yeah...
14:53
< Tarinaky>
The walls are lines and '+' is a line with a line through i.
14:53
< Tarinaky>
*it
14:54
<@AnnoDomini>
We obviously have differing aesthetic sense.
14:54
< Tarinaky>
:/
14:54
<@TheWatcher>
Tarinaky: screenshot of your output available?
14:55
< Tarinaky>
Not with doors on it.
14:55
< Tarinaky>
I have ones of empty door-ways
14:55
< Tarinaky>
Which're '.'
14:56
<@TheWatcher>
s'av a gawk, then?
14:56
<@AnnoDomini>
Tarinaky: You have a screen of doors.
14:56
< Tarinaky>
I lost it then :/
14:56
<@AnnoDomini>
The movement blocking screen.
14:56
<@AnnoDomini>
On Wave.
14:56
< Tarinaky>
Those're door ways.
14:56
< Tarinaky>
That's from before I had doors.
14:57
< Tarinaky>
Just WALL,DOOR_OPEN and OPEN
14:57
<@AnnoDomini>
Are those + or what?
14:57
<@AnnoDomini>
It's hard to tell.
14:57
< Tarinaky>
Those're empty door ways.
14:57
< Tarinaky>
With periods in them.
14:58
< Tarinaky>
Heh. They do look a little like '+'s actually... I assure you that's my font.
15:07 * Tarinaky grumbles because his code's still not working right :/
15:09 * AnnoDomini tracks down the problem.
15:10
<@AnnoDomini>
http://i49.tinypic.com/2hqqptj.jpg
15:11 * TheWatcher eyes that zombie
15:11
<@TheWatcher>
Well, he's trapped...
15:11
< Tarinaky>
He's gone for a little swim~
15:12
<@TheWatcher>
Or is it just vampires that can't cross running water, rather than undead in general
15:12
<@TheWatcher>
hm, this probably requires some experimentation.
15:12
< Tarinaky>
Eugh. Anyone wanna help me figure out why my pretty walls aren't displaying right?
15:13
<@AnnoDomini>
The problem here is that I've converted the player object into a dynamically created member of the creatureVector object. The compile was bitching at me because getName(), getArmourName() and such were absent in the base Creature class. I created virtual functions. But it's using the definitions from the base class, rather than the child class.
15:13
<@AnnoDomini>
How do I fix this?
15:14
< Tarinaky>
http://i48.tinypic.com/1o29mr.png << This is as far as I've got :/
15:15
<@TheWatcher>
AD: have you tried casting?
15:16
<@AnnoDomini>
What do you mean? Like "(You*) pointers[0]" or something?
15:16
<@TheWatcher>
Yeah
15:17
<@AnnoDomini>
No, I have not.
15:17
<@AnnoDomini>
Trying now.
15:17
<@AnnoDomini>
Works! Thanks.
15:17
<@AnnoDomini>
The code is rather ugly, but it works.
15:34
<@AnnoDomini>
YES!
15:34
<@AnnoDomini>
Collision detection operational.
15:34
<@TheWatcher>
Woot!
15:36
<@AnnoDomini>
http://i46.tinypic.com/331zxo6.jpg
15:41
<@AnnoDomini>
The final problem with that was that every creature was detecting a collision with itself. Nope, I'm in my way. Can't move.
15:59 Tarinaky [Tarinaky@Nightstar-14df8a41.adsl.virginmedia.net] has quit [Ping timeout: 121 seconds]
16:05 * AnnoDomini thinks he'll save the creature vector into a .csv file.
16:13 Tarinaky [Tarinaky@Nightstar-a055766b.adsl.virginmedia.net] has joined #code
16:17
< Tarinaky>
Hmm. Currently trying to work out how to make the map scroll.
16:18
<@AnnoDomini>
In Soviet Russia, map scrolls YOU!
16:30
<@AnnoDomini>
Gnar. I should write my own damn function that translates int to string. Using itoa is cumbersome.
16:32
< Tarinaky>
itoa isn't portable anyway.
16:37
< Tarinaky>
Right. Time for saving.
16:39
< Tarinaky>
Hmm. Is it possible to have a map<string,class>?
16:39
< Tarinaky>
And would this be highly inneficient or would I be better off with a const char*?
16:40
< Tarinaky>
char* even
16:42
<@AnnoDomini>
Huzzah. My creature vector is saved and loaded from a file.
17:03
<@AnnoDomini>
http://i45.tinypic.com/5ju3w5.jpg
17:03
<@AnnoDomini>
Maximus summons Zombies with the ancient incantation of "S".
17:04
<@TheWatcher>
.... zombie apocralypse
17:05
<@AnnoDomini>
These can now be SAVED.
17:09
<@AnnoDomini>
http://i45.tinypic.com/2dhxpxe.jpg
17:12 You're now known as TheWatcher[afk]
17:18
< Tarinaky>
I'm going to go eat some dinner and contemplate how best to replace my creature management system.
18:29 Vornicus-Latens is now known as Vornicus
18:40 Vornicus [vorn@ServerAdministrator.Nightstar.Net] has quit [[NS] Quit: ]
18:42 Vornicus [vorn@ServerAdministrator.Nightstar.Net] has joined #code
18:42 mode/#code [+o Vornicus] by Reiver
18:52 You're now known as TheWatcher
18:58 celticminstrel [celticminstre@Nightstar-f8b608eb.cable.rogers.com] has joined #code
19:14
< celticminstrel>
But xrange would still have the problem that any changes made to the index variable are swept away in the next iteration.
19:16
<@Vornicus>
I'm still trying to figure out why stomping the index variable is a good idea in the first place.
19:16
<@Vornicus>
It's something I have literally never seen.
19:44
< celticminstrel>
Because I want to skip forward.
19:45 Rhamphoryncus [rhamph@566022.D9E3D0.C48D64.6110F6] has joined #code
19:46
< celticminstrel>
For example, parsing command line arguments. One argument may take the following argument as a parameter, so I would want to handle both simultaneously, then advance the index by 2 instead of 1.
19:47
<@Vornicus>
Is it just me or would a producer-consumer setup be better for that?
19:48
< celticminstrel>
Maybe?
19:50
<@Vornicus>
You'd set up a function - a generator, in this case - that all it does is spew the next command line option, and then whenever you need a new value you ask the generator.
19:51
< celticminstrel>
That does sound like it would work.
19:53
<@Vornicus>
On the other hand? You're reading command line options. Somebody's written this before.
19:54
< celticminstrel>
Hm?
19:56
< celticminstrel>
Someone's written what before?
19:57
<@McMartin>
command line parsers, presumably
19:59
<@Vornicus>
indeed
20:11
<@jerith>
optparse in the standard library.
20:12
<@Vornicus>
^--- that
20:13 AnnoDomini [annodomini@Nightstar-3c8b7a3f.adsl.tpnet.pl] has quit [Ping timeout: 121 seconds]
20:13 AbuDhabi [annodomini@Nightstar-3c8b7a3f.adsl.tpnet.pl] has quit [Ping timeout: 121 seconds]
20:18
< celticminstrel>
I was programming in Python, actually.
20:18
<@jerith>
celticminstrel: You seem to be spending a lot of time trying to treat Python like C.
20:18
< celticminstrel>
...but wait. The C++ standard library actually has a command line parser?
20:19
<@jerith>
No, the Python standard library.
20:19
< celticminstrel>
Oh. Okay.
20:19
<@jerith>
Python has some useful idioms that will make life a lot easier.
20:19
<@Vornicus>
And for a lot of stuff, Python has batteries.
20:19
< celticminstrel>
I probably know some of them.
20:20
<@jerith>
The C-style "for" construct doesn't exist because it's almost never necessary.
20:20
<@jerith>
And when I say "almost never", I mean just that.
20:21
<@jerith>
I think I've seen index-based iteration used maybe two or three times in the wild.
20:21 * Namegduf has had to use it a few times for various reasons, mostly contrived.
20:22
<@Vornicus>
I use it sometimes in specific situations where I need to be able to hang on to the index of certain things.
20:22
< Namegduf>
Not really index-based, because I generally am not iterating over an array.
20:22
< celticminstrel>
Yeah, what Vornicus said.
20:22
< Namegduf>
But doing something repeatedly for other reasons.
20:22
<@Vornicus>
(oh, and I also use it for monitoring; if i % 10000 == 0: print i, count...
20:23
<@jerith>
Also, enumerate().
20:23
< celticminstrel>
Oh yeah, I remember noticing that function.
20:23
<@Vornicus>
Yeah, enumerate helps a lot too.
20:32
<@jerith>
Also, list comprehensions.
20:35
<@jerith>
And the canonical way to iterate over something like command line parameters where you may want to operate on more than one item at a time is "while len(list_of_things) > 0:" and then pull elements off the list as you go.
20:36
< celticminstrel>
I was reluctant to alter sys.argv. Of course, that's easily solved.
20:36
<@jerith>
Or a normal for loop with a state machine.
20:36
< celticminstrel>
.....?
20:37
< celticminstrel>
Oh wait, I think I know what you mean.
20:37
<@jerith>
If you come across a thing that needs to eat the next item, change state and behave differently on the next iteration.
20:37
<@Vornicus>
Actually; while list_of_things
20:37
<@Vornicus>
not while len(list_of_things) > 0
20:38
<@Vornicus>
(non-empty lists evaluate as true)
20:38
<@jerith>
Vornicus: True. I prefer to be more explicit in case list_of_things is an iterator or something.
20:39
<@Vornicus>
len doesn't work on iterators! :)
20:39
<@jerith>
Precisely.
20:40
<@jerith>
It's actually more habit than anything else.
20:40
< celticminstrel>
Non-empty lists evaluate as true? I didn't know that.
20:40 AnnoDomini [annodomini@Nightstar-3c8b7a3f.adsl.tpnet.pl] has joined #code
20:40 mode/#code [+o AnnoDomini] by Reiver
20:41
<@AnnoDomini>
Anything interesting in the last three hours?
20:41
<@jerith>
Thangs that evaluate to False are False, None, 0, "", [] and I think {} and ().
20:41
<@jerith>
*Things
20:41
<@jerith>
Vornicus: What did I leave out?
20:42
<@jerith>
AnnoDomini: Just some discussion about Pythonic ways to do various things.
20:42
<@Vornicus>
0.0. 0L, 0j... I think you can get a file to evaluate to false...
20:44
<@jerith>
Wait. Complex literals?
20:45
<@Vornicus>
Yeah.
20:45
<@jerith>
When did that happen?
20:46
<@Vornicus>
They've been in there as long as I've been using Python.
20:46
< celticminstrel>
Technically not complex literals. Just imaginary literals.
20:47 Rhamphoryncus [rhamph@566022.D9E3D0.C48D64.6110F6] has quit [Ping timeout: 121 seconds]
20:47
<@jerith>
I knew complex numbers were there, I just didn't know the literal syntax. Shiny.
20:48
<@jerith>
At least they used the correct imaginary symbol. ;-)
20:55
< gnolam>
So Python was designed by an EE? :)
21:02
<@jerith>
As well as instantaneous current, 'i' is also the standard loop variable. :-)
21:28 Tarinaky [Tarinaky@Nightstar-a055766b.adsl.virginmedia.net] has quit [Operation timed out]
21:29 Tarinaky [Tarinaky@Nightstar-a055766b.adsl.virginmedia.net] has joined #code
21:42 Serah [Z@3A600C.A966FF.5BF32D.8E7ABA] has quit [Ping timeout: 121 seconds]
21:43 * AnnoDomini learns yet again that he shouldn't loop dependancies.
21:43
<@McMartin>
An important lesson
21:44
<@AnnoDomini>
So no trying to invoke creatureVector inside the definition of Creature.
21:46
<@AnnoDomini>
Hmm. I expect to have a problem with monsters 'hiding' under corpses.
21:47
<@Vornicus>
?
21:49
<@AnnoDomini>
Stuff gets printed to the screen in the order it was allocated.
21:49
<@AnnoDomini>
Creatures may die in a different order.
21:50
<@Vornicus>
Ah. Don't do it that way.
21:50
<@Vornicus>
You'll want a prioritization system for what gets displayed.
21:50
<@AnnoDomini>
Yes, I know.
21:50
<@AnnoDomini>
Right now, I'm trying my damnedest to make the linker accept what the compiler gives it.
21:50
<@Vornicus>
Living creatures > dead creatures > interactable furniture > important objects > rubble
21:57
<@AnnoDomini>
Oh, I see.
21:58
<@AnnoDomini>
Several files were removed from the project, mysteriously.
21:58 * AnnoDomini adds them back.
22:12
< Zedidiah>
This is for your roguelike?
22:13
<@AnnoDomini>
Yes.
22:15
<@AnnoDomini>
Fuck. Program terminated abnormally.
22:18
<@AnnoDomini>
Well, that's very abnormal.
22:19
<@AnnoDomini>
I set up attacks implicitly, on collision with another creature.
22:19
< Tarinaky>
Okay. C++ problem. I'm currently writing an enumeration to a file.
22:19
< Tarinaky>
How do I read it back out?
22:19
<@AnnoDomini>
I have these zombies milling about outside, attacking each other... but only one zombie is taking the damage.
22:19
<@AnnoDomini>
Zombie 5,-3815,51,21,5,30,1,30,4
22:19 * Vornicus fiddles with Euler 105. Can't figure out what his Euler 103 code is doing any more.
22:19
<@AnnoDomini>
-3815 is its health. >:(
22:20
< Tarinaky>
It's not quite dead yet.
22:20
< celticminstrel>
You could cast to int?
22:21
< celticminstrel>
Then when you read it in you'd need to do a range check.
22:21
<@AnnoDomini>
Yay, I fixed. :D
22:21
<@AnnoDomini>
"The Maximus attacks the Zombie 2 and inflicts 12 damage!"
22:22
< Tarinaky>
map.cpp:376: error: ambiguous overload for operator>> in file >> (int)((tile*)((map_row*)((map_plane*)((map_space*)this)->map_space::_space.std:: vector<_Tp, _Alloc>::operator[] [with _Tp = map_plane, _Alloc = std::allocator<map_plane>](((unsigned int)iLevel)))->map_plane::operator[](iRow))->map_row::operator[](iCol))->tile::< anonymous>.entity::type()
22:22
<@AnnoDomini>
Whee. AI knows when its dead, but the player doesn't.
22:22
<@AnnoDomini>
*it's
22:23
< Tarinaky>
"file >> (int)(_space[iLevel][iRow][iCol].type() );"
22:24 Rhamphoryncus [rhamph@Nightstar-a62bd960.abhsia.telus.net] has joined #code
22:24
< Tarinaky>
Suggestions?
22:24
< Tarinaky>
:/
22:24
<@AnnoDomini>
Genuflect.
22:25
< Tarinaky>
Isn't that a catholic thing?
22:26
<@AnnoDomini>
Not necessarily.
22:26
< Alek>
it's also known as taking a knee. XD
22:26
< Alek>
football players do it several times a game. :P
22:26
< Tarinaky>
Ahah! casting type() as int&
22:26
< Alek>
Genuflection (or genuflexion), bending at least one knee to the ground, was from early times a gesture of deep respect for a superior.
22:27
<@AnnoDomini>
http://i45.tinypic.com/4j23rr.jpg
22:29
< Alek>
The Maximus now?
22:30
<@AnnoDomini>
His Strength is over 9000.
22:30
< Alek>
his strength is as the strength of 9000?
22:31
< Alek>
or better yet, "His Strength was as the Strength of Ten Thousand"
22:45
< Tarinaky>
"map.cpp:392: error: request for member second in newInstance, which is of non-class type std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, entity*>()" << This error makes no sense.
22:45
< Tarinaky>
pair -is- a class o.o
22:57
< celticminstrel>
But std::pair() is a function type.
22:58
< celticminstrel>
It thinks newInstance is a function taking no arguments and returning an std::par<std::string,entity*>.
22:58
< celticminstrel>
^std::pair
22:59
< celticminstrel>
Did you declare it as "std::pair<std::string,entity*> newInstance();"?
22:59
< celticminstrel>
At least, that's what it looks like to me.
23:21
< Tarinaky>
I got it to work.
23:21
< Tarinaky>
I'm currently struggling to figure out why I'm getting a very bizarre infinite loop.
23:22
< Tarinaky>
It's bizarre because the control variable stopped changing :/
23:22
< Tarinaky>
Like... it's just frozen on ':' >.>
23:22
< Tarinaky>
So it keeps performing the same thing again and again but it doesn't reach the EOF so the loop won't terminate -that- way either :/
23:25
< Tarinaky>
http://tarinaky.pastebin.com/m324b18d5
23:44 Serah [Z@3A600C.A966FF.5BF32D.8E7ABA] has joined #code
23:49
< Tarinaky>
Gah. How do I write an eof to the end of a file?
23:54
<@AnnoDomini>
char endOfFile = 4; filestream << endOfFile;
23:54
<@AnnoDomini>
Try this?
23:56
<@McMartin>
... Except 4 isn't EOF
23:57
<@McMartin>
Traditionally, you don't *actually* write the EOF marker, you rely on the OS to tell you there's no file left to read.
23:57
<@Vornicus>
Similarly to mark the end of a file when writing you simply, well, close the file.
23:57
<@Vornicus>
If you're working in mmap though and you want to resize the file though I'm pretty sure you're doing it wrong.
23:59
< Tarinaky>
Well. eof() isn't going high.
23:59
< Tarinaky>
It's just politely not reading from the file any more.
--- Log closed Sat Jan 23 00:00:03 2010
code logs -> 2010 -> Fri, 22 Jan 2010< code.20100121.log - code.20100123.log >