Steve Hannah: This week

Web Lite SWeTE: Simple Website Translation Engine

November 12, 2008

Hunter

Filed under: Uncategorized — shannah @ 2:35 pm

I have been watching Hunter Season 1 over the past few days. I had forgotten just how corny that show was. Good quality 80’s corn.

November 7, 2008

Operation Aborted in IE:

Filed under: Software Development — shannah @ 7:03 am

Found this great IE blog article explaining the cryptic “Operation Aborted Error” in IE.
Click Here.

Another reminder of why I don’t use IE, but also why the fact that many people do use it makes my life as a developer miserable.

October 30, 2008

Americans don’t even know what socialism is

Filed under: Uncategorized — shannah @ 8:01 pm

It’s not the Republicans calling Obama a socialist that has my blood boiling. It is the fact that they believe that this is serious accusation that, if proven true, would be damning of Obama. If Obama were a socialist, it would mean he was an enemy of the state deserving prison time.

At least that’s what it sounds like when you listen to Fox News and other Republicans fear mongering about Obama’s supposed “socialism”. Listening to interviews with Republican supporters, I have heard the following misconception preached over and over again:

“They are worried that Barrack Obama will turn the United States into a socialist republic like Sweden, rather than the democracy that they have and currently cherish.”

Where do I begin?

1. Socialism is not the opposite of democracy. It isn’t even concerned with the same subject. Socialism refers to a collection of economic theories that advocate shared ownership and administration of resources, and the creation of an egalitarian regime (i.e. all men equal). Democracy is a form of government where the people hold the power, and there is a free electoral system. There exist socialist democracies. There also exist capitalist dictatorships. There is no connection between socialism and democracy.

2. If you read Obama’s policies, there is no way you can mistake them for socialism. I think that socialists would be quite insulted to be grouped together with a capitalist like Obama.

3. Sweden has a higher standard of living than the US.

I could probably go further.

But it is important for Americans to know how little they know about these topics. All this socialist talk boils down to Republicans trying to scare people with a word that they have been brainwashed to fear their entire lives.

I hope that the next generation of republicans will grow out of these ignorant beliefs.

October 21, 2008

Indiana Jones Special Features Reveals where it went wrong

Filed under: Fun — shannah @ 8:44 am

I recently purchased the latest Indiana Jones DVD. As expected it contains a couple of documentaries about the making of the movie containing interviews with the cast and crew.

In watching the interviews I spotted two red flags that indicate where the cancer began to eat away at this movies chances to reach its potential.

1. George Lucas said that he wanted to change the genre from the 1930’s serials to the 1950’s alien sci-fi’s. He thought that this would be a nice parallel since the originals took place in the 30’s and this one takes place in the 50’s.

Perhaps the next movie can be a 1960’s musical a la Mary Poppins. This would be the perfect parallel since it will take place in the 1960’s.

2. Stephen Spielberg said that he didn’t want to do anything new with this film as it should be a blood relative of the original trilogy. He just wanted to make a nice movie for the fans to relive the originals.

This apparently flies in the face of what George Lucas was trying to do with the genre switch (and the friction was evident in the interviews), but more importantly it makes it sound like Spielberg handcuffed himself going into the flick. The thing that made the originals great were that they captivated the imagination of the viewer, and this is due, in large part, to the creative genius of Stephen Spielberg. So if he goes into the movie with the mindset that he doesn’t want to do anything new, he is necessarily leaving the creative genius that made the first films great in the storage locker.

October 19, 2008

Indiana Jones and the Saucer Men

Filed under: Fun — shannah @ 10:19 pm

I just finished watching the special features for the latest Indiana Jones movie. Apparently George Lucas wanted to call the movie “Indiana Jones and the Saucer Men”

This man is a marketing and literary genius!

Boxing is about drama

Filed under: Fun — shannah @ 10:05 pm

I watched Rocky III for the first time in 1983. I was 4 years old. I watched Rocky III for the one hundredth time in 1983. I was 4 years old.

The Rocky series captured the drama potential that exists in the sport of boxing in a way that even a 4-year-old can appreciate. When you transition from the Hollywood into the real-world sport of boxing, however, the drama becomes much more subtle, and scarce. One has to be selective about the fights that he watches, lest he become engulfed in oceans of boring bouts between mediocre fighters. I generally only watch the fights that are broadcast on HBO. This is a form of personal quality control and it raises the likelihood of a fight being exciting from 1% up to about 35%. Still, it is seldom in real boxing to see the level of drama that the Rocky series conveyed.

Despite these low odds, I am still drawn to boxing for the potential of drama. I enjoy the thrill of seeing two undefeated champions go head to head (e.g. Oscar De La Hoya vs Felix Trinidad). I hope for my aging heroes to be able to turn back the clock, if only for a night, and reclaim their former form to defeat a younger rising star. Muhammad Ali’s defeat of a younger, stronger favorite George Foreman is one example of drama that exceeded the manufactured drama of Hollywood.

On Saturday night, Bernard Hopkins brought some more genuine drama to the Ring. At 43 years old it looked like he didn’t have much left to offer, based on his previous couple of fights in which he made his opponents look awkward but didn’t offer much offense himself. On Saturday, against middleweight champion Kelly Pavlik, however, he looked like a finely tuned and youthful boxing master. He completely schooled and dismantled Pavlik, leaving him in bewilderment of what had happened.

Prior to the fight Pavlik was undefeated, and was (and still is) a rising star in the sport. He had recorded two decisive victories over Jermain Taylor, who had defeated Hopkins twice a couple of years ago to take the middleweight title which Hopkins had held for a record ten years. Pavlik was a 4-to-1 favorite to beat Hopkins. The only question was whether he could knock Hopkins out. What actually happened was very different. Hopkins owned every round and, by about the fourth round, the question became whether Hopkins could knock Pavlik out.

Watching this fight reminded me of why I enjoy the sport of boxing. It can be seen as an allegory for life. You can watch a young prospect come of age, gain skill, face challenges and climb to the top of the proverbial mountain. Within a few short years, however, you are forced to watch this same prospect begin to diminish with age and be overtaken by the shadow of what he once was. But once in a while you get to witness a blazingly beautiful sunset to cap a great career and peel away the shadows that must ultimately prevail. I believe I watched such a sunset on Saturday with Hopkins’ brilliant performance.

I hope the sun never completely sets on Hopkins, but knowing that it must, I hope that it lasts at least a few more years.

October 2, 2008

Focus on the family spreading Republican Propaganda

Filed under: Uncategorized — shannah @ 7:38 am

Focus on the Family distributes bulletins that are handed out in many Churches across Canada and the United States. It contains small pieces of wisdom on Christian and family living. I was quite angered to find that they are abusing their trusted position in the minds of Christians to spread blatantly republican propaganda. The following story appeared in this week’s bulletin:

Before You Vote by Tom Minnery

You know you should vote, but how can you tell whether you’re voting for the best candidates? Here are some thoughts and questions to consider:

Separate principles from policies. Achieving noble goals like world peace or affordable housing requires how-to policies. Would the candidate’s policies likely increase the size of government? New programs usually mean higher taxes and more waste.

Does the candidate have a Christian world-view? Is he pro-life? Does she firmly support God’s definition of marriage? Does he believe that parents have ultimate say over what a child learns in school? A candidate’s positions on such issues are important.

Political parties matter but may not define a candidate. Sometimes a candidate takes a stand that his party does not. Some conservative Democrats were elected to Congress in 2006 by pledging to stop the wasteful practice of earmarks in the budget. But neither major party had the will to stop this.

It goes on, but I want to focus on these first three points to start.

Their first “thought to consider” (Separate principles from policies) is an underhanded way of scaring people away from the Democratic party.

New programs usually mean higher taxes and more waste

In plain English, this statement says that the Democratic party, if elected, will bankrupt the United States. This is a common form of fear mongering that Republicans have been using for years to scare the public away from Democrats.

So what does this recommendation have to do with Christianity? In fact it seems to fly in the face of teachings that we take care of the poor. Hence their first “thought to consider” is unrelated to Christianity, at best - at worst it is opposed to Christian doctrine.

The next thought speaks to the issues that should be important to a Christian (Does the candidate have a Christian world-view?). A good question to ask. But then they proceed to outline the important issues:

  1. Gay marriage
  2. Abortion
  3. Teaching religion in school

Hmm… If this list were comprehensive, then it would be clear that a Christian should vote Republican. But it is not. What about issues such as caring for the poor, ending bloodshed abroad, health care, education, etc… . These issues are not mentioned because the Democrats are (at least arguably) stronger on these issues.

The last “thought” (Political parties matter but may not define a candidate) is meant to demonize Democrats who profess to be Christian. In plain English it reads: “Don’t be fooled by Democrats who claim to be Christian. They are just as evil as their Democratic contemporaries.”

At the end of the article, they have the gall to refer you to their website that is purportedly “non-partisan”, to help you make your voting decision.

This article is deceitful (claiming to be non-partisan), and shameful from an organization such as Focus on the Family. If its views truly represent the issues that are important to Christians, then Christianity is in trouble and in danger of becoming irrelevant. The heartfelt concern that a Christian has over the definition of marriage would be a little more credible if he shows the same concern over the horrors of poverty and inequity in society.

Based on this article, I conclude that Focus on the Family is a partisan political organization that caters to upper middle-class white people and uses its trusted position to disseminate its right-wing propaganda.

September 24, 2008

Wordpress CAS plugin adventures

Filed under: Software Development — shannah @ 3:41 pm

I am building some SFU websites using Wordpress and I need to set them up to use the SFU central authentication service (CAS). A quick search on Google found this plugin:
cas-authentication

I downloaded and installed it without trouble, but couldn’t seem to get it working. Likely it has something to do with the fact that it was written for Wordpress 2.5.1, and I’m using the latest (2.6.1). The errors I was getting were unhelpful, basically just stating that the CAS authentication failed and that I was not logged in. I tried in vain to debug the script for an hour or so.

Then I came across a thread in a Wordpress message forum indicating that I was not the only one having these problems. Through this thread, I was able to find another CAS plugin (written by Casey Bisson) that claimed to work with Wordpress 2.6.1 - and the claims were true.

The plugin can be found at http://wordpress.org/extend/plugins/wpcas/

(Note to self: SFU uses CAS 1.0; not 2.0).

The only thing that this new plugin lacked was the ability to automatically create accounts when users log in. I made the following change to the wpcas.php file to add this behavior.


function authenticate() {
		global $wpcas_options, $cas_configured;
	
		if ( !$cas_configured )
			die( __( 'wpCAS plugin not configured', 'wpcas' ));
	
		if( phpCAS::isAuthenticated() ){
			// CAS was successful
			if ( $user = get_userdatabylogin( phpCAS::getUser())){ // user already exists
				// the CAS user has a WP account
				wp_set_auth_cookie( $user->ID );
				if( isset( $_REQUEST['redirect_to'] ))
					wp_redirect( function_exists( 'site_url' )  ? site_url( $_REQUEST['redirect_to'] ) : $_REQUEST['redirect_to'] );
				wp_redirect( function_exists( 'site_url' )  ? site_url( '/wp-admin/' ) : '/wp-admin/' );
			}else{
				// the CAS user _does_not_have_ a WP account
	
/**  BEGIN CHANGES TO ADD AUTO ACCOUNT CREATION **/
				if (function_exists( 'wpcas_nowpuser' ))
					wpcas_nowpuser( phpCAS::getUser() );
				else
					{
					// auto-registration is enabled
					require(dirname(__FILE__).'/../../../wp-includes/registration.php');
				  // User is not in the WordPress database
				  // they passed CAS and so are authorized
				  // add them to the database
				  $username = phpCAS::getUser();
     			  $password = md5('testing');
				  $user_email = '';
				  if ($cas_authentication_opt['email_suffix'] != '')
					$user_email = $username . '@sfu.ca';
	
				  $user_info = array();
				  $user_info['user_login'] = $username;
				  $user_info['user_pass'] = $password;
				  $user_info['user_email'] = $user_email;
				  $res = wp_insert_user($user_info);
	
				  $user = get_userdatabylogin( phpCAS::getUser());
	
				  wp_set_auth_cookie( $user->ID );
				  if( isset( $_REQUEST['redirect_to'] ))
				  	wp_redirect( function_exists( 'site_url' )  ? site_url( $_REQUEST['redirect_to'] ) : $_REQUEST['redirect_to'] );
				  wp_redirect( function_exists( 'site_url' )  ? site_url( '/wp-admin/' ) : '/wp-admin/' );
				}			//	die( __( 'you do not have permission here', 'wpcas' ));
			}
/** END CHANGES TO ADD AUTO ACCOUNT CREATION **/		
	
		}else{
			// hey, authenticate
			phpCAS::forceAuthentication();
			die();
		}
	}

Now it works like a charm.

September 14, 2008

Feed2JS: Incorporate News feeds into static HTML webpages

Filed under: Uncategorized — shannah @ 8:06 am

My Recent goal. Minimize the amount of infrastructure in building a small website (i.e only use static HTML pages), and still incorporate dynamic content such as news and events in the web page.

Feed2JS is an invaluable tool for achieving this (at least the news and events part). You can embed an RSS feed into your web page with a tiny bit of HTML code (a script tag). Likely this RSS feed would go to a blog of sorts (easy to set up on any service).

You now have a web page with updated news and events, but doesn’t require any infrastructure (e.g. database or scripts).

September 13, 2008

IE Annoyances

Filed under: Software Development — shannah @ 5:30 pm

There are hundreds of reasons not to use IE (Internet Explorer), but the common folk still seem to use it en masse, so I am forced to deal with its bugs when developing web pages.

A couple that I ran into today in IE 6:

1. No support for onload handler on script tag (makes dynamically loading scripts a pain).
2. No support for transparency or opacity in PNG files. I have a beautiful logo that looks great in all browsers except IE. IE just shows a gray background where it is supposed to be clear.

Haven’t gotten my hands directly on an IE 7 machine to test out, but by all indications, these problems still exist in IE7.

If you are still using IE, I beg you to switch to something else - anything else (e.g. Firefox, Safari (yes it is available for windows now), Opera, Google Chrome (Google’s new shiny browser). Just stop using IE and make the world a better place.

When the statistics show that less than 2% of the users are using IE, I can stop wasting my time on workarounds for it and focus on developing.

Next Page »

Powered by WordPress