Tuesday, March 10, 2009

Tips to get the best results

Vote Early, Vote Often

Are you tired of sitting quietly in the background, but lack the boldness to post your opinion? SitePoint Forums' polls let you discreetly join the conversation. They enable you to follow the ever-changing Internet trends and give you a chance to influence them. So vote early and vote often! We've compiled a list of currently open polls to start with:

  • Promotion Techniques
> If you had to choose one Autoresponder which would it be?
  • MySQL

> In what order does MySQL "bore down"?

  • Search Engine Optimization

> Should you change your backlink's anchor text?

  • Business and Legal Issues

> Vote for EACH CMS you WOULD use for a "cheaper" client.

> Would you drop your rates for the suffering economy?

> How do you charge for PPC campaign management?

  • .NET

> If you've tested or started using IE8RC1 moving from IE7, how has it worked?

  • General Chat

> Do You Smoke?

  • Web Page Design

> What is the ONE thing you want to see most in IE9?

  • Content

> Do you write your own content?

> Who should provide the content for a web site?

  • Blogging

> Is your web site merged with your blog, or is your blog in a subdirectory?

  • Graphics

> Jpeg XR will ...

The polls below recently closed, but you can click on the links for the results:

  • Business and Legal Issues

> Do you put your service prices on your web site?

  • General Chat

> What movie are you most looking forward to?

It's easy to start your own poll, too. Post your thread as usual but before you submit, scroll down and click on “Add a Poll.” Then submit your thread and you'll be redirected to your poll. There you can enter your questions or change any options.

latest and greatest in SitePoint

Simply SQL -- a practical, step-by-step guide to writing SQL.

Rather than bore you with theory, in Simply SQL author Rudy Limeback focuses on the practical use of SQL with common databases. It's packed with plenty of diagrams, easy-to-read text, and clear examples to help make learning SQL easy and fun.

Any questions? Rudy (aka r937) is always around the forums -- almost 24/7 -- to answer them.

The Official SitePoint Twitter Background Competition

Around my neighborhood spring is in the air. The birds are a-twitter and so is nearly everyone else!

If you have imagination, creativity, and style, this contest is for you. Design the best Twitter profile background imaginable and submit it in any graphic format that Photoshop can open. (Just remember, you'll be sending it by email so make it a reasonable size!)

Contest ends March 26, 2009. Our judges will consider any theme or style except for those that include political, violent, or adult references. Nothing controversial or offensive, please. Complete contest and entry submission details available here.

Prizes go to the top 10 entries: your choice of The Principles of Beautiful Design by Jason Beaird or a copy of the soon-to-be-released Sexy Web Design by Elliot Jay Stocks.

Need inspiration? Read Mihaela Lica's blog post, Beautiful Twitter Backgrounds to Inspire You for the SitePoint Twitter Contest.

SitePoint at SxSW Interactive 2009

SitePoint will be represented at SxSWi in Austin, Texas, March 13-17.

Besides co-founder, Matt Mickiewicz and some Australian staff members, it's your chance to meet SitePoint authors like Jason Beaird, Jina Bolton and Josh Catone, plus SitePoint Forum staff members like Podcast co-host Patrick O'Keefe and forum advisor Brandon Eley. You’ll find them all at the Razorfish opening party at The Madison, starting at 6pm on March 14.

Please post if you'll be attending. As Matt mentioned, we’d love to meet everyone in person.

Server-side JavaScript Common as PHP

Reading through the comments on Craig Buckler's blog post, Will Server-side JavaScript ever catch on?; confirms what Douglas Crockford wrote about JavaScript: it's been typecast. A lot of people can only see it in context of the browser. A big part of this is due to the confusion between the language and the browser DOM. The DOM interface is actually where most JavaScript programmers spend their time.

It also confirms another fact: a lot of people hate JavaScript. I'm confident though -- for programmers who appreciate JavaScript's finer features and can accept its rougher parts -- that the news JavaScript is moving server-side is unsurprising and probably welcome. And I'm certain that this is only the beginning.

So where can JavaScript be found server-side right now?

Jaxer is a JavaScript web application framework and server. The server-side API is as capable as any, including access to databases, files, and network sockets. There's a blurring of the boundary between server-side and client-side scripting; for example, server-side scripts can manipulate the web page DOM.

Scripts are embedded ASP style into your HTML:


The runat attribute can be server, both, or server-proxy. If set to server, the script is evaluated before the page is sent to the browser. If not set the scripts are executed client-side. If set to server-proxy, then the functions can be called from a client-side script by name, but are proxied, via Ajax, to the server-side equivalent.

Helma is another web application framework that uses JavaScript for server-side scripting. Helma has a templating system, which means it avoids mixing server-side and client-side JavaScript code. You instead write actions in JavaScript, which then render templates, injecting data into the rendering process. Each HTTP request triggers a configured action.

Here's an example of a template or skin in Helma jargon, named 'hello':

Hello, my name is <% response.name %>.

And the action that renders it:

res.data.name = 'Helma';
this.renderSkin('hello');

There are many more examples of server-side JavaScript as the Server-Side JavaScript topic on Wikipedia shows. Almost all of them use Rhino or SpiderMonkey to execute the JavaScript.

Is server-side JavaScript a serious proposition?

While implementations of JavaScript on the server are appearing, it's far from the ubiquity of PHP hosting. A fair comment is that server-side JavaScript is currently bound to the framework in which it resides. As such, JavaScript written in one environment is unlikely to be portable because of the lack of a standard API. It's a need that's already been identified and so the work of the ServerJS group has begun. Projects like jslibs also aim to solve this problem.

Lack of hosting services is also an issue, though Jaxer and AppJet provide their own hosting platforms. Helma applications can be hosted with services that support Java. Once the standard library problem is solved I'm sure we'll see hosting support improve -- you'll be asking your host for "mod_javascript" support.

Finally, JavaScript has more than enough rough parts to make many people nervous about using it server-side. I seriously think ECMAScript 3.1 and ECMAScript Harmony will eventually have that covered.

We're seeing JavaScript support appear in many platforms, both web and desktop, local and server. Will server-side JavaScript support offered in hosting packages be as common as PHP? I think it's inevitable.

Friday, March 6, 2009

Submit Your Work to Gallery Sites

Last week I spoke to a client of ours, who was quick to mention that the web site we built for them recently appeared on a CSS gallery site. They were glad to have been listed, because it confirms that he made the right decision choosing my company. He also said that he's already received an enquiry for their services, which he directly attributes to a link from this gallery.

It's great for me because I have a very happy client, but more importantly, we also have prospects enquire about our service as a result of being on such gallery sites. Additionally, there are the obvious SEO benefits of more inbound links. Finally, the team who works on the featured web site are pleased because they effectively are being judged by their peers, and so we all win.

So where do you find these galleries? Well, there are a few sites that come to your rescue:

* CSSGalleryList.com list 50 of the larger galleries and their Alexa rank, and link directly to their submission pages.
* This blog post from Web Design Beach has an exhaustive list of more than 250 gallery sites, complete with Alexa Rank, PageRank, Google, and Yahoo inbound links.
* Finally, if you haven't already had your share of lists, here's another list of 212 galleries, over at Web Gallery List.

You'll soon filter your preferred list down to a dozen or so galleries, and will be submitting away in no time at all. Good luck!

Create a Killer Business Card

If you want to impress, you'll want to have a clever business card. Especially if you do any design work, your business card needs to speak volumes about your ability, as well as provide those useful contact details.

A friend of mine uses old cereal boxes, which he cuts into the standard shape. Then he uses a rubber stamp on the unprinted side with his details. Every card is therefore different, and it sends a great recycling message.

Another friend has a square business card; I've recently seen a card utilizing Braille, and another which looks like a playing card.

Gimmicks aside, you still need to include those details, and my only word of warning is to ensure that your card fits in a standard business card wallet or binder easily, as well as your pocket.

For some great inspiration on what others have done manipulating the traditional business card, have a look at the recently launched gallery site, cardobserver.com or Art of the Business Card. There's also Inspiration: Business Card Designs, and finally the humorously named ItEvenHasAWatermark.com.

I Want to Build Your Next Web Site!

You might look at Chris's adventure above and think to yourself, what a geeky but once-only stunt he pulled; however, there's a lesson in there for all of us.

Suppose you're a web designer, and your target clients were small business owners. Imagine attending a small business trade show or conference with a T-shirt that said, I want to build your next web site! That's sure to gain a positive reaction.

Let's look at trade shows. Most trade shows and exhibitions cost a small fortune to have a display stand, and if you're a developer, what do you have to really show? Perhaps a few computer screens showing your portfolio as a slideshow? Boring!

A better (and considerably cheaper) idea here would be to attend as a normal visitor, but carry a stack of your business cards. Then go from booth to booth enquiring about the products and services on display, and politely hand them your card at an appropriate time.

You could even print a short run of special cards just for that event, which could potentially state, We met at the XYZ Expo, and I want to build your next web site! on one side, and your contact details on the other. This is cheap, and definitely memorable.

Tuesday, March 3, 2009

Build a Buzzword Bingo Card in PHP

In the past, I've done a fair bit of work with government departments. Here are three things I learned from that experience:

  1. government workers love meetings
  2. government workers also love jargon
  3. when you combine meetings and jargon, you have excellent conditions for a quick game of Buzzword Bingo*

If you've yet to play Buzzword Bingo, you're missing out on great fun! It's a game in which you collect buzzwords, clichés, and weasel words, then arrange them in a grid and check them off as you hear them during a particularly wordy meeting. When you've checked off a row, column, or diagonal line -- bingo!

With just a little bit of beginner PHP and a good collection of jargon words, you can make your own buzzword bingo card that's randomly generated every time you load the page. Let's take a look.

(*Buzzword Bingo has a less than worksafe name too, but because we want this newsletter to pass by unimpeded by any cursing filters, I can't repeat it here.)

Step 1: Create a Function Shell

We'll be creating a function called Bingo to generate a random buzzword bingo card, which we can then include within a document. Let's start out by creating a document shell with the Bingo function inside (I've called mine bingo.php):

 function Bingo() {

}
?>

Step 2: Compile Some Buzzwords

Grab a list of the jargon words or phrases you'd like to see in your bingo cards. You'll need at least 25 to fill a bingo card, so be sure you have a good collection. I've just spent an amusing few minutes strolling around Weasel Words, a site devoted to collecting some horrible examples of managerial speak, and I've plucked a bagful of my favorites.

Let's pop these in an array inside our PHP function:

$buzzwords = array(
"leverage",
"synergy",
"stakeholder",
"touch-points",
"knowledge initiatives",
"cross-organizational collaboration",
"strategic planning",
"dynamics",
"catalyst",
"values-driven",
"evangelize",
"incentivize",
"loop back",
"let's take this offline",
"360 degree thinking",
"in the pipeline",
"actioning",
"paradigm",
"2.0",
"going forward",
"game plan",
"the end of the day",
"thought leading",
"on board",
"monetize"
);

Step 3: Do the Shuffle

We want to make sure our card has a random arrangement of buzzwords, so we'll use PHP's shuffle function to jumble up the items in the array:

shuffle($buzzwords);

Step 4: Prepare a Table

Bingo is all about filling up rows or columns in a grid, so we'll use a table to arrange the items.

Let's create a new variable called $bingocard and start preparing the table markup. You can see I've left a gap in the middle -- this is where we'll later put the code that creates the cells and rows.

$bingocard = "summary='A random selection of 25 buzzwords
arranged in a bingo card'>";
$bingocard .= "";
$bingocard .= "

";
$bingocard .= "";
$bingocard .= "";
$bingocard .= "";

// here's the gap

$bingocard .= "";
$bingocard .= "";
$bingocard .= "
B IN GO
";

Step 5: Create Cells and Rows

We now need to create 25 cells from the items in our buzzwords array. We'll use a for loop to iterate through the items in our shuffled array 25 times, and create a table cell for each. That for loop goes in the gap we left in the previous step.

Our table will be a 5x5 grid, so we'll also need to create five rows, each with five cells. We already prepared the start of our first row and the end of our last row, so we'll also need to double-check to make sure we don't do this on the last cell.

To work that out, I've used a variable $rowend, which is the remainder of $cell + 1, divided by five. After we create each cell, there's a small if statement to check whether a $rowend is zero, and that it isn't the 25th cell. If that's the case, we'll close and open a table row element.

Here's the for loop:

for($cell=0; $cell<25; $cell++)
{
$rowend = ($cell + 1) % 5;
$bingocard .= ""
. $buzzwords[$cell] . "";
if($rowend == 0 && $cell < 24) {
$bingocard .= "n";
}
}

Step 6: Echo the Table

We've built an array, shuffled it, and made it into a table. All that's left to do now is print it:

echo $bingocard;

… and we're nearly done! You should now have a PHP file that looks similar to Example 1.

Step 7: Drop It in a document

Let's now use this function in a web page. Include the bingo.php file at the start of the document:

Now call on the Bingo function wherever you need to put your card:

Use some CSS to style the buzzword bingo table how you'd like. You can see a very plain example of a bingo card in Example 2, and the results in Example 3. You might even like to layer on some JavaScript to let players check off each cell by clicking on it, or cause an amusing effect when the player achieves bingo.

Step 8: Play!

When you're happy with how your card looks, it's time to pass on the URL of the bingo card to your co-workers. Next time there's a meeting, print a copy for every player, and see who can call bingo first!

Read the blog entry:

Raena Jackson Armitage PHP Blog: Dynamically Typed
by Raena Jackson Armitage

Build A Buzzword Bingo Card in PHP