Category Archives : Computer Science

Braintree – No Acceptable Use or The Puritan Processor   Recently updated !

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

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


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

A Letter to the Creators of EVE

A Response to CCP Hellmar’s Letter. The estrangement from CCP that many of you have been feeling of late is my fault, and for that I am truly sorry. There are many contributing factors, but in the end it is I who must shoulder the responsibility for much of what has happened. I appreciate both the sentiment and the spin, as well as the effort you are putting forward, to be honest I doubt many other game companies would bother to write the letter you’re writing but let’s be honest, the problems with EVE and with CCP are endemic, and asking us to swallow this guilt trip is not coming off as humble as you’d think. I mean saying that you are responsible for the the current state of EVE is like saying Lee Harvey Oswald really shot JFK, sure, that’s the official story, but no one really believes it. I was impatient when I should have been cautious, defiant when I should have been conciliatory and arrogant when I should have been humble. No, You were greedy. We aren’t children, well most of us aren’t. A few of us have lived long enough, and participated in business long enough to recognize zealous hubris from gluttonous greed. You got greedy and you fucked up. You started to look at us like we were just dollar signs, just consumers. …growing the company to 600 people, increasing our subscriber count beyond that of the population of Iceland and on and on, one resounding success after the next […]

Rails 3 – PHP Style Global Variables, $_SESSION, $_GET, $_POST in the models, and everywhere.

PHP Globals in Rails 3 So, as part of my slow descent into hell for even showing this stuff, I thought I would make a quick and dirty post about getting PHP like globals into your models in Rails. I wrote a longer article about globals in the model in rails which you can check out for some other options. def some_before_filter $_SESSION = session $_GET = request.GET $_POST = request.POST $GLOBALS = {} end Yeah, that simple. When it comes to globals, the ruby and rails community is kind of like the child of a former Nazi sympathizer who got off the hook at Nuremburg. Yeah, they’re related, but they just don’t want to have anything to do with them, and if you remind them of the connection they get really angry.

Never Again! Backing up your rails .sqlite3 dbs

Well, with mysql, it’s pretty hard to overwrite your dbs, but with sqlite, it’s real easy. I did this, luckily I only lost about a days worth of work, but nevertheless, I have instituted a new rule for sqlite3 dbs: Hourly backups. Here’s the script: #!/bin/sh D=`date +%H` cp -f /var/www/app/db/production.sqlite3 /var/www/fapp/db/production.sqlite3.bak.$D