Archive for September 12th, 2007

0

I spent some time with the wp-randomquotes plugin today. I noticed a few months ago that it was not displaying every quote in the database, and this has been increasingly annoying me.

It took me longer than it should have to track down what was up. The problem was that when I delete a quote (which I have done a few times, because there have been times I have entered in one poorly), it does not backfill the quote ID number. So my quote database goes 1 4 … 17 18 20 … 102. The plugin, when it goes to display all quotes, does an sql query to get all quotes into a single array, which it then counts. Naturally enough, as you can infer from the above, it finds 99 quotes. It then iterates from 0 to 100, attempting to find a quote for each $i. If there is no quote at a given $i (such as $i=2), it skips it. It gets quote 100 because it increments $i after the test but before it tries to pull the quote. But it misses quotes 101 and 102 because $i is now larger than 99.

The solution is to have two iterators, both of which start at 0. Iterate $i from 0 to 99, when you reach $j = 99, stop. Inside that while loop, there was already a test for an empty quote, have that increment $j instead of $i. Then make sure you increment $j after a successful query after displaying the relevant quote. If you increment it too early, you’ll skip the quote you just found. If you fail to increment it, you will find the same quote repeatedly. This way $j will grow faster for $i, with the difference between them at any given time being equal to the number of deleted quotes that have been reached at that point of the process. So that when $i = 99, $j = 102. Then all the quotes display.

0

Archbishop Wuerl has proposed making eight of the twelve inner city schools in his diocese into charter schools to save them from closing down completely.1 This would entail changing the names of the schools and removing religion from the curriculum. Once upon a time, a parish would offer free or nearly free tuition, running the school on general parish funds, and making ends meet because nuns, sisters, brothers and deacons do not make as much as lay staff. As lay teachers and administration replaced the religious, the operating expenses rose. Many parishes could no longer afford to pay for all of the school’s expenses, and started charging and raising tuition. Apparently the archdiocese of Washington D.C still heavily subsidizes the students’ tuition, but with free charter schools, parents are pulling their children from the Catholic schools to save money.

This is entirely understandable, parents have so many struggles and sacrifices on their plates as they try to raise their children. This is especially true of our inner city poor. That is why I am not as upset about this proposal as I could be. If the choice is between closing the schools and secularizing them, then by all means secularize them. The students will get a lesser education, but hopefully still better than that in the public schools available to them. Still, I hope this is not a result of the diocese expecting the schools to support themselves. That is an all too common perspective (it seems to me) for a pastor to have, and one that I believe is at best suboptimal if not outright wrong.


  1. Catholic News Agency. “Archbishop Wuerl proposes Catholic schools being converted to charter schools to avert closure” catholicnewsagency.com. 2007-09-12. http://www.catholicnewsagency.com/new.php?n=10359 

0

“As cosmopolitan urbanites, even the conservative among us like to think we are more tolerant, more liberal-minded than backwoods red-state America. And maybe we are. But perhaps this is only because it is easy for us to tolerate neighbors we do not know.” - Paul Gage1


  1. Mr. Paul Gage. “New Doubts About Diversity’s Value” reprinted at the Discovery Institute. 2007-09-12. http://www.discovery.org/scripts/viewDB/index.php?command=view&id=4216&program=DI%20Main%20Page%20-%20Article&callingPage=discoMainPage