Recent blog posts
John Kawakami's blog
If you go to the home page you can add a site-limited google search to your search bar. Google isn't too nice about it, but it'll work.
2010 is upon us, and unlike the Arthur C. Clarke sequel to 2001, wherein the world is exploring space, in the real 2010, the world is trying to find a goddamn job and avoid a huge, double-dip recession and rapid price deflation.
I've been putting ads on here for years, and they have basically failed. On other sites, it's actually OK, making a little trickle of money, which is so weird. Lately, I've been looking at the ads on this site, and sometimes I click them. It's not click fraud because I'm actually interested. So they are working. Then I put up this hideous ad with a big stack of text ads, and I wanted to click more than one of them.
These ads work on me now.
So, I have this library, and it's always a pain to release it onto my internal computers (or any computers). Unlike the web apps it's not running from a virtualenv. It's right on the system. Maybe it shouldn't be :/
Anyway, that was my motivation for learning Python packaging. It's not hard, but you have to follow every step in the tutorials, and really repeat them a few times. After a couple tries, I had my "eggs" working locally. I also found out that I'm supposed to use pip to make "wheels" instead. I was behind the times.
What a confusing topic. Unfortunately, if you start wanting to add "library" features to your code, like I did, you have to study Promises.
These are notes about Parse.Promises, and the end product is a small object that caches models.
The technique here is cool. You can find out how much your eyeballs pivot, and how far apart the lenses need to be.
I got 65mm and 70mm.
Here's a Jasmine spec to instantiate an HTML5 widget and test a few of the method calls. These method calls cause changes in the DOM, and these tests verify that the changes happened.
This is a trick to write modules that are testable in a browser, without subjecting the test to Browserify. Why?
I want to develop without the compilation step. It's easier and faster to work in the browser. (This particular app is mostly DOM manipulation, so headless isn't important.) Once the module has settled down, it can be added to the library.
The rest of this note assumes you know the Jasmine sample test runner included with the distro.
I wrote the original experiment a couple years ago. It's a JS client that retrieves some json data from the la.indymedia.org server, and displays it. I ran out of time, and didn't finish it then.
Upon revisiting the code, I found it a little confusing. It was around 800 lines of jQuery-style JS.
Learning d3 events this afternoon. These are the notes I'm taking while I'm learning it. I hope it helps.
It's called d3.dispatch. d3.dispatch('eventname1','eventname2') returns an object that manages setting event handlers, and dispatching events. The event system isn't global (unlike in most frameworks, where the event system appears to be globally available)- it's contained entirely within the object.
We all take it for granted that most sites will have a user registration system, and way to log in. We're used to it, and most people are unaware of how complex it is.
So, how complex is it?
It's around 15 different steps or screens.
I've done it a dozen times, and I think that's about right.
I took a step away from Angular and jQuery style coding conventions and dropped back to the traditional JS-style OOP, mainly because I wanted to get familiar with regular JS programming using the MDN docs, and learn the new HTML5 calls (which aren't new anymore).
I ended up coding using an MVC style, and consequently, added an event handling system. It was easy-but-cheesy so I eneded up using Backbone's event system. (It makes me look more hip.)
BTW, here's one way to use Backbone events within traditional JS code:
This is a short snippet of code to do the popular "parallax" effect for headings. This code has two boxes. The second box helps you see how to deal with a box that's not at the top of the page.
There's not much to it. You make some boxes and set the background-position based on the window.scrollY value.
So, I'm doing wordpress programming, and one of the headaches is that they store serialized objects in the database with the update_option() and related functions.
This makes querying some data difficult. Here's an example of the data structure I was dealing with (it stores sidebar settings).
Array ( [wp_inactive_widgets] => Array ( ) [sidebar-1] => Array (  => search-2  => recent-posts-2  => recent-comments-2
This took forever to fix. I upgraded the computer two versions of Ubuntu ago, and ever since then, the front mic stopped working.
It could be the mic's wire or the mic, but even a standalone mic wasn't working. It worked OK with Audacity, which uses Alsa.
It turned out the problem was that the Sound control panel in Gnome didn't work. Somehow, the system decided to change the input from Analog to Digital SPDIF. I don't use SPDIF.