code logs -> 2010 -> Thu, 21 Jan 2010< code.20100120.log - code.20100122.log >
--- Log opened Thu Jan 21 00:00:56 2010
00:03
< PinkFreud>
sorry, Bob - your earlier line may just wind up being immortalized for all to see.
00:03
< PinkFreud>
http://qdb.us/queue/
00:07 SmithKurosaki [Smith@Nightstar-a68aafef.dsl.teksavvy.com] has joined #code
00:14 Derakon[work] [Derakon@Nightstar-1ffd02e6.ucsf.edu] has quit [[NS] Quit: Leaving]
00:30 GeekSoldier [Rob@Nightstar-e86e3e0d.ip.cablemo.net] has joined #code
01:03 Attilla [Attilla@FBC920.81F6E9.6632EA.A0BB54] has quit [Ping timeout: 121 seconds]
01:03 Attilla_ [Attilla@FBC920.81F6E9.6632EA.A0BB54] has joined #code
01:06 Thaqui [Thaqui@27B34E.D54D49.F53FA1.6A113C] has joined #code
02:04 gnolam [lenin@Nightstar-38637aa0.priv.bahnhof.se] has quit [[NS] Quit: Z?]
02:04 Derakon [Derakon@Nightstar-5abd3ac9.ca.comcast.net] has joined #code
02:04 mode/#code [+o Derakon] by Reiver
02:05 Tarinaky [Tarinaky@Nightstar-9433e782.adsl.virginmedia.net] has quit [Ping timeout: 121 seconds]
02:19 Tarinaky [Tarinaky@Nightstar-39664116.adsl.virginmedia.net] has joined #code
02:34 Attilla_ [Attilla@FBC920.81F6E9.6632EA.A0BB54] has quit [Connection reset by peer]
03:32 Tarinaky [Tarinaky@Nightstar-39664116.adsl.virginmedia.net] has quit [Ping timeout: 121 seconds]
03:34 Tarinaky [Tarinaky@Nightstar-60f1718f.adsl.virginmedia.net] has joined #code
04:17 GeekSoldier [Rob@Nightstar-e86e3e0d.ip.cablemo.net] has quit [Ping timeout: 121 seconds]
05:02 AnnoDomini [annodomini@Nightstar-9d3229ea.adsl.tpnet.pl] has joined #code
05:02 mode/#code [+o AnnoDomini] by Reiver
05:31
< Bobsentme>
anyone here really good with Javascript?
05:31
< Bobsentme>
and got a minute or two?
05:44
<@Derakon>
I have a minute or two.
05:44
<@Derakon>
No guarantees on my skills, but I've used the language.
05:48
< Bobsentme>
ok
05:48
< Bobsentme>
http://pastebin.starforge.co.uk/104
05:49
< Bobsentme>
There's the code. My problem is: How the heck do I pull the values from the cloned text fields?
05:50
< Bobsentme>
or send them somewhere usefull, even?
05:50
<@Derakon>
IIRC the value of a form field foo is "foo.value".
05:50
<@Derakon>
Oh, you know that already.
05:51
< Bobsentme>
Right.
05:51
< Bobsentme>
My problem is: the fields are dynamically written to the page as blanks. If someone types or chooses something, I need to be able to capture the text / selected option and send it somewhere.
05:52
<@Derakon>
Your whitespace is driving me nuts, incidentally.
05:52
< Bobsentme>
yeah, sorry. too much copy / pasting / moving things around.
05:52
<@Derakon>
Any created form fields should be submitted along with existing form fields when the user hits submit.
05:52
< Bobsentme>
Ah, ok
05:53
< Bobsentme>
I didn't know that.
05:53 * Bobsentme thought he was screwed by having to use a work around for javascript values.
06:04
<@Derakon>
Here, check this out: http://derakon.dyndns.org/~chriswei/temp2/jstest.html
06:04
<@Derakon>
Take a look at what happens after you add some form fields and then click submit.
06:06
<@Derakon>
Hm. 12 minutes. Not bad.
06:08
< Bobsentme>
sweet. Nicely done, sir
06:09
< Bobsentme>
I suppose an alternative is, once the field is created, I can use php on the next page to check if the field exists and send it's contents into a variable.
06:15
< Bobsentme>
I apologize if calling your code "simple" is an insult, but it is awesome and it works beautifully....I just can't wrap my head around it.
06:15
<@Derakon>
Hey, simple code is good code. :)
06:15
<@Derakon>
Let's just walk through it real quick.
06:15
<@Derakon>
Okay, first off, the HTML.
06:16
<@Derakon>
I have a div that contains all of my form inputs, a base input for me to make copies of, and two buttons.
06:16
<@Derakon>
One button calls the Javascript function addElement, the other submits the form.
06:16
<@Derakon>
The form itself doesn't do anything, of course, since I didn't write a form handler.
06:16
<@Derakon>
It's using GET instead of POST just so you can see the arguments in the URL after submitting it.
06:17
<@Derakon>
All good?
06:18
<@Derakon>
Bob?
06:18 BeastMegatron2 [BeastMegatron@Nightstar-028c5e40.cable.rogers.com] has joined #code
06:18
<@Derakon>
If you have any questions, ask 'em.
06:20
< BeastMegatron2>
Rants are encouraged?
06:20
<@Derakon>
This channel does get its share of tech support hell, yes.
06:21
<@Derakon>
Bob, you there?
06:25
< Bobsentme>
sorry, dog issues.
06:25
<@Derakon>
Ahh, no worries.
06:27
< Bobsentme>
The HTML makes sense to me. It's more or less the parent / child elements that throw me.
06:27
<@Derakon>
Okay.
06:27
<@Derakon>
You understand how lastCreated works?
06:27
< Bobsentme>
not really
06:28
<@Derakon>
When the page is loaded, I create a Javascript variable, in the global scope, named lastCreated.
06:28
<@Derakon>
It automatically gets the value null (though generally, I would set this explicitly).
06:28
< Bobsentme>
oh...I didn't see that var at the top.
06:28
<@Derakon>
Ahh, that would make things confusing. :)
06:28
< Bobsentme>
makes a bit more sense now
06:28
< Bobsentme>
:)
06:29
<@Derakon>
The first time the Add button gets clicked, I note that lastCreated hasn't been set yet, and set it to the initial hardcoded form field.
06:29
<@Derakon>
Thereafter, it gets set to the form field I last created.
06:29
<@Derakon>
Okay, so newElement starts out as a clone of lastCreated.
06:30
<@Derakon>
That means it has the same name, id, and value as lastCreated, which is no good for me.
06:30
<@Derakon>
So I overwrite each of those fields individually.
06:30
< Bobsentme>
right
06:30
<@Derakon>
Now, lastCreated.parentNode is the HTML element that contains lastCreated.
06:30
<@Derakon>
In this case, it's the "inputs" div.
06:31
<@Derakon>
That parent node contains a list of all of its children. When the page first loads, that list has two elements: the "existing" form field, and a <br> tag.
06:31
< Bobsentme>
ooooooooh
06:31
<@Derakon>
In order for my newly-created form fields to show up on the page, I have to insert them into the page, as a child of some existing element.
06:32
<@Derakon>
I could do something like "document.getElementByType('body').children[0].children[0].appendChild(newElemen t)", but that's pretty terrible.
06:32 * Bobsentme nods
06:32
<@Derakon>
(That is, get the first child of the body tag, which should be the form, then get the first child of that, which should be the inputs div, and append to that)
06:33
<@Derakon>
So lastCreated.parentNode.appendChild(newElement) says "Stick newElement onto the end of the list of elements that contains lastCreated".
06:33
< Bobsentme>
Well, after you explain it like that: That code is gorgeous. And if I ween't already married. :P
06:33
<@Derakon>
And then I toss a <br> tag onto the end to make it look nicer.
06:34
<@Derakon>
Well, I'm glad you approve.
06:35
< Bobsentme>
well, 1) it works in less lines and is easier to understand than what I've got, and 2) you can write your own field names.
06:35
< Bobsentme>
1 is cool, 2 is very handy.
06:35
<@Derakon>
It's mostly just a matter of familiarity with Javascript and how it affects the DOM.
06:36
<@Derakon>
(DOM == Document Object Model, a.k.a. how the actual page is structured)
06:36
< Bobsentme>
Yeah, I've tried to understand the DOM, but it makes my head go boom.
06:37
<@Derakon>
Heh.
06:37
<@Derakon>
Do you have much familiarity with XML?
06:37
<@Derakon>
They're broadly similar.
06:37
< Bobsentme>
not a lot. Only 1 quick assignment in php class that had me load and parse XML.
06:38
<@Derakon>
Mm. I didn't start really understanding it until I had to write and read my own XML files.
06:41
<@Derakon>
Idly, I didn't know about cloneNode until I saw your code.
06:42
<@Derakon>
In this example, it doesn't matter if we pass true or false to cloneNode since it doesn't have any child nodes to recursively clone.
06:44
<@Derakon>
Anyway, I'm gonna head to bed. Good luck with your project.
06:45
< Bobsentme>
thanks again!
06:47 Derakon is now known as Derakon[AFK]
07:03 You're now known as TheWatcher
08:13 You're now known as TheWatcher[afk]
09:41 BeastMegatron2 [BeastMegatron@Nightstar-028c5e40.cable.rogers.com] has left #code []
09:59 You're now known as TheWatcher
10:23 MyCatVerbs [mycatverbs@Nightstar-3b2c2db2.bethere.co.uk] has joined #code
10:23 mode/#code [+o MyCatVerbs] by Reiver
11:00 Attilla [Attilla@FBC920.81F6E9.6632EA.A0BB54] has joined #code
11:00 mode/#code [+o Attilla] by Reiver
11:16 Reiver [reaverta@ServerAdministrator.Nightstar.Net] has quit [Ping timeout: 121 seconds]
11:20 Rhamphoryncus [rhamph@Nightstar-a62bd960.abhsia.telus.net] has quit [Client exited]
--- Log closed Thu Jan 21 12:28:01 2010
--- Log opened Thu Jan 21 12:29:12 2010
12:29 TheWatcher [chris@Nightstar-b4529b0c.zen.co.uk] has joined #code
12:29 Irssi: #code: Total of 20 nicks [5 ops, 0 halfops, 0 voices, 15 normal]
12:30 Irssi: Join to #code was synced in 53 secs
--- Log closed Thu Jan 21 12:38:35 2010
--- Log opened Thu Jan 21 12:38:42 2010
12:38 TheWatcher [chris@Nightstar-b4529b0c.zen.co.uk] has joined #code
12:38 Irssi: #code: Total of 20 nicks [5 ops, 0 halfops, 0 voices, 15 normal]
12:39 Irssi: Join to #code was synced in 52 secs
12:55 You're now known as TheWatcher[d00m]
12:59 Attilla [Attilla@FBC920.81F6E9.6632EA.A0BB54] has quit [Connection reset by peer]
13:00 Attilla [Attilla@FBC920.81F6E9.6632EA.A0BB54] has joined #code
13:02 Attilla_ [Attilla@FBC920.3488E2.676C06.EDEFB9] has joined #code
13:04 Attilla [Attilla@FBC920.81F6E9.6632EA.A0BB54] has quit [Ping timeout: 121 seconds]
13:09 Attilla [Attilla@FBC920.480E8C.CB1862.485F29] has joined #code
13:11 Attilla_ [Attilla@FBC920.3488E2.676C06.EDEFB9] has quit [Ping timeout: 121 seconds]
14:41 You're now known as TheWatcher
14:53 Attilla [Attilla@FBC920.480E8C.CB1862.485F29] has quit [Connection reset by peer]
14:53 Attilla_ [Attilla@FBC920.480E8C.CB1862.485F29] has joined #code
14:53 gnolam [lenin@Nightstar-38637aa0.priv.bahnhof.se] has joined #code
14:53 You're now known as TheWatcher[afk]
15:04
< gnolam>
Hmm.
15:04
< gnolam>
I wonder if MSVS 2005 and 2010 can co-exist?
15:25
< Tarinaky>
When I inherit from an abstract class is it enough to just write the specialised function into the code or do I actually have to mention it in the header?
15:27
< gnolam>
You have to declare it.
15:28
< gnolam>
If you're overriding it, that is.
15:28
< gnolam>
Which I assume you meant.
15:28
< Tarinaky>
It's an abstract function. As in "virtual void thingie()=0;"
15:28
< gnolam>
Ah, yes.
15:28 * gnolam is several days behind on his sleep.
15:29
< Tarinaky>
So I have to put void thingie() into the declaration of my class then?
15:29
< gnolam>
Yes.
15:29
< Tarinaky>
That's a touch annoying :/
15:29
< gnolam>
Note that it's still implicitly virtual though.
15:30
< gnolam>
In case you inherit from the derived class.
15:39
<@Derakon[AFK]>
The alternative would be assuming that child classes always implement all of their parent classes' virtual functions, which fails in the case that you want a child to only implement some of them and leave the rest for a second-degree child.
15:39
<@Derakon[AFK]>
And now, away to work!
15:41
< Tarinaky>
Gah.
15:42
< Tarinaky>
The documentation says that std::map contains a typedef value_type which is a pair<key,T>
15:43
< Tarinaky>
But when I attempt: "_keys.insert(_keys.value_type(KEY_UP,INPUT_MOVE) );" it doesn't like me at all.
15:44
< Tarinaky>
interface.cpp:9: error: invalid use of std::map<int, _key_handler&, std::less<int>, std::allocator<std::pair<const int, _key_handler&> > >::value_type
15:44
< Tarinaky>
I rather thought that, you know... This was kindof what map::value_type was there for >.<
15:48
< gnolam>
Post code.
15:49 celticminstrel [celticminstre@Nightstar-f8b608eb.cable.rogers.com] has joined #code
15:50
< Tarinaky>
http://tarinaky.pastebin.com/m34a8435 << This is where I am atm.
15:54
< gnolam>
You appear to be trying to store references in your map. This is Not Allowed.
15:55 * Tarinaky fixes things to use a pointer instead then.
15:58
< Tarinaky>
:/ still doesn't wanna work.
16:01
< celticminstrel>
The problem with references is that they are immutable.
16:02
< celticminstrel>
An int& is like an int*const, but with indirection performed automatically.
16:02
< Tarinaky>
interface.hpp:21: error: ((key_table*)this)->key_table::_keys.std::map<_Key, _Tp, _Compare, _Alloc>::operator[] [with _Key = int, _Tp = _key_handler*, _Compare = std::less<int>, _Alloc = std::allocator<std::pair<const int, _key_handler*> >](((const int&)((const int*)(& KEY)))) cannot be used as a function
16:02
< celticminstrel>
Okay, let me parse that...
16:05
< celticminstrel>
((const int&)((const int*)(& KEY))) looks like casting an int pointer to an int reference... :-/
16:05
< Tarinaky>
Ah. I think I managed to fix it by putting some brackets in.
16:05
< Tarinaky>
>.>
16:05
< celticminstrel>
I think the error is that the map's value isn't a function, but is being treated like one.
16:08 * Tarinaky boggles at the errors he's getting now.
16:16
< Tarinaky>
"key_table::key_table() {_init(); }" is giving me "/home/tarinaky/src/roguelike/interface.cpp:5: multiple definition of `GAME_ENGINE'"
16:16
< Tarinaky>
This doesn't make any sense to me at all :/
16:22 Reiver [reaverta@ServerAdministrator.Nightstar.Net] has joined #code
16:22 mode/#code [+qo Reiver Reiver] by ChanServ
16:29
< gnolam>
Post code again.
16:29
< gnolam>
Sounds like a variable definition inside a header file or something like that.
16:32
< Tarinaky>
I've decided to just say "fuck it" and refactor my map code so that I can, you know... stop using the stopgap global all together >.<
16:42 * Tarinaky reverts his code to yesterday and goes to get more IronBru so he can start again.
17:30 Derakon[work] [Derakon@Nightstar-1ffd02e6.ucsf.edu] has joined #code
17:30 * Derakon[work] finally gets around to figuring out what the Must_Restart() function does.
17:31
< Derakon[work]>
It's basically the threading equivalent of fork(): it examines the stack, grabs the caller's state, and re-invokes it in a separate thread.
17:31
< Derakon[work]>
Why do we have this?
17:31
< Derakon[work]>
I don't know.
17:31
< Derakon[work]>
It appears to be used only to spin off some function invocations to their own threads.
17:31
< Derakon[work]>
Of course, since the functions involved are pure Python, the GIL prevents this from getting you any performance gains.
17:47 * Derakon[work] discovers two other functions: G.sleep() and G.msleep(), which, respectively, do "import wx; wx.Sleep(secs)" and "import wx; wx.Usleep(msecs)".
18:18 You're now known as TheWatcher
18:30
< TheWatcher>
Dera: ...
18:32
< TheWatcher>
y'know, I think at this point I'm just going to stop being surprised at /anything/ Mr Haase has perpetrated
18:32
< Derakon[work]>
Heh.
18:42 * Derakon[work] removes all evidence of U.sleep and U.msleep.
19:24
< Tarinaky>
Okay. What am I doing wrong with the line: "extern "C++" engine;"
19:25
< celticminstrel>
There's no type.
19:25
< Tarinaky>
Would extern "C++" class engine be correct?
19:26
< celticminstrel>
Um... what exactly are you doing?
19:26
< Tarinaky>
The engine class won't compile because its header mentions the input class.
19:26
< Tarinaky>
The input class won't compile because its header mentions the engine class.
19:26
< celticminstrel>
Why do you need the extern "C++"?
19:27
< celticminstrel>
Wouldn't just "class engine;" be sufficient?
19:27
< Tarinaky>
Because I'm a gigantic moron >.>
19:27
< celticminstrel>
An extern "C++" would be useful only within an extern "C" { } run.
19:27
< celticminstrel>
(Or extern "some-other-language" { }.)
19:30 MyCatVerbs [mycatverbs@Nightstar-3b2c2db2.bethere.co.uk] has quit [Ping timeout: 121 seconds]
19:30 * Tarinaky head-desks.
19:30
< Tarinaky>
Still can't get it to compile :/
19:30
< Tarinaky>
"engine.hpp:17: error: field _Input has incomplete type" for line: "key_table _Input;"
19:31
< Tarinaky>
I'm forward declaring key_table :/
19:32
< celticminstrel>
You can't declare a variable of incomplete type. You'll need to put the full declaration of key_table before the declaration of _Input.
19:32
< Tarinaky>
The problem is that key_table's full declaration mentions engine :/
19:32
< celticminstrel>
You can only use incomplete types to declare pointers, references, and functions, if I recall correctly. And not for defining functions.
19:33
< celticminstrel>
Could you forward declare engine before key_table?
19:33
< Tarinaky>
key_table contains a pointer to engine.
19:33
< celticminstrel>
That should be fine then.
19:33
< Tarinaky>
input.cpp:20: error: invalid use of incomplete type struct engine
19:33
< Tarinaky>
:/
19:34
< celticminstrel>
What's line 20?
19:34
< Tarinaky>
stateGame->debug("New Input handler is receiving.");
19:34
< celticminstrel>
So, your problem would be solved by moving the implementation out of the header file, I think.
19:34
< Tarinaky>
Ah. Yeah. /me facepalms.
19:35
< Tarinaky>
What does "/home/tarinaky/src/ironsoulrl/engine.cpp:17: undefined reference to `key_table::register_game(engine*)'" mean?
19:35
< celticminstrel>
...um...
19:36 Rhamphoryncus [rhamph@Nightstar-a62bd960.abhsia.telus.net] has joined #code
19:36
< celticminstrel>
I have no idea.
19:36
< celticminstrel>
What's the line?
19:36
< Tarinaky>
"_Input.register_game(this);"
19:37
< celticminstrel>
:-/
19:37
< Tarinaky>
_Input being the instance of key_table.
19:37
< Tarinaky>
And this being... yeah >.>
19:37
< Tarinaky>
What am I doing that's failing so much?
19:38
< celticminstrel>
And register_game is declared in key_table as taking an engine* argument?
19:39
< Tarinaky>
Hmm... Does it matter that it's taking a typedef'd alias for engine?
19:39 * Tarinaky changes it.
19:40
< Tarinaky>
Apparently not.
19:40
< Tarinaky>
key_table -definately- takes an engine* argument.
19:40
< celticminstrel>
There's no difference between a typedef and the type it represents.
19:41
< celticminstrel>
Except for the binding of const when the typedef represents a pointer type.
19:41
< Tarinaky>
"void register_game(engine*);"
19:41
< celticminstrel>
I have no idea what's wrong here. :-/
19:42
< Tarinaky>
I'd provide full code listing but engine.cpp is starting to get -very- unwieldy. (hence why I wanted to move input elsewhere)
19:43
< Tarinaky>
http://tarinaky.pastebin.com/ma40be26 << Here is input.hpp
19:46
< celticminstrel>
Unrelated, but... "(*_keys[KEY])(_Game,KEY);"?
19:46
< Tarinaky>
Functors.
19:47
< celticminstrel>
_keys is an array of pointers to functors?
19:47
< Tarinaky>
_keys is a map of functors.
19:47
< Tarinaky>
Well, pointers to functors.
19:47
< celticminstrel>
Ugly.
19:47
< Tarinaky>
Because someone advised me that function pointers were bad.
19:48
< Tarinaky>
celticminstrel: The old way involved a tangled mess of switches >.>
19:48
< celticminstrel>
They are, but they have the minor advantage that they can be used just like functions, whereas pointers to functors are probably not callable.
19:48
< Tarinaky>
You can overload operator().
19:48
< Tarinaky>
Which I have done. >.>
19:49
< Tarinaky>
inline void operator() (engine* Game, int KEY) { _perform(Game,KEY); }
19:49
< celticminstrel>
But you can't then do _keys[KEY](_Game,KEY), can you?
19:49
< celticminstrel>
If they were function pointers, you could.
19:50
< Tarinaky>
Oh well. :/
19:50
< Tarinaky>
It's only 3 extra characters.
19:50
< celticminstrel>
True.
19:50
< Tarinaky>
I'd rather just figure out what's up with this linker error :/
19:50
< celticminstrel>
I can't see anything wrong with input.hpp.
19:50
< celticminstrel>
...wait, what?
19:51
< Tarinaky>
Hmm?
19:51
< celticminstrel>
Linker error?
19:51
< Tarinaky>
engine.o: In function `engine::init()':
19:51
< Tarinaky>
/home/tarinaky/src/ironsoulrl/engine.cpp:17: undefined reference to `key_table::register_game(engine*)'
19:51
< celticminstrel>
I thought it was a compile error.
19:51
< Tarinaky>
I was under the impression the fact it says engine.o meant it was a linker error.
19:51
< Tarinaky>
I may be wrong.
19:51
< celticminstrel>
Yes, but I didn't see that part.
19:52
< Tarinaky>
I did say >.<
19:52
< celticminstrel>
You only posted the second line before.
19:52
< Tarinaky>
Yes. But I said it was a linker error.
19:52
< Tarinaky>
:x
19:52
< Tarinaky>
At least, I think I did.
19:52
< Tarinaky>
Sorry.
19:52
< Tarinaky>
Does this change anything?
19:52
< celticminstrel>
Probably not...
19:53
< celticminstrel>
Perhaps I could see engine::init()?
19:53
< Tarinaky>
http://tarinaky.pastebin.com/m40b2dd0f
19:56 * celticminstrel Googles.
19:56
< celticminstrel>
Oh! That's what "undefined reference" means. Did you forget to define key_table::register_game(engine*)?
19:58
< Tarinaky>
... Not that I'm aware of.
19:58
< Tarinaky>
engine.hpp includes input.hpp
19:58
< celticminstrel>
Where is it defined? It's declared but not defined in input.hpp.
19:58
< Tarinaky>
Ha ha ha ha.
19:58
< Tarinaky>
You're right.
19:58
< Tarinaky>
I did forget!
20:00
< Tarinaky>
I repeat what I said earlier.
20:00
< Tarinaky>
I am a moron.
20:00
< Tarinaky>
Thanks.
20:01
< celticminstrel>
You're welcome.
20:48
< Bobsentme>
It's 500 lines of code away, I've got half a pack of smokes, half a tank of gas, it's dark, and I'm wearing sunglasses.
21:02 Derakon[work] [Derakon@Nightstar-1ffd02e6.ucsf.edu] has quit [Ping timeout: 121 seconds]
21:14
< Tarinaky>
Hit it.
21:23
< Bobsentme>
:)
21:38
< Bobsentme>
http://i.imgur.com/n61Fi.png
21:49 * Tarinaky head-desks
21:49
< Tarinaky>
"map.cpp:(.text._ZN6entityC2E8position11entity_type[entity::entity(position, entity_type)]+0xb): undefined reference to `vtable for entity'" << What does this mean?
21:49
< celticminstrel>
Something to do with virtual functions.
21:50
< Tarinaky>
Ah. That works.
21:50
< celticminstrel>
Maybe you declared one or more virtual functions but didn't define any of them?
21:50
< Tarinaky>
>.>
21:59 Derakon[work] [Derakon@Nightstar-1ffd02e6.ucsf.edu] has joined #code
21:59 * Derakon[work] crosses his fingers.
21:59
< Derakon[work]>
Running the upgraded microscope program in its prone-to-crash mode, and it's taken 907 datapoints so far without trouble.
21:59
< Derakon[work]>
Previous best I can remember is on the order of 400-500.
22:00
< Derakon[work]>
Oh, Rhamphoryncus!
22:00
< Derakon[work]>
Is there any purpose to a threading.Event whose wait() function is never called?
22:01
< Derakon[work]>
clear() and set() are called, but not wait().
22:01 * Rhamphoryncus scratches his head
22:01
<@McMartin>
Tarinaky: What celticminstrel said, or if you *did* define them but forgot to include them in the final link
22:02
<@McMartin>
the vtable is the part of the class that says what the methods are
22:02 MyCatVerbs [mycatverbs@Nightstar-58acb782.cable.virginmedia.com] has joined #code
22:02 mode/#code [+o MyCatVerbs] by Reiver
22:02
< Rhamphoryncus>
neither clear nor set block or have a return value
22:02
< Rhamphoryncus>
are you calling is_set()?
22:02
< Derakon[work]>
No.
22:02
< Tarinaky>
If there's one thing I hate debugging it's loops.
22:02
< Derakon[work]>
There are only three references to the Event: when it is created, when it is set, and when it is cleared.
22:04
< Rhamphoryncus>
no purpose I can find then
22:04
<@McMartin>
Tarinaky: You know the trick for breaking only on the Nth iteration of a loop, right?
22:04
< Tarinaky>
That's not the problem.
22:04
< Derakon[work]>
Okay, thanks.
22:05
< Tarinaky>
The problem is I have a segfault that's throwing because an earlier loop that populates a data structure isn't working correctly.
22:05
< Rhamphoryncus>
Tarinaky: I usually solve that with prints
22:06
<@McMartin>
Have a data structure verifier routine, call it right after init
22:10
< Derakon[work]>
1132 datapoints~
22:10
< Tarinaky>
Or maybe not.
22:10
< Tarinaky>
:/
22:11
< Tarinaky>
I'm confused as to what exactly is causing the segfault :/
22:11 * Vornicus is graduated!
22:11
< Derakon[work]>
Hey, congrats!
22:11
< Tarinaky>
Aside from deferencing a null pointer but that only helps a little.
22:11
< Derakon[work]>
Now we can precisely measure volumes we pour into you!
22:11
< Derakon[work]>
Tarinaky: got a stack trace with line numbers?
22:12
< Tarinaky>
Yes.
22:12
< Derakon[work]>
Those make debugging this stuff so much easier. ?.?
22:12
< Tarinaky>
I know.
22:13
< Tarinaky>
Problem is that the cause of the problem isn't on that line.
22:13
< Derakon[work]>
Well no, but you should be able to trace the object you tried to deference back through the code to find out why it isn't getting initialized.
22:13
< Derakon[work]>
Or why it's getting unset, or whatever.
22:13
< Tarinaky>
Oh yes. That's what I'm doing.
22:13
< Derakon[work]>
I'm not being very helpful here, am I?
22:13
< Tarinaky>
It's just proving to be difficult.
22:14
< Derakon[work]>
Debugging is harder than programming. Thus, if you are as clever as you possibly can be when you write your code, you won't be able to debug it. Therefore, write simple code. :)
22:14
< gnolam>
Kernighan's Law. \o/
22:15
< Tarinaky>
The problem is for some reason it's only creating a 1x20x20 map.
22:15
< Derakon[work]>
Checked your iterator variables?
22:15
< Tarinaky>
My constants specify a 1x20x30 map.
22:15
< Derakon[work]>
And their loop bounds?
22:15
< Tarinaky>
Yes.
22:15
< Tarinaky>
Yup.
22:15
< Derakon[work]>
Checked that you're always indexing into your array in the right order?
22:15
< Derakon[work]>
I.e. [i][j][k] not [k][j][i], or whatever is appropriate for your array.
22:16
< Tarinaky>
I've maintained ncurses convention of z,y,x/
22:16
< Derakon[work]>
Checked that that convention matches your memory allocation?
22:17
< Tarinaky>
Ahah!
22:17
< Tarinaky>
I think I might have spotted my mess.
22:18
< Tarinaky>
Yeah. Fixed.
22:18
< Derakon[work]>
Woot.
22:18
< Derakon[work]>
What was the problem?
22:19
< Tarinaky>
In the body of one of my constructors I was iterating columns rather than rows.
22:19
< Tarinaky>
Essentially rotating my map 90 degrees >.>
22:19
< Derakon[work]>
(1318 datapoints~)
22:19
< Derakon[work]>
Ah ha.
22:20
< Derakon[work]>
Man, 1318 datapoints...that means I have about four thousand 512x512 bitmaps of static.
22:21
< Derakon[work]>
Hey, any of you know of a Linux program that would handle storage/lookup/retrieval of massive files that have been gzipped?
22:21
< Derakon[work]>
Ideally something with a GUI so users can see a preview image of the file or something like that.
22:21
< Derakon[work]>
It's almost shameful how well these files compress (over 50% compression with gzip), and seeing as how we keep running out of disk space...
22:22
< celticminstrel>
That's why I hate multi-dimensional arrays.
22:22
< Tarinaky>
celticminstrel: So easy to fuck-up? Aye.
22:22
< celticminstrel>
It's too easy to rotate them.
22:24
< celticminstrel>
Though it may be partly because people overthink them a little. It doesn't really matter how it's stored in memory; if you decide that the first index is the x coordinate and the second index is the y coordinate and use that convention consistently, it'll work. Or you could choose to index by row,column instead.
22:25
< celticminstrel>
I used a boost::multi_array, which asserts on out-of-bounds rather than creating a segfault. Slightly better, I guess.
22:25
< Derakon[work]>
Celticminstrel: which works fine up until you have to hand your array off to a library that expects a different convention...
22:25
< Derakon[work]>
This is why the program I'm working on is littered with "XYZ" and "ZYX" variants on basic positioning functions.
22:25
< celticminstrel>
True.
22:33
< Derakon[work]>
1587!
22:34
< Derakon[work]>
It's over a quarter of the way through the stress test!
22:34
< Derakon[work]>
Say, anyone know if engaging the screensaver in Windows does anything beyond just changing what's shown onscreen? Disable any services or something like that?
22:35
< AbuDhabi>
Not positive, but it doesn't SEEM to do anything more.
22:35
< AbuDhabi>
I've never had problems.
22:36
< Derakon[work]>
Okay.
22:36
< Derakon[work]>
Yesterday I ran the stress test and got a crash, but not the crash, and was wondering if the screensaver kicking in could somehow have been at fault.
22:37
< Derakon[work]>
But thinking about it now, I'm more inclined to blame a piezo problem that caused the slide to gradually drift out of bounds.
22:47
< Derakon[work]>
Incidentally, Gnolam: that issue I mentioned awhile back where the piezo controls weren't on? I lied. It was that they weren't in closed-loop mode, where they examine their motion and correct for error automatically.
22:47
< Derakon[work]>
Kinda like how a robot on wheels will tend to naturally turn unless it's intentionally looking to drive straight.
22:47
< Tarinaky>
:/ This is an odd bug.
22:48
< gnolam>
Derakon: Ah. :)
22:48
< gnolam>
Another reason to avoid multidim arrays is that you can't pass them around properly.
22:49
< gnolam>
All but the last dimension must be fixed.
22:55
< Tarinaky>
"map.o: In function `tile':
22:55
< Tarinaky>
/home/tarinaky/src/ironsoulrl/position.hpp:14: multiple definition of `DEBUG_ENGINE' "...
22:56
< Tarinaky>
Line 14 of that file contains exactly 0 mentioning of DEBUG_ENGINE.
22:56
< Tarinaky>
>.<
22:56
<@McMartin>
Yay #define~
22:58 Alek [omegaboot@Nightstar-3f3964f1.emhril.sbcglobal.net] has quit [[NS] Quit: beroot, feh]
22:59
< Tarinaky>
Can someone remind me what 30_base 8 is in hex?
23:00
< Tarinaky>
I have a vague-ish recolection that it's 40-something.
23:00
< Tarinaky>
Oh wait. No.
23:00
< Tarinaky>
Nm. I'm an idiot.
23:01
< celticminstrel>
30 octal is 18 hex or 24 decimal.
23:01
< gnolam>
It'd be one strange number to be bigger in hex than octal. :)
23:01 * Derakon[work] gets momentarily confused when told that a biologist is using fish.
23:01
< Tarinaky>
Yeah. I was thinking of 0x30.
23:01
< Tarinaky>
>.<
23:01
< Derakon[work]>
Apparently this means actually studying fish, not using the FISH imaging technique.
23:01
< celticminstrel>
Which is 48 decimal.
23:01
< Tarinaky>
Which is '0'.
23:02
< Tarinaky>
Hence its significance to me.
23:02
< celticminstrel>
????
23:02
< AbuDhabi>
It loops?
23:02 Alek [omegaboot@Nightstar-3f3964f1.emhril.sbcglobal.net] has joined #code
23:03
< Tarinaky>
AbuDhabi: Converting integers to characters,
23:03
< celticminstrel>
Oh, right, yes.
23:03
< Derakon[work]>
ASCII(48) == '0'
23:03
< Derakon[work]>
Or I guess, itoa(48)
23:03
< Tarinaky>
itoa isn't portable iirc.
23:03
< Tarinaky>
And I don't appear to have it on my computer.
23:03
< celticminstrel>
You can just use sprintf anyway for that.
23:04
< celticminstrel>
Or stringstreams.
23:04
< Tarinaky>
Now I just need to figure out why -this- loop is fucked.
23:04
< gnolam>
So... when people go "Derakon, do you have my DNA sequences?", you say "Go FISH"?
23:05 * Derakon[work] facepalms.
23:06 * Tarinaky is -seriously- confused where this bug is coming from :/
23:06 Attilla_ is now known as Attilla
23:09
< Tarinaky>
>.> it also doesn't manifest itself when I use smaller numbers for my map-size constants.
23:09
< Tarinaky>
Ahah!
23:11 AbuDhabi [annodomini@Nightstar-be406da0.adsl.tpnet.pl] has quit [[NS] Quit: EXIT LIGHT, ENTER NIGHT.]
23:16
< celticminstrel>
I can never remember which is which between '\n' and '\r'...
23:17
< gnolam>
\r as in carriage \return.
23:17
< gnolam>
And \n as in \new line (line feed).
23:17
< Rhamphoryncus>
\r is carriage return, \n is newline. \n is used on linux, \r on macs, and \r\n pairs on windows
23:17
< celticminstrel>
But apparently some compilers switch the meaning?
23:17
< Rhamphoryncus>
celticminstrel: it's not the compilers that give the meaning
23:18
< celticminstrel>
Um...
23:18
< celticminstrel>
...yes it is?
23:18
< Rhamphoryncus>
However, there can be conversion between the different conventions if you open a file in text mode rather than binary
23:18
< gnolam>
But that's in the C runtime and not in the compiler.
23:19
< celticminstrel>
Right, which I just realized is what I'm doing. 9.9
23:19
< Rhamphoryncus>
Often you just use \n internally and it gets converted for you if needed. If setup right.
23:34
<@ToxicFrog>
Macs also use \n these days.
23:34
<@ToxicFrog>
Translation occurs at runtime; a file opened in text mode on windows will translate \n to \r\n on write, and vice versa on read.
23:51 gnolam [lenin@Nightstar-38637aa0.priv.bahnhof.se] has quit [[NS] Quit: Z?]
--- Log closed Fri Jan 22 00:00:36 2010
code logs -> 2010 -> Thu, 21 Jan 2010< code.20100120.log - code.20100122.log >