Skip to Content Skip to Navigation Menu

Archives

My Status: Robert "Status Unavailable"

A fantastic journey through both heaven and hell

Posted Thursday the 25th of June, 2009 by Robert Carpenter

From C.S. Lewis's The Great Divorce:

'Do ye think so?' Said the teacher with a piercing glance. 'It is nearer to you than ye think. There have been men before now who got so interested in proving the existence of God that they came to care nothing for God Himself...as if the good Lord had nothing to do but exist! There have been some who were so occupied in spreading Christianity they never gave a thought to Christ. Man! Ye see it in smaller matters. Did ye never know a lover of books that with all his first editions and signed copies had lost the power to read them? Or an organizer of charities that had lost all love for the poor? It is the subtlest of all the snares.'

Here's to not loosing my passion to my desire to pursue the very thing.

moral fun

Posted Friday the 12th of June, 2009 by Robert Carpenter

From "Mere Christianity" by C.S. Lewis, page 69.

There is a story about a schoolboy who was asked what he thought God was like. He replies that, as far as he could make out, God was 'the sort of person who is always snooping around to see if anyone is enjoying himself and then trying to stop it'. And I am afraid that is the sort of idea that the word Morality raises in a good many people's minds: something that interferes, something that stops you having a good time. In reality, moral rules are direcions for running the human machine. That is why these rules at first seem to be constantly interfering with our natural inclinations. When you are being taught how to use any machine, the instructor keeps on saying, 'No, don't do it like that,' because, of course, there are all sorts of things that look all right and seem to you the natural way of treating the machine, but do not really work.

This chapter, titled 'The three parts of morality,' is probably the best in the entire book. Lewis provides several illustrations which take the abstract ideas philosophers create about morality and make them easy to understand (and solveable) problems.

My first SQL Stored Procedure

Posted Friday the 5th of June, 2009 by Robert Carpenter

I am working with OS Commerce 2. Unfortunately developing with and for OS Commerce has been an exercise in patience. I've worked with many open source projects in the past and seen some bad coding practices but OS Commerce tops them all. If there is a bad, corrupt, or insecure php programming practice that isn't demonstrated in the source for OS Commerce somewhere I would be really surprised. Even spelling errors are rampant!

Unfortunately it seems to be about the most complete PHP open source shopping cart system available. Its popularity mixed with its corrupt nature has even caused some to completely refactor the code in an attempt to remove early 1990s design paradigms (literally almost a hundred layout tables per page) and allow for accessibility.

In working with it I had to create a tax zone for the entire world in order to charge extra shipping for international orders. Rather than manually adding each of the 238(?) countries to my tax zone I wrote this mySQL Store Procedure to accomplish that task for me:

DELIMITER //
DROP PROCEDURE IF EXISTS import_countries//
CREATE PROCEDURE import_countries ()
BEGIN
  DECLARE s_country_id INT DEFAULT 0;
  DECLARE s_country_name VARCHAR(100);
  DECLARE s_max_i INT DEFAULT 100;
  DECLARE s_i INT DEFAULT 0;
  SELECT max(countries_id) FROM countries INTO s_max_i;
  aloop: LOOP
    SET s_i=s_i+1;
    IF s_i > s_max_i THEN
      LEAVE aloop;
    END IF;
    SELECT countries_id, countries_name INTO s_country_id, s_country_name FROM countries WHERE countries_id = s_i;
    IF s_country_id <> 223 THEN
       INSERT INTO zones_to_geo_zones 
          (association_id, zone_country_id, zone_id, geo_zone_id, last_modified, date_added)
    VALUES(NULL, s_country_id, 0, 2, NOW(), NOW());
    END IF;
  END LOOP aloop;
END;
//
DELIMITER ;

Football as a moral school of thought

Posted Monday the 1st of June, 2009 by Robert Carpenter

From C.S. Lewis's Mere Christianity:

If we ask: 'Why ought I to be unselfish?' and you reply 'Because it is good for society,' we may ask, 'Why should I care about what's good for society except when it happens to pay me personally?' and then you will have to say, 'Because you ought to be unselfish' -- which simply brings us back to where we started. You are saying what is true, but you are not getting any further. If a man asked what was the point of playing football, it would not be, much good saying 'in order to score goals', for trying to score goals is the game itself, not the reason for the game, and you would really only be saying that football was football -- which is true, but not worth saying. In the same way, if a man asks what is the point of behaving decently, it is no good replying, 'in order to benefit society', for trying to benefit society, in other words being unselfish (for 'society' after all only means 'other people'), is one of the things decent behavior consists in; all you are really saying is that decent behavior is decent behavior. You would have said just as much as if you had stopped at the statement, 'Men ought to be unselfish.'

From a chapter entitled 'The reality of the law'.