TJ Singleton

Software Engineer, Baptist Preacher

The Purpose of His Name

But while he thought on these things, behold, the angel of the LORD appeared unto him in a dream, saying, Joseph, thou son of David, fear not to take unto thee Mary thy wife: for that which is conceived in her is of the Holy Ghost. And she shall bring forth a son, and thou shalt call his name JESUS: for he shall save his people from their sins.

Matthew 1:20-21

Shakespeare may have asked “What’s in a name?” and quipped, “That which we call a rose by any other name would smell as sweet.” However, nearly 1600 years before God had sent the angel of the LORD to answer that very question in a much different manner. God sent the angel to Joseph to ensure his son would be born with the name that he had decided. The name Jesus carries the meaning savior or deliverer, which is the very thing the angel reveals as the reasoning for God’s choice of that precious name. Jesus was going to save his people from their sins.

Do you hear the confidence and sureness in those words? “For he SHALL save his people.” There was no doubt or room for discussion. It had been determined that he would save his people and it would come to pass.

Notice not only the sureness, but notice the completeness of it. “He shall SAVE his people.” Wouldn’t it have been a sad thing if Christ death did not accomplish our salvation? If he had only made us saveable, but not actually saved. If our salvation was based not fully on the gracious work he completed, but also on our good works or attempts to hold on to it.

As frail humans, we would have never been able to save ourselves. But thanks be to God, his death didn’t make salvation just a possibility dependent on us, but he obtained our salvation for us. Like Jonah we can cry, “Salvation is of the Lord!”

O, What joy we should have that we have such a God and such a savior. God named Jesus after the purpose that he had for his son. Next time you hear his name, remember his purpose.

Cleaner Git History - Stash, Rebase, Pop

A common workflow of mine is:

1
git stash && git pull --rebase && git stash pop

I actually have this aliased to gpull. It stashes any uncommitted changes, pull in the latest with rebase, and then pops my changes off the stash.

git pull is a shorthand for git fetch and git merge. You can tell git that you’d prefer to rebase instead of merge by adding the —rebase option. Using rebase instead of merge will lead to a cleaner history.

"Git graph with merge"

Notice in this image how the you can see the branch that occurred from the merge? Merge takes the two versions of code and lays them on top of each other, merging them together. In the image, “moved impersonation controller to admin namespace” is merged into “features initial pass at phase 1”.

"Rebase"

In this image, if you were just looking at the tree, you can’t even tell that more than one person is committing. This is an example of the cleaner rebase. Instead of taking two different versions of the code and merging them together, git is placing all of the incoming head’s (FETCH_HEAD) commit’s first and then merging your commits one by one onto it.

To illustrate from the image, I pushed my commit “moved hydra.yml…”, then David pulled and pushed “updated required fields…” at 4:35. In the meantime, I had already made the “whitespace” commit at 12:12, but had yet to push it. When I rebased git took the FETCH_HEAD, which was at David’s commit, and then reapplied my commit to it.

Are You a Pillar?

And when James, Cephas, and John, who seemed to be pillars, perceived the grace that was given unto me, they gave to me and Barnabas the right hands of fellowship; that we should go unto the heathen, and they unto the circumcision.

Gal 2:9

Driving around Georgia we often pass by an old plantation homes. These homes have stood for years. One of the one of they distinguishing features was the use of columns. These pillars have supported the weight of the house through many storms.

Paul describes James, Cephas, and John as pillars. The idea of being a pillar is not that of leadership, but of support. These men had a reputation of underpinning the church.

The root word for pillar means to stand. When we lay down, our weight is supported by the bed. When we sit, the chair supports our weight. However, when we stand we are supporting ourself.

We need people who are pillars in the church. We need people that help support fellow christians. We need people who are stable and strong. People who like the columns on the plantation house can stand the test of time.

How about you? Are you a pillar?

Daily Thanksgiving

By him therefore let us offer the sacrifice of praise to God continually, that is, the fruit of our lips giving thanks to his name.

Hebrews 13:15

Burnt orange leaves rustling in the chilly wind reminds us that the holiday season is just around the corner. The festivities begin with a day set aside for us to express thankfulness for our many blessings. However, on the christian’s calendar every day should be marked by such gratitude to the father of light from which ever good and perfect give originates (James 1:17).

The writer of Hebrews admonishes us to offer God praise continually. As the earth steadfastly revolves around around the sun, so our hearts should be fixed in an orbit of appreciation for our great and wonderful God. Our lives should be marked by the constant recognition of our God.

Notice too that we are called not just to silent meditation, but also to burst forth with a vocal demonstration of our thanksgiving to God. We are to offer him the sacrifice of our lips. We are to speak and sing of his goodness that others may be hear and be reminded.

Finally, unlike the world who’s focus seemly revolves around what they have. Our thankfulness should be grounded in who we have. We are called to give thanks to his name. In this context, the name signifies the character and attributes of who God is. Every one of his excellencies provides us great cause for rejoicing.

Let us raise our voices daily, not just annually in thanksgiving. Let us recognize the worth of the giver, not just the gift. Let us praise him continually.

Regex Result Access Benchmark

The question came on forrst.com about which of the following two styles of accessing the results of a regex match were preferred:

1
2
"qqq100601.txt"[/\A([a-z]+)/, 1]
"qqq100601.txt".match(/\A([a-z]+)/)[0]

So I benchmarked it and was surprised that there was such a difference in the performance. Except on jruby, the array style access is the clear winner.

"Graph of Results"

Benchmark and Raw Results

Update I went ahead and ran this through RubyProf in 1.8.7. It turns out that #[/REGEXP/] is optimized to one method call and doesn’t instantiate the MatchData object. String#match is delegated to Regexp which instantiates MatchData and then accesses the result for a total of 3 method calls. So the real savings is less object churn and method calls.