This is the long awaited return of the Steve Hannah Show after a 3 month hiatus. I’m back in full force with two fresh faces joining the team. Enjoy!
References:
More information about TED can be found at http://www.ted.nu
This is the long awaited return of the Steve Hannah Show after a 3 month hiatus. I’m back in full force with two fresh faces joining the team. Enjoy!
References:
More information about TED can be found at http://www.ted.nu
Hi had the pleasure to behold two boxing greats go toe to toe on Saturday night: Roy Jones Jr. and Felix (Tito) Trinidad. Jones, in his prime was arguably the greatest boxer of all-time, with a brilliantly unorthodox style, lightning fast punches, and absolute control over his opponents. A few years ago he decided to challenge John Ruiz for the Heavyweight championship, for which he gained about 30 lbs.
He, of course, defeated Ruiz and captured the crown, however, it spelled the end of the greatness that we had come to expect from Jones. The problem, apparently was that he had to lose the 30 lbs he had gained in order to defend his Light-heavyweight crown. This took a toll on Jones’ body and left him a mere shadow of his former self. Going into the Trinidad fight on Saturday, he had lost 3 of his last 5 fights, with 2 of those losses by devastating knock-outs.
Saturday gave us glimpses of Jones’ former self as he demonstrated good speed and ring generalship, especially for his 39 years. He handily defeated the 35 year old Trinidad, who himself is a great boxer and former champion. One thing that stuck out to me during the fight was how Jones’ stamina is not what it used to be. He would fight for 45 seconds to 1 minute per round, and rest for the remaining 2 minutes. This may be acceptable for an aging and rusty opponent like Trinidad, but it would spell disaster against the current top contenders such as Joe Calzaghe, whose youth and energy would result in a sustained onslaught that Jones surely would not survive.
Don’t get me wrong. Jones still appears to have the tools to beat the best in the game. He just doesn’t have the stamina. In watching his actions in and out of the ring it almost looks like he has mono. In any case, I would love to see Jones rise to greatness one last time and face the best in the division – but only if I can solve his stamina problem. I don’t think I can bear to watch another Holmes-Ali fight where a hero gets dismantled.
This is just a quick note to help me (and others) in case I run into the same problem again. I was setting up Amazon EC2 following This tutorial. When it came time to test my instances:
powerbook-2:~ shannah$ ec2-describe-images -o self -o amazon
Client.AuthFailure: AWS was not able to validate the provided access credentials
The problem was that I had to make the permissions on my private key and cert files to be more restrictive so that only I could read them.
i.e.
chmod 600 chmod 600 pk-7HIOWAY3SOPV7G2LQLMMXEKAH5CKJ5HY.pem
chmod 600 cert-7HIOWAY3SOPV7G2LQLMMXEKAH5CKJ5HY.pem
That fixed it.
Suppose you have a PHP/MySQL application that you want to adapt to work across multiple timezones. I.e. Users from Toronto should see all dates and times in Eastern time while Vancouver users should see times in Pacific time. On this surface this appears like a simple thing to do, but there are a number of pitfalls to watch out for.
For this design pattern we’ll assume that we can always obtain the user’s timezone by calling a function, say getUserTimezone()
which would return something like Canada/Pacific.
The tricky part is making sure that different users can view and edit dates in their local timezone, while keeping the data consistent. For example, if Toronto Tony posts an event in our application, he can specify that it starts at 8pm (meaning 8pm Toronto time). When Vancouver Vinnie logs in, he sees this event, but the time says ‘5pm’ because he sees the event in Vancouver time.
Our solution for the first design decision, is that it doesn’t matter how we store the dates in the database, as long as we are consistent. I.e. we must store ALL of the dates in Toronto time or ALL of the dates in Vancouver time, but we cannot store some in one timezone and some in another. When deciding on an appropriate default timezone for the database, I considered using GMT (Greenwich mean time) but it is probably better just to leave the server running the most intuitive time for the majority of users. If the server is physically located in Denver, why not just leave the times in Denver time. We will convert the times to and from the users’ timezones when we insert and retrieve the data from the database.
For the 2nd design decision,, it will be much easier to use the MySQL conversion functions than to use the PHP functions. This will allow us to simplify our handling of the timezone issue exclusively to our SQL queries and leave our PHP code largely alone.
Inside our PHP script we can set the timezone for the current user by setting the TZ environment variable:
putenv('TZ='.getUserTimezone());
Once we have set the timezone, the PHP date function will properly convert timestamps to the user’s local timezone, and the strtotime function will propertly convert dates in the user’s local timezone back to timestamps.
Now we have 3 choices in how to store our dates in the database and interact with them.
Since timestamps are not affected by timezones, we could just store all of our dates in INT columns as timestamps and convert them to dates using PHP. e.g.:
// inserting dates
$date = '2007-12-29 08:00:00';
mysql_query("insert into events ( ..., `startDate`, ...) values ( ..., '".strtotime($date)."', ...)");
// retrieving dates
$res = mysql_query("select `startDate` from events where ...");
list($date) = mysql_fetch_row($res);
$date = date('Y-m-d H:i:s', $date); // convert the timestamp back to a date string
The main drawback to this strategy is style. Databases are equipped with DATE data types for a reason. By using INT datatypes to store our dates, we are missing out on some nice features for data manipulation etc… Plus it just doesn’t *feel* quite right to be using INT columns when we should be using DATETIME columns.
MySQL provides a some nice conversion functions that will allow us to work with timestamps yet still store our dates in proper DATE and DATETIME columns in the database. The FROM_UNIXTIME()
function will convert a timestamp into a date string, and the UNIX_TIMESTAMP()
function will convert a date string into a unix timestamp. So we can achieve the same as in Strategy 1 with the following:
// inserting dates
$date = '2007-12-29 08:00:00';
mysql_query("insert into events ( ..., `startDate`, ...) values ( ..., FROM_UNIXTIME('".strtotime($date)."'), ...)");
// retrieving dates
$res = mysql_query("select UNIX_TIMESTAMP(`startDate`) from events where ...");
list($date) = mysql_fetch_row($res);
$date = date('Y-m-d H:i:s', $date); // convert the timestamp back to a date string
This strategy is a little bit better, in my opinion, because it uses the proper data types for the proper data. However it still requires that we use timestamps as an intermediary. In certain cases you may be unable to use timestamps (either because the rest of the system expects the SQL queries to return and accept date strings directly (not timestamps)), or because timestamps won’t handle the extreme dates in your application (e.g. timestamps are only valid for dates later than 1901 on most systems, and later that 1970 on some).
MySQL’s CONVERT_TZ() function will convert a date between two different timezones without requiring the intermediate step of converting to a timestamp. Theoretically, it should be able to accept input of the form:
CONVERT_TZ(`startDate`, 'Canada/Pacific', 'Canada/Eastern');
However if your server doesn’t have the timezone tables installed, then it won’t work correctly with these forms of timezones. The safest way seems to be to specify timezones in the form ‘+08:00’, meaning (8 hours behind GMT). e.g.
CONVERT_TZ(`startDate`, '+01:00', '-08:00');
This creates a small hurdle for us: How do we convert the user’s timezone (in the form ‘Canada/Pacific’) to an offset timezone like ‘+08:00’?
Here is a function that does just that:
/**
* Returns the current timezone as an offset (e.g. +08:00) of GMT
**/
utc_offset(){
// Find the difference in seconds between GMT and local time.
$diff = gmmktime(0,0,0,12,29,2007) - mktime(0,0,0,12,29,2007);
$sign = ( ( $diff >= 0 ) ? '+' : '-');
$diff = abs($diff);
$hours = str_pad(strval(floor($diff/3600)), 2, '0',STR_PAD_LEFT);
$minutes = str_pad(strval(floor($diff/60) % 60), 2, '0',STR_PAD_LEFT);
return $sign.$hours.':'.$minutes;
}
So we can use our utc_offset()
function to get the user’s timezone as an offset from GMT. We can pass this as one of the parameters for CONVERT_TZ(). The other timezone will be the system timezone, which we can conveniently specify as ‘SYSTEM’. e.g.:
-- Convert from -08:00 to system time
CONVERT_TZ(`startDate`, '-08:00', 'SYSTEM')
-- Convert from system time back to -08:00 time.
CONVERT_TZ(`startDate`, 'SYSTEM','-08:00')
We now have all the tools we need to adapt our examples from strategies 1 and 2:
// inserting dates
$date = '2007-12-29 08:00:00';
mysql_query("insert into events ( ..., `startDate`, ...) values ( ..., CONVERT_TZ('$date','".utc_offset()."','SYSTEM'), ...)");
// retrieving dates
$res = mysql_query("select CONVERT_TZ(`startDate`,'SYSTEM','".utc_offset()."') as `startDate` from events where ...");
list($date) = mysql_fetch_row($res);
echo $date; // 2007-12-29 08:00:00
I used this strategy to add timezone support to Xataface because I needed a solution that would allow me to change the mysql queries without altering any of the code them uses them. It seems to work quite well.
Happy hunting!
I found it interesting that Dataface Inc from Houston, TX decided to file a trademark for DATAFACE in Canada. I have been using the trade name Dataface since March 2005, in Canada. Their trademark application found
here declares that they have used it in Canada since at least Nov. 5, 2007. That is over 2 years after the first use for my open source app.
According to the Canada trademark application instructions I can file a statement of opposition with the opposition office. However it costs $750 to file the claim and I haven’t been able to find a good example of what such a claim looks like. It doesn’t appear as though there is a standard form for this.
In doing some research on the validity of my claim to the trademark, I came across the Effigi Inc v Canada case in which it was declared that the date of first use was not relevant and that the dates of filing were the key decider as to who had rights to the trademark. This would indicate that in Canada it is essentially a first come first served system. Read more about this here.
This is obviously frustrating for someone like me who just wants to develop good open source software, and naturally needs to give a name to his products. It is unreasonable to trademark every name that I use since most of my products are released free to the public and for public benefit. It is a catch 22 because I cannot afford to trademark every phrase used in my applications, and I cannot afford to change the names of my applications when some tax-collecting company decides to trademark my phrase.
I hope that the powers that be might some day recognize the unjust aspects of this system and correct it so that artists, like myself, are protected from corporate interests.
I have created and released dozens of open source applications and have coined over 50 phrases concerned with labeling certain programming patterns. It would cost me about $10,000 to trademark all of these names and phrases (if I didn’t enlist the help of a lawyer). This seems rather ridiculous since most of these applications are free and open source, and I derive no money from them. Hence I would be paying a tax of $10,000 purely for the ability to name my things without having to worry about being sued or forced to change the name at a later date (which is a huge hassle, once you have amassed a lot of material on the topic.
I plan to blog on this issue more specifically once I have looked more closely into the protections available to artists with respect to corporate rent collectors.
Well I figured this might happen eventually. A company in Texas has taken exception to my use of the name ‘Dataface’ for my open source application framework. It must rot their socks that I also come up #1,2 and 3 on Google for the search term “Dataface”.
I received a letter from their lawyers as follows:
The Buskop Law Group
Patents & Trademarks
4511 Dacoma Street
Houston, TX 77092
Telephone: 713-275-3400
Fax: 713-275-3419
www.buskoplaw.com
Dear Mr. Hannah,
We are the intellectual property cousel for Dataface, Inc., a company that awas founded in 1981. Dataface is the owner of the common law and U.S. federally protected trademark DATAFACE for a computer program in the field of facilitating conversion of legacy applications and data to a newer, more efficient technology using object-oriented programming techniques, as referenced by U.S. Trademark No. 2,617,053.
Dataface. Inc. has used the trademark DATAFACE in conjunction with their products and associated services since 1997. A copy of the referenced U.S. federal trademark registration is included herein as Attachment A. In addition, Dataface, Inc., has used the referenced trademark in Canada in conjunction with their products as well. Through extensive use of the mark, our client has developed a valuable goodwill in the DATAFACE trademark.
It has come to our client’s attention that you and your company are currently using a mark termed “Dataface” to promote and advertise products offered by your company on the company’s website at www.data-face.com. A copy of the webpage showing use of the term “Dataface” from the website at www.data-face.com is included herein as Attachment B.
Your use of the term Dataface is highly similar in look, sound, and connotation to our client’s common law and U.S. federally protected trademark DATAFACE. In addition, your use of the term “Dataface” is used in association with goods and/or services that are highly related to the goods and/or services offered by our client and covered under their U.S. federal trademark registration. Given the clear similarity between the term “Dataface”, as used on your company’s website, and our client’s trademark, your continued use of the term “Dataface” may cause a likelihood of confusion among consumers and customers of our client’s products and associated services.
Accordingly, my client requests that you discontinue the use of the www.data-face.com domain name and dicontinue the use, display, distribution of materials bearing the term “Dataface”, any derivations of the term “Dataface”, or any expression that comprises in whole or in part, our client’s trademark DATAFACE, within 30 days of service of this letter, and adopt another term for use in conjunction with your company’s products and services. Please contact our office if you have any additional questions regarding this matter.
Regards,
Buskop Law Group, P.C.
Wendy K. B. Buskop
Managing Patent Attorney
cc: Dataface, Inc.
Judith Osborne, VP Legal Affairs, Simon Fraser University
Cleverly, they applied for a canadian trademark a couple of weeks ago to solidify their case.
I have been using Plone for my Dataface web site for the past couple of years. Finally, the slow performance, resource heaviness, and lack of a decent forum product forced me to move the site out of Plone and into PHP. This move was inevitable since Dataface itself is a PHP framework so it would only make sense to eventually host the site using Dataface.
When I first set up the site I wasn’t sure how it would be used mostly. I knew I would need a forum for support but I didn’t realize just how important the forum would be. Over 80 percent of traffic was directed to the forum, and Plone’s forum (Ploneboard) was barely up to the challenge as it was lacking quite a few standard forum features (like email notifications), and the community didn’t seem to be too interested in pushing the development along (there is no money in developing message forums).
With the new site, I had a few choices for the forum:
1. I could build my own using Dataface. This would be pretty easy to do, but I figured the time would be better spent on other things especially if I could be a pre-built forum with all the features ready to go.
2. I could use one of the 2 main commercial PHP bulletin board products (VBulletin, and Invision Power Board). These are definitely full featured, and the prices are pretty good, but I kind of wanted to stay open source through and through for this open source project.
3. I could use PHPBB.
PHPBB is the most well known open source PHP bulletin board systems and it has been around for a while. I have used it for web sites in the past, but have had bad experiences, as every one of my past PHPBB sites has been hacked repeatedly. I have heard that it has improved, however, and that the new version is much more cleanly designed. So I am reluctantly giving it another shot.
There are MODs you can get to try to prevent spam even more, but I think I will rig up my own solutions so that the board can’t be spammed by standard PHPBB methods (they will at least have to come up with some custom spam stragegies for my site if they want to spam me).
I figured that such a large project surely would have developed a module system by now (so that you can install and uninstall modules without changing the main application. I figured wrong.
So far it doesn’t seem too bad. I’ll have to make a few customizations to shore up security and add a few features that I want, but all-in-all I’m pretty happy with what I see so far with PHPBB.
So here it is. The time has come for my path and Plone’s to diverge. I’m sure we’ll meet again sometime in the future as she has too much potential to shun completely. She showed up at my door adorned with diamonds, so who wouldn’t let her in. She held so much promise. There were times when I fantasized about handing Plone all of my responsibilities, but these dreams were dashed time and time again by tantrums, fights, and utter refusal to do the work at hand. Now that I have handed her her bag and coat, show shows glimmers, once again, of the grace and beauty that convinced me to let her in in the first place. I would reconsider the eviction notice except for the fact that she uses far too many resources and works far too slowly for an operation of my size.
To Plone:
Thank you for making it so easy for me to extract all of your data from you. You are being a little sticky with your passwords, but who wouldn’t be. (No worries… I have sent in a request to the powers that be to tell me how to extract those too… so watch out .. I will get them.
You may be wondering how I will be replacing someone with such a broad range of duties like yourself. I haven’t decided completely. You were primarily used for posting tutorials, news, and hosting a forum, so I will likely just replace you with PHPBB and some homegrown PHP CMS (or Drupal). In any case, whatever I use to replace you will use 50 times less memory and run 50 times faster. That’s really all it comes down to. I didn’t like using you, so how can I expect the other community members to like using you. One day I’ll check on you again to see if your performance has improved at all… but until then, I won’t be using you anymore if I can help it.
P.S.: I am still using you for some sites, but won’t be setting up any new sites with you for quite some time.
This was just posted on my fun wall. I wonder how many people they had to interview to get this footage. It is solid gold!
Unions were originally created to protect workers from being exploited by unscrupulous employers and improve working conditions. They work by allowing the workers to withhold labour en masse if they feel that they are being treated unfairly. This works because every day that a business’ employees are off the job, it costs the business money. Long strikes could cause the business to go under so there is tremendous pressure on the employer to settle a strike quickly.
This, perhaps, is the reason why many public sector strikes have been prolonged and largely unsuccessful. Every day that the workers are off the job, the employer saves money. Not alot of pressure to settle on the employer side. On the workiers’ side, there is still pressure in the form of lost wages. The only possible pressure that the employer might feel in a public sector strike comes from its constituents. And this is where a strike essentially breaks down into a public relations campaign. The employer tries to convince the public that they are being reasonable so as to paint the union greedy, while the union tries to convince the public that they deserve their raises.
Unfortunately in a world where union workers are perceived by many as being overpaid, the battle of public opinion sways in the direction of the employer. Hence the employer has NO urgency to settle, and we end up with long strikes where the union cannot win.
So where does this leave the working man in the 21st century? Is he doomed to descend to minimum wage? Of course not. We will certainly see a shift in the distribution of jobs towards the private sector, but this is not all bad. In fact this is where workers should look for help from unions, and where the union will truly have teeth. One of key points of contention in recent years has been in the employers’ rights to contract out services to the private sector. The unions see this as a threat, and indeed any changes are sure to disrupt the steady flow of things for some workers, but in the long run the unions will still have a prominent role in ensuring fair wages for the working man in the private sector.