I received, about a week early, my Droid Incredible in the mail today! That was cool. I plugged it in, promptly rooted it and made a restore backup image to NAND. I'm considering doing the overclocking/custom ROM thing, although I'm mostly interested in an early copy of FroYo (rather than waiting for the Sense-UI OTA version). Since I'm still getting used to things, I probably won't miss Sense if I do that.
I also synched contacts with my Gmail account -- I'm not so sure that was a good idea. Now I've got a phone contact for every last person I've e-mailed (it feels like). support@paypal.com? Ugg, why is that there. I've got some pruning to do. I found an option to trim it down to just those I had phone numbers for, but my contact book was pretty sparse on that. Guess I'll have to rectify it.
Game-wise: I've done a bit more thinking about how things should work, and it's not exactly TDD worthy but at least I have some solid thoughts on the matter. No plan survives the enemy and all that, so I think my next big coding step (after fixing the snafu I'm about to describe) will be to figure out how to Profile this stuff. Whether I wrote my own code (probably necessary), or can somehow use the Android tools. I'll also try debugging on my device, since I have that now. Should be fun!
So, as things currently stand, about a few hours into making the document I got bored and wanted to write some code. I coded up a C++ test rig and wrote a few test cases for my reals class. Ideally, I want the reals to work like any other built-in type, so this means I've got some operator-overloaded muck to deal with.
The usual stuff wasn't that big of a deal: arithmetic and arithmetic-assignment operators are all done, as well as logical comparisons--inequalities (and equalities, I suppose). I had also coded up some constructors, assignment operators, and some cast operators, but they were causing me no end of grief with the equality operators. Briefly, it couldn't decide how to handle equality, so in a case like this:
real r = 32.2f; float f = 32.2f;
if( r == f ) { // ...
it would call real(32.2f) to convert that number to a real type, but then when it got to the second line, it didn't know whether to call real(float) with f to convert f to a float, or to call real::operator float() to convert r down to a float before it could compare them. And then there was some ugly template mess thrown into the mix. (The fixed-point version of real uses an int template to determine where exactly the point is.)
Anyway, I solved that problem by getting rid of the constructors, but through some sequence of events that eludes me unless I sit and think really hard (like, with pencil and paper) about it, it managed to break my list class (and my vector class). Something about how my list was expecting <T>'s (just any old type), but I guess it was trying to construct them and that didn't work, and so I tried to change it to take pointer-to-<T>'s, but that doesn't work in the simple value-case where I don't mind if it gets copied around. That is, I can't just have a list of ints (or vectors) anymore, I have to specifically allocate each one somewhere and then keep track of it. It's sort of a mess.
I've downloaded a few STL implementations and if I can manage to decipher the typedef/macro insanity that all STL implementors feel is necessary, I'll try to do something similar in my own class. I suspect I may have to create my own allocator for the case where I want to store simple value-types that are larger than a native pointer. This isn't a huge problem, though, since I was planning on creating a couple fixed-size allocators to use for such a purpose. I'll just cordon off a smallish chunks of memory near the end for 4, 8, 16, and 32 byte allocations and be happy (well, maybe not 4 bytes, that's a bit small).
Goals for the immediate future include: figuring out what chain of events fixing my real type causes lists to explode, documenting it, and fixing all of that so that it compiles.
Oh, I should manage that I have like three working directories now. My trunk, which I've sort of given up on because it's in all sort of non-compile state: I was trying to port some things around and it's been a while since I looked at it so all I know right now is that it doesn't compile. I spawned a new repository from the latest commit in that (which compiled), and used that to fix some of the issues I discovered while writing the test cases. I was able to commit those changes, push them back into the trunk repo, pull and (seemlessly!) merge those changes down into the test repo, and then push a bit of the test rig setup back to the main repo. It was all so smooth. It's amazing! SVN has nothing on this. (I hear Perforce might be okay, but I have to wonder how much the cost of it helps indoctrinate its users into thinking it's so great. While that can be had for
free for individual users, I can't imagine it being as painless to use as
Mercurial is.)
Recent Comments