Category Archives : Topics

Braintree – No Acceptable Use or The Puritan Processor

Now I’ve mentioned Braintree Payments a few times as the measuring stick against which all CC processing APIs should be considered. It’s a company I’ve wanted to work with for so long, just because I hate all of the existing payment gateway APIs. Finally a client came along who needed a replacement for the insanely Nazi-esque Paypal. Paypal by the way is a company that I hate, with a passion. So I hop on over to Braintree Payments and what do I see, a Paypal Company. What the hell? That’s right, they sold out, but not just to any company, but the one company in the whole world that I hate with the fire of a thousand suns: Paypal. Oh well, I imagine they just got bought by Paypal, so I decide to shoot them an email to see if they can help me with my client, selling legal goods online (just the kind of legal goods that Paypal will freeze your account over.) I get a nice reply from a sales rep who directs me to their Acceptable Use Policy. Words fail me. Do they process any transactions at all?!? It’s like they decided to decline to process transactions for 90% of the fucking internet. No Porn. No Age Restricted Services. No telecommunications equipment? No drug paraphernalia? Like t-shirts? Pipes? Because those are legal, it’s just the drugs that aren’t. And in some places, Mary-J is legal. Essay Mills? I can only guess they mean those sites that sell college/university level essays? Umm, yeah… […]

Moving to Go-lang: The little language that can…can

A year or so ago I tinkered with Go, a language created and promoted by google. I liked it, but I just didn’t have any project to use it with, so it didn’t go anywhere. Now I’ve been seriously considering updating my website with a more custom solution. I love wordpress and all, but it can be a really pain in the ass sometimes. Then I had an idea, why don’t I do my website in Go. That will give me a project to learn Go with. So I’ve been reading the docs, looking at source code, and I gotta say. Some of the ideas of Go just seem right. Go looks like a scripting language (it’s not the prettiest), but it compiles. Not only that, but the developers of Go have made some decisions that remove common irritations. Like formatting code. Everyone has an opinion, but Go tosses that shit out the door and says: Not fucking here. I like that. The formatting of Go appears to be, to a large extent, a part of the language. It’s not so strictly enforced, but because Go can compile its own AST, the go fmt tool can reformat someone elses code to the established standard. This leads to one of the many great ideas with Go, go fix. When API changes are made, the go tool chain can help you update your code, looking for common patterns and rewriting them in place for you, or printing an error when the code is too complicated. To me […]

Sonnet 57

So, I’ve been going back and memorizing some of my favorite poems. I decided to refresh Sonnet 57 first. It’s nice and easy. Being your slave, what should I do but tend Upon the hours and times of your desire? I have no precious time at all to spend, Nor services to do, till you require. Nor dare I chide the world-without-end hourWhilst I, my sovereign, watch the clock for you,Nor think the bitterness of absence sour When you have bid your servant once adieu; Nor dare I question with my jealous thought Where you may be, or your affairs suppose, But, like a sad slave, stay and think of noughtSave, where you are how happy you make those.   So true a fool is love that in your will,   Though you do any thing, he thinks no ill.  This one is particularly easy to memorize. The repetition of Nor is helpful. The last bit is a bit complicated and can sometimes get confused because you have: Where you may be, and then you have Where you are. I suggest you use the method where you repeat the whole thing each time through, adding two sentences each time. Or one if you are having trouble with two. So a memorization practice would go like this: Being you slave, what should I do but tend Upon the hours and times of your desire? Being your slave, what should I do but tend Upon the hours and times of your desire? I have no precious time at all to spend Nor services to do, till you require And on […]


SDL 1.2 Game Development

I finally decided to sit down and learn game development. From my research there is only one way to do it, and that is SDL. If it’s good enough for Valve and Steam, it’s good enough for me. As it turns out, it’s surprisingly easy to get up and running with SDL. There are plenty of tutorials about the basic SDL game setup, so I won’t repeat the ubiquitous info and go straight to some basic problems of making a game that no one really seems to discuss. There are two main problems when designing a game: How do I save and restore game state? How do I make my game configurable? C is a great language for speed and algorithms, but it is really shitty when you want to handle data. Games are both algorithm and data intensive. So for half the game development, C rocks. But for the other half, it’s a slog. Saving and restoring game state means populating a structure in your C code with values from a human editable, dynamically loaded file. Things like the x,y or even z coordinates of the player in game space, their health, equipped weapon, inventory items and so on. One solution for solving this problem is to use some kind of config file format like INI, or XML. INI is a good choice for very simple games, and it’s dead simple to write an INI parser in C. The other common option is XML, which means something like libXML, which means I’d rather have […]

An intermediate introduction to chess

This article will assume that you understand the basic moves of each piece, that a pawn can move twice at the beginning, and only once afterward. That the pawn captures diagonal, or that the knight moves in an ‘L’ shape and so on. The most important shift in thinking about a piece is from how it moves, to how it attacks. In this sense, we think of a guard as any piece that is “attacking” one of it’s own pieces. Of course it’s not really attacking, but it is threatening an attack on any piece that attempts to take its compatriot. It is attacking an empty square in the sense that any piece that moves to that square will be attacked. Next to the Queen, the Knight attacks in the most directions, but it is shorter range than the Bishop. There are differing opinions about which piece is more valuable. The old belief is that the Bishop, which controls a diagonal is more valuable, however you can get stuck with a wrong squared bishop late in the game and his effectiveness becomes 0, whereas a Knight can attack the backrank of the opposing side within four moves. The Bishop is also powerful because novice players, including myself, have a tendency to think in obvious and straight lines of attack, therefore checkmates like this one are common. Here of course is another example using both the Bishop and the Knight. But notice that the Knight is the key piece that seals the deal. Personally I think […]

How the Knight Attacks

Print this out and fill in the squares. Permission granted to use for education.

Learning to play chess at

Latest Game(2015)   Well, due to reasons I can’t really fathom, a loss of heart maybe, I stopped playing chess for awhile, but am back at it. I am only winning about 51% of my games there, I sunk pretty low(down to 690) but have managed to climb back up to 717 in blitz. For standard chess, my rating is 1365, but I’ve only played one game, which I won. I have purchased two books on chess, Mikhail Tals biography, and Robert Fischer’s My 60 memorable games(the newest one with updated notation). I am also trying to use the analysis board more often, and going through some grandmaster games, specifically Fischer’s but also any games showing the KID, which is my chosen opening to practice. I have decent results(50-50) with KID. I am also working on some learning aids, and thought I would share them. Instead of a new post for each one, I’ll just add them here at the bottom as I come up with them. The first one is for learning the squares and the algebraic notation.

On Atheists and Objectivity

An atheist is very often a curious character for he removes all possibility of a subjective ideal, in that he worships only the objective and apparent, and an ideal is just too wishy washy for him to waste any time on. Is it any wonder then that clothes, cars, buildings, and art conceived by the atheist are so often very dull and pointless, as if they had no purpose at all except to be. The atheist must do something because he is afraid of doing and being nothing, which is the ultimate goal of his life, oblivion is what awaits us all he proudly proclaims. Much of what he is and produces merits it. It is a man overly concerned with his own sanity from fear of going insane. Of course what that sanity could be he cannot truly know, because he only knows and studies what is not sane, so everything that is not his current definition of insanity is precisely what he should do. That the atheist, or the honest one, cannot have an ideal is easy enough to prove. The atheist proclaims he only believes that for which there is objective evidence, since he cannot believe in an ideal because, objectively, it has no objective existence, cannot be measured in a lab, cannot be photographed by an electron microscope, then it cannot be ‘believed’ in. He may accept an ideal, or even follow one, but then he is hard pressed to escape his gross hypocrisy, for if you can create and follow […]

ANTLR4: So awesome it makes Java look good

I have been trying to write my own programming language off and on for about 5 years now. That doesn’t mean I have spent 5 years on a single project. Only that I have been toying with the idea and educating myself for that amount of time. Writing your own language is kind of the Holy Grail of computer science. Well, writing a language that is actually useful. Over the years, my experience in Ruby, PHP, C/C++, Python and even LISP, has informed my idea of what a good language would look like. Note I didn’t say perfect language. There is no such thing. I have come to believe that all languages are good in some way or another, and bad in other ways. Emotionally I like Ruby, and I like C. The elegant syntax of Ruby makes you happy to program, while the Do-Anything attitude of C makes it the ultimate language. I have been looking at Java( due to it’s cross platform nature ) and have to say at first I hated it. Now I hate it less. The number one reason I hate it less is ANTLR. I love the code generated by ANTLR because it looks like code that a human being would actually write. It’s very dense, but it’s alive. It’s hackish and clever. I have been following along the book The Definitive ANTLR4 Reference. This is a first time for me. Normally I, quite wrongly, just jump in and get it done. This time I am going to RTFM. […]

HTML5 Canvas: Smooth, variable width lines with transparency. 2

When making a drawing app with HTML5 canvas, you might come up against the problem of making a smooth, variable width line. Eventually you might find that you can make several calls to ctx.quadraticCurveTo(x,y,xc,yc) and get some kind of effect. If you stroke every 2 or 3 points, then as long as the line width is very small, you won’t notice the jaggedness. Unfortunately, if you try to do this with semi-transparent lines, the effect is truly horrible. To solve this problem, instead of drawing lines, I simply draw very thin shapes, and fill them with a color. This allows for 1) variable thickness and 2) nice transparency. Variable transparency is a problem I haven’t quite figured out yet. It may require composing the shape from individual pixels, which is simply too slow, especially in IE. What I am writing is a drawing App that works with the Wacom Web Plugin, and therefore varies line thickness based on pressure. I would like to vary opacity too, but this seems problematic right now. A solution that may be possible is to fill the shape with a complex gradient, if it is possible to create semi-transparent stops. Here is an image of what the program does so far:   Each line is actually a full shape, with varying degrees of opacity. Thickness and thinness is accomplished with pen pressure from the Wacom Intuous5 tablet. As the line is drawn, a temporary line is shown to the user, when they lift the pen, that line disappears, and a […]


HTML5 Canvas, Pixel Compositing, Transparency, and why all the trivia!

One thing I really hate about new technology are all the early adopters who incessantly post the same trivial examples. They cross link them too. So you can go from one page to the next, and see essentially the same example, just with the bits renamed or moved around. At a certain point, I got it into my head that I wanted to make a quickie HTML5 App that works with my Intuous5 Wacom Pad. Wacom has a web plugin that let’s you get data about pen pressure and so on from the tablet. So I started to work on it, and found the said trivial examples and started mashing something up. Pretty soon it became apparent that if I wanted my lines to look good, I might have to anti-alias them, or so I am trying, I don’t know if it will work, because I just spent the better part of 2 hours looking for a solution to a simple problem. If you look for examples of pixel level manipulation for HTML5 Canvas, you will find the same trivial examples over and over again, which basically say: var id = context.createImageData(1,1); var d =; d[0] = r; // where r is 0…255 … context.putImageData(id,x,y); If you actually want a full trivial example, use google, they abound. The problem with the above is: it replaces the entire pixel, all the way to the background, erasing any colors beneath it. The alpha channel of the pixel doesn’t make it transparent to what was under the […]