“On Cowper’s Grave” by Elizabeth Barrett Browning

COWPER’S GRAVE

I.
It is a place where poets crowned may feel the heart’s decaying;
It is a place where happy saints may weep amid their praying;
Yet let the grief and humbleness as low as silence languish:
Earth surely now may give her calm to whom she gave her anguish.

II.
O poets, from a maniac’s tongue was poured the deathless singing!
O Christians, at your cross of hope a hopeless hand was clinging!
O men, this man in brotherhood your weary paths beguiling,
Groaned inly while he taught you peace, and died while ye were smiling!

III.
And now, what time ye all may read through dimming tears his story,
How discord on the music fell and darkness on the glory,
And how when, one by one, sweet sounds and wandering lights departed,
He wore no less a loving face because so broken-hearted,

IV.
He shall be strong to sanctify the poet’s high vocation,
And bow the meekest Christian down in meeker adoration;
Nor ever shall he be, in praise, by wise or good forsaken,
Named softly as the household name of one whom God hath taken.

V.
With quiet sadness and no gloom I learn to think upon him,
With meekness that is gratefulness to God whose heaven hath won him,
Who suffered once the madness-cloud to His own love to blind him,
But gently led the blind along where breath and bird could find him;

VI.
And wrought within his shattered brain such quick poetic senses
As hills have language for, and stars, harmonious influences:
The pulse of dew upon the grass kept his within its number,
And silent shadows from the trees refreshed him like a slumber.

VII.
Wild timid hares were drawn from woods to share his home-caresses,
Uplooking to his human eyes with sylvan tendernesses:
The very world, by God’s constraint, from falsehood’s ways removing,
Its women and its men became, beside him, true and loving.

VIII.
And though, in blindness, he remained unconscious of that guiding,
And things provided came without the sweet sense of providing,
He testified this solemn truth, while phrenzy desolated,
—Nor man nor nature satisfies whom only God created.

IX.
Like a sick child that knoweth not his mother while she blesses
And drops upon his burning brow the coolness of her kisses,—
That turns his fevered eyes around—“My mother! where’s my mother?”—
As if such tender words and deeds could come from any other!—

X.
The fever gone, with leaps of heart he sees her bending o’er him,
Her face all pale from watchful love, the unweary love she bore him!
Thus woke the poet from the dream his life’s long fever gave him,
Beneath those deep pathetic Eyes which closed in death to save him.

XI.
Thus? oh, not thus! no type of earth can image that awaking,
Wherein he scarcely heard the chant of seraphs, round him breaking,
Or felt the new immortal throb of soul from body parted,
But felt those eyes alone, and knew—“My Saviour! not deserted!”

XII.
Deserted! Who hath dreamt that when the cross in darkness rested,
Upon the Victim’s hidden face no love was manifested?
What frantic hands outstretched have e’er the atoning drops averted?
What tears have washed them from the soul, that one should be deserted?

XIII.
Deserted! God could separate from His own essence rather;
And Adam’s sins have swept between the righteous Son and Father:
Yea, once, Immanuel’s orphaned cry His universe hath shaken—
It went up single, echoless, “My God, I am forsaken!”

XIV.
It went up from the Holy’s lips amid His lost creation,
That, of the lost, no son should use those words of desolation!
That earth’s worst phrenzies, marring hope, should mar not hope’s fruition,
And I, on Cowper’s grave, should see his rapture in a vision.

—–

Jesus cries, “My God, why have you forsaken me?” so that no one else would ever have to.

Posted in Christianity, Hymns | Comments Off

Reading Hebrews: Chapter 1, verses 1 to 4

My small group at church is currently going through the book of Hebrews.  Hebrews presents Jesus Christ as the supreme revelation of God with a special focus on showing how Christ is superior to the Old Testament covenant of works – that is, the law.  I thought I’d write up a few of my thoughts and notes as I read through the book.

Hebrews 1:1-4 (ESV):

Long ago, at many times and in many ways, God spoke to our fathers by the prophets, but in these last days he has spoken to us by his Son, whom he appointed the heir of all things, through whom also he created the world. He is the radiance of the glory of God and the exact imprint of his nature, and he upholds the universe by the word of his power. After making purification for sins, he sat down at the right hand of the Majesty on high, having become as much superior to angels as the name he has inherited is more excellent than theirs.

The author contrasts several ways in which Christ as the revelation of God is superior to the Old Testament revelation.

Category Old Testament Christ
Time “Long ago” “these last days”
Circumstances “at many times and in many ways” “by his Son”
Recipients “our fathers” “us”
Agents “the prophets” “by his Son”

Since the author uses the phrase, “our fathers” we know that the author and the audience somehow identify as Hebrew. The author’s reliance upon the LXX (the Septuagint; the Greek translation of the Old Testament) possibly identifies the audience as Hellenistic Jews.

The author’s use of “these last days” shows us that Christ’s death and resurrection mark the beginning of the “last days” – that is to say, we are currently in the last days. Hebrews 9:26 reads, “But as it is, he has appeared once for all at the end of the ages to put away sin by the sacrifice of himself.” 1 Peter 1:20 reads, “He was foreknown before the foundation of the world but was made manifest in the last times for the sake of you”. Finally, in Peter’s sermon in Acts 2 he identifies the pouring out of the Spirit on the day of Pentecost with the “last days” prophesied in Joel.

Kim Riddlebarger has a sermon series on Hebrews and in his sermon on these verses he identifies seven characteristics of Jesus that these four verses describe:

  1. Jesus Christ is the heir of all things (Psalm 2:8; cf. Matt 21:38)
  2. Jesus is the creator of all things (cf. John 1:3, Col. 1:16)
  3. Jesus is the radiance of the glory of God (cf. 2 Cor. 3)
  4. Jesus is the exact imprint of his nature
  5. Jesus sustains all things
  6. Jesus sits down at the right hand of the Majest on high (unlike the continuing Aaronic sacrifices, Jesus’ sacrifice is once and for all)
  7. Jesus has inherited a better name than the angels (He alone sits at God’s right hand which means he possesses the authority of God)

From these attributes we can see that Jesus is certainly superior to angels (mediators of the Old Testament covenant and law). This superiority the author will elaborate further in the rest of chapter 1.

Posted in Bible, Christianity | Comments Off

Installing and using Tesseract 2.04 on Mac OS X 10.6.6 with Homebrew

Tesseract is a program that does OCR – optical character recognition. The goal is to take a picture of text and transform it into text; e.g. you scan a page of a book and it will turn it into editable text. Note, Tesseract does not do layout analysis so a two column layout might confuse Tesseract. Also, the input image must be within certain parameters and Tesseract will not convert it for you nor will it complain too much if you give it a bad image; it will just fail to output the text.

To actually use Tesseract, you’re going to want to install ImageMagick to get the command line utility `convert`. The best way to do this is with homebrew which in my experience has been a thousand times better than MacPorts. Basically, homebrew does not clobber the system stuff, does not install to /opt/ or any other weird place, and does recognize system compilers and X libraries and things like that…

Anyways, let’s start:

1) Install imagemagick

brew install imagemagick

Imagemagick has jpeg, libtiff, little-cms, jasper as dependencies, but all of these are also in homebrew and will install automatically.

2) Install tesseract

brew install tesseract

Tesserat depends on libtiff, which should have been installed when you installed imagemagick. Pretty straight forward.

After these two steps you should have the `tesseract` command-line program and the `convert` command line program.

3) Acquire an image

I just copied a selection from a PDF that I was reading for class. This PDF is a scanned book and had two columns (both pages). I saved it as a PNG with 200 DPI. (I also read a tip to save the PNGs without an Alpha layer – I’m pretty sure TIFFs don’t support Alpha channels so I think that will just go away in the conversion process anyways.) The image is below:

4) Convert the image to a TIFF

It doesn’t really matter what file format you capture your image in, but it has to be high-res enough – the 200-300 DPI range should do. If your source image is not within that range, you will have to resample the image at a higher DPI. Anyways, this is where ImageMagick comes in:

convert -density 200 -units PixelsPerInch -type Grayscale +compress test.png test_input.tif

Now, the -density and -units is telling ImageMagick we want the output file to be 200 DPI. These must be there even if your input file is 200 DPI – when I ran it without these options I got a file that had a much lower DPI (72 I think) which Tesseract cannot use. The -type Grayscale makes sure to remove colors from output image. Tesseract doesn’t really handle colors too well, but handles black and white great. And since the image is pretty much just black text on white paper this isn’t a problem. The +compress option must be there as well – I’m still reading up on ImageMagick and don’t know a whole lot about the TIFF format but without it tesseract will not be able to open/process the input image file. For whatever reason WordPress did not like the TIFF file so there is no thumbnail.

5) Run tesseract

I ran tesseract with the following command:

tesseract test_input2.tif output2 -l eng

The -l option specifies a language, and, if you installed through homebrew, there will be a number of language data training packs installed in the correct place. Tesseract may default to English but I like being explicit. Here is the text output:

Certainly theology needs empirical facts and scientific theoretical
insights. The social scientists offer help. Yet they do not accomplish
what l must now attempt. My main question is where and how the
church must stand to be the witnssing church; that is, what must be
the relation between the culture that is the church (and the larger
Christian and biblical metaculture the church represents) and those
cultures the church indwells, evangelizx, serves? Answering will
require all the resources that Christian theology can bring to bear, and
not a little help from such as Berger and Bellah as well. Already they
have showed us, willy»nilly that theology is required for the task: they
make such ample (and often skillful) use of it, themselves!

So, a few basic mistakes will be caught by a spell-checker. There is a lowercase L instead of “I”. Overall, I’m pretty happy with the results.

Tesseract works great; fussing with the input image is the most difficult part. But some reminders: the input must be a TIFF (and .tif at that), must be grayscale, and have between 200 – 300 DPI.

OCRopus and many other frontends solve many of these problems by using the tesseract engine with a GUI. OCRopus is not on homebrew, and only one of the dependencies for OCRopus (iulib) is not on homebrew. I’ll start working on a homebrew formula for iulib and the OCRopus and write it up in a new post. Also, there is a perl module called Image::OCR::Tesseract that I’ll be testing on my system and maybe extending.

Posted in Uncategorized | Comments Off

Fixing up Math::Primality – Part 1

Math::Primality is my one and only CPAN module, a result of my Google Summer of Code work almost two years ago. I was surprised about 10 months ago to get an email requesting features – I can’t believe someone is actually using this stuff! Well, I’ve put it off for a while so this weekend instead of doing homework I finally knocked out a few things on my todo list.

The main feature is more test coverage. We implemented some optimizations – for numbers of certain sizes there are actually simpler conditions to check. This optimization results in a speedup but the test suite no longer actually exercised some of the more complex code. To fix this, I had to find specific numbers that would exercise each condition. I use Devel::Cover and prove to check exactly what code was being exercised:

1) cover -delete

Not strictly necessary, but it’ll delete any previous coverage statistics

2) PERL5OPT=-MDevel::Cover prove -Ilib t/*.t

This runs prove, adds the ‘lib’ directory to my search path, and tells it to run every test in the t/ directory. Including Devel::Cover will automatically generate the coverage statistics.

3) cover

This will take the output and generate some pretty HTML. Each line is annotated with coverage statistics, and each conditional statement is annotated with how many different combinations of statements it has been tested with.

I’ve also converted the README to POD because GitHub supports rendering POD inline. Finally, I’ve run the entire module through perltidy (configuration from http://www.leifove.com/2011/02/why-i-use-perltidy-or-why-coding-style.html) to beautify the setup.

Next steps: run Perl::Critic and convert the distribution to use Dist::Zila. After that, I will begin work on Math::Primality::AKS.

Posted in Uncategorized | Comments Off

Reforming my Mac – Part 2

I finally got `perlbrew` installed. It’s a utility like `rvm` that allows you to manage multiple installations of perl without clobbering your system files. I followed the instructions from here: http://www.pythian.com/news/19971/guerilla-perl-installations/

1) Run curl -L http://xrl.us/perlbrewinstall | bash

Just a fancy way of getting the install script and running it.

2) Run /Users/bob/perl5/perlbrew/bin/perlbrew init

Your home directory will vary, but this will setup perlbrew to work with your shell. At the end of this process there will be instructions on adding this to your .bashrc or .bash_profile.

3) Add “source /Users/bob/perl5/perlbrew/etc/bashrc” to the end of ~/.bash_profile

I don’t have a .bashrc, and I know there is some subtle difference between the two files but they are both run when you start a shell.

4) Run perlbrew install perl-5.12.3

There were actually two failing tests on my machine, so I had to run it with –force. Also, this command will not show the progress of the install, so if you want to follow along you’ll have to open up another terminal and tail the output of the build log.

5) perlbrew switch perl-5.12.3

This selects 5.12 as your current perl.

6) perlbrew install-cpanm

This will install CPANM. I recommend using it over regular CPAN and CPANPLUS.

7) cpanm Test::More

This installs Test::More. Note you don’t need to type `cpanm install Test::More` as this will install a module named “install”. I have yet to run into a module that will not install in cpanm but will install in CPAN.

I can now switch between my system CPAN (which is 5.10.0 on my Mac) and the 5.12.3 that I installed. Another good feature of perlbrew is that it does not require sudo permissions to install, and keeps all of the installed files in your home directory.

Posted in Uncategorized | Comments Off

Reforming my Mac – Part 1

For my previous job I needed to setup a development environment on my mac which required some packages like PostgreSQL, ImageMagick, and some other packages. I started using MacPorts and eventually found a GUI for it called Porticus. I mostly used the command line `port` but every now and then Porticus was easier to manage.

The problem with MacPorts, at least the way I did it, was that I needed to run everything under `sudo`. Furthermore, MacPorts required me to install a new copy of X11 even though I had one from Apple.

Enter Homebrew.

I heard about Homebrew a while back and a previous coworkers nuked his MacPorts installation and switched over to Homebrew. So I finally took the plunge.

Read more »

Posted in Uncategorized | Comments Off

Parrot on RTEMS: Out of directory building, part 2

Well, the bad news is that the “hard” deadline is coming up next Monday. The good news is that I’m making progress. I will not make my original goal of having a cross-compiled Parrot testing on RTEMS. What I do have currently is the “secret sauce” that allows the Parrot configuration to do a minimal cross-compilation. I’m currently working on getting 1) Parrot to build out of directory and 2) Parrot to target multiple platforms. If you haven’t been following, my patches allow Parrot’s configure script to run from a separate directory, run all tests outside the source directory, and generate all configure time files outside the source directory. I am currently working on fixing the Makefile so we can actually build i.e. run `make`. This is a pretty monumental problem as there are multiple problems – paths in the Makefile, perl scripts that run from the Makefile to generate more files, separate included Makefiles, and all Makefiles are actually templates that are created at configure time. My latest push allows us to run a few steps in the Makefile but there are still miles to go.

Posted in Google Summer of Code | Comments Off

Parrot on RTEMS: Out of directory building

Sorry it’s been such a long time since I’ve given an update. After a long discussion with one of my mentors we’ve decided to switch focuses and knock out a few minor Parrot features that would help us immensely. Currently I’m working on getting Parrot to build out of directory. Currently Parrot assumes that we are building in the same directory our source is in which, while it works, means we get our executables (and compiled objects) intermingled with our source and other files. Also if we wanted to have two versions of Parrot from a single source (say with different Configuration options) it seems nigh impossible unless we have two copies of the source. Our of directory building will allow us to do something like:

mkdir build
cd build
perl ../Configure.pl
make

And we’d have our build separate from our source code.

Those first three steps are now possible with a set of patches to the Parrot configuration code. Now all that remains is to copy the source code to the build directory so we can just run `make`. I’ve tested configuring out of directory and building in directory and you get exactly the same Makefile and build and it passes all coding tests. The patch right now is a bit ugly and should be refactored into a separate module.

After this is done, I’ll work on getting a mechanism to copy over all the source so we can do a full build out of directory. Hopefully this will be committed to the source, and I can begin working on getting Parrot to cross-compile. Since I’ve already got Parrot compiling with the RTEMS tool-chain, after all this is done I’ll create a bootstrapping Perl script that’ll help install the source, get you a system copy of Parrot, a RTEMS cross-compiled copy and build libparrot for linking.

Posted in Google Summer of Code | Comments Off

Parrot on RTEMS: Parrot Configuration is Clean

This week for the Google Summer of Code, I finished work on getting Parrot to configure cleanly. The latest commit can configure Parrot without any errors. The long and the short of it is that the configure steps and hints file is completed although several of the hints are currently hard-coded in. Next week I will focus on getting the build to complete without errors. A quick refresher:

Parrot does not come with a Makefile but comes with a Perl script called Configure.pl that runs a number configuration of steps. One steps determines what CPU and architecture we are running, one checks for the sizes of native types like ‘int’ and ‘float’ and ‘double’. Some steps wrangle templates to generate Makefiles and source code while others compile programs to check how a system compiler actually handles certain pieces of code. Essentially these steps capture all the information necessary to configure Parrot to compile correctly on whatever system we are running.

The problem is that with RTEMS our development system will not necessary be the same architecture as the target platform. For example, I’m running Fedora Core 12 on x86 but my code and compilers target sparc. So these automated tests won’t run. We need some secret sauce to get Parrot to compile on different hardware architectures for RTEMS.

The first part of the secret sauce was overriding the default compiler, linker, and other parts of the tool chain. This was simple because Configure.pl can accept the overrides not only through the command line, but we can also specify an external file to hold our entire configuration recipe. This helps keep things organized, makes it easier to generate, and avoids the problem of a max command line argument length.

The second step was to disable as many of the auto configuration steps as possible. Again, this was simple because the external file can also specify which steps we want to skip. Last week I disabled every step which generated a lot of errors from the configuration script. Reading these errors showed me exactly what information was necessary and from there I could either provide the information in a hints file (in lieu of running the step) or I could re-enable the step (if it didn’t run hardware dependent code).

This week I finished the hints file and removed the last remaining configuration bugs. That means Parrot can now run the Configure.pl script with RTEMS variables and Configure.pl will generate a Makefile and not throw any errors. It’s not time to celebrate quite yet – many of the values are hard-coded into the hints file rather than probed from the RTEMS. And the build still hangs on a few wrong values in the hints file.

To alleviate the first problem would require a re-write of the secret sauce with either autoconf or with perl. Autoconf would be nice because RTEMS already uses it and there are probably many examples of how to get exactly the information I want. Perl would be nice because I already know the language unlike autoconf / m4.

A rewrite is definitely in the future, but for now I will work on getting the build clean and a ‘Hello World’ example in PIR running before that. Once I’ve worked out all of the problems there I will begin to work on getting the Parrot test suite running, rewriting the secret sauce, testing multiple hardware configurations, and then even playing with High Level Languages (HLLs) that run on top of Parrot like Rakudo (Perl 6 on Parrot) or Cardinal (Ruby on Parrot). Finally, I’d like to round things out with a series of tutorials (or even screencasts) showing how to install RTEMS, Parrot, and some HLLs on a blank target environment.

Posted in Google Summer of Code | Comments Off

Parrot on RTEMS: Hint Hint!

I am continuing work to port Parrot to run on RTEMS. The “secret sauce” is in configuring Parrot to use the correct compilers, linkers, etc. Because we are doing cross-platform development, that means our host system will most likely not have the same architecture as the target system. For example, I am currently working on an x86 system but, in targeting an embedded sparc system, have sparc variants of gcc, ld, and so forth. We must tell parrot to compile with those variants rather than the system default.

The good news is that this step is mostly complete. The configure script now recognizes which compilers we must use, and, best of all, this information is generated based on the RTEMS installation that you have (rather than a static recipe).

Parrot’s configuration, however, is more than just to determine which compiler to run but also includes automatic probes for architecture specific information, such as byte order or the size of an int. Since our target architecture is not our host architecture, we can compile these automatic probes but we cannot run them. So the hints file will contain all of the information that we need to compile Parrot but can’t figure out on our own.

Work on the hints file has begun by first overloading the standard libraries that are linked to. Again, this is because the host architecture (with which the libraries are built against) is not the same as the target architecture and we need a few RTEMS specific libraries as well.

Right now the configuration script runs but errors on a few of the steps. I hope that by next week the entire configuration script can run and we can begin trying to build Parrot on RTEMS.

As always, you can track progress at my github repository for the project or pinging me on IRC… look for bubaflub hanging out on #RTEMS on freenode or #Parrot irc.perl.org.

Posted in Google Summer of Code | Comments Off