Well, everything is, really, but when I was looking for a character generator to create characters for a Shadowrun game, I kept wondering why I couldn't find one that was web-based. When I looked at the desktop applications I did find, I was surprised that none of them seemed to be using a database; Chummer, the most complete one (in terms of supported rules) I could find, uses XML files for its data, for instance. I didn't like Chummer's UI so much, and wondered why one wouldn't use a database which could automagically do the maths of character creation for you, and with all those gear and spell tables in SR, a relational database structure seemed to lend itself well to the problem - so I went ahead and started building one. I'm still working on it, and it's lacking quite a few features especially in BP and Karma cost computation, but it could already be used to generate NPCs and things like that. The implementation is in SQLite, since this application doesn't seem to need a client-server based DBS; besides, if someone is going to build a desktop front end for it, people wouldn't want to set up PostgreSQL on their home machines, and I hear embedded PostgreSQL is a pain, so SQLite it is.
In case you've never heard of Shadowrun, it's a tabletop role-playing game that is set several decades into the future, with both cyberpunk and fantasy themes. Just imagine someone had given the tech in Neuromancer a bit of a boost, and put wizards, dragons and trolls into the equation; characters usually are shadowrunners, professional criminals who do less-than-legal operations for megacorporations. The game itself is an interactive story, where N-1 people in the group control one character each, and the remaining person (called the gamemaster) controls everything else. Player characters are generated using a point buy system: every player gets a given amount of build points which they can spend to make their character stronger, smarter, give them additional skills, or even the ability to do magic.
By the way, yes, I'm aware I'm somewhat late to the party with a Fourth Edition character generator, with Fifth Edition coming out this summer. However, I don't think everyone is going to make the switch to Fifth Edition, a lot of people aren't going to make it right away, and judging from how many groups still play Third Edition, this is still going to be of some use. Besides, with the basic database layout already in place, writing sr5.sql shouldn't be too much of an issue either.
Last week I wrote about markov.sql, a markov chains implementation in SQLite3. As most of you are aware of, I really do like SQLite for most uses, but whenever I need something client-/servery I tend to go with PostgreSQL, no questions asked.
Unfortunately, PostgreSQL can be a bit difficult if you like some SQL features. In particular, their version of SQL triggers are quite... unusual. The feature set is complete, but all in all PostgreSQL isn't exactly forgiving and some common expressions end up somewhat more convoluted than necessary.
This is a quick update to put out the word about a new feature on the site: comments on articles.
A simple and straightforward implementtion of higher order markov chains in SQL(ite).
Some databases already ship with built-in functions to generate sequences - others don't. This'll come in handy in the latter case.
A summary of the weird things I came across writing the XHTML to ebook transcoders in use on this site.
Ever since I got my new 4th generation Kindle I wondered how hard it would be to write your own ebooks for it. As it turns out, this isn't all that hard to do in principle but there's a lot of funky details to deal with. I think I've now dealt with most of them, so now there's a number of links to a few automatically generated transcripts at the bottom of most pages on this site:
Gestern auf Twitter gab's da doch was längeres. Und hier gibt's daher mal eine Zusammenfassung. Oh, schon wieder in deutsch! Wo führt das hin!?
Why can't we have one marriage law for everyone, regardless of gender? Dear politicians: Please grow up.
How to keep computer scientists happy? Well, gadgets go a rather long way. I did say I'd take pictures, so here we go :D. Thanks again to Jamie and Jack!
Warum die aktuelle Situation absolut untragbar ist für Leute die wirklich Ahnung von der Technik dahinter haben. Oh, hatte ich nicht erwähnt, dass ich des Deutschen mächtig bin?
My previous article on SSD write endurance seems to have caused quite a stir. I've received lots of constructive feedback via email (and slashdot), so I'd like to take the time to follow up with some corrections for more common devices. I will, however, keep the original article unmodified because it's been linked to quite a lot according to my logs. It did also completely reach its goal: judging from some of the sources I've seen and the feedback I got, people started talking and thinking about the problems instead of a lot of general handwaving. And those that didn't seem to have calmed a bit.
In particular, before I begin, I would like to refer to Allyn's rebuttal over at PC Perspective. That article nicely sums up most of the suggestions I received.
A primer for students who struggle with writing mathematical proofs
This March was nothing short of depressing - Kraut politards fucked up good, so here's a summary of the fun we have to endure over here. Hope the lot of ye can get a couple smirks outta this.
Yeah I was eerily reminded of my This-Is-Why-We-Can't-Have-Nice-Things series from last year, too. This kind of sums it up pretty well.
π-Day Special: an even more esoteric version of yesterday's Game of Life.
Similar to the earlier XSLT mandelbrot, this is a stylesheet implementing Conway's Game of Life in XSLT. It's also extremely slow.
Ever wonder how long your shiny new SLC SSD will last? It's funny how bad people are at estimating just how long "100,000 writes" are going to take when spread over a device that spans several thousand of those blocks over several gigabytes of memory. Not to mention even newer drives that can take even more of a beating before going down. So yeah, let's crunch some numbers for that:
Sometimes you need to serve RSS feeds even though you'd much rather use Atom. Fortunately it turns out to be trivial to convert Atom to RSS with XSLT.
Turns out that you might need to get a bit creative to get VMware Server to play nice with IPv6 networks.
Despite being discontinued, VMware Server 2.x is still quite a nice piece of software - if you massage it just right.
For a long time Intel's GMA 3600s seemed to be that one huge exception to Intel's otherwise awesome track record regarding Linux graphics drivers. Somewhat recently Intel did, however, release closed-source drivers. Even more recently these drivers were even adopted as binary blobs into Ubuntu's multiverse repository.
So why am I even writing this? Because the whole mess is still hideously underdocumented! Unlike other Ubuntu packages, the ones for this driver come with no documentation in the usual places (i.e. neither READMEs in /usr/share/doc nor manpages) and they certainly don't 'just work' either.
The dread. The horror. Still worked out fine though, no idea how or why...
XML directory indices may or may not be coming to nginx Soon(tm), so here's an alternative we can use right now.
NAT is evil. But while IPv6 is still being held back, you can't always avoid it entirely. Strange how this scenario isn't mentioned more frequently...
A rather odd idea: serving the contents of an Atom/XHTML bundle directly through a web server - i.e. nginx - without extracting the individual 'files'.
The Worst bash/sed/SQL/XSLT Combobulation You'll Ever See(tm): this article presents a nifty script to export a Drupal 5/6 MySQL database to a static Atom bundle.
A little something I've been working on: integrating tweets on your website without using any JavaScript or having your users load data off remote servers.
Since I already went to the trouble of explaining all about normal vectors in higher dimensions, it seems like a good idea to follow up with some of the maths that actually uses those normals. One of the more prominent examples of this is rendering pretty pictures of 4-cubes and similar constructs. But before we have a closer look at how to do these projections, there is one other prerequisite that is typically not explained all that well.
Remember that in geometry we have many different coordinate systems to represent points in a given space. For example, in 2D we commonly deal with cartesian coordinates, that is two numbers that represent the horizontal and vertical offsets from a point of origin. These two coordinates are typically called X and Y - or x0 and x1 when working with vectors. In 3D, we extend these coordinates with a third coordinate - Z or x2 - representing depth. Beyond that we can keep adding xns for each new dimension we introduce.
This works great when dealing with rectangular things - squares, cubes, tesseracts, etc. It doesn't work quite that well with round things, however. When we're primarily interested in circles, then in 2D we can use polar coordinates instead. Polar coordinates represent points on a plane as the distance from a pole and a polar angle. Again we have two coordinates, typically called r and theta. We can easily extend these coordinates to 3D and up as spherical coordinates, that is adding another angle for each new dimension. Geographic coordinates in latitude and longitude would be an actual example of spherical coordinates in 3D (the radial component is implicit in this case).
One of the things I always found lacking when learning about higher dimensional geometry was how there aren't any really simple programmes that just let you view something like an n-cube and play with the camera. Sure, there's a good deal of videos to be found on Youtube, and you could just whip out your old, trusty copy of Mathematica or MATLAB. But that is a bit over the top if all you want to do is just have a quick look.
To alleviate this issue, I've written this rather simple Mac application. It allows you to view n-cubes, n-simplices, n-spheres from 3D to 7D, as well as plain ol' boring 3D moebius strips and klein bagels. I originally intended to put this programme on the Mac App Store and add for it to have quite a few more features. But alas, I really don't have the time to work on it right now. Version 1 is thus still somewhat unfinished.
Even more things designers use to make a web site look awful...
One of the single largest bits of bandwidth abuse these days. And it keeps finding ways of getting worse, too.
Moving on from Volume I, we continue by examining a lot of the misguided attempts at layouting commonly found on the web.
Working in IT leaves you with no shortage of things to complain about. And sometimes, that's about the only thing you can do. So let's have a look at some of the rubbish on the web.
An XSLT stylesheet that formats UNIX time stamps as Maya dates. The article also tries to explain the different calendars used by the Maya.
I've literally spent hours searching for a concise explanation of an algorithm to compute a cross product in an arbitrary number of dimensions. Several times. Many of the basic formulas in geometry require a cross product, and often these formulas would apply in arbitrary dimensions, if we could only find such a cross product. The truth is, there is no such thing as a cross product in vector spaces other than the 3 and 7 dimensional spaces. However, what the authors of those formulas typically neglect to mention is that they do not actually call for a cross product as such - they really only need a way to calculate normals, i.e. vectors that are perpendicular to a set of other vectors.
Such a normal vector in n dimensions can be thought of as one of the vectors perpendicular to the analogue of a "plane" through the origin point in that number of dimensions. For example, in the typical three-dimensional space we can construct a normal to two vectors by first constructing a regular plane through the origin and those two vectors. The normal is then one of the two vectors perpendicular to this plane. For most applications we don't really care which of the two vectors we use, as long as we choose between the two consistently.
Renders an interactive projection of a 4-cube in a browser window. Hail to the mathematicians, baby.
This article demonstrates some creative uses for the CSS3 :checked selector: showing additional elements in a form and creating rather pure tabs without any scripting.
Example code that demonstrates how to write functions in XSLT by recursively calling templates. Generates an image of the Mandelbrot set.
An online programme that displays 'fortune cookies,' random epigrams, as found on pretty much all modern Unices.
TLDR; there once was a long preface here that would explain how tech sucks and that this article is about using nginx and XSLT to cut out crap from your favourite websites. You only need to know the latter. Moving on...
Important note: We're not using nginx as a reverse proxy, we're using it as a "regular" HTTP proxy. "Regular" as in the kind you set in your browser's network options. This is called a "forward proxy". If you google for how to use nginx as a proxy, virtually all hits will tell you how to use it as a reverse proxy. This is different. Now that we've cleared that up, let's get started!