From Pine View Farm

2015 archive

Regular Expressions Make My Brain Hurt 0

If they also make your brain hurt, here’s a good tutorial.

If you are not sure what Regular Expressions (often called “regex”) are, they are a versatile tool for searching text for specific strings. You can search for strings with various permutations and qualifications.

Here’s an example, illustrating a search of the file /usr/doc/HTML/en/common/gpl-license for the any occurrence of a string including two characters followed by the characters “cept” (the -i means “ignore case”). The working directory was /usr/doc/HTML/en/common/, which is where the GNU Public License resides in Slackware –Current.

The text is choppy because the output of the command displays individual lines from the text file, rather than sentences:

$ grep -i "..cept" gpl-license
License. (Exception: if the Program itself is interactive but
special exception, the source code distributed need not include except as expressly provided under this License. Any attempt
5. You are not required to accept this License, since you have not
prohibited by law if you do not accept this License. Therefore, by
Program), you indicate your acceptance of this License to do so, and
make exceptions for this. Our decision will be guided by the two goals
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN

Here’s some more searches I did during the tutorial:

grep "^[A-Z].*\.$" gpl-license <--Searches for all lines starting with capital letters or ending with periods.

egrep "(public license)" gpl-license <--Searches for all lines including the string "public license."

grep "^[A-Z]" gpl-license <--searches for all lines starting with capital letters.

These are very simple regex searches.

Here’s a complex regular expression string that I grabbed from a website. Note that it is just the search string, not prefaced by a search command:

\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}\b

When I understand that, I will consider that I have achieved geekdom.

Yes, this is my idea of fun.

Share

The Danger from Without 0

Republican looking at newspaper headline, which reads

Via Juanita Jean.

Share

Facebook Frolics 0

Serenade in blue

Share

QOTD 0

Michael Korda:

An once of hypocrisy is worth a pound of ambition.

Share

“The Smart One” 0

Turn off the oven. He’s done.

Afterthought:

Even a facade of sanity is now anathema in Republican World.

Share

Chartering a Course for Disaster 0

Share

“An Armed Society Is a Polite Society” 0

Be polite during family activities.

The 20-year-old was working with his mother on a partially disassembled .22-caliber firearm about 5:30 p.m. Monday in their garage in the 3300 block of Zamora Way, according to Stockton police.

The gun discharged, hitting the son in the face.

. . . and another gun that fires itself.

Share

In a Nutshell 0

Dick Polman sums up the Republicans’ Benghazi farce:

And, oh, how Trey Gowdy and his fellow sleuths tried and tried. I felt I was watching the Cubs again.

Follow the link for the play-by-play.

Share

Decoding de Code 0

One more time: A complaint about “political correctness” means “I want license to be nasty without penalty.”

Share

Twits on Twitter 0

Huckster twits.

Share

Still Rising Again after All These Years 0

It’s the big lie of the secesh, the big lie they tell themselves even more than they tell it to others: the big lie that the Civil War was not about slavery.

Share

The Voter Fraud Fraud 0

Cartoon lampooning Republican efforts to keep citizens from voting.

Via Job’s Anger.

Share

“Just the Facts, Ma’am” 0

Wait. No, we meant our facts, not real facts.

As my two or three regular readers know, I’m not a big fan of Hilary Clinton, but I freely admit that that has more to do with style than with substance; her substance is pretty damn substantial and her making peace with President Obama after the 2008 nomination race showed a lot of class (on both their parts, I must add).

In the case of the Benghazi Republican scamdal, I must agree with John Cole.

Share

QOTD 0

Ben Hecht:

Hollywood held this double lure for me, tremendous sums of money for work that required no more effort than a game of pinochle.

Share

“The Smart One” 0

Daniel Ruth, in the midst of a larger discussion the relationship between Marco “Rube” Rubio and Jeb! makes this telling offhand observation (emphasis added):

Trump grasps what no one else quite understood: Bush has no clue how to fight back when he gets slapped around. He’s never had to.

Share

Debtor’s Prisons 0

If you wonder why I support the ACLU, look no further.

Share

“An Armed Society Is a Polite Society” 0

I guess this is what is meant by “guarded politeness.”

Share

One’s Attire Must Suit the Occasion 0

Republican Benghazi Committee to Hillary Clinton, as they indicated a witch's costume:  Could you put it on before the hearing.  It would make things simpler.

Via Job’s Anger.

Share

In the Pink 0

The NFL is run by some of the worst people in the world.

Share

Black Coffee, Black Hearts 0

Share
From Pine View Farm
Privacy Policy

This website does not track you.

It contains no private information. It does not drop persistent cookies, does not collect data other than incoming ip addresses and page views (the internet is a public place), and certainly does not collect and sell your information to others.

Some sites that I link to may try to track you, but that's between you and them, not you and me.

I do collect statistics, but I use a simple stand-alone Wordpress plugin, not third-party services such as Google Analitics over which I have no control.

Finally, this is website is a hobby. It's a hobby in which I am deeply invested, about which I care deeply, and which has enabled me to learn a lot about computers and computing, but it is still ultimately an avocation, not a vocation; it is certainly not a money-making enterprise (unless you click the "Donate" button--go ahead, you can be the first!).

I appreciate your visiting this site, and I desire not to violate your trust.