Archive for the ‘Coding’ Category

Google’s New Search index, Caffeine

Wednesday, June 9th, 2010

In August of last year, I posted Caffeine, the codename for Google’s latest iteration of its search product. The idea behind it was simple yet encompassing: to “push the envelope on size, indexing speed, accuracy, comprehensiveness and other dimensions.”.

Today, Google have announced in their Official Blog that they have completed the indexing system.

Caffeine provides 50 percent fresher results for web searches than our last index, and it’s the largest collection of web content we’ve offered. Whether it’s a news story, a blog or a forum post, you can now find links to relevant content much sooner after it is published than was possible ever before.

Source: Official Google Blog

What is Google Font API?

Wednesday, June 2nd, 2010

Despite the constant progress in web development and it’s technologies, there’s still one simple area that lacks and until now, has always frustrated me.  What am I referring to?  Web Typography!  Although there potentially thousands of typefaces to choose from, unless you have them installed on the computer you are reading this blog on (and chances are they’re not), as a Web Designer/Developer, I can’t use them which frustrates the hell out of me.

Enter our saviour, Google Font API!  Why somebody didn’t think of this earlier beats me, but Google have very kindly introduced Google Font Directory and Google Font API, a free web service that allows web sites to display and use other fonts, high quality open-source fonts, outside of the safe fonts that are common place.

Why use Google Font API?  If you have a web site that you think would benefit from a slightly different font, then Google Font API is the perfect solution. Instead of using images, @font-face is a much more SEO friendly solution and it’s unobtrusive meaning that you don’t need to update your existing content, just the CSS file.  Also, using Google’s servers means you’re off-loading your servers work to to dish up the CSS, over to Google’s reliable infrastructure.

To use the Google service, you simply browse the Font Directory (which will undoubtidly grow in size), and find the font that you would like to use.  Once found, you simply add a link to your CSS file:

<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Font+Name">

Then just use the new font in your CSS file.  Note that I’ve also used a fallback font just in case.  This is known as font stacks.

p {
 font-family: 'Font Name', serif;

}

For my latest “fun” project, www.PredictFootyResults.co.uk, I employed this technique and used the font of ‘Droid Sans’.

Further reading can be found here on Google’s official pages.

The State of Web Development 2010

Tuesday, May 4th, 2010

Keeping track of cur­rent web design and devel­op­ment prac­tice is far from straight­for­ward. We can make some con­jec­tures as to the gen­eral con­sen­sus about best prac­tices from arti­cles pub­lished at rec­og­nized sites and forums devoted to web devel­op­ment, but just what devel­op­ers are actu­ally doing when they develop for the web is much harder to deter­mine. Objective projects like Opera Software’s MAMA can give us a sense of the use of par­tic­u­lar tech­nolo­gies, but it’s more dif­fi­cult to deter­mine when par­tic­u­lar sites were devel­oped (and so to deter­mine how prac­tices change over time), and it’s also dif­fi­cult to con­clude from these objec­tive data the under­ly­ing prac­tices, philoso­phies and approaches adopted by devel­op­ers (for exam­ple, how impor­tant is it to them that pages look as nearly the same as pos­si­ble across all browsers).

Link to PDF


Source: web directions

Face.com Opens Up To Developers

Tuesday, May 4th, 2010

Facial recognition technology startup Face.com publicly launched at last year’s Techonomy event in Tel Aviv, Israel.

The company is today publicly launching a developer community and open API, providing third-party developers access to their facial recognition technology, including the algorithm that powers their Facebook applications Photo Finder and Photo Tagger.

The former app saw one hell of a kick-off, tagging up to 400 million photos in its first month. A year later, Face.com’s Facebook apps have scanned over 7 billion photos in total and identified no less than 52 million faces.

Developers who are interested in building their own facial recognition apps can now get full access to the open Face.com API, free of charge. That basically means developers can tap into Face.com’s face detection and recognition technology and create brand new ways for friends to engage through photos at zero cost. Hard to beat that offer.

Face.com is letting any developer tap into their tech through simple REST API calls, and via Facebook’s and Twitter’s APIs also enable developers to apply their tried face recognition tech to their users’ social graphs.

Here are some examples of ways the Face Open API and database have already been integrated: Celeb-Finder/Twitterazzi, Tagger Widget and PosterYourself.

Soure: TechCrunch

Web Security: Are You Part Of The Problem?

Monday, January 18th, 2010

This is a great article about the most common web security vulnerabilities, from Smashing Magazine.  If your a novice it will probably open your eyes and strike a spear of fear through you, but not to worry.  With a little reserach you’ll be able to overcome most if not all of the covered vulnerabilities and make your site quite secure.  If your an expert, you may find it interesting just what percentages these vulnerabilities are.

Web Security: Are You Part Of The Problem?

Help Save MySQL!

Monday, January 4th, 2010

If Oracle buys MySQL as part of Sun, database customers will pay the bill.

In April 2009, Oracle announced that it had agreed to acquire Sun. Since Sun had acquired MySQL the previous year, this would mean that Oracle, the market leader for closed source databases, would get to own MySQL, the most popular open source database.

If Oracle acquired MySQL on that basis, it would have as much control over MySQL as money can possibly buy over an open source project. In fact, for most open source projects (such as Linux or Apache) there isn’t any comparable way for a competitor to buy even one tenth as much influence. But MySQL’s success has always depended on the company behind it that develops, sells and promotes it. That company (initially MySQL AB, then Sun) has always owned the important intellectual property rights (IPRs), most notably the trademark, copyright and (so far only for defensive purposes) patents. It has used the IPRs to produce income and has reinvested a large part of those revenues in development, getting not only bigger but also better with time.

If those IPRs fall into the hands of MySQL’s primary competitor, then MySQL immediately ceases to be an alternative to Oracle’s own high-priced products. So far, customers had the choice to use MySQL in new projects instead of Oracle’s products. Some large companies even migrated (switched) from Oracle to MySQL for existing software solutions. And every one could credibly threaten Oracle’s salespeople with using MySQL unless a major discount was granted. If Oracle owns MySQL, it will only laugh when customers try this. Getting rid of this problem is easily worth one billion dollars a year to Oracle, if not more.

Source: Help Save MySQL!

OS X Colour Picker & HEXColorPicker

Tuesday, November 24th, 2009

I’m a big fan of Firefox, purely down to the amount of add-ons it has to customise and help my daily job of Web Design & Development.  However, I can’t help looking across to Safari when the latest release of FF (in this case 3.5.3) makes some of my add-ons incompatiable!

In this example is the advanced colour picker called ColorZilla, from iosart.com.  It’s a very clever.
ColorPicker that sits in the bottom left of the browser, ready to pick any colour on the web page and immediately converts it to RGB or HEX.  Very very useful!!

However, it seems to be incompatiable with the latest release of FF.  So, what to do…

Here’s one solution.  Use the built Mac (look away now PC users) Colour Picker.  It’s in many applications and it is very precise and user freindly.  Here’s how to launch it, without having the application open, and save it in your applications folder!

Colors

1) If you use Spotlight, or Google Quick Search Box, simply type in “AppleScript Editor”, or navigate to your Applications folder and find ‘AppleScript Editor’.

2) Once AppleScript Editor is open, type in “choose color” and Save As > Application, and save it in your Applications folder.  I simply decided on ‘Choose Color’.

3) That’s it, you’re done.  Laucnhing your new application launches the Mac’s Colour Picker.

4) You can extend this application further by adding HEX capability by installing HexColorPicker.

5) Me being me, changed the default icon to this one

Mac PHP Function Reference Dashboard Widget

Tuesday, October 13th, 2009

php_widegtHere is my new favourite Dashboard Widget for the Mac, well, for this month anyway!

PHP Function Reference allows you to quickly lookup the documentation for the PHP web programming language.

Brilliantly, it also has a quick-link to the Date Formatter, that is also interactive!  You can live test in the Dashboard your desired date format.

JavaScript: Object Literals to Pass Optional Arguments

Saturday, October 10th, 2009

Here is a handy coding tip to keep in mind when dealing with functions that can accept a large number of optional arguments. Instead of passing the large number of arguments in the conventional fashion, which could unnecessarily complicate the function, you can pass just one argument which ends up being a collection of arguments declared in an object literal.

Let’s look, first of all, at how we might do this in the typical manner, so we can see the contrast:

function showStatistics(name, team, position, average, homeruns, rbi) {
 document.write("<p><strong>Name:</strong> " + arguments[0] + "<br />");
 document.write("<strong>Team:</strong> " + arguments[1] + "<br />");
 if (typeof arguments[2] === "string") {
 document.write("<strong>Position:</strong> " + position + "<br />");
 }
 if (typeof arguments[3] === "number") {
 document.write("<strong>Batting Average:</strong> " + average + "<br />");
 }
 if (typeof arguments[4] === "number") {
 document.write("<strong>Home Runs:</strong> " + homeruns + "<br />");
 }
 if (typeof arguments[5] === "number") {
 document.write("<strong>Runs Batted In:</strong> " + rbi + "</p>");
 }
}
showStatistics("Mark Teixeira");
showStatistics("Mark Teixeira", "New York Yankees");
showStatistics("Mark Teixeira", "New York Yankees", "1st Base", .284, 32, 101);

The function above can take up to 6 arguments. The first two arguments are mandatory, so inside the function, we don’t check for their existence. The last 4 arguments are not mandatory, so we only display their values if they exist.

We call the function 3 different times (last 3 lines), with different numbers of arguments each time. You can see that if the number of passed arguments was in the dozens, or more, the code could look a little messy, and would be harder to maintain, or read.

Now let’s look at the same code using object literals to pass the arguments:

function showStatistics(args) {
 document.write("<p><strong>Name:</strong> " + args.name + "<br />");
 document.write("<strong>Team:</strong> " + args.team + "<br />");
 if (typeof args.position === "string") {
 document.write("<strong>Position:</strong> " + args.position + "<br />");
 }
 if (typeof args.average === "number") {
 document.write("<strong>Average:</strong> " + args.average + "<br />");
 }
 if (typeof args.homeruns === "number") {
 document.write("<strong>Home Runs:</strong> " + args.homeruns + "<br />");
 }
 if (typeof args.rbi === "number") {
 document.write("<strong>Runs Batted In:</strong> " + args.rbi + "</p>");
 }
}
showStatistics({
 name: "Mark Teixeira"
});
showStatistics({
 name: "Mark Teixeira",
 team: "New York Yankees"
});
showStatistics({
 name: "Mark Teixeira",
 team: "New York Yankees",
 position: "1st Base",
 average: .284,
 homeruns: 32,
 rbi: 101
});

Technically, this second method of passing the arguments might require a little bit more code, but with a large collection of arguments, there are a few advantages.

First, the function itself is simplified because it accepts only one argument (args), which is a collection of all the values passed from the object literal (name, team, position, etc). Plus, the actual argument values are easy to read, and can easily be understood, updated, or modified, since the correlation between the values and the argument references are more direct.

If the function required only a small number of arguments, then this method would not be necessary, and might actually have the opposite effect. So, use this technique sparingly, and only in situations where you foresee the collection of arguments being hard to maintain over time.

Source: Six Revisions