Sunday, February 1, 2015

<include --optional>

Bedrock 2.4.1-10 now includes a new option of the <include> tag.  The new --optional argument, will prevent Bedrock from throwing an exception if your include file is not found.  This might be useful for those situations where you might want to conditionally include a file.

<include:foo --optional>

There a couple of old school ways of achieving the same thing.

<if -e --file ($config.INCLUDE_DIR + '/foo.inc')>
  <include:foo>
</if>

or

<try>
  <include:foo>
<catch>
</try>

Either way you slice it, the old school way seems forced.  The --optional tag is admittedly syntactic sugar, but a welcome sweetener!

Cookieless Sessions - Automatically Login Your Users

The default Bedrock persistence store, implemented via the $session object has the ability to create a token (session identifier) you can use to automatically log your users into your applications.

This is a useful feature for resetting passwords and perhaps creating convenience links for fast access to application specific pages that would normally require a user to login to the application.  Here's how it works...

Sunday, January 18, 2015

Bedrock + Barewords = Bug

This morning, after being sufficiently caffeinated with a full pot of coffee, I was able to isolate a Bedrock bug that has been bugging me.  Bedrock was failing to throw an exception on what I would consider a syntax error (missing right end tag >).  


  <null:foo $baz.some_method()
  <var $foo>

Bedrock however, happily parsed the expressions and went along it's merry way...argghhh!

Is it a bug in Bedrock?  Probably, but IMHO it's really a problem with Bedrock's loosely defined grammar.

Saturday, January 10, 2015

Love me some more Chromebook!

New beta channel release appears to have fixed memory management issues.

For the first time since I've owned my Chromebook I experienced a lot of "He's Dead Jim" out of memory issues.  So far the new update of January 8th seems to have corrected the problem.

New 15.6" Acer Chromebook

Looks like Acer is going to enter the 15" market.  They were giving sneak peeks at the CES in Las Vegas of a new Acert 15.6" Chromebook.

According to the representive they'll have several models including an i3 4GB model.  Lower end models (2GB, lower resolution) will start at $249.  Since it comes in at almost 5lbs I don't think it will replace my current C720 as my go to road device, but the increased screen size will make this a nice addition to the den.

The experiments with crouton and running Ubuntu on my 2GB model were very successful, so I suspect there will soon be an emerging Linux laptop pattern fueled by these Chromebooks.  I'd go with the 4GB model for those contemplating running unity.

Love me some Chromebook!  Can't wait to get my hands on one.  Rumors suggest March...

Wednesday, December 31, 2014

RESTful APIs with Bedrock (part V)

This is the 5th in a series of blogs on using Bedrock to create a RESTful API.  So far we've checked off several requirements for building a RESTful API.  We've been able to demonstrate the basics of creating a RESTful API using Apache and Bedrock.  We've satisfied requirements #1 through #4 and #6.
  1. Parse a URI
  2. Determine the operation to be performed
  3. Determine the result format requested by the client
  4. Retrieve, validate, and de-serialize client data
  5. Retrieve data from the back end
  6. Serialize data to send back to client
  7. Set HTTP response headers
  8. Handle errors
We'll round out the discussion by showing how Bedrock can satisfy the 3 remaining requirements.

Tuesday, December 30, 2014

RESTful APIs with Bedrock (part IV)

To recap our 8 requirements of a web development framework for creating our RESTful API:
  1. Parse a URI
  2. Determine the operation to be performed
  3. Determine the result format requested by the client
  4. Retrieve, validate, and de-serialize client data
  5. Retrieve data from the back end
  6. Serialize data to send back to client
  7. Set HTTP response headers
  8. Handle errors

In yesterday's blog we talked about using Apache directives to help us create meaningful URIs and using Bedrock to interpret the extra path information and HTTP method in order to satisfy requirements 1 & 2.

Today we'll examine #3 and #4 and touch on #6.

Monday, December 29, 2014

Perl Regular Expression Capture Groups

After cursing Bedrock for not giving me access to capture groups in regular expressions, I finally bit the bullet and figured out how to implement this in a somewhat sane manner.