Showing posts with label scripture. Show all posts
Showing posts with label scripture. Show all posts

Regular Expression for Book/Chapter of the Bible

What perl-compatible regular expression (PCRE) could match books/chapters of the bible?
How about this one:

/(^[123]?(\s+)?[a-zA-Z\s]+)(\s+)?([0-9]+)/




Everything between the first set of parenthesis is the book name. The parenthesis are done so we can pass the variables separately on to an array. This is a common task in working with PCRE, but for simply matching a pattern, may or may not be necessary. Though the second set, putting the \s+ in parenthesis, is for grouping as opposed to passing.

^[123]?
First we have to see if it is one of the books that starts with (^) a 1, 2, or 3 (e.g., 1 Chronicles, 3 John). The question-mark means that it's optional, because most books of the bible don't have those.

(\s+)?
Next we have to check if there is a space between that and the book name, because when somebody is searching for a book of the bible, they may get lazy (like me) and not put in a space. Again, it's optional as to whether or not it's there, so we use a question-mark.

[a-zA-Z\s]+
Next we have to check for all variations of capital or small letters, and we need to allow spaces as well for books like "Song of Solomon" (actually that's the only one with a space in it). Instead of the question-mark we have the plus, because at least one of these is required. You could also use [\p{L}\s]+ in PCRE, where \p{L}, or it's long form, \p{Letter} indicates a letter from any language.

The second set of parenthesis is the chapter...

(\s+)?
Again, the space (or more than one space for that matter) is optional between the book name and the chapter.

([0-9]+)
A chapter. At least one chapter is required (the + symbol).

Pretty easy, and honestly I put this blog entry in for myself to quickly refer to in case I have documented all my code badly (which I have!).

Reading and remembering

As I was reading scripture today, I came upon Matthew 8, particularly the section that describes what one has to be willing to surrender to follow Jesus. I have read this dozens of times, but I had to "cheat" using Bible Gateway to remember where it was in scripture.

Something that I know already, but want to try more today, is sharing something you read and remember with other people. That is the best way to learn anything, not just where something is in scripture. I'm learning a new language right now, and it's well-known that the way to retain what you learn in a day is to repeat it and interact with it among lots of people.

May I be better at walking that out...

Application Performance and the Jesus Way

Application Efficiency, Part I
The website Ethereal Mind, which I often read, had a recent post in response to another post by Matthew Norwood entitled Programming Bad Performance. It touched on something every network engineer feels when application performance is slow somewhere on the network. It's a topic I have dealt with a lot in my professional career so I uncharacteristically weighed-in with a comment, which I present below in a modified form...

It seems that the onus, or bur­den of proof, is often on the net­work engin­eer to fig­ure out just what the prob­lem is, since the net­work is this mys­ter­i­ous entity that most people don’t know much about. I have found two types of server admins in my exper­i­ence:
  • The ones that assume it’s their prob­lem and never think about the net­work, but then it proves to be a net­work prob­lem (often when attempt­ing to estab­lish com­mu­nic­a­tion between a ser­vice net­work and an internal net­work).
  • The ones that assume (along with all the users, usu­ally) that it is a net­work prob­lem and very quickly start point­ing fin­gers.
I have found that over the years I have learned a lot more about effi­cient data­base pro­gram­ming, ana­lyz­ing server cpu, memory, and disk util­iz­a­tion, etc, than I ever wanted to, as a means to simply find what the real prob­lem is. Greg at Etherealmind points out that prov­ing it’s not the net­work, or at least cast­ing plaus­ible reason to believe it’s not, will get you home on time. I agree with that, but in a world of people say­ing, “It’s not my prob­lem” and wash­ing their hands of it, I want to put forth a little more effort to get to the bot­tom of things.

Something else that I have learned is that humil­ity is really import­ant. If you start act­ing cocky and the prob­lem turns out to be yours, you really look like, and are, a jerk. Taking more of a “Let’s fig­ure this out together” atti­tude is much more likely to lead to suc­cess and team unity in the end. The real art is being able to foster and main­tain that atti­tude when other people seem to be out for blood.

The Jesus Connection
I'll make this my first post that crosses my two categories of blogging. Wanting to live life in a way that Jesus would do it, the previous paragraph helps see one or two ways of doing that. The bible often speaks of humility... three places that jump out to me:
  • Do nothing out of selfish ambition or vain conceit. Rather, in humility value others above yourselves, not looking to your own interests but each of you to the interests of the others (Philippians 2:3-4).
  • For those who exalt themselves will be humbled, and those who humble themselves will be exalted (Matthew 23:12).
  • When pride comes, then comes disgrace, but with humility comes wisdom (Proverbs 11:2)
Unity is also key to solving problems. It's amazing how humility and unity go together as well (I think that's pretty obvious). If everyone is cocky, it does not help team unity--it just creates divides. Be completely humble and gentle; be patient, bearing with one another in love. Make every effort to keep the unity of the Spirit through the bond of peace. There is one body and one Spirit, just as you were called to one hope (Ephesians 4:2-4).

Three of my favorite topics: humility, unity, and hope!

Go out with joy

As I was praying this morning, and studying the scriptures, I remembered that going out with joy is one of the most powerful testimonies to the love of God. Some people just seem to have joy and a hope, even if circumstances are crummy.

It reminds me of the famous passage in the Prophet Isaiah chapter 55 (which I wrote some about last year). Verse 12 says,
  • "You will go out in joy and be led forth in peace;
  • the mountains and hills will burst into song before you,
  • and all the trees of the field will clap their hands."
How is it to go out in the joy of the Lord and be so contagious that the trees of the fields and the mountains will even catch the joy? Obviously it's poetic, but what better way to speak of the fellowship with God than to display joy and hope as you go along?

Where I live, everyone around me says, "As-Salamu Alaykum" which basically means "Peace be upon you" in Arabic--a beautiful greeting. I also long for a joy to be among us all through knowing the very character and nature of God and how he extends his hand in love and calls us each by name (John 10:3)!

As-Salamu Alaykum!

Psalm 27

It's amazing how the same section of scripture that you have read many times comes to life anew every time.

The Lord is my light and my salvation, whom shall I fear?

This is a basic rule for life. Even if someone kills me or I die, because the Lord is my eternal salvation, where is there room for fear? I'm not my own salvation--I haven't saved myself through my piety or good deeds.

The LORD is the stronghold of my life—of whom shall I be afraid?

If the last sentence speaks of my eternal salvation, this one speaks of my life here and now. Fear is one of the most devious tricks of Satan. It paralyzes a person from carrying out the things they know they should do.

One thing I ask of the LORD,

this is what I seek:
that I may dwell in the house of the LORD
all the days of my life,
to gaze upon the beauty of the LORD
and to seek him in his temple.

The most important thing, the goal of life, the highest request to be made of God, is to dwell in his presence, to gaze on his beauty, to bask in his love.

For in the day of trouble
he will keep me safe in his dwelling;
he will hide me in the shelter of his tabernacle
and set me high upon a rock.

God is faithful. If we look to him and remain in his presence, he will reach back to us and do these things.

at his tabernacle will I sacrifice with shouts of joy;
I will sing and make music to the LORD.

The natural response for the deliverance that is offered.

More on this another day, but I'm trying to keep these short. There is a lot to fear in India. Going out on the streets trying to practice language is really difficult for me, whether it's because I'm not particularly extroverted, or because if I look silly, I want it to be on my own terms, or some other reason. Yet the people I would interact with are not my enemies at all--most of them are happy to help me learn. Yet it's easier to just stay in the house.

Yet none of these fears should be serious. Real fear is not having enough money to buy food, or not having a secure place to stay. Yet these "big" fears like that are easier to tackle head-on and to give a name to. It's the small fears that constantly bombard a person. Yet God has promised release from fear, and that a life lived in fear is not a life of obedience.

I'm writing these things to remind myself... :)

The Language of [Jesus]

Since living in India, it's interesting to see the different religious terminologies, based on different languages, traditions, and religions. I've discovered that most (if not all) major religions in India have a reverence for Jesus Christ. But there is confusion about his name, and his title, perhaps.
  • The Name
    • The name he probably went by in his time was "Yeshua"
    • "Jesus" that we use in English seems to have come primarily from the Latin, "Iesous."
    • Most Hindi speakers will say "Yeshu"
    • He is known in the Arabic from the Qur'an as عيسى ("Isa") and that has become the name all Muslims will use, Arabic-speaking or not.
    • Whatever language, the meaning is the same; the name means "God is salvation."
  • The Title
    • The original title is, of course, Hebrew: Mashiaẖ
    • When this title is translated into Greek, it is "Christ"
    • In English we say "Messiah" or "Christ"
    • In Arabic, as defined in the Qur'an, his title is "al-Masīḥ" and that has become the title all Muslims will use, Arabic-speaking or not.
    • Whatever language, the meaning is the same; his title means "Anointed One."

Isaiah 55 part 2

Where should my eyes be fixed? God says:
  • Listen to me (v2)
  • Come to me (v3)
  • Hear me (v3)
If somebody says something to me that is not in line with what God says, I can't listen. But God says that he will make a covenant with me, the same faithful love that he promised to David via Moses (Exodus 34:6).

Who is the "him" in verse 4? It has to be Jesus, because in Acts 8:32, the Ethiopian is reading the Isaiah scroll, in chapter 53, which is part of the same discourse. And who is "you" in all these verses? It must be anyone who is thirsty (verse 1). So what's our role? It's to be so endowed with the splendor the Lord that nations want to be part of what we have. How can we be endowed with splendor? By seeking the Lord, forsaking wicked ways and thoughts. If I do that, God will bless me with splendor, which I read as a holy, contagious joy! When people come seeking the Lord, he will freely pardon and show great mercy!

We can show mercy and our own efforts. I hope that doesn't sound like heresy, but certainly people who have no belief in God can show mercy. But to show the kind of mercy that God shows is beyond our thoughts.

And the rest of Isaiah 55 just flows off the tongue! I'm no poet, but even translated into English, verses 8-13 are so beautiful.

Isaiah 55 part 1

I'm reflecting on Isaiah 55 tonight as it's come up for me several times in the last few weeks.

I always thought verse 1 was talking to those who did not know the Lord. But I've been pondering that everyone is thirsty, no matter their spiritual state, that we might drink from the living water that Jesus talks about in John 4, and long for it as the deer pants for water. Jesus says in Matthew 5:6, "Blessed are those who hunger and thirst for righteousness, for they will be filled." My goal is to always be hungry and thirsty for righteousness that I might always be eating and drinking of the Lord (in a figurative sense) to be filled!

How often I spend money on what is not bread and I labor on what does not satisfy! If I vow to live a life of righteousness, how I seek to live by that vow, even as God cuts to my heart in Ecclesiastes 5:4. I'm so glad for the second part of Isaiah 55:2, where it says, "then my soul will delight in the richest of fare." I've heard of people who have turned their back on God because they just feel guilty all the time and want to talk away from God so they can feel good. How I pity those people, because they think God looks at them constantly wagging his finger. I think these people confuse the wagging finger of "religious people" with the wagging finger of God. God absolutely seeks holiness ("Be perfect...as your heavenly Father is perfect" -Matthew 5:48, as well as dozens of other places) from those who would confess to know him. But mercy triumphs over judgment (James 2:13). He will pour out his blessing in greater measure toward those who are holy and pure, but he will show mercy to all who call on his name (see Acts 16:31 but also 1 Corinthians 3:12-15). God loves to bless those who bless him, and I want to bless God, and if I do so with a heart of purity, my soul will delight in the richest of fare!

Holy smokes, that's quite a preachy first blog post. And I'm only through the first 2 verses of Isaiah 55. I'm new to this blogging thing so we'll see where it goes from here...

Peace!

Previous working directory in Windows Command Prompt

Using bash in *nix has a handy feature: If you are in one directory and you switch to another one, you can use   cd -  to go back to the pr...