Skip to main content

Posts about programming (old posts, page 12)

Introducing Regular Expressions

Done with Introducing Regular Expressions, by Michael Fitzgerald.
The subtitle, of the book says it all.

Unraveling Regular Expressions, Step-by-Step

Michael is a funny, patient and pithy author.

The book breaks down the basics of Regular Expressions into its components and then walks through explaining them in examples, line by painstaking line.
Any book that uses Coleridge to teach me Regular Expressions is awesome, so I’m biased :)

Definitely worth a read if you are brand new to the powerful world of RegEx.

Python Regular Expressions - Real World Projects

Did this short course to get myself upto speed with Regular Expressions, since the books I was trying to read were not quite doing it for me.
It’s short, sweet and extremely thorough.

After this I don’t quite know regex, but I’m no longer lost at sea.

I’ve now picked up a book and I get what they are talking about now.
The book and lots of practice, should get me to where I want to be with Regular Expressions.
I’m sweating this, because I’ve realised, this is an important skill, I need to have.

A Hundred Days of Code, Day 029

Awfully proud of myself today.
I wrote little program to scratch an itch, I had.
It’s still rough, but it does what I want it to, and that makes me happpy.
I go to Poetry Foundations’ Poem of the Day ever so often to catch a poem.
And I wondered, what if the daily poem showed up in my RSS reader everyday?
I searched and unfortunately couldn’t find a feed.

So I did the next best thing.
Armed with my newly acquired, Python knowledge, I set out to see if I could just get a link to a new poem daily.
And what I ended up doing was writing a program, that scraped the webpage metadata for the date, compared it to today and if it was, created a baby xml feed for me, that I have now put into my reader.

It’s a blank entry. The title takes me to the poem foundations page, so I don’t miss a day.
I put the program on my linode and then scheduled a cron job that runs the script once a day and moves the xml file to the appropriate place.
Today’s run was brilliant. Let’s see if it holds up tomorrow.

Right now it just overwrites the current item, since that is all I need.
But I could also look at building a list of daily items, if I so desire, later.
I need to just show up every day, for this positive ratchet to continue.
Like Seth says,

The hard part is “steady.”

Anyone can go slow. It takes a special kind of commitment to do it steadily, drip after drip, until you get to where you're going.

The code as usual, is here on Gitlab and Github1

  1. I still have to document it. But I will save all that for another day. More practice to do!