Archive

Author Archive

Tidey Source

September 12, 2010 2 comments

I thought I might make a little money on Tidey through ads, but in the last 9 months or so I’ve made a whopping $14.74. So I figured I might as well just release the source and see if anyone finds it useful. (read more about Tidey in my previous post.)

You can view the Tidey source on Github.

Google Script

August 20, 2010 Leave a comment

I wanted to learn a little about Google Script. I discovered a site that has the vocabulary list from Latina Christiana I in a table in HTML. I was pleasantly surprised that this pasted nicely into a Google spreadsheet.

But the first column had extra stuff in it that I didn’t want in that column. Gee, I thought, wouldn’t it be nice to be able to just run a simple regular expression on that column to remove everything after the comma?

So yes, it is possible and really not very difficult to do. And here is my solution:

function stripAfterComma() {
 var range = SpreadsheetApp.getActiveRange();
 var values = range.getValues();
 var results = [];
 for( j in values ){
   var row = [];
   for( i in values[j] ){
     var new_value = values[j][i].match( /^[^,]*/ )[0];
     row.push(new_value);
   }
   results.push(row);
 }
 range.setValues( results );
}​

And Voila my spreadsheet can now be pasted into Quizlet and used to learn those vocabulary words. Have fun with the quiz.

Categories: Programming

Daily Scripture Reading

July 19, 2010 2 comments

I’ve been trying to follow the Orthodox lectionary readings with my family each morning at breakfast. Often times I forget or don’t have time to go look them up. So I wrote this little script that goes out and gets them and prints them. I have an entry in my crontab file that runs this script at 6:30am each morning. Running this from cron requires that you have Xvfb installed. The crontab entry looks like:

30 6 * * * xvfb-run /home/brian/bin/scripture.py

Here is the scripture.py python script:

#!/usr/bin/python

import feedparser
import os
import time

f = feedparser.parse('http://onlinechapel.goarch.org/daily-rss.asp')
for s in f['entries']:
    if 'epistle' in s.link or 'gospel' in s.link:
        os.system("firefox -P Brian -print '%s'" % s.link)
        time.sleep(5)

Using Firefox to print in this manner requires installing the Firefox Command Line Print extension.

You can follow the lectionary readings from the Saint Paul Orthodox Church website.

Categories: Christianity, Programming

Highlighting Two New Sites

May 13, 2010 1 comment

On this day, the Feast of the Ascension, I would like to draw your attention to two new sites, neither of which I was involved in.

First, Journey to Orthodoxy was announced yesterday. The site is beautiful and is loaded with excellent and inspiring content.

And also, the Patristic Christian Theology Search Engine, which is based on the excellent work done by CCEL, but provides an innovative user interface for searching just the Fathers.

UPDATE (9:41EST):

I’d also like to draw your attention to a beta launch of a a site my employer, 5Q, developed called Church Juice. It looks like there is a lot of good information there for church communications.

Categories: Weblogs

Sheepology Sprint

April 20, 2010 3 comments

My employer, 5Q Communications, is very generous.  Normally we get to use 1 hour out of our regular work time for learning something of our choice that will benefit the company. This quarter all full-time employees were given 8 hours of extra learning time as a reward for meeting our company-wide goal for milestones.

I have chosen and been approved to use my 8 hours in one lump to work on adding some new features to my open-source project Sheepology. Since the goal here is to learn something, I plan to add features using technologies I haven’t used and don’t know yet.

Since this is a sprint I’ll create a list of things I want to do that is longer than what I have time for and work through the list till I run out of time. I want to have my projects planned well in advance so I won’t waste my 8rs. I also need to import some membership data before the sprint.  On my list are the following.

  • Donations using Google Checkout, Paypal, or similar
  • Integration with Google Apps including things like single-sign-on, contact synchronization, menu integration, etc.
  • Integration with Facebook using Facebook Connect or something similar
  • producing printable reports using something like Geraldo Reports
  • inter-parish/diocesan communication via AMQP (see qpid or rabbitmq)

That should be quite a bit more than I can do in 8rs.

Categories: sheepology

Sheepology Finally in Production

April 11, 2010 Leave a comment

Sheepology is finally in production. You can see it at Saint Paul Antiochian Orthodox Church.

Sheepology started as a church management system, but its first purpose in this rollout is as a content management system. Over the coming weeks I will be importing membership data and beginning to use the church management aspects of it. Other content based features will also be built as we find we need them.

I am also considering renaming the project to something a little less cutesy.

Other things that need to be done before I call it beta quality are documentation and improved installation procedures.

Categories: sheepology

Family Blog

You can follow our family blog at Genesis 12:1… the escapades of an Orthodox Christian homeschooling family living in South West Florida.

Categories: Uncategorized

About Tidey

December 19, 2009 1 comment

I’d like to introduce Tidey.

Tidey is a tide prediction application that uses xtide to make tide predictions and provides a fun web UI.

Tidey is a 3-fold personal experiment. The goals I had/have for Tidey are:

  • Build a project using pure Tornado (i.e. not mixed with Django) to evaluate it
  • Practice using RaphaelJS and JSON
  • See what kind of advertising revenue a simple site can generate with a small amount of work

Tornado is cool, but only for certain applications. I wouldn’t want to build an application like a church management system using Tornado. Django provides the absolutely amazing built-in admin tool that is indispensable IMHO. Tornado has no such thing. That said, Tornado is useful for certain types of applications and used in conjunction with Django could prove very useful. For this application I am using it to asynchronously run xtide in the background. The server itself is a single thread process.

Raphael JS is very cool.

Only time will tell on the advertising.

I spent about 20-30 hours on this project. I would still consider it beta.

Categories: Programming

Asynchronous Shell Commands with Tornado

November 29, 2009 13 comments

I’ve been playing around with Tornado a bit and wanted to asynchronously call a long-running shell command without blocking the server process. Here is my solution.

Running this server I am able to visit http://localhost:8888/test/ numerous times while a request for http://localhost:8888/ is waiting for the command to finish. The beauty of this is that this is a single process with a single thread. With a process this light and fast, a relatively large number of applications can be crammed into a $10/mo hosted account.

#!/usr/bin/env python
import os
import tornado.httpserver
import tornado.ioloop
import tornado.web

class MainHandler(tornado.web.RequestHandler):
    @tornado.web.asynchronous
    def get(self):
        self.ioloop = tornado.ioloop.IOLoop.instance()
        self.pipe = p = os.popen('sleep 5; cat /etc/mime.types')
        self.ioloop.add_handler( p.fileno(), self.async_callback(self.on_response), self.ioloop.READ )

    def on_response(self,fd,events):
        for line in self.pipe:
            self.write( line )

        self.ioloop.remove_handler(fd)
        self.finish()

class TestHandler(tornado.web.RequestHandler):
    def get(self):
        self.write('this is a test')

application = tornado.web.Application([
    (r"/", MainHandler),
    (r"/test/", TestHandler),
])

if __name__ == "__main__":
    http_server = tornado.httpserver.HTTPServer(application)
    http_server.listen(8888)
    tornado.ioloop.IOLoop.instance().start()
Categories: Programming Tags: , ,

We’re off to see the Scientist

November 25, 2009 Leave a comment

If you haven’t heard about the ClimateGate scandal, then you’ve been hiding under a rock.

Late last week hackers penetrated systems at the Climate Research Unit (CRU) at the University of East Anglia in the UK. The CRU is considered something of a global hub for climate-change “science.” What the released email revealed is that climate scientists have been deliberately deceptive and scientifically disingenuous in their campaign to stop “climate change.” Contrary data has been concealed or even tampered with to hide evidence contrary to climate change theories.

Science in the strictest sense is the objective application of the scientific method (i.e. observation, hypothesis, testing, lather-rinse-repeat). A scientist is someone who is understood to objectively follow the scientific method. But for the average lay person science is “whatever scientists say.” The average lay person doesn’t understand the advanced mathematics behind the climate models and thus can never really understand the “science.” He has to trust the scientist to tell him what he knows. That is “science.”

In today’s world “science” is held in very high regard. Few dare to question the teachings of “science.” “Science” has produced space travel, the internet, modern health-care, and other wonders too numerous to mention. But what people haven’t realized en masse is that “science” is really a matter of faith… in scientists.

Even though we can see the evidence of many scientific successes, entire fields of “science” do not produce tangible results. The present case of climate change “science” in particular is a purely speculative theory with no possibility of proof (and consequently it does not follow the scientific method). Similar examples are string theory, Darwinian evolution, and big bang theory.

While on the one hand we are given many tangible wonders like iPhones and cars to dazzle the mind and lend “science” credibility, on the other hand we are fed unproven theories as factual doctrine.  While the wizards of science put on a wondrous show for us with all the whiz-bang gadgets, when we pull back the curtain we see only a fraud.

There is no wizard.

There is no scientist.

Categories: Current Affairs Tags:

Sheepology Structure

November 13, 2009 Leave a comment

sheepologyThings have changed a bit since I last created a structure diagram for Sheepology. This graph was generated by django-command-extensions and Graphviz.

Sheepology Version Control

November 12, 2009 Leave a comment

Version control seems to be broken in the demo right now. It’s probably due to all the version changes of Django and such that have happened since last I test this feature.

UPDATE: Versioning is fixed. I had to install django-reversion 1.2 so it would work with Django 1.1.1.

Categories: Uncategorized

Sheepology Updates

November 11, 2009 2 comments

I just rolled out an update to the Sheepology demo. Many changes have taken place since this demo was last updated:

  • Content management system – I needed this ASAP so it was what I’ve worked on for the last month or so.  It doesn’t have a lot of features right now, but has an architecture that I am very happy with and is highly extensible.
  • Revamped the communications architecture.
  • Generalized the Flex-based visual tree editor so that it could be used with more than just groups. It is now being used for content categories as well. (I would actually like to rewrite this in Javascript now that I have played with raphael.js)
  • Added version control for pretty much anything of importance (people, groups, events, content, etc.) using django-reversion. You can easily restore deleted people, content, whatever, or revert to previous versions.
  • Updated the theme to the latest version of Grappelli
  • Optimized some queries
  • Got the whole thing running under Tornado instead of Apache. It now uses much less memory and runs in a single process. In theory it should be very fast but I haven’t load tested it yet.

I hope to role this out into production in my church (the “public” site in the demo is a previews of the site I’m doing for my church).

The list of features I want to add is growing faster than the list of items completed, but I think I need to get something into production and get it field tested before going too much further.

More on The Kindle

I take back everything nice I said about the Kindle.  Don’t buy one.

This morning, hundreds of Amazon Kindle owners awoke to discover that books by a certain famous author had mysteriously disappeared from their e-book readers. These were books that they had bought and paid for—thought they owned.

Read more at Some E-Books Are More Equal Than Others. Apparently Amazon can delete books right off your Kindle without your permission. And yes, they did refund the purchase price of the book, but that is little recompense for their intrusion. The irony of it all is that the revoked book is George Orwell’s 1984.

I decided after using if for a while I liked it and could get used it using it. But I have also come to the realization that paper is a really ingenious technology. Suppose you want to spread out several reference works on your desk while you are studying? You can’t do that with a Kindle.

Paper is good.

Categories: Uncategorized

Scripting Gnome

I wanted to automate some things on my Gnome desktop and being rather fond of Python, I thought that I would start there and see what I could do. My first task was to change the Gnome Panel from one screen to another automatically. I have a dual monitor setup and I want to automate the panel moving from one to the other.

I did a little research and came up with this little script that does the job. It simply toggles the panel between screen 0 and 1. I had no idea it would be this simple.

import gconf

path = ‘/apps/panel/toplevels/panel_0/monitor’

gc = gconf.client_get_default()
cs = gconf.ChangeSet()
cs.set_int( path, not gc.get_int(path) )
gc.commit_change_set(cs,True)

Categories: Uncategorized

Sheepology Update

June 24, 2009 3 comments

I finally started working on Sheepology again. I decided that the next order of business is a content management system (CMS). I have spent the last couple months working with Ellington and Jazbox here at the Naples Daily News and have developed strong feelings about these systems and consequently a vision for something better. Coupling this knowledge with my experience of Joomla and Bricolage, I think I have a pretty good idea of what a good CMS should be. (Bricolage is by far my favorite CMS, but not very friendly). And hey, Django was designed as a framework for building content management systems, so I’ve already got a good start.

In addition, the church I am attending has a strong need for a new website. I would like to use Sheepology to do that. Initially the integrated CMS will be simple so that I can get something out the door, but I do have a vision for something larger.

All that said, without thinking about it I packed away my desktop computer into my trunk to free up space on our camper’s kitchen table. Shari got a laptop and I decided that we no longer needed to have the whole desktop taking up all that space. So before I thought to commit my changes I tore it all down.

Thankfully we should close on “our” house by the end of July and all will be well.

Kindle 2

I have an opportunity to play with an Amazon Kindle 2 for a while. I’m not supposed to buy any books since it’s on the company card, but there are oodles of free books out there.

I’m a big fan of Christian Classics Ethereal Library CCEL, so I wanted to see if I could get any of their books onto this Kindle. It turns out that many if CCEL’s books are available in the online store for a nominal fee, but having been mandated not to buy anything I decided to see if I could go a different route.

I started out by downloading a PDF from CCEL and trying to convert that. That was not as easy as I thought it would be. You’re supposed to be able to send an email to a service on Amazon and have it converted, but apparently my address was not approved for that. So I installed Calibre. That actually worked pretty well. It converted the PDF to a .mobi file and then I was able to drag it onto the USB Kindle “drive.” Unfortunately, the formatting is really not that great.

It turns out that the easiest way to do this is to simply use a plain old .txt file. CCEL has .txt files for everything so I downloaded one (Eusebius’ Ecclesiastical History) and stuck it on the Kindle. Really bad formatting. No biggie because it’s just a .txt file. I can mangle it all I want with Python or Perl. So I put this little script together and it makes a very readable book on Kindle.

#!/usr/bin/env python
import re,sys

for line in file( sys.argv[1] ):
    if re.match('\s+$',line):
        print '\n'
    else:
        # shrink strings of spaces to one
        line = re.sub('[ ]+',' ',line).strip()
        # shrink strings of repeating characters
        line = re.sub(r'(.)\1{39,500}','\n'+r'\1'*40+'\n',line)
        print line,
Categories: Books, Programming

My Mac

April 30, 2009 Leave a comment

I’ve been using a Mac now for a week. This is the first time in my life that I’ve actually used a Mac for anything serious or for an extended period of time. I vowed to give it a chance for at least a couple weeks before I install Ubuntu.

The hardware is exceptional. I have a 17″ MacBook Pro with 4G ram and about 300G disk. The screen is beautiful, the touchpad is the only touchpad I’ve every gotten along with, and surprisingly the chicklet keyboard isn’t as bad as I expected. The aluminum case is a thing of beauty.

I am getting used to it. In fact, I could probably exist in the Mac world OK. That is to say that it is tolerable. Tolerable requires a good shell (that rules Windows out) and a good scripting environment including such things as Python and Perl. Those come bundled on a Mac. Tolerable also requires something like Spaces (something that Linux/Unix has had since the early 90s). While Windows doesn’t come bundled with something like Spaces, I know that there are add-ons that can do something similar. Tolerable requires easy access to tools like ssh, ftp, sshfs, etc. While that doesn’t quite rule Windows out, most of the Windows based tools that provide that functionality are sub-par and barely tolerable.

So yes, I can get along on a Mac. That does not mean it’s ideal.

I have 3 chief complaints with Mac OS. One, easy access to open-source software is poor. With Ubuntu almost any open-source package can be installed with a few clicks. Fink and it’s clones are sub-par. Two, it is relatively uncustomizable. That is to say I can’t set short-cut keys easily to do the things I want them to do; I can’t make the finder open files with a single click instead of a double; I can’t make the window focus follow the mouse without clicking (without buying a $15 add-on that still doesn’t work the way I want it to), etc.

And now for the biggest complaint, three, the basic premise of the UI is a throwback to the 80s. In the 80s desktop computers were a single-tasking deal. You could only use one application at a time. So at that point in time it made sense for Apple to put the application menu bar at the very top of the screen unattached to the application windows itself. That simply doesn’t make any sense anymore and it causes problems when you want to have things like focus follows mouse. Come on Apple, even Microsoft figured that one out.

So yes, I will give this Mac OS thing another week to see if I can somehow tolerate this broken UI, but I’ve already downloaded the latest Ubuntu in anticipation of my install next week. Supposedly this thing came with bootcamp…

Categories: Uncategorized

First Day

April 13, 2009 1 comment

Today is my first day at the Naples Daily News. It’s 88° here today.

Categories: Uncategorized

Naples Daily News

March 27, 2009 1 comment

I am currently in Naples Florida interviewing for a job at the Naples Daily News. Naples is what I would call a tropical paradise. It’s a bummer that there are no mountains for skiing or hiking, but it has its own beauty. Walking on the beach in shorts in March is pretty cool.

Categories: Uncategorized

Sheepology Updates

March 21, 2009 2 comments

I just finished updating the Sheepology demo with the latest code. New features include:

  • fully function visual group tree editor
  • email

The visual editor turned out to be a very good exercise in learning Flex. The editor is now fully functional. You can drag and drop groups onto each other to create parent/child relationships. Click on a connection to delete it. Click on the X in the upper right to delete a group. There is a button for creating new groups and a way to get back to the list view. Positioning is persistent. Changes made are immediately saved to the database. It is fully interactive.

After some thought, I concluded that this might be a useful tool for managing pages in a content management system as well and I may generalize it at some future point for that purpose.

The email system is rudimentary. You can send email to one or more individuals or to a group or a group and its subgroups. It uses TinyMCE for rich-text editing. It stores a history of any email sent. And automatically BCC’s the sender. I made a short detour from the visual group editor to make this happen because I thought it would be a necessity for any church wanting to use Sheepology in production.

The next thing I will be working on is some sort of reporting system as I think that will be critical. Other items on my list of future features are:

  • inventory system
  • a more sophisticated contact management system
  • accounting
  • integrated web content management
  • on-line donations
  • volunteer scheduling

I’m willing to takes suggestions at this point on what people would find most useful or necessary.

Sola Scriptura

March 16, 2009 8 comments

I get in trouble in cycles. About 7 or 8 years ago I, through study, exited the Seventh-day Adventist church and entered the mainstream of protestant Christianity. This caused a major crisis in the Glass family. My spiritual steps go in cycles. I take a step and then settle into it for a while.

Over the last year or so I have been contemplating how to explain my thoughts on Sola Scriptura. It is not easy to explain. It is akin to trying to explain something in English to a person who only speaks Spanish. To a protestant it is as fundamental as gravity. It is so foundational to most protestant thought that protestant thought does not exist without it. It is the dividing line between protestantism and traditional Christianity.

The simple truth is that Sola Scriptura is a newfangled teaching. It was unknown to the Christians of the first century. It has only been around since Luther. It is not even supported by the scripture itself (a fatal flaw). So I was pleased to read a recent post by my favorite blogger Father Stephan. This post explains it better than I ever could.

What does this mean? It means that I can no longer in good conscience call myself protestant. What remains? The Roman Catholic West or the Orthodox East. That choice still lies ahead.

Categories: Christianity, Church

Upheaval

March 10, 2009 2 comments

Having recently become unemployed, life is full of excitement. Thank God for the WARN act, which requires companies to pay employees for a full 2 months after announcing a company closure.

It looks very much like we will be relocating regardless of what job I take. For Sheepology that means development will be on hold for a couple months while we re-pack and relocate. Things are going to be very crazy around here for a while.

Categories: Uncategorized

Final Edition

February 27, 2009 1 comment
Categories: Uncategorized

On Contemporary Christian Music

February 23, 2009 Leave a comment

Last December I attended an evening service at a local church. During that service a young teen-aged girl sang a song I generally really enjoy – Breath of Heaven by Amy Grant. The young girl had a phenomenal voice and excellent control. She sang beautifully, but there was something wrong and I couldn’t put my finger on what it was.

In my head I could hear Amy singing it and I compared. There was something about the maturity in Amy’s voice that was missing in the present rendition and suddenly I knew what it was. There is something in the act of singing that you can’t really put your finger on but your soul feels.

I can’t tell you why I knew. I can’t describe musically what was different. But I could feel a difference in attitude and in the mental state of the singer. The young singer lacked humility. The most magical part about Amy Grant’s version of the song is that somehow she captures the humility present in the story of Saint Mary. The young girl in the present wasn’t singing for the glory of God with an air of humility. She was singing to impress the audience.

I have been bothered by most contemporary Christian music for some time now but I couldn’t put my finger on why. Electric guitars and drums are not what bothers me. Not all contemporary music lacks humility, but 90% of what I hear does. It is not about bringing glory to God, but glory to the singer.

Next time time you listen, don’t just listen to the words, the tune, or the rhythm. Listen to the soul of the singer. For whom does he sing? You’ll hear it in his voice and know.

Lord, teach me humility.

Categories: Christianity
Follow

Get every new post delivered to your Inbox.