DKOs – Data Knowledge Objects

May 7th, 2013

(Or Derek’s Objects, depending on who you ask…)

DKOs are an ORM for people who hate ORMs.

ORMs are a pain. They promise a world of being free from your database where you just work with good ol’ Java. Your database server doesn’t matter. Your schema doesn’t matter. Tables and relationships can be abstracted away and changing them doesn’t have to affect your code. All you have are some object references and you can modify them willy-nilly and it’ll all just work.

Well that’s just nonsense. It may work for a 100 entry blog implementation, but you’re not going to process millions of new rows daily with it (or at least not without a world of pain getting there). Your database is a shared resource on a different machine, not an in-memory entity. And ignoring your schema is a great way to accidentally DOS your database with millions of “select * from x where id=35476753″ style queries.

Plus: SQL is not the devil! It’s one of computer science’s most successful languages! The devil is SQL built by string concatenation. And string identifiers. And a lack of typing. And a lack of streaming.

DKOs addresses all these issues:

  • It’s fully typed.
  • It’s streaming (by default).
  • It embraces SQL (rather than replaces it).
  • It doesn’t use string identifiers for tables/columns/etc.
  • It doesn’t hide from you the fact that it’s hitting a database (or what SQL it’s running).

Much more information here:

DIY Neato XV-11 Base / Charging Station

April 13th, 2013

This is such a simple hacked-together project I’m embarrassed to even post it. But I can’t find it documented anywhere else on the internet, so here it is…

I bought a Neato XV-11 recently. It’s great. LIDAR + SLAM >> Roomba’s bump and grind. But it only comes with one charging station, and you can’t buy a spare without buying a second robot. WTF? Neato, you made a great robot, but it can’t clean either floor of my very-normal-sized house without recharging at least once. Without a charging station on the same floor, this thing is useless.

Anyway, let’s pop off that suspicious window at the LIDAR’s eye level…

Well that makes a lot of sense and looks pretty simple to replicate. Let’s check around for some reflective tape… Thanks Amazon! And while we’re at it, toss in a power supply.

Comparing to the original: visually this looks identical.

I grabbed a scrap of wood from the garage and free-formed the same pattern w/ reflective + electrical tape.

Woot! Neato tried to dock with it! (and was disappointed at the lack of electrical contacts)

Hey look, here’s a soda can, a few brad nails and random wire I dug up…

Positive terminal is on the top. Make sure you sand off the BPA coating. (Good $DEITY I can’t believe I’m admitting to this – but hey, a toddler really cuts down on your build times and I’m looking for functional not pretty here :) )

Neato is almost done. Moment of truth…

Success! 100% dock rate! (1/1) :)


Terrible Software

June 1st, 2012

I can feel age creeping up on me. I’m becoming an old curmudgeon. I’m much less tolerant of bad software than I used to me. (not that I was ever actually tolerant… :) )

Ok, to be fair, Eclipse isn’t terrible. It does a lot of things well. But for f#@ks sake it does a lot of I/O. Repeatedly. In the main GUI thread. When you REALLY wouldn’t expect it to. That freezes the whole UI for seconds at a time.

Granted, we have a lot of our dependent jars NFS mounted at work. (Actually, I have an SSHFS mount to a server that has an NFS mount) So my “disk” I/O (from Eclipse’s point of view) is a lot slower than most. But why is it constantly re-scanning the directory when I’m just typing in the editor? Why does copying a string from a test editor INTO AN ALREADY EXISTING STRING IN THE EDITOR randomly lock up my entire GUI?

If I’ve said it once I’ve said it a thousand times: I/O does not belong in the GUI thread of any application. EVER. Eclipse is more than a decade old. THIS SHOULD BE FIXED BY NOW.


ACER AO522 Linux Compatibility (and memory upgrade procedure)

February 24th, 2011

Some notes on the ACER AO522 netbook (the first AMD C-50 laptop out AFAIK)…

Upgrading the memory: There are posts elsewhere on the internet saying to take a screwdriver to the top-right corner of the laptop and pry off the keyboard. DO NOT DO THIS. The keyboard is fit very tightly and i do not see a way to do it without marring up your laptop. You do have to remove the keyboard to get to the memory though. Here’s how:

  1. remove the battery
  2. open the notbook; turn it over
  3. look into the battery cavity; towards the right there in a square hole in the plastic with metal flush behind it – this is the bottom of your keyboard
  4. push on the metal with something dull (I used the butt end of a pen) until the kayboard releases; note: don’t use the jewelers screwdriver you have in your hand! the metal is thin (almost a foil) – I broke it my first attempt (keyboard still works luckily)
  5. flip laptop over; finish prying out keyboard
  6. remove the 4 screws under the keyboard w/ a (1) next to them
  7. push in the (2) hole w/ something blunt to pop off the bottom panel
  8. install memory
  9. reassemble (johnny 5?)

As for linux compatibility (using Ubuntu 10.10 AMD64):

  • installer uses the wrong screen resolution, but otherwise completes fine
  • broadcom wireless worked fine after restricted driver install; note: I had to push the Fn-{wireless} key to turn it on on first boot (although it stays on through power cycles)
  • ATI graphics worked fine after restricted driver install; although there is an “unsupported hardware” overlay in the lower-right corner (probably will go away when Ubuntu updates catalyst driver); OpenGL works well (tested w/ WebGL in Google Chrome
  • sound works fine
  • ethernet works fine
  • webcam works fine
  • suspend does NOT work (graphics driver?) (UPDATE: works; see below)

Overall I like it – assuming the suspend issue gets resolved shortly. The high-resolution screen is a very welcome improvement over every other netbook out there. (darn you Intel w/ your arbitrary hardware restrictions!) CPU-wise it is moderately faster than my Lenovo S10 (Intel Atom) at “open all in tabs” (17) from Google Chrome. GPU-wise it blows it out of the water (as expected). Battery did last in the range of 6h last night and this morning w/ heavy usage. (installing packages and updates mostly)

Will update as I discover more.

UPDATE: Hibernate works!

UPDATE 2: I installed the ATI Catalyst driver v11.2 and the watermark is gone. And suspend/resume works. Everything works now as far as I can tell. A very nice little laptop. :)

Comcast and Bittorrent

April 10th, 2010

Dear Diane Rehm,

I was just listening to Thursday’s show regarding Comcast and Bittorrent.  Unfortunately I was listening to the pod-cast after the fact, as I would have really liked to have called in.  I believe the discussion missed a very crucial element of the issue:

Comcast was not simply throttling Bittorrent traffic.  They were forging fake data packets that appeared to come from machines on the Internet they did not originate from.

Consider a conversation via typed letters between myself and a friend, delivered by the USPS.  Now say the USPS is uncomfortable with the volume of letters my friend and I are exchanging, and decides to slow down delivery of some or all of these letters.  This would be throttling, and could prompt a reasonable “letter neutrality” debate.  Now instead the USPS decided to insert their own fake letters into the system, with my return address sent to my friend that said simply “stop sending me letters”.  (and vise-versa)  This would indeed be an efficient tactic to disrupt the conversation and reduce letter volume, but it would be quite clearly illegal.  (mail fraud)  This was the behavior of Comcast the FCC (and many others, myself included) so strongly objected to.

This was further compounded by Comcast’s initial and long-running denial of this behavior.  Which to me suggests they clearly knew the immorality (and likely illegality) of sending forged data packets.

This behavior by the way was confirmed by Google, the EFF, and I believe the FCC’s own study.

Multiple sources exist for this information.  Wikipedia contains a good writeup and many references:

Thank you,
Derek Anderson

Calculating PI

March 14th, 2010

In honor of PI day, I thought I would recall a story of my wayward youth.  =P

In middle school (at JDMS), I was becoming decently proficient at everything BASIC.  (Apple II, TRS-80 and DOS 3.3)  One of my math teachers mentioned to me that you could approximate PI by filling one quarter of a circle with an ever increasing number of rectangles of smaller and smaller widths.  And so I wrote a program to do just that.  Spent weeks running and rerunning it with different numbers of slices (and different methods of calculating the heights) and comparing the outputs to official known good values.  (and charting my accuracy)

I don’t remember exactly how accurate I finally got before they told me to stop running multi-day processes on the lab computers…  But suffice it to say: I was VERY nerdy.  =P

Ad Revenue for A Small Free WebOS App

March 10th, 2010

When I first considered submitting an app (Where’s My Car?) for the Palm Pre / Palm Pixi, I was somewhat turned off by the $50 app submission fee  (even for free apps).  This is a hobby for me, and I don’t really like the idea of paying money to give my work away for free.

So I looked into putting an ad on my app to potentially recoup the submission fee, but I was unable to find any meaningful data regarding how long it would take, which left me on the fence as to whether or not it was worth the hassle.  Of course, this lack of public data is not that unexpected, as most companies doing this for profit would consider this a trade secret, but it was still disappointing.  So I justified to myself paying it as the cost of an experiment with a civil benefit:  Hopefully by publishing these numbers I can help either encourage or discourage future hobby developers as to whether or not it’s worth it to them to submit their own hobby apps.

Anyway, here are the numbers from ~24 hours after release: (AdMob is the advertiser)

  • Downloads: 7687
  • Ad Requests: 11,491
  • Ad Impressions: 11,456
  • Fill Rate: 99.70%
  • Click Through Rate (CTR): 3.26%
  • Estimated Revenue Per Thousand Impressions (eCPM): $1.11
  • Total Revenue: $12.68

I will post updates to this entry as I pass other timeline milestones.  (one week and one month, at least)  I’m very curious as to if this will be a sustained daily trend, will grow, or if this is a one-day newness peak that will drop off a cliff tomorrow.  :)

BTW, I strongly encourage other hobby developers to publish their numbers as well.  (or even share with me privately or anonymously)  I would love to compare against a larger data set.

Daily total download counts: (recorded here because I don’t yet know how detailed Palm’s monthly reports are) 3/10/2010:7687, 3/11/2010:10242, 3/12/2010:11196, 3/13/2010:12057, 3/14/2010:13013, 3/15/2010:14019, 3/16/2010:14783, 3/17/2010:15422, 3/18/2010:15961, 3/19/2010:16786, 3/20/2010:18310, 3/21/2010:19843, 3/22/2010:20988, 3/23/2010:21729, 3/24/2010:22323, 3/25/2010:22848, 3/26/2010:23390, 3/27/2010:23783, 3/28/2010:24264, 3/29/2o1o:24776, 3/30/2010:25179, 3/31/2010:26339, 4/1/2010:26902, 4/2/2010:27249, 4/4/2010:27890, 4/6/2010:28501, 4/7/2010:28896, 4/8/2010:29300, 4/9/2010:31018, 4/11/2010:32683, 4/12/2010:33536, 4/13/2010:34230, 4/17/2010:36201, 4/26/2010:40149

Downloads for Public Radio: 3/27/2010:2904, 3/28/2010:6109, 3/29/2010:8514, 3/30/2010:10250, 3/31/2010:10641, 4/1/2010:11017, 4/2/2010:11321, 4/4/2010:11871, 4/6/2010:12309, 4/7/2010:12602, 4/8/2010:12872, 4/9/2010:14108, 4/11/2010:15511, 4/12/2010:16154, 4/13/2010:16655, 4/17/2010:18245, 4/26/2010:21467

UPDATE: Version 1.3.0 is live as of 3/19/2010.


Well, it’ll probably eventually make enough to cover the submission fee, but not likely to be a real revenue generator.  :P

Where’s My Car? for Palm Pre/Pixi

March 4th, 2010

I’ve submitted my first WebOS application to their App Store!

Where’s My Car? helps you find your car in a crowded parking lot. When you leave your car, simply open the application. (It will automatically get your current GPS location) Leave the application open, and when you’re done doing whatever it is you have to do, click “Take Me To It!” An arrow will show up (as well as a distance measurement). Simply walk in the direction of the arrow, and you’ll be quickly guided back to your car! BTW, I originally wrote this app as a present for my wife. :) I’ve decided to place it on the App Store as a FREE app because I don’t see why the other apps that do the same thing charge $5 for such a simple feature. Let me know if you like it! :)

UPDATE: It has been approved/published!  To download, open the App Catalog.  Search for “car”.  Click the coins icon in the lower-right to show only FREE apps, and “Where’s My Car?” should be the first in the list!  :)

UPDATE 2: Click here to download:  Where’s My Car?

Screenshots after the break…

Read the rest of this entry »

Dependency Injection: Coke with Lime

January 29th, 2010

I have in the past expressed skepticism regarding the utility of Spring’s XML-based dependency injection configuration files. A bit ago, in one of these conversations, I was pointed to Martin Fowler’s article on dependency injection. I found it hilarious.

Read the rest of this entry »


December 21st, 2009

Java is somewhat brain-dead at times. For instance:


Doesn’t do what you’d expect. (hide console input) It appears that is being silently buffered.

So a little googling:

Sun’s recommendation is a busy-wait loop in a separate thread that constantly rewrites the previous character?!? I mean, seriously, WTF?!?

Edit: It looks like Sun implemented a new API for non-echoing prompts in v1.6:

But this is still crappy. Introducing a new API to partially work around the broken functionality of an old API is how you get bloated monstrosities to begin with.

<>   © Copyright 2000-2005 by Derek Anderson
Get Firefox