Latest Posts

MongoDB Tuning: disable-transparent-hugepages fix for Debian/Ubuntu

MongoDB Tuning: disable-transparent-hugepages fix for Debian/Ubuntu

Seeing: “WARNING: /sys/kernel/mm/transparent_hugepage/defrag is ‘always’.” ?

Run the following commands to quickly do what MongoDB describes at greater length.

  # Currently just debian
  sudo curl -sSL -o /etc/init.d/disable-transparent-hugepages
  sudo chmod 755 /etc/init.d/disable-transparent-hugepages
  sudo update-rc.d disable-transparent-hugepages defaults


When AI Fails & the Crashing Robotic Cars

Robotic Cars: More accidents (now With Less Injury & Damages!)

Google’s self-driving cars are apparently in 2x as many accidents as human drivers - If you think this is just buggy new tech, way too complex from the get-go - well, you’re partially right. An important detail I should share: as of Dec 2015 virtually all accidents were not the robots fault.

The accidents are caused by humans drivers unfamiliar with robotic drivers. Furthermore, Google has programmed the cars to obey the law in absolute terms - never speeding, difficulty merging in dense or fast freeway traffic. This opens up a bunch of legal, ethical questions -

  • Is it ever ok:
    • to avoid a rear-end collision if it means driving past the walkway at a red light assuming path is clear ?
    • to drive on the sidewalk to avoid a bicycle cutting across lanes? - is it ok for AI to accept this breach in ‘rules of the road’

I understand Google’s approach, especially when trying to minimize liability: always follow the rules - logically it follows that you cannot really be at fault if you always observe the law.

There would be massive liability if an accident happened because of intentionally designed ‘flexibility’ around the laws.

Don’t let the future escape us

The future will still arrive, even if the robots drive like octagenarians.

Perhaps a simple fix for now would be to use bright red flashing LEDs (think school buses) to warn human drivers they are about to rear-end an innocent robot.

I would be more comfortable with a car which had tiers of observance and rule adherance. To my mind this would be much closer to how humans drive.

Imagine 3-tiers of system-perception as follows: (decision & other layers omitted for simplicity)

  1. base: follows laws with annoying precision
  2. local: flexibile adjustments based on current traffic - to allow merge on the highway if say, 10MPH+ is needed. Conversely if the traffic is simply going too fast, the car should be smart enough to pull over to avoid being a nuissance to other drivers.
  3. 360: calculate ANY potential extreme collision risk/avoidance measures - driving on a shoulder or

This would likely require a smart balancing act - say tier 1 detects an immenent accident which cannot be avoided following the laws, it would then shift all processor power into tier 3 - hopefully finding a creative way to avoid harm.

Robotic cars are on the cusp of being technically smarter & faster than any human driver. Accept it. Welcome it.


Higher Order Programming

Array- and Set-based Coding Techniques

An Anti-Pattern?

This is an exploration of advantages gained when you code everything as an array. (Using Jedi concepts from SmallTalk)

Here’s some guiding principles:

  1. All input is array-like. Even if an array of 1.
  2. Higher level functions should generally accept AND return arrays. (Except for callback methods for loops: map/reduce/each/filter)
  3. 99 out of 100 devs code suffers from what I call acute schema surplusage syndrome.
  4. Beware bloated class-backed models - with all the predictable trappings: fragile instance state w/ so many levers and knobs to mess with, DB transactions, sql locks, async/mutexing (that always works first time), using idiomatic property getter/setters, and your public/private/final/etc usage is solid, right?

  5. So let me take a common problem and shoehorn ~add~ some set-based musings.
  6. A hypothetical Blog Site has lots of Articles, and has even more Posts (Comments).
  7. Let’s add a delete method (below) - but with support for both singular OR arrays.

public class Post {
  public String   title;
  public Date     created;
  public String   message;

  public Post(String title, String message) {
    this.title    = title;
    this.message  = message;
    this.created  = new Date();

  public Date isArchived() {
    return this.created < new Date(2015, 0, 1);

  // Post.delete` can be called w/ a singular Post or an array of Post[]
  public static int delete(Post post) {
    Post<List> posts = new Post<List>(post);
    return delete(posts)

  public static int delete(Post<List> posts) {

Forgive me if my Java is a little rusty.

Beautiful Models (and Data)

See updated article Naming things real good

AngularJS v2.0 and the Impending Schism

I think we are witnessing the Python 2->3 ‘Conversion’ all over again. AngularJS v2.0 introduces too many changes. Not least of which is TypeScript, which is a big ask amidst the finalization of JS’s latest version: ES6.

Let me say clearly: I love TypeScript. I seccretly wish the TC-39 meetings had produced it… They didn’t. However, They came up with another (totally different), also-awesome spec…

While TypeScript compiles to JavaScript, it doesn’t mean you blindly copy & paste ‘compiled’ TypeScript. It effectively becomes required learning, as to understand annotated AngularJS 2.0 TypeScript.

Now, newbies must climb ‘Mount TypeScript’ before they can even start assembling an Angular app (with some level of understanding).

I have a feeling how this might go…

endless loop

Oh well, I’ll add it to the Newbie training list: somewhere between Basic Shell Usage and Gulp or Grunt? Godsend+Misery!

Anyway, I hope this works out…

everything is going to be ok

Tag Cloud