David Herron is a blogger, software engineer, electric vehicle enthusiast, and energy healer.

Silicon Valley housing costs are insane, verified by real data

Housing costs in Silicon Valley are insane. Both rental and purchased housing has always have been outrageous, compared to the rest of the country, but the last two years has seen an absolutely insane rise in property values and rental rates. I haven't looked for data on this, but obviously those at the lower end of the pay scale are being priced out of the market.

Fixing broken images when Drupal adds _0 to uploaded file names; filename and filepath differs

druplicon.large_.pngOccasionally on Drupal sites (perhaps only Drupal 6), uploading a file to a file field, or the file uploads area on a node, results in the "filepath" indicating a different name than the "filename". That is, in the data model for a Node, you can attach files in the "uploads" or in a CCK field (in Drupal 7 this is slightly different) and each attached file is an object (or array) containing attributes named "filename" and "filepath".

Easily offload your CPU-intensive Node.js code with simple Express-based REST server

nodejs-dark.pngNode.js is horrible with CPU bound processing, supposedly. Why? Because CPU-intensive algorithms block the event loop from handling events, blocking the Node.js platform from doing its core competency. Actually, as I demonstrate in my book Node Web Development (see sidebar for link), it's possible to use "setImmediate" to dispatch work through the Node.js event loop, and perform intensive computation while not blocking the event loop.

Unit testing Express route handlers in isolation from everything, including Express

nodejs-dark.pngWhen we write unit tests it's good practice to "mock" out extraneous bits to the code being tested. It's almost like the scientific method in that testing, in the unit testing paradigm, means exercising each small portion of your code in isolation if only to eliminate unwanted variables. While there are other testing paradigms, unit testing has its value. A big question for Node.js web application programmers is - how do you mock out HTTP requests for unit testing?

Progress on jQuery-style templates for AkashaCMS (Mahabhuta)

Since last weekend I've been working on Mahabhuta, the new element-oriented template system using jQuery's API, in AkashaCMS. The goal was to verify that it's useful by attempting to implement some important things with it. I'm happy to say that Mahabhuta is living up to what I hoped. I've been able to reduce complexity in AkashaCMS and the path is clear to perhaps removing the Kernel template engine, because the functionality I sought with Kernel is now available via Mahabhuta.

Eliminating duplicates in Views 3 Drupal 6 when the "distinct" and "group by" features don't work

Yes, Drupal 6 is water under the stream except for those of us still maintaining Drupal 6 websites. On one of my sites I'm trying to bring the module status into 2014, because they'd last been updated in 2012 and Views hadn't even been upgraded to Views 3. It was pretty straightforward to generate a Drush Make file to generate updated code for the site. A couple of the Views didn't get properly upgraded to Views 3, and in most cases minor tweaks were all that was needed. But one View had a major flaw - it generated lots of duplicated content.

Major change in AkashaCMS - new model for rendering content, and jQuery as a template engine

I'm about to release an AkashaCMS v0.3.x update that represents a major rewrite of the rendering system, and the addition of support to use the jQuery API on the server side to manipulate rendered pages. Both of the changes are major, and take AkashaCMS to a new level of flexibility. First, Website authors will be able to use any combination of template engine on each page, giving better flexibility over page formatting.

Avoid tearing your hair out on variable values in deeply nested JavaScript/Node.js callback chains

JavaScript, and hence Node.js, supports a useful model for variable scoping and callback functions where the available variables build up as the code nests. It's very convenient because your code doesn't have to pass values through function parameters to code in an in-line callback function. But it's possible for a variable to not have the expected value by the time the callback function executes. When that's the case, it's tempting to start tearing your hair out in frustration screaming about the variable's value is incorrect.

Chrome will become a new application distribution platform for any operating system - over time

What if a browser-based application can act in a desktop computer the same way as any regular application? Typically, browser based applications stay within the browser, and are launched inside the browser, while regular applications are launched through the regular desktop menubar or file system browser. Typically these worlds don't meet, but what if they did?

Over on Google+ a senior Chrome developer has announced a test feature for Google Chrome which will do exactly that. When this feature is ready for general use by everyone, this will be HUGE.

Ra - not just the Sun God, but a mighty fine programmers editor for Chrome for editing local files

I like my Chromebook (an Acer C720) because it's lightweight, slim, the battery lasts forever, and the performance is great. It's a wonderful machine on which to browse the web, run Gmail, Google Docs, etc. But there are several things I do frequently that is keeping me using my Mac desktop computer. The potential for freedom using the Chromebook is beckoning, but these use cases keep me chained to the Mac.

Pages

Short URL

Subscribe to Front page feed