TweetDeck Now Works in Ubuntu 10.04

Something magical happened this morning. It must have been the Ubuntu updates. I tried to install TweetDeck again for the thousand time, this time it worked. What a pleasant surprise. Thanks to Ubuntu for fixing the TweetDeck install. Prior to the updates this morning, I wasn’t going anywhere. Nothing worked. Clicking on the TweetDeck install produced nothing. Not a beep. I often wondered if Adobe Air was installed properly, but it said it installed without a hitch. I just couldn’t figure it out why it doesn’t work, until today, although Twitter seems to be having some capacity problems all morning long. I’m so pumped TweetDeck works.

Twitter Fail Whale

I love Twitter, but occasionally it’s over capacity. Too many tweets they say. It looks like today is another “fail whale” day. Consider yourself lucky because I haven’t seen “fail whale” in a while. PCMag says it’s a system-wide issue. Twitter said the problem has been addressed, but it’s not 100% there yet. It means they are probably rebooting their servers or something along those lines.

Now, some people predict Twitter will explode during the World Cup. As long as they don’t mean blowing up or detonating the whale. The last thing we want is a messy whale carcass all over the screen. Yes, I predict Twitter will be very popular during the month long tournament. Twitter better be ready because the World Cup starts in just 2 days.

Generating PHP Random Keys

There are many ways of generating random keys in PHP. Random keys are essential in applications where you need unique identifiers that are not necessarily in sequential order. A prime example of where to use this script would be is when you need to create unique key for a URL shortener script.

For example: a user supplies a long URL. The script generates a random key based a predetermined length and returns a short URL based on the random key. So, here are  a couple of PHP random scripts that you might find useful. They both generate 6 random characters each time they are called.

Example 1

We create a function called rand_str(). We set the characters and generate a random key with a length of 6 characters. We make sure the same two characters don’t appear next to each other.

function rand_str($length = 6, $chars = ‘ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890?) {
  $chars_length = (strlen($chars)1); // Length of character list
  $string = $chars{rand(0, $chars_length)}; // Start our string
  for ($i = 1; $i < $length; $i = strlen($string)) { // Generate random string
    $r = $chars{rand(0, $chars_length)}; // Grab a random character from our list
    if ($r != $string{$i1}) { 
      $string .=  $r; // Make sure the same two characters don’t appear next to each other
    } 
    echo $string; // Return the string
  }
}

Example 2

This is example is essentially the same as above, but a bit more succinct. It generates a 6 character random string, but it doesn’t have a consecutive character feature like above.

for ($s =, $i = 0, $z = strlen($a = ’0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ’)-1; $i != 6; $x = rand(0,$z), $s .= $a{$x}, $i++);
$key = $s;
echo $key;

There you have it. Two scripts for generating random strings based on a predetermined length. It’s perfect for applications that need to generate unique and random keys.

There’s a good possibility a “swear” word could be generated by random chance. To avoid such words, simply take out the vowels from your character list.

Lessons From Greece

Whatever happened to living within your means? I just read an article from Associated Press covering the impact of the 2004 Athens Olympics to the current state of the Greek economy. Interestingly enough, irrational government spending and month long sporting events are fairly common.

A quick search about Olympics and Finances is a sobering realization. Montreal taxpayers are now just paying off debts incurred way back in 1976. The 2004 Athens Olympics cost was twice the budget.

Meanwhile, London 2012 organizers are facing similar challenges. Contrast that to the 1984 Olympics which made money. Here are excerpts from the AP article about the Athens Olympics and the Greek economy.

When it comes to overspending, Greece gets the gold medal.

Governments in the Greek capital of Athens haven’t balanced a budget in nearly 40 years, and the country narrowly averted bankruptcy in May before panicky European partners grudgingly put up massive rescue loans.

While many factors are behind the crippling debt crisis, the 2004 Summer Olympics in Athens has drawn particular attention.

The 2004 Athens Olympics cost nearly $11 billion by current exchange rates, double the initial budget. And that figure that does not include major infrastructure projects rushed to completion at inflated costs. In the months before the games, construction crews worked around the clock, using floodlights to keep the work going at night.

In addition, the tab for security alone was more than $1.2 billion.

Six years later, more than half of Athens’ Olympic sites are barely used or empty. The long list of mothballed facilities includes a baseball diamond, a massive man-made canoe and kayak course, and arenas built for unglamorous sports such as table tennis, field hockey and judo.

Greek Olympic officials insist the scale of the country’s dire financial problems — and its staggering national debt of $382 billion — are is simply too big to be blamed on the 2004 Games budget.

Some financial experts agree.

“Put in proper perspective, it is hard to argue that the Olympic Games were an important factor behind the Greek financial crisis. It is, however, likely that they contributed modestly to the problem,” Andrew Zimbalist, a U.S. economist who studies the financial impact of major sporting events, said in an email.

Next up, London.

London’s main Olympic budget now stands at $13.3 billion. Last week, Britain’s new coalition government announced $38 million in Olympic budget cuts as part of efforts to slash the nation’s budget deficit.

Well, the Olympics seems to be a case of failed project management. The delivery is on time, but it’s way over budget.

Officially Off Facebook

This marks the 3rd time I’ve deactivated my Facebook account. The latest came as a result of Facebook resetting my privacy settings. This was the second time this has happened. I’m not the biggest Facebook fan to begin with; so there is no love loss for being not in Facebook. I would rather blog and tweet than work with Facebook. Just my personal preference.

By the way, over 30,000 Facebook users quit last week which constitutes to less than 1 percent of the total number of users. I don’t think Facebook misses me or any of the 30,000 who quit last week. Checkout the latest Facebook statistics.

  • More than 400 million active users
  • 50% of our active users log on to Facebook in any given day
  • Average user has 130 friends
  • People spend over 500 billion minutes per month on Facebook

Lastly before I sign out, I overheard someone talk over the weekend while posing for a camera, that the pics to be taken are going to be posted on Facebook. I remember not too long ago when MySpace was all the rage. There is an open-source project called Diaspora that’s focused on privacy. That might be worth checking out.

AT&T New $15 Data Plan

If you get a smartphone nowadays, all phone providers have been forcing users to have a data plan for about $30 a month. I happen to be one of the lucky ones with a smartphone (Blackberry Curve) without a data plan. I have been interested in getting a data plan, but the $30 data plan per month is too steep for me. Now that AT&T is revamping their data plan, I might reconsider. From ZDNet:

AT&T on Wednesday carried out sweeping changes to its data plan pricing structure in a move that could force rivals to follow.

AT&T’s move (statement) comes as analysts come around to the realization that the U.S. wireless subscriber market is saturated. The game is to keep the subscribers you have happy and that means better pricing and long-awaited perks like tethering.

Among the major changes from AT&T:

  • An entry data plan for $15 a month capped at 200 MB of data. AT&T says 65 percent of its users could get by with the $15 a month plan and cut their costs in half. Should you exceed your 200 MB cap then you get another 200 MB for $15.
  • A plan for $25 a month for 2 GB of data. This “DataPro” plan allows for an extra 1 GB of data for $10 should you go over the cap. AT&T said that 98 percent of its customers use less than 2 GB of data a month. That cap is hard to top.
  • Tethering will arrive on the iPhone and any other smartphone for $20 a month on top of a DataPro plan. Generally speaking, this set-up means a 2 GB plan with tethering for $45 a month total.
  • iPad customers will see their $29.99 unlimited plan replaced with the $25 a month DataPro plan. You still prepay without a contract.

Google Phasing Out Windows

From Datamation.com:

It’s not like Google was ever going to be a showcase customer for Microsoft, but a report that the search giant is phasing out Microsoft Windows underscores security concerns that have long dogged the widely-used software.

According to a report in the Financial Times, Google (NASDAQ: GOOG) began moving employees to other operating systems back in January after its systems were hacked by what the company said were operatives working out of China, a charge corroborated by Internet infrastructure provider VeriSign .

Google was one of at least two dozen U.S. businesses targeted in the attacks that security firm McAfee (NYSE: MFE) said exploited a flaw in Microsoft’s Internet Explorer browser. Google has long been a strong supporter of Linux, and the FT report said employees are being moved to Linux and Apple’s Mac OS.

Excellent move. It also paves the way for Google to test Chrome OS.