DAVE LANE


Mobile Web Apps Will Become First Class Citizens

October 3rd, 2013

Google Chrome Mobile: Install to Homescreen

Google merged their Chrome and Android divisions into a singly managed unit, appears to be moving from Android set-top boxes (Google TV) with Chromecast (Google Cast) which supports Chrome/JS apps, and now gives web developers the ability to present their web apps as full-fledged Android applications through this update to Chrome.

I would not be surprised to see the Chrome Store merge with Google Play in the near future.

501 Developers

April 17th, 2012

I just came across the 501 Manifesto on HN. I choose to work after 5:01 each day, but get to “clock out” at 40:01 guilt-free and feeling accomplished. I don’t know how much I like the final statement (“To us it is just a job, but we still do it well.”), but I like the general sentiment: “I will do my job to the best of my ability. I will also live my life to the best of my ability.”

There are so many things we do right that I tend to take for granted.

A recent interviewee I led around our office expressed awe at our beautiful space: the chairs, equipment, stone wall, nice floor, and bright sun shining in through giant windows into a quiet room. He exclaimed “you guys really made a great place to work!” It sort of caught me by surprise. I glanced around with fresh eyes and thought “yeah, I guess we did.”

Technology Breadth and Depth

March 22nd, 2012

Today a co-worker poked fun at me for not knowing how to write iOS apps.  This was purely in jest (I think), but made me think a bit about what I know and how developers’ experiences — even within a small mobile development shop — can vary greatly.

Here is a list of technologies I’ve used in a professional capacity in the past four years.  This only includes technologies which I can use effectively with an hour or less of ramp-up time:

  • Android (essentially J2SE 1.5)
  • Atlassian Confluence and JIRA (plugins and core code additions)
  • Bash scripting (typically awk, grep, and sed)
  • BlackBerry (J2ME, essentially J2SE 1.3)
  • Java web services (CXF, Jersey, Hibernate, and Spring)
  • JavaScript libraries (Sencha/ExtJS, jQuery, YUI)
  • Maven plugin development
  • Relational databases (HQL, MySQL, Oracle, and SQLite)
  • PHP (symfony)
  • Python
  • Ruby on Rails
  • Symbol PocketBrowser development

So…  No, I don’t know iOS.  This doesn’t mean I entirely lack knowledge of iOS:  I’ve researched ways to make iOS apps perform unconventional feats, have helped co-workers troubleshoot web API calls, and know enough about Apple App Store policies to ensure clients understand potential approval issues with their app ideas.  But I’m more proud of my ability to pick up new technologies as I need them.

These differences in skills mostly have to do with opportunity and desire.  I’ve managed servers running production systems that require a breadth of knowledge as opposed to pure mobile app development which demands more depth.  I also go home after work and read tech news, tinker with software I’ll never finish, and generally search for neat things to play with.  I’ll make a prototype over a weekend and then discard it because I’ve learned all of the interesting pieces.  Am I the best one to write an iPhone app?  Maybe not, but I may be the best one to find solutions to new problems.

I Hope You Know We’re in the Future

February 21st, 2012

My next phone is totally gonna be sunglasses.

I still occasionally giggle in amazement when my phone or tablet does something cool, like derive turn-by-turn directions from nothing more than a business name.  I can’t wait to see what cool new things the next ten years have in store.

Easier Parameterized Queries Using MySQL Improved

August 29th, 2009

Parameterized queries decrease the likelihood of SQL injection attacks and increase the speed with which you can subsequently execute the same query. A parameterized query is just like a normal SQL query, but you use placeholders for values instead of directly referencing them.

For example, a regular query might look like this:

SELECT * FROM user WHERE username='dave'

The same query can be represented using parameters, where a question mark indicates some variable value:

SELECT * FROM user WHERE username=?

PHP has included support for parameterized MySQL queries for a while, but using them quickly becomes cumbersome. Handling a result set which contains an unknown number of fields per record is extremely frustrating. Setting up, executing, and retrieving a result set takes many lines of code. To remedy these issues, I’ve created a convenience class for handling MySQL connections.

Using this class, you can easily create a parameterized query and retrieve a complete result set by calling a single method:

$bindParams = array( 'dave' );
$types = 's'; // see types for the mysqli_stmt_bind_param method.
$mysql = new MySQL();
$results = $mysql->parameterizedQuery( 'SELECT * FROM user WHERE username=?', $types, $bindParams );

Or more succinctly:

$mysql = new MySQL();
$results = $mysql->parameterizedQuery( 'SELECT * FROM user WHERE username=?', 's', array( 'dave' ) );

The returned $results variable contains an array of records matching your query, with each record’s structure being identical to the output expected from mysqli_fetch_array.

Download MySQL.php to make use of the parameterizedQuery() convenience method.

Parts of this class were derived from comments on PHP documentation pages. Many thanks to TheJkWhoSaysNi for his contributions to the mysqli_stmt_bind_result method discussion, and to tasdildiren for his contribution to the mysqli_stmt_bind_param method discussion.

Dave
Dave Lane is a mobile/web developer in Franklin, TN.


Find me elsewhere:
BitBucket
GitHub
Google+
LinkedIn
Stack Overflow
Twitter

Log in