P.S.: Meso is live!

Woo-hoo! I got my mesostic generator up & running on Django at PythonAnywhere, and it does its thing. Rock that mesostic! πŸ™‚

Here’s a sample, read through Django’s template language introduction with “Django” as the spine:

                      Document this
explains the language Just
        xml/html templAtes.
                     oNe more

                althouGh that has a
           special belOw.
                      Dot (.)
                    obJects
                    thAt
                dictioNary
                 throuGh
                     lOwer filter, which text
               β€œchaineD.” the output
                      Join
                      A list with
              list|joiN:", " }}. provides about thirty
                      Give

                     yOu

…hee, I like how it threw “chained” in there. Get it? πŸ˜› Go on now, pull the other one–it has got bells on. Make your own mesostic here: P.S.: Meso.

Side-note: I am posting this in the middle of the night because I thought it was working four hours ago (and wrote the post up to this paragraph then), but apparently when you import a module, its global variables aren’t global for its functions anymore–if program X imports program Y, program X’s global variables are the only global variables, looks like. So I had to figure that out, which took a long time because I thought it was a problem with the textarea widget or Django forms in general, rather than a plain ‘ole Python noob error. Once I found the problem, two lines fixed it up. Shiny. Don’t worry if you didn’t follow that; I had to write it out for me.

Point being, it works! Go! Allez! Make poetic nonsense!

P.S.: Meso

…is the tentative, extremely dorky,* name of my mesostic generator, which now works!

It takes either a plain text file or pasted plain text as input; strips the punctuation if you tell it to; takes the seed (spine) text that you give it; asks how many times the spine should appear; and rocks your mesostic. πŸ˜€

The result is not exactly a true mesostic – which would use a word no more times than it appears in the source text – because it can repeat a word too many times if it has to loop back through. That happens more the shorter the source text is or the more times you repeat the spine. But on the plus side, as long as it can make a mesostic with one copy of the spine (plus the first letter again), it can make as many copies as you want! For now, I’ve set a limit of 20 copies, but I can easily increase that; it’s just in case some fool tries to run the thing a million times or something. πŸ˜‰

The program also handles cases where it can’t create the full mesostic pretty gracefully – instead of just throwing a nasty error, it prints a message that says it couldn’t complete the request, then prints as much of the mesostic as it was able to make. Much nicer, right?

Now, if I can learn a bit of Django, I should be able to get the Python code working online — no JavaScript necessary (though I’d still like to rewrite it in that for my hosted site that doesn’t allow server-side code).

* “P.S.” stands for “poesis spinea” – which I hope is Latin for “spiny poetry.” You know, a poem with a spine. Bad, I know. Pretend I only meant “post-script” if you must. πŸ˜‰

Beginnings of a mesostic generator

I may or may not be making good progress on a mesostic generator (I really need a good name for this thing, like the Mesostisaur or Poeticus mesosticii or…um, something even geekier…? πŸ˜›

I think my read function is good — it takes the text from a txt file and cleans it up nicely (it does remove punctuation; hyphens within words are ok, but anything between words gets stripped away).

But I don’t have a good idea how to test the other subfunctions individually, so I’m trying to do the whole thing and then give it a go. I’m trying to make it so that it loops back to the beginning if it hits the end of the oracle (source text) before it’s done. That may mean that words get used more than once, although hopefully they won’t be repeated excessively or in the same part of the mesostic every time.

It will also abort and print the partially completed mesostic if it can’t finish with the oracle, seed (spine), and number of iterations requested. I didn’t like that the mesostomatic just threw an error…not very polite, right? πŸ˜‰

I should (fingers crossed) be able to get it printed as text in a way that you can just copy & paste it and have it look right as long as you’re in a monospace font.

This is all in Python; I have no idea how much of it I can do in JavaScript, even assuming I get this version going flawlessly. But there you go – some progress, and hope of a mesostic generator that takes plain text input instead of webpages, so you don’t get all the html tags mixed in to your “poem”!

“Genesis Revisited”

It is a good thing I was not drinking anything when I read “Genesis Revisited,” or I would have had coffee or tea all over my ereader. (I’m reading The Portable Atheist, which contains a lot of great – and some quite challenging – excerpts of various mostly atheist authors. That’s where I found those Shelley quotes, and I decided I have got to read Middlemarch due to Eliot’s chapter.)

If Ideas Had Shapes

By now the valley of the shadow of doubt was overrunneth with skepticism, so God became angry, so angry that God lost His temper and cursed the first humans, telling them to go forth and multiply themselves (but not in those words). But the humans took God literally and now there are six billion of them.

(quoted in The Portable Atheist)

View original post

Wunderkind Shelley

Do you know this poem?:

I met a traveller from an antique land
Who said: Two vast and trunkless legs of stone
Stand in the desert. Near them on the sand,
Half sunk, a shattered visage lies, whose frown
And wrinkled lip and sneer of cold command
Tell that its sculptor well those passions read
Which yet survive, stamped on these lifeless things,
The hand that mocked them and the heart that fed.
And on the pedestal these words appear:
‘My name is Ozymandias, King of Kings:
Look on my works, ye mighty, and despair!’
Nothing beside remains. Round the decay
Of that colossal wreck, boundless and bare,
The lone and level sands stretch far away.

Percy Bysshe Shelley, that is. I read it for a correspondence course in my senior year of high school, and I love it–brilliant, searingly ironic, beautifully lyric. I think I’ve posted it before – back when this blog was new and I posted a poem each Wednesday.

Did you know he also wrote this?:

Why do we admit design in any machine of human contrivance? Simply, because innumerable instances of machines having been contrived by human art are present to our mind, because we are acquainted with persons who could construct such machines; but if, having no previous knowledge of any artificial contrivance, we had accidentally found a watch upon the ground, we should have been justified in concluding that it was a thing of Nature, that it was a combination of matter with whose cause we were unacquainted, and that any attempt to account for the origin of its existence would be equally presumptuous and unsatisfactory.

and this?:

It is vain philosophy that supposes more causes than are exactly adequate to explain the phenomena of things.

You assert that the construction of the animal machine, the fitness of certain animals to certain situations, the connexion between the organs of perception and that which is perceived; the relation between every thing which exists, and that which tends to preserve it in its existence, imply design. It is manifest that if the eye could not see, nor the stomach digest, the human frame could not preserve its present mode of existence. It is equally certain, however, that the elements of its composition, if they did not exist in one form, must exist in another; and that the combinations which they would form, must so long as they endured, derive support for their peculiar mode of being from their fitness to the circumstances of their situation.

and this?:

That certain animals exist in certain climates, results from the consentaneity of their frames to the circumstances of their situation: let these circumstances be altered to a sufficient degree, and the elements of their composition must exist in some new combination no less resulting than the former from those inevitable laws by which the Universe is governed….

and this?:

If we found our belief in the existence of God on the universal consent of mankind, we are duped by the most palpable of sophisms. The word God cannot mean at the same time an ape, a snake, a bone, a calabash, a Trinity, and a Unity. Nor can that belief be accounted universal against which men of powerful intellect and spotless virtue have in every age protested….

Turns out he got expelled from Oxford for writing a tract advocating atheism, and wikipedia claims that publishers were afraid to print his writing, throughout his life, lest they be punished for it. Oh yeah, and Shelley wrote the work these quotes are from in 1814. He was a little ahead of the curve, you might say.

…Also, seriously? Shelley was arguing 200 years ago against the very same design arguments that are still trying to insinuate themselves into classrooms today? (sigh)