I am Joshua Poehls. Say hello Archives (not so) silent thoughts

Parse .NET TimeSpans in a Tableau Calculated Field

Here’s a formula you can use to create a calculated field in Tableau for converting strings in the format of .NET TimeSpan values to a total number of seconds.

Given a string 79.23:08:01.3976607 (79 days, 23 hours, 8 minutes, 1.3976607 seconds), it would return the total number of seconds.

IF ISNULL([TimeSpan]) THEN
   NULL
ELSE
   (IFNULL(INT(REGEXP_EXTRACT_NTH([TimeSpan], "^((\d+)\.)?(\d+):(\d+):(\d+(\.(\d+))?)$", 2)), 0) * 86400)
   + (INT(REGEXP_EXTRACT_NTH([TimeSpan], "^((\d+)\.)?(\d+):(\d+):(\d+(\.(\d+))?)$", 3)) * 3600)
   + (INT(REGEXP_EXTRACT_NTH([TimeSpan], "^((\d+)\.)?(\d+):(\d+):(\d+(\.(\d+))?)$", 4)) * 60)
   + FLOAT(REGEXP_EXTRACT_NTH([TimeSpan], "^((\d+)\.)?(\d+):(\d+):(\d+(\.(\d+))?)$", 5))
END
⦿

Resources for Studying Zephaniah

I’ve been studying through Zephaniah recently, prompted by the recently released ESV Expository Commentary (Volume 7): Daniel–Malachi. The commentary on Zephaniah is written by Jason DeRouchie who I’ve been following since his How to Understand and Apply the Old Testament, which is fantastic.

Andy Naselli’s companion volume, How to Understand and Apply the New Testament, is equally fantastic. I read it first and I’m still working through DeRouchie’s volume.

Jason DeRouchie has taught though Zephaniah several times, including 15 lectures given to his adult Sunday School class at Bethlehem Baptist Church in the Fall of 2015. I’ve compiled the audio recordings from those lectures into a podcast feed for easy listening.

Here are some other links that I’ve found useful for studying Zephaniah:

⦿

Greek New Testament Narrated by Theo Karvounakis

I recently discovered an excellent narration of the Greek New Testament. It is freely available for download and streaming; the links are below.

After finding these recordings on YouTube I had to dig around to find who to cite as the narrator. According to a post on Glen Scrivener’s blog, the narration is by Theo Karvounakis and the recordings are being released into the public domain by he and Matthias Müller.

The readings are from Scrivener’s Textus Receptus (1894 edition) published by the Trinitarian Bible Society, the text of which is also in the public domain.

I’ve listened to a bit from The Gospel of Matthew and The Gospel of John and the production quality is very good. Theo Karvounakis reads in a modern Greek pronunciation that is easy to understand and listen to.

The Gospel of John: A Podcast?

I’ve experimented with creating a podcast feed for these recordings so that they are easy to stream on the go. I like to listen to spoken audio in Overcast as much as possible because of the excellent Smart Speed and Voice Boost features that trim up the excess silence and enhance the audio quality so much.

I started by making a feed for The Gospel of John by uploading the MP3s to the Internet Archive and hosting the podcast RSS feed on GitHub. Use the links below to subscribe. If this is useful to you then I’d love to hear your feedback.

⦿

Vincent van Gogh - The Letters

Vincent van Gogh - The Letters is an amazing archive of documents. Searchable, with facsimiles, translations, and including even the original sketches. Van Gogh seems like a fascinating person and the letters contain some gems.

Someone has a great fire in his soul and nobody ever comes to warm themselves at it, and passers-by see nothing but a little smoke at the top of the chimney and then go on their way.

– Vincent van Gogh, Letter no. 155 (June 1880)

Facsimile of a letter from Vincent van Gogh

Facsimile of a letter from Vincent van Gogh

What am I in the eyes of most people? A nonentity or an oddity or a disagreeable person — someone who has and will have no position in society, in short a little lower than the lowest.

Very well — assuming that everything is indeed like that, then through my work I’d like to show what there is in the heart of such an oddity, such a nobody.

This is my ambition, which is based less on resentment than on love in spite of everything, based more on a feeling of serenity than on passion.

Even though I’m often in a mess, inside me there’s still a calm, pure harmony and music. In the poorest little house, in the filthiest corner, I see paintings or drawings. And my mind turns in that direction as if with an irresistible urge. As time passes, other things are increasingly excluded, and the more they are the faster my eyes see the picturesque. Art demands persistent work, work in spite of everything, and unceasing observation.

– Vincent van Gogh, Letter to Theo van Gogh from The Hague (21 July 1882)

⦿

The Bible Project: Justice

Justice has been a recurring theme that stands out to me as I read the Bible. This video from The Bible Project is really helpful to understand the biblical themes righteousness and justice.

Humans are set apart from all other creatures as the image of God… This identity is the bedrock of the Bible’s view of justice. All humans are equal before God and have the right to be treated with dignity and fairness, no matter who you are.

Doing righteousness… what comes to mind is, being a good person. But what does that even mean, “being good”?

The biblical hebrew word for righteousness is tsĕdaqah. It’s more specific. It’s an ethical standard that refers to right relationships between people. It’s about treating others as the image of God. With the God given dignity they deserve.

And this word justice, it’s the hebrew word mishpat. It can refer to retributive justice… yet most often in the Bible, mishpat refers to restorative justice. It means going a step further. Actually seeking out vulnerable people who are being taken advantage of and helping them out. …It means taking steps to advocate for the vulnerable, and changing social structures to prevent injustice.

Open your mouth for the mute,
    for the rights of all who are destitute.
Open your mouth, judge righteously,
    defend the rights of the poor and needy.
Proverbs 31:8-9 (ESV)

Thus says the LORD: Do justice and righteousness, and deliver from the hand of the oppressor him who has been robbed. And do no wrong or violence to the resident alien, the fatherless, and the widow, nor shed innocent blood in this place.
Jeremiah 22:3 (ESV)

[The LORD,]
who executes justice for the oppressed,
    who gives food to the hungry.

The LORD sets the prisoners free;
    the LORD opens the eyes of the blind.
The LORD lifts up those who are bowed down;
    the LORD loves the righteous.
The LORD watches over the sojourners;
    he upholds the widow and the fatherless,
    but the way of the wicked he brings to ruin.
Psalm 146:7-9 (ESV)

The behind-the-scenes is pretty cool as well.

Did not your father eat and drink
    and do justice and righteousness?
    Then it was well with him.
He judged the cause of the poor and needy;
    then it was well.
Is not this to know me?
    declares the LORD.
Jeremiah 22:15-16 (ESV)

⦿
⦿

PowerShell Script Boilerplate

This post is as much for me as it is for you. I write a lot of PowerShell scripts and they tend to follow a certain pattern. This is my personal boilerplate for PowerShell scripts.

#Requires -Version 3
Set-StrictMode -Version Latest
$ErrorActionPreference = "Stop"

$stopwatch = [System.Diagnostics.Stopwatch]::StartNew()
$scriptDir = Split-Path -LiteralPath $PSCommandPath
$startingLoc = Get-Location
Set-Location $scriptDir
$startingDir = [System.Environment]::CurrentDirectory
[System.Environment]::CurrentDirectory = $scriptDir

try
{
    # TODO: Insert script here.
}
finally
{
    Set-Location $startingLoc
    [System.Environment]::CurrentDirectory = $startingDir
    Write-Output "Done. Elapsed time: $($stopwatch.Elapsed)"
}

What’s going on here?

  • Enables StrictMode to enforce some best practices. 1
    • Prevents use of variables that have not been initialized.
    • Cannot call non-existent properties on objects.
    • Disallows calling a function like a method, e.g., Do-Something(1 2) instead of Do-Something 1 2.
    • Prohibits creating variables without a name.
  • Sets $ErrorActionPreference so that unhandled exceptions will halt the script execution. By default, PowerShell will roll on when an exceptions is thrown and this statement makes my scripts safe by default.
  • Set $scriptDir to the directory path of the current script. This may be different than the working directory.
  • Set the working directory to the $scriptDir so that relative paths in the script itself can be consistent.
  • Most of the time I want to know how long my script takes to run so I include a $stopwatch that will output the elapsed time when the script finishes.
  • The try...finally ensures that the elapsed time will output even if the script throws an exception.

Need to wrap your PowerShells script with a batch file? Grab my PowerShell batch file wrapper.


  1. Read more about this on the “Hey, Scripting Guy!” blog.
⦿

Bible Quiz: Deu 7:9, 10:12-13

Hundreds of verses forgotten. Yep, that’s what happen to me. I joined up with our church’s Bible Quiz team as a teen and memorized hundreds of verses for competition. Looking back, it is one of my favorite things I did growing up. Unfortunately, that was many years ago and with little practice comes much forgetfulness.

I kicked off 2016 by starting Fighter Verses. This is my attempt to get back into the practice of memorizing scripture. One of the ways I ingrain verses in my mind is to break them apart and mentally quiz myself. Quoting it backwards and forwards, so to speak, as I answer questions about the passage. It really works.

So, dear readers, I present to you some Bible Quiz style questions I’ve been drilling for the first couple Fighter Verses. Let me know if you find these helpful!


Deuteronomy 10:12-13

And now, Israel, what doth the LORD thy God require of thee, but to fear the LORD thy God, to walk in all his ways, and to love him, and to serve the LORD thy God with all thy heart and with all thy soul, To keep the commandments of the LORD, and his statutes, which I command thee this day for thy good?

Q: What does the LORD require of Israel, according to Deuteronomy 10:12-13?

  • To fear the LORD thy God.
  • To walk in all his ways.
  • To love him.
  • To serve the LORD thy God with all their heart and soul.
  • To keep the commandments of the LORD and his statutes.

Q: What reason is Israel given for keeping the LORD’s commandments and statutes, according to Deuteronomy 10:13?

It is for their own good.

Q: What is Israel told to do “for their own good”, according to Deuteronomy 10:13?

  • Keep the commandments of the LORD
  • and his statutes.

Deuteronomy 7:9

Know therefore that the LORD thy God, he is God, the faithful God, which keepeth covenant and mercy with them that love him and keep his commandments to a thousand generations;

Q: What attribute of God is mentioned in Deuteronomy 7:9?

His faithfulness.

Q: What is commanded to be known in Deuteronomy 7:9?

That the LORD thy God, he is God.

Q: What does God promise to keep with them that love him, according to Deuteronomy 7:9?

Covenant and mercy.

Q: Who does God promise to keep covenant and mercy with, according to Deuteronomy 7:9?

  • Them that love him
  • and keep his commandments
  • to a thousand generations.

Verses are quoted from the King James Version.

⦿

Serve the LORD, Fear Not

I call heaven and earth to record this day against you, that I have set before you life and death, blessing and cursing: therefore choose life, that both thou and thy seed may live:1

And if it seem evil unto you to serve the LORD, choose you this day whom ye will serve; …2

If ye will fear the LORD, and serve him, and obey his voice, and not rebel against the commandment of the LORD, then shall both ye and also the king that reigneth over you continue following the LORD your God:3

For God hath not given us the spirit of fear; but of power, and of love, and of a sound mind.4

These things I have spoken unto you, that in me ye might have peace. In the world ye shall have tribulation: but be of good cheer; I have overcome the world.5

Ye are of God, little children, and have overcome them: because greater is he that is in you, than he that is in the world.6

So that we may boldly say, The Lord is my helper, and I will not fear what man shall do unto me.7

The LORD is on my side; I will not fear: what can man do unto me?8

These quotations are all from the KJV.


  1. Deu 30:19
  2. Jos 24:15
  3. 1Sa 12:14
  4. 2Ti 1:7
  5. Jhn 16:33
  6. 1Jo 4:4
  7. Heb 13:6
  8. Psa 118:6
⦿

Delighting in the Trinity

“It is not to be expected that we should love God supremely if we have not known him to be more desirable than all other things.” So wrote the great hymn writer Isaac Watts. And of course, he was quite right, for we always love what seems most attractive to us.

But what kind of God could outstrip the attractions of all other things? Could any unitary, single-person god do so? Hardly, or at least not for long. Single-person gods must, by definition, have spent eternity in absolute solitude. Before creation, having no other persons with whom they could commune, they must have been entirely alone.

Love for others, then, cannot go very deep in them if they can go for eternity without it. And so, not being essentially loving, such gods are inevitably less than lovely. They may demand our worship, but they cannot win our hearts. They must be served with gritted teeth.

Just imagine for a moment a single-person god. Having been alone for eternity, would it want fellowship with us? It seems most unlikely. Would it even know what fellowship was? Almost certainly not. Such a god might allow us to live under its rule and protection, but little more.

But if God is a Father, whose very life has been about loving and delighting in His precious Son, then you begin to see a God who would have far more intimate and marvelous aims, aims to draw us into His life and joy, to embrace us with the very love He has for His dear Son.

The Trinity, then, is not some awkward add-on to God, the optional extra nobody should want. No, God is beautiful, desirable, and life-giving precisely because He is the Father, the Son, and the Spirit.

⦿