Little Sisters Disciples of the Lamb

“The Little Sisters Disciples of the Lamb are a contemplative community that enables girls with Down’s syndrome to respond to a religious vocation.” “We follow every day the ‘little way’ taught by Saint Therese; knowing that ‘great actions are forbidden to us’, we learn from her to receive everything from God, to ‘love for the brothers who fight’, to ‘scatter flowers for Jesus’, and to pray for the intentions entrusted to us.”

Little Sisters Disciples of the Lamb via Laodicea
Little Sisters with Big Grins via The Anchoress

Posted in links | Tagged , , | Leave a comment

BDD Cheat Sheet

Epic

A large or complex user story that should be broken into several smaller stories.

Story

A feature written as:

AS A [person/role who will benefit],
I WANT [some feature],
SO THAT [some benefit or value is provided].

Scenario

A story’s acceptance criterion, to be implemented as an executable test, and written as:

GIVEN [some initial context],
WHEN [an event occurs],
THEN [ensure some outcomes].

Posted in essays | Tagged | Leave a comment

What other answer would suffice?

I know now, Lord, why You utter no answer. You are Yourself the answer. Before Your face questions die away. What other answer would suffice?

– C.S. Lewis, Till We Have Faces

Posted in quotes | Leave a comment

Google Blog Converters: blogger2wordpress

Yesterday, while using the Google Blog Converters to migrate a blog from Blogger to WordPress (see the “Plan B” section of Migrating an old Blogger blog to WordPress), I encountered the following error:

$ google-blog-converters-r89/bin/blogger2wordpress.sh blog-12-27-2011.xml > wordpress-blog-12-27-2011.xml
Traceback (most recent call last):
  File "google-blog-converters-r89/bin/../src/blogger2wordpress/b2wp.py", line 28, in <module>
    import wordpress
  File "/Users/username/Downloads/google-blog-converters-r89/src/blogger2wordpress/wordpress.py", line 55, in <module>
    element_tree_write = ElementTree.ElementTree._write
AttributeError: type object 'ElementTree' has no attribute '_write'

A quick search led me to an open issue on the Google Blog Converters site, but no solutions were provided. I did a little more research, and realized I had overlooked the fact that because the Google Blog Converters are built for Google’s App Engine, they require Python 2.5, and that more recent versions — say, the Python 2.7.1 provided with OS X “Lion” — may not work with the scripts provided. Another quick search (for “python 2.5 lion”) led me to a Stack Overflow post where I learned that Apple provides Python 2.5 for Lion, with a custom binary at /usr/bin/python2.5. With that information, I was able to fix the blogger2wordpress.sh script by changing line 13 from:

PYTHONPATH=${PROJ_DIR}/lib python ${PROJ_DIR}/src/blogger2wordpress/b2wp.py $*

to:

PYTHONPATH=${PROJ_DIR}/lib python2.5 ${PROJ_DIR}/src/blogger2wordpress/b2wp.py $*

I ran the script after the change, and it worked as expected. I hope this helps someone out there, though YMMV.

Posted in essays | Tagged , , , , | 2 Comments

Rebuilding the Android NDK for Objective-C Support

How to make the Android NDK compile Objective-C! Many thanks to Jackie Gleason (@LifeIsTooShort) for his M3 Conference (@M3Conf) presentation, Adding Objective-C Support to the Android NDK, upon which most of this tutorial is based.

DOWNLOAD AND PATCH THE ANDROID NDK TOOLCHAIN SOURCES

Using the terminal, create a directory for your toolchain sources:

mkdir -p ~/SDKs/Android/toolchain-src
cd ~/SDKs/Android/toolchain-src

IMPORTANT: The build-gcc script expects a specific layout for the source directory. Create the above directory anywhere you like, but be sure to create the subdirectories below exactly as described.

Next, fetch the sources:

git clone https://android.googlesource.com/toolchain/build.git
git clone https://android.googlesource.com/toolchain/gmp.git
git clone https://android.googlesource.com/toolchain/gdb.git
git clone https://android.googlesource.com/toolchain/mpc.git
git clone https://android.googlesource.com/toolchain/mpfr.git
mkdir binutils
cd binutils/
curl -O ftp://sourceware.org//pub/binutils/snapshots/binutils-2.22.51.tar.bz2
tar xjfv binutils-2.22.51.tar.bz2
cd ../
mkdir gcc
cd gcc/
curl -O ftp://ftp.gnu.org//gnu/gcc/gcc-4.6.1/gcc-4.6.1.tar.bz2
tar xjfv gcc-4.6.1.tar.bz2
cd ../

Patch the toolchain makefile:

git clone git://gist.github.com/1378127.git build-patch
cd build/
patch < ../build-patch/Makefile.in.diff
cd ../

Patch GCC:

cd gcc/
curl http://gcc.gnu.org/bugzilla/attachment.cgi?id=24879 > gcc-4.6.1.patch
cd gcc-4.6.1/
patch -p1 < ../gcc-4.6.1.patch

DOWNLOAD AND PATCH THE ANDROID NDK

Using the terminal, fetch the NDK:

cd ~/SDKs/Android/
curl -O http://dl.google.com/android/ndk/android-ndk-r6-darwin-x86.tar.bz2
tar xjfv android-ndk-r6-darwin-x86.tar.bz2

Next, patch the build-gcc script:

git clone git://gist.github.com/1378122.git android-ndk-build-gcc-patch
cd android-ndk-r6/build/tools/
patch < ../../../android-ndk-build-gcc-patch/build-gcc.sh.diff

BUILD THE ANDROID NDK TOOLCHAIN

Using the terminal, get to the NDK build/tools directory:

cd ~/SDKs/Android/android-ndk-r6/build/tools/

Next, rebuild GCC on Mac OS X:

./build-gcc.sh --gmp-version=4.2.4 --mpfr-version=2.4.1 --binutils-version=2.22.51 --try-64 ~/SDKs/Android/toolchain-src ~/SDKs/Android/android-ndk-r6 arm-linux-androideabi-4.6.1

Or rebuild GCC on Linux:

./build-gcc.sh --gmp-version=4.2.4 --mpfr-version=2.4.1 --mpc-version=0.8.1 --binutils-version=2.22.51 --try-64 ~/SDKs/Android/toolchain-src ~/SDKs/Android/android-ndk-r6 arm-linux-androideabi-4.6.1

ACKNOWLEDGEMENTS

Adding Objective-C Support to the Android NDK. Gleason, Jackie. M3 Conference. 19 Nov. 2011.

Building an Android NDK with Recent GCC and Binutils. Hommey, Mike. Glandium. 1 Aug. 2011.

Compiling GCC 4.6.1 on Mac OSX Lion. Solarian Programmer. 20 Sep. 2011.

Android NDK GCC 4.2.1 with Objective C 2.0 Support. phausler@gmail.com. 19 Jan. 2010.

Posted in essays | Tagged , , , , | 2 Comments

Command-Line File Encryption and Decryption using OpenSSL

To encrypt file.txt (you will be prompted for a password):

openssl aes-256-cbc -salt -in file.txt -out file.txt.enc

To decrypt file.txt.enc (you will be prompted for the password used to encrypt):

openssl aes-256-cbc -d -in file.txt.enc -out file.txt

Simple File Encryption with OpenSSL. Dryer, Tom. Tombuntu. 12 Dec. 2007.

Posted in links | Tagged , , , , , | Leave a comment

Holy Week Timeline Visualization

Holy Week Timeline

Click to enlarge. Also available as a PDF.

Holy Week (or Passion Week) [is] the week that commemorates Jesus’ death and resurrection. Here’s a new visualization we created that harmonizes the four Gospel accounts of Holy Week and lets you examine the “who,” “what,” and “where” of events leading up to and through Easter. Follow the lines in the chart to see at a glance what people were doing, where they were, and whom they were with at any point during the week.

Holy Week Timeline Visualization. The Bible Gateway Blog. 15 Apr. 2011. via @weisjohn.

Posted in links, photos, quotes | Tagged , , | Leave a comment

Dvorak Keyboard Layout on Ubuntu

Switch to Dvorak layout:

sudo loadkeys dvorak

Switch back to U.S.:

sudo loadkeys us

That was easy!

Posted in essays | Tagged , , | Leave a comment

An Unlikely Crusader for Cleaning Up the Food Supply

TEDxAustin Robyn O’Brien 2011. O’Brien, Robyn. TEDxAustin. Mar. 2011.

Posted in links, videos | Tagged , , , , | Leave a comment

Catching the “Little Things” with BDD

I’ve often read/heard the following kind of critique comparing TDD (Test-Driven Development) and BDD (Behavior-Driven Development):

BDD is great, but unlike TDD, it can’t catch little things like obj.length vs. obj.length()

Such assertions tell me that we need to improve how we teach BDD. BDD is TDD. Many argue BDD is simply TDD “done right”. So why the new name? Because Test-Driven Development, thanks to its misleading name, tends to place inordinate emphasis on testing over design, prompting immediate resistance from developers and project managers alike.

Alright Mr. SmartyPants, how do we ensure our BDD covers “little things” such as obj.length versus obj.length()? I’m glad you asked! Suppose we are working with the following Story and Scenario:

Feature: Count my friends
    In order to track my popularity
    As a social networker
    I want to be given a sum of all my friends

    Scenario: Add friends
        Given Tom, Jerry and Tweety are my friends
        When I add Sylvester and Sylvester Jr. to my friends
        Then I should have 5 friends

And the following Cucumber steps for JavaScript (purposefully not DRY, for the sake of demonstration):

Given(/(.*) are my friends/, function(s)
{
    me = new Person();
    var friends = s.split(/,\s?|\s?and\s?/);
    for (var i in friends)
    {
        me.friends.push(new Person({ name: friends[i] }));
    }
}

When(/I add (.*) to my friends/, function(s)
{
    var friends = s.split(/,\s?|\s?and\s?/);
    for (var i in friends)
    {
        me.friends.push(new Person({ name: friends[i] }));
    }
}

Then, depending on which is needed, one can easily test obj.length:

Then(/I should have (.*) friends/, function(n)
{
    assertEqual(n, me.friends.length);
}

Or obj.length():

Then(/I should have (.*) friends/, function(n)
{
    assertEqual(n, me.friends.length());
}

Voila! Now your BDD is covering your length/length() dilemma, and you didn’t have to “switch back” to a “test-driven” mindset.

Posted in essays | Tagged , , , , | 3 Comments