code logs -> 2010 -> Sun, 12 Dec 2010< code.20101211.log - code.20101213.log >
--- Log opened Sun Dec 12 00:00:47 2010
00:09 Tarinaky [Tarinaky@Nightstar-f349ca6d.plus.com] has quit [Connection closed]
00:16 Stalker [Stalker@3A600C.A966FF.5BF32D.8E7ABA] has joined #code
01:17 Anno[Laptop] [annodomini@Nightstar-3c364523.adsl.tpnet.pl] has quit [[NS] Quit: Zzz.]
01:46 Attilla [Some.Dude@Nightstar-bdcc79b4.threembb.co.uk] has quit [[NS] Quit: ]
02:02 Stalker [Stalker@3A600C.A966FF.5BF32D.8E7ABA] has quit [Ping timeout: 121 seconds]
02:38 gnolam [lenin@Nightstar-38637aa0.priv.bahnhof.se] has quit [[NS] Quit: Z?]
03:13 Alek [omegaboot@Nightstar-96006922.il.comcast.net] has quit [[NS] Quit: beroot...]
03:18 Alek [omegaboot@Nightstar-96006922.il.comcast.net] has joined #code
03:32 Thaqui [Thaqui@27B34E.D54D49.F53FA1.6A113C] has joined #code
06:34 Stalker [Stalker@3A600C.A966FF.5BF32D.8E7ABA] has joined #code
06:48 celticminstrel [celticminstre@Nightstar-f8b608eb.cable.rogers.com] has quit [[NS] Quit: And lo! The computer falls into a deep sleep, to awake again some other day!]
08:48 Syloqs-AFH [Syloq@NetworkAdministrator.Nightstar.Net] has quit [Connection reset by peer]
08:49 Syloqs_AFH [Syloq@NetworkAdministrator.Nightstar.Net] has joined #code
08:51 Syloqs_AFH is now known as Syloqs-AFH
08:55 Anno[Laptop] [annodomini@Nightstar-15816230.adsl.tpnet.pl] has joined #code
09:16 Vornicus is now known as Vornicus-Latens
09:31 Thaqui [Thaqui@27B34E.D54D49.F53FA1.6A113C] has quit [Connection closed]
09:43 You're now known as TheWatcher
11:08
< Anno[Laptop]>
http://osix.net/modules/article/?id=348 <- Is it crazy of me to use this method of serialization, provided I use it on structs which have arrays and null-terminated strings?
11:09
< Anno[Laptop]>
It seems to work, anyway.
11:13
< Anno[Laptop]>
The comments imply problems which may be caused by using std::strings and using the files across different systems/compilations.
11:14
<@McMartin>
std::strings are not null-terminated
11:15
< Anno[Laptop]>
I know.
11:15
< Anno[Laptop]>
I'm not using std::strings.
11:16
< Anno[Laptop]>
What I intend to do with this is make save files.
11:17
<@McMartin>
The best way to set up save files is to have it be firmly specified though so that you can use across systems, yeah
11:17
<@McMartin>
UQM had a huge problem with 32- vs 64-bit.
11:18
< Anno[Laptop]>
But provided a save file isn't made on one architecture and then loaded on another architecture, I should be fine?
11:18
<@McMartin>
That said, if they aren't portable, it's the cheapest way to get it done in a hurry
11:18
<@McMartin>
Yeah
11:18
<@McMartin>
But people will want their saves to port. -_-
11:18
< Anno[Laptop]>
Cool.
11:19
< Anno[Laptop]>
This saves me a lot of work. :D
11:19
< Anno[Laptop]>
http://pastie.org/1369764 <- I'd need at least ten times more code to do this.
11:19
<@McMartin>
You would eventually want to add serialize() and deserialize() methods that just dump each field in a stated order
11:19
<@McMartin>
This would also let you use std::strings as long as they didn't have nulls in them >_>
11:20
<@McMartin>
Well, that pastie is the same thing, but with stdio instead of iostream
11:21
< Anno[Laptop]>
Adding methods is a bit problematic, seeing as I'm coding in C.
11:21
<@McMartin>
Oh
11:21
<@McMartin>
Yeah, OK
11:21
<@McMartin>
You're golden then
11:21
<@McMartin>
The standard name for this is "structure dump"
11:21
<@McMartin>
And in fact
11:21
<@McMartin>
You have a decent chance at portability here too
11:22
< Anno[Laptop]>
Really?
11:22
<@McMartin>
As long as your strings are all, say, a multiple of 8 long.
11:22
<@McMartin>
Then they'll all be 64-bit aligned, and there will be no padding.
11:22
<@McMartin>
Oh
11:22
<@McMartin>
Your strings have to be char arrays, though, not const char *
11:22
< Anno[Laptop]>
Yeah, they're all char arrays.
11:23
<@McMartin>
Otherwise the dump will fail horribly because it's dumping pointers to memory in a process that's gone~
11:23
<@McMartin>
Yeah, golden
11:23
< Anno[Laptop]>
Multiple of 8 long with or without regard for the ending null?
11:23
<@McMartin>
Doesn't matter; I'm talking the size of the array itself.
11:23
< Anno[Laptop]>
Aha.
11:23
<@McMartin>
Basically, you'll be dumping even the unused chars here using this technique.
11:24
<@McMartin>
You want that number to be a multiple of 8 and then everything's QWORD aligned, and made of stuff that's 1 byte long
11:24
<@McMartin>
That should work regardless of endianness and pointer size.
11:25
< Anno[Laptop]>
Awesome. Thanks!
11:25
<@McMartin>
But I wouldn't trust it overall.
11:25
<@McMartin>
If portability is important, doing it a char at a time is the way to go.
11:26
<@McMartin>
(And with null termination if you then wrote the nulls out, you could have the saves be smaller, too~)
11:26
<@McMartin>
But yeah, structure dumping is the classic cheap serialization technique.
11:40 Tarinaky [Tarinaky@Nightstar-f349ca6d.plus.com] has joined #code
12:31 gnolam [lenin@Nightstar-38637aa0.priv.bahnhof.se] has joined #code
15:20 Syloqs-AFH [Syloq@NetworkAdministrator.Nightstar.Net] has quit [Ping timeout: 121 seconds]
15:26 Syloqs_AFH [Syloq@NetworkAdministrator.Nightstar.Net] has joined #code
15:27 Syloqs_AFH is now known as Syloqs-AFH
16:09 celticminstrel [celticminst@Nightstar-f8b608eb.cable.rogers.com] has joined #code
16:30 Attilla [Some.Dude@Nightstar-1738884b.threembb.co.uk] has joined #code
16:30 mode/#code [+o Attilla] by Reiver
16:30 Kindamoody [Kindamoody@Nightstar-4764665d.tbcn.telia.com] has joined #code
16:31
< Kindamoody>
Hello, is it OK if I just sit in a corner and lurk for a while?
16:32
< gnolam>
Knock yourself out.
16:37
< gnolam>
People here tend to divide their time between lurking and ranting.
16:37
< gnolam>
Speaking of which...
16:37 * gnolam stabs Valve.
16:38
< gnolam>
When I tell you to cancel a script, you should fscking /cancel/ it, dammit.
16:38
< Kindamoody>
I don't know anything about this channel, I just now found out it existed a channel with this name.
16:38
< gnolam>
Not pretend to cancel it, and then queue the next one for execution at can't-be-arsed o' clock. >:E
16:41
< celticminstrel>
Kindamoody: It's a channel for programmers.
16:41
< Kindamoody>
I'm not a very advanced programmer, but I know some.
16:43
< Kindamoody>
I mean, I know some programming.
16:44
< Kindamoody>
Well, I may know some advanced programmers, too. :/
16:57
< gnolam>
We have a full range of skills here, from "beginner" to "guru".
17:03
< gnolam>
Hmm. Beta or fix the borked scripting, that is the question...
17:11
< Kindamoody>
I know some C, C++ and PHP. I also know a little bit of Actionscript, but my favorite is, unfortunately, the sadly outdated Lingo.
17:37 Kindamoody is now known as Kindamoody[out]
17:45 kwsn [NSwebIRC@Nightstar-fb2504b4.dyn.centurytel.net] has joined #code
17:59 Anno[Laptop] is now known as Birds
18:06 * gnolam decides on beta.
18:42 Vornicus-Latens is now known as Vornicus
19:15 * jerith sighs at Java.
19:16
<@jerith>
Why is it such a pain to write and use a compile-time annotation processor?
19:16
< celticminstrel>
Because Java is a pain in general?
19:17
<@jerith>
Yeah.
19:17
<@jerith>
Also, Eclipse is made of spiders and fail.
19:17
< celticminstrel>
Its reflection interface is pretty obtuse too.
19:17
< celticminstrel>
I'd agree on the spiders but not on the fail.
19:18
<@jerith>
Oh, it's made of so very much fail.
19:19
<@jerith>
I used runtime annotation processing and reflection before this, but that's a pretty massive performance penalty on the Dalvik VM.
19:20
<@jerith>
Especially since I have to turn integers into strings all the time, because they forgot to implement arrays of primitive types in annotations.
19:30 Stalker [Stalker@3A600C.A966FF.5BF32D.8E7ABA] has quit [Ping timeout: 121 seconds]
20:37 * gnolam ponders float comparisons.
20:41
<@jerith>
Compare with a threshold.
20:43
< gnolam>
That's the general answer, yes.
20:43
< gnolam>
But I think I might get away with == 0.0f comparisons here.
20:44
<@jerith>
If you're doing arithmetic, you might not actually get to 0.0f.
20:44
< gnolam>
Just assignments.
20:45
<@jerith>
Then you should be fine.
20:59 * Vornicus has done == 0.0f once or twice. As an edge case.
21:19 Vornicus is now known as Finerty
21:22 Birds is now known as AnnoDomini
22:52 AnnoDomini [annodomini@Nightstar-15816230.adsl.tpnet.pl] has quit [[NS] Quit: leaving]
23:00 kwsn [NSwebIRC@Nightstar-fb2504b4.dyn.centurytel.net] has quit [[NS] Quit: moo]
23:21 Tarinaky [Tarinaky@Nightstar-f349ca6d.plus.com] has quit [Client closed the connection]
23:48 * simon__ is making a toy-language based on Erlang that contains primarily atoms, tuples and higher-order functions.
23:48
< simon__>
I just realized how annoying it is not to have type inference.
23:52
<@McMartin>
Heh
23:55
< gnolam>
What a coincidence! My project involves atoms as well. But unfortunately, they're not very stable. ;)
--- Log closed Mon Dec 13 00:00:49 2010
code logs -> 2010 -> Sun, 12 Dec 2010< code.20101211.log - code.20101213.log >