Category Archives : Writings

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 […]

eBay Trading API – The worst in the world

  Every few months I end up having to update one of my customers applications due to eBays arbitrary changes. I have to spend an hour or two futzing with their shitty documentation on the world’s slowest developer website. When you’re there, you have to deal with verbose yet trivial example code ( at least they have input/output examples) to do things you can’t really imagine anyone ever wanting to do. The developer website hardly works. All help is behind a paywall (thanks assholes) but what is worse, I paid for help, and I can’t even submit a ticket to PAY THEM FOR HELP BECAUSE THE SITE IS BROKEN, AGAIN. Really, I can’t even pay these people to do their friggin’ jobs. Don’t get me wrong, my personal software issues with the eBay API are based on not being an expert in their API. It’s fair enough that there is probably, buried deep in the docs, some obscure setting or something that would help me out. But I can’t find it for the life of me, and they don’t want to make it easy, mainly because they want you to pay for assistance. Fine. I’ll pay. I have no problem paying. But their stupid website won’t even let me do that!!!! The eBay API is one of those APIs that you are simply forced to work with. eBay is big, and people still use it, and as long as that is the case, you have to deal with their bullshit. But I tell you, the […]


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 […]

Elite Dangerous? Mostly Loading, Mostly Crashing, Mostly Irritating, Mostly Lonely 2

  Elite: Dangerous is an ambitious game, and on the whole is very well done. Though I would say it has been and continues to be plagued with a number of unfortunate gameplay killing problems, I expect that most of them will be taken care of post-haste. Games generally have two major problems, both are the game designer/programmer/producers fault: Buggy Client/Server The first kind of problem is the buggy client or server, but this is a fault which we can’t really hold against them, because it’s not like there is some cadre of developers twisting their mustaches and laughing about how often the client or server goes down or disconnects. It’s irritating, but generally the pleasure gained playing the game while it’s working can offset this problem. There is also the issue of being an early adopter of a game, the sooner you get in, the more money/power/respect you’ll build up in the game so coping with the growing pains of the client and server as well as the game has its benefits. Shitty Gameplay The other problem a game can have is shitty gameplay, which is a rather broad category which spans from irritating mechanics all the way up to “you’ve got to be fucking kidding me.” While Elite:Dangerous seems to have minimized any serious fun killers, there are a few mechanics which just piss you off to no end. When you couple these issues with the fact that if rand(10) < 5, the server randomly disconnects, or crashes, especially while in SuperCruise, HyperDrive, […]


Deconstructing Harry Potter

Harry Potter is probably one of the most well known fictional characters in history. I don’t say that lightly, and perhaps it’s just an accident of the times, or perhaps it’s because he really is awesome. I struggle with saying this: I hate Harry Potter. I think he is quite simply the stupidest person in all of fiction. I love the Harry Potter books, I have read them many times. I love all of the characters. All of them except Harry. Harry is the perfect example of the non-hero. He never really does anything worthwhile of his own accord. He is constantly in situations where he wins by default, because he is the protagonist, and because he is destined to win, but never because of any innate talent. In fact, the only talent he has is the ability to ride a broom. That is: he’s a jock. All of Harry Potter’s popularity, success, and his very life comes from those things done by others for which he benefits. He benefits from his mother’s sacrifice, his father’s and Dumbledore’s ingenuity, Hermiones fastidious studying and so on. Harry Potter is the most active passive hero ever. Throughout the book series we learn about his father, who is a genius and a jock. I mean he figures out how to map Hogwarts, how to transfigure himself, and apparently makes enough money to keep Harry knee deep in chocolate frogs for at least 7 years of school. We learn about Snape, and via his potions textbook, how clever he […]

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 […]

Jay n’ Mike’s Rules of Acquisition

My programming partner and I have been working for quite some time on some large projects, and we have come up with a basic list of rules that apply to startup computer businesses, from software development to software sales. You have to pay – Nothing in life is free, someone is always paying for it, in time, energy, and or money.  Never-Ever do anything for free, because when it’s free, you’re the one paying for it. That doesn’t mean you have to charge money for things, there are many forms of currency, favors, endorsements, contributions, and forgiveness for mistakes and lateness are all ways of getting compensated for going the extra mile. No funny stuff- This is also what we call Jay n’ Mike’s Razor, similar to Occam’s Razor, where the simplest solution is usually the correct one, this rule states that the simplest and most direct route to a solution is the most maintainable, stable, and testable. Arcane, convoluted, esoteric systems are a hassle. This applies to development as well as business.This rule is akin to the KISS principle, keep it simple stupid, but is more precise in its application, that is, it is not so much about keeping it simple, somethings just can’t be made simpler than they are, it’s about keeping things explicit. While the No funny stuff rule may seem simple and obvious, there are some important conflicts, for instance, while some meta-programming is permitted, it almost always violates the No funny stuff rule. Some optimizations in code, like managing several […]

Qt C++: Threaded Communication with Artema Hybrid on Linux

Communicating with an Artema Hybrid CC Payment device is actually deceptively simple. I’ve written an application what uses a webkit widget exclusively for the UI display, and so I hook into the Javascript to provide some extra functionality to the app, in this case, reading and writing to/from the Artema Hybrid device. The documentation that I received was in German exclusively, so this took a bit of work to get going, but once you have it down it’s very easy. The device is connected via it’s POS connection Serial->RJ45 connection to a Serial->USB (FTDI chipset) converter that gets plugged into a usb port. You use the standard open, read, write and close functions. The Artema Hybrid constantly communicates with your system, so you’ll need to create a QThread to run in the background reading from the device once every second. The Artema Hybrid will send you an ENQ (0×05) and you need to respond with either an ACK (0×06) or an STX (0×02). With the way that I have it set up, the c++ code does the absolute minimum required which is it reads from the device and emits a dataRead() signal which is connected in Javascript. If I read ENQ, then I emit dataRead(“ENQ”). and in the Javascript function that is connected to the dataRead() signal, I see if the string passed up == ENQ. In the javascript, I have an array of data to write to the device, if that array is empty, I just write back to the Device ACK, otherwise, I […]