General
I’ve been contemplating making my novels available on various electronic markets, and the Amazon Kindle market was particularly easy to convert one for, so I’ve gone ahead and taken the plunge with my scifi biopunk novel Fourwar. I initially intended to post it at the 99-cent price, but Amazon’s odd royalties mean that you have the choice of posting it at 99 cents for a 35% royalty (so I’d get about 34 cents, minus a few cents for the bandwidth of the book) or at a minimum of $2.99 US for a 70% royalty. While 35% is still significantly better than the traditional rates for a new author of maybe 2% (yes, two percent) if you’re lucky (from all I’ve read), I’m not really sure why I should give Amazon 65% of the royalties instead of 30% if I have the choice. So, rather than give Amazon the lion’s share, I’ve posted it at the $2.99 minimum price.
I’m not entirely sure what Amazon’s logic for the $2.99 minimum is. I’ve seen speculation that Amazon wants to force the customer expectations for ebooks to stay higher than $0.99 by dangling a carrot in front of authors who take the higher prices, and that may be possible. While Amazon stands to make about 65-70 cents on a $0.99 book, they will make about 90-95 cents on a $2.99 book (depending on bandwidth charges which are taken out of the author’s profit), so it seems evident that, at least at the bottom end of each range, they stand to make more money while keeping a nominally smaller cut if the author charges more. I’m not sure how this will work out, but I’m also not entirely sure how to go about marketing my book without obnoxiously spamming everything in sight, so I suppose I’ll figure both things out as I go.
Anyway, I took an hour or so last night and painted a little cover image and did a simple cover layout in Photoshop. See results below.:)
While the book is freely available as a PDF in my writing section (and PayPal donations are less cumbersome than Amazon.com royalties if you just want to tip me – see the right sidebar), if you have a Kindle and want to have a portable version, I’d certainly encourage you to get it:

Volumetric Raycasting and Near-Plane Clipping
Just a little note that if you need to prevent near-plane clipping while moving the camera into your volume, there seems to be a simple way to achieve this effect (in OpenGL): simply enable GL_DEPTH_CLAMP while rendering the front and back faces of the bounding volume you are casting from. There may be a better way to do this, but this seems to work and with no noticeable performance loss.
Just a minor site update – I’ve tested this layout in Chrome, Firefox, and the latest IE, but it might break on older browsers.:) In any case, welcome to the new front page! I’ve also pulled my Twitter/Plurk feed in, which I update a good bit more frequently than this, so hopefully that helps things stay more current.
As always, I’m working on a billion projects. OpenGL and direct volume rendering of procedural volumes via shaders is my current primary project:

I’m also still slowly pounding away at a third novel, more science fiction. I’ve tweaked my existing novels to be available as PDFs using a more readable layout – see my writing for that. Haven’t done much music lately, besides tinkering with dubstep.
And I’ve been running and doing a bit of TKD, so that about sums it up.:)
QuickFIX/J and Odd Memory Leaks
This is more a case of posting here to remind myself, but maybe it will help someone out. I just ran into a case where QuickFIX/J seemed to be stacking up endless messages in a LinkedHashMap object (messageQueue) in SessionState.java (discovered using a heap dump and the helpful Memory Analysis Tool from Eclipse) and spent a few hours banging my head on the wall trying to figure out why. After I bothered to read the QFJ code, I understood why, but it’s non-obvious.
Essentially, QFJ’s Session class parses each incoming message, and then attempts to parse any “queued” messages from the aforementioned LinkedHashMap before doing it all again. The contents of the LinkedHashMap (in my case, built up to 500+ megabytes before bringing the JVM to flaming ruin) are only messages that result from a “sequence number too high” error. So if your QFJ application throws, for example, a repeated NPE while handling FIX messages, in certain cases this can trigger a “sequence number too high” problem and will result in FIX messages stacking up in that QFJ-side queue.
I’m not sure if this is really a bug in QFJ or not — I should have checked the QFJ event log sooner, and I might have solved this without noticing the pileup. I suspect that’s why there isn’t a lot of information to be easily found online about the issue – other people just debug their applications correctly.;) That said, it’s non-obvious to me that anything I do in my QFJ application should result in some map inside QFJ’s core classes growing out of control. Hence, noted for myself and anyone else who may care/be curious.:)
Your Zodiac Sign Didn’t Change.
In the interests of combating ignorance, I’ll make a note about this “zodiac change” everyone has been going on about.
YOUR ZODIAC SIGN DIDN’T CHANGE!!!
I’m an interested non-believer in astrology. I find it amusing, systematic, good for entertainment purposes and a reasonable psychological self-inventory system at times. I don’t really believe it has predictive or prescriptive power, but I’m a general agnostic so I won’t categorically deny that it might not for the same reason that I won’t deny the possible existence of a deity. I’m apathetic about either one. What I’m not apathetic about is people in positions of intellectual authority who spread misinformation in some misguided attempt to drive the dark ages of superstition out of the masses, or whatever nonsense.
The very short reason that your zodiac sign didn’t change: you’re most likely a Westerner, accustomed to the not-very-accurate zodiac divisions laid out in newspaper astrology. These dates are aligned to a tropical geocentric zodiac — what this means is that the start of the zodiac is defined by the moment of the vernal equinox, the start of spring. This is usually sometime between March 20-22. This first sign is called Aries, because once upon a time, it was noted that the sun appeared to be in Aries from our vantage point here on earth at that time of the year. The visual change over thousands of years is the “precession” that the linked article refers to. While the background starscape has shifted since the zodiac “time segments” were named, some fundamental scientific facts haven’t changed.
The vernal equinox is the point of the earth’s orbit around the sun where the earth’s axis is exactly halfway from being inclined away from the sun. When the incline of the axis points directly away from the sun, it’s the winter solstice, and the coldest part of the year for the northern hemisphere. Since the earth’s orbit is circular, there are 360 degrees in the orbit. Divided by 12, these roughly align to the 365 days in a year (not quite, which is why the actual start date for zodiac signs shift from year to year), starting at the vernal equinox which is STILL called Aries in Western astrology.
As a result, based on the system that newspaper astrologers here in the West use, you’ll STILL be Aries if your birthdate falls in the March 20-April 20 range, give or take a couple of days. If you believe that the stars are more important than the much closer planets as astrological influences (or you just like your “new” sign better), you can go look up Vedic/sidereal astrology, which uses the apparent position of the sun against the starscape instead of the earth’s orbit around the sun to define the signs. Otherwise, you are still a Virgo or Cancer or whatever, and there is no such thing as Ophiuchus.
Just a quick note to mention that I finally posted my second novel (finished right at the end of 2005!) on this website under my writing section. FourWar is a bit (okay, a lot!) less fantastic than Alice, trading off the dreamlike qualities for something best described as a sort of sociological cyberpunk scifi blend, but I’ll let my readers tell me exactly what it is.;)
Additionally, I’ve posted a reformatted version of Alice, which should be somewhat more readable than the first version (single-spaced now, Verdana instead of Courier, etc.).
Enjoy!
I’ve decided to go ahead and make all of my completed (and one mostly-complete) tracks available here under a CC-BY-SA License. There are 13 tracks so far, all trance-influenced electronica, some with female vocals by Naomi. Any and all feedback is appreciated, but mostly — enjoy!
On a related note, I’m making decent headway on a new track which I’ll hopefully release before the end of the year if I manage to get enough breathing room around my upcoming web-based game project which is now running a private alpha. I’ll convert that project to public alpha shortly, so keep an eye out for a post announcing this!
I’ve had occasion to play around with FreeSwitch lately and was looking at implementing a directory of extensions on the main menu, and so I set up Brian Snipes’ example Lua directory from the FreeSwitch wiki. I didn’t like the fact that the extension list was hardcoded, so I replaced the names{} table with the following bit of code. It’s ugly, but it’s my first 2-3 hours of messing with Lua. Anyway, it basically makes a system call to “grep” to pull the extensions out of your FS directory XML files using the effective_caller_id_* values which you may or may not have in each listing in the directory. Maybe this will help someone avoid having to reinvent the wheel completely.
Note: this presumes that each entry in the directory lives in its own users_[firstinitial][lastname].xml file. For example, I have users_nsimpson.xml containing the following two lines:
<variable name="effective_caller_id_name" value="Nate Simpson"/>
<variable name="effective_caller_id_number" value="1000"/>
You can hack the following code to match the particulars of your own installation. Also, I think string.gfind() has become string.gmatch() in Lua 5.1, so you may need to tweak that as well.
-- NS: build the names table from grep
directory_path = "/usr/local/freeswitch/conf/directory/default/"
namesearch = io.popen("grep effective_caller_id_ "..directory_path.."user_*.xml")
namelist = namesearch:read("*a")
namesearch:close()
names = {}
for thisuser, thisname in string.gfind(namelist, "user_(%a+)\.xml:%s+
names[reversename] = thisextension
end
SIMILE Timeline and XML String Datasources
I’ve recently been playing around with the SIMILE Timeline visualizer for XML data, which is pretty neat. I had one minor little gripe with it, which is that I wanted to be able to use data from an XML string in certain cases where I already was working in the context of an XSL stylesheet instead of hitting the server again just to present the same data in a different XML structure for the timeline. So I downloaded the code, told it NOT to use the bundled code in timeline-bundle.js by editing appropriately in timeline-api.js, and started experimenting with the sources.
What seems to have worked for me is the following modification [I added it just before the line starting: Timeline.DefaultEventSource.prototype.loadXML = function...] to sources.js (pardon the messy formatting here – you can correct the line breaks in the text editor of your choice
):
Timeline.DefaultEventSource.prototype.loadXMLText = function(sometext) {
return Try.these(
// For Firefox, etc.
function() { return new DOMParser().parseFromString(sometext, ‘text/xml’); },
// For IE
function() { var xmldom = new ActiveXObject(‘Microsoft.XMLDOM’); xmldom.loadXML(sometext); return xmldom; },
// As a last resort, try loading the document from a data: URL. This is supposed to work in Safari. Thanks to Manos Batsis and his Sarissa library (sarissa.sourceforge.net) for this technique. (NS: – got this from timeline-helper.js in the GWT Timeline build)
function() { var url = “data:text/xml;charset=utf-8,” + encodeURIComponent(sometext); var request = new XMLHttpRequest(); request.open(“GET”, url, false); request.send(null); return request.responseXML; }
);
};
and in your calling script, replacing the line:
Timeline.loadXML(“example1.xml”, function(xml, url) { eventSource.loadXML(xml, url); });
with the following:
eventSource.loadXML(eventSource.loadXMLText(xmlstring,), “http://path.to.script/goes/here”);
Replace “xmlstring” with either a quoted string of XML or a string variable, and edit your path accordingly. Hope it works for you – it seems to be working fine for me!

