blogs.sitepoint.com
Quote:SitePoint » Learn CSS | HTML5 | JavaScript | Wordpress | Tutorials-Web Development | Reference | Books and More
An Introduction to C Posted on: 19 May 2012, 9:00 am Introduction C is a general purpose, structured programming language. Its instructions consist of terms that resemble algebraic expressions, augmented by certain English keywords such as if, else, for, do and while. In this respect it resembles high level structured programming languages such as Pascal and Fortran. C also contains additional features, that allow it to be used at a lower level, thus bridging the gap between machine language and high level language. This flexibility allows C to be used for systems programming as well as for applications programming. Therefore C is called a middle level language. C is characterized by the ability to write very concise source programs, due in part to the large number of operators included within the language. It has a relatively small instruction set, though actual implementations include extensive library functions which enhance the basic instructions. C encourages users to create their own library fuctions. An important characteristic of C is that its programs are highly portable. The reason for this is that C relegates most computer dependent features to its library functions. Thus, every version of C is accompanied by its own set of library functions which are relatively standardized. Therefore most C programs can be processed on many different computers with little or no alteration. History of C: C was developed in the 1970′s by Dennis Ritchie at Bell Telephone Laboratories,Inc. (now a part of AT&T). It is an outgrowth of two earlier languages, called BCPL and B, which were also developed at Bell Laboratories. The Combined Programming Language(CPL) was developed at Cambridge University in 1963 with the goal of developing a common programming language which can be used to solve different types of problems on various hardware platforms. However it turned out to be too complex, hard to learn and difficult to implement. Subsequently in 1967, a subset of CPL, Basic CPL(BCPL) was developed by Martin Richards incorporating only the essential features. However it was not found to be sufficiently powerful. Around the same time another subset of CPL, a language called B was developed by Ken Thompson at Bell Labs. However it also turned out to be insufficient . Then, in 1972, Dennis Ritchie at Bell Labs developed the C language incorporating the best features of both BCPL and B. C was largely confined to use within Bell Labs until 1978, when Brian Kernighan and Ritchie published a definitive description of the language . The Kerninghan and Ritchie description of C is commonly referred to as ‘K &R C’. Following the publication of ‘K&R C’,computer professionals, impressed with C’s many desirable features, began to promote the use of C. By the mid 1980′s the popularity of C had become widespread-many c compilers and interpreters had been written for computers of all sizes and many commercial application programs had been developed. Moreover, many commercial software products that had originally been written in other languages were rewritten in C in order to take advantage of its efficiency and portability. Early commercial implementations of C differed a little from Kerninghan and Ritchie’s original description, resulting in minor incompatibilities between different implementations. As a result, the American National Standards Institute(ANSI committee X3J11) developed a standardized definition of C. Virtually all commercial compilers and interpreters adhere to the ANSI standard. Many provide additional features of their own. C and Systems Programming: There are several features of C, which make it suitable for systems programming. They are as follows: - C is a machine independent and highly portable language.
- It is easy to learn; it has only 28 keywords.
- It has a comprehensive set of operators to tackle business as well as scientific applications with ease.
- Users can create their own functions and add to the C library to perform a variety of tasks.
- C language allows the manipulation of bits, bytes and addresses.
- It has a large library of functions.
- C operates on the same data types as the computer, so the codes generated are fast and efficient.
Structure of a C Program: Every C program consists of one or more modules called functions. One of the functions must be called main. The program will always begin by executing the main function, which may access other functions. The main function is normally,but not necessarily located at the beginning of the program. The group of statements within main( ) are executed sequentially. When the closing brace of main( ) is encountered, program execution stops and control is returned to the operating system. Any other function defintions must be defined separately, either ahead or after main( ). Each function must contain: 1. A function heading, which consists of the function name, followed by an optional list of arguments, enclosed in parantheses. 2. A return type written before the function name. It denotes the type of data that the function will return to the program. 3. A list of argument declarations, if arguments are included in the heading. 4. A compound statement, which comprises the remainder of the function. The arguments(also called parameters) are symbols that represent information being passed between the function and other parts of the program. Each compound statement is enclosed between a pair of braces{ }. The braces may contain one or more elementary statements (called expression statements) and other compound statements. Thus compound statements may be nested one within another. Each expression statement must end with a semicolon(;). Comments (remarks) may appear anywhere within a program as long as they are enclosed within the delimiters /* and */. Comments are used for documentation and are useful in identifying the program’s principal features or in explaining the underlying logic of various program features. Components of C Language: There are five main components of the C Language:- 1. The character set: C uses the uppercase letters A to Z, the lowercase letters a to z, the digits 0 to 9 and certain special characters as building blocks to form basic program elements(e. g. constants, variables, expressions, statements etc. ). 2. Data Types: The C language is designed to handle five primary data types, namely, character, integer, float, double and void; and secondary data types like array, pointer, structure, union and enum. 3. Constants: A constant is a fixed value entity that does not change its value throughout program execution. 4. Variables: A variable is an entity whose value can change during program execution. They are used for storing input data or to store values generated as a result of processing. 5. Keywords: Keywords are reserved words which have been assigned specific meanings in the C language. Keywords cannot be used as variable names. The components of C language will be discussed in greater detail in the following articles. This section gives only a brief introduction to the components of C. Example 1: The following program reads in the radius of a circle, calculates the area and then prints the result. Code:
/* program to calculate the area of a circle*/
#include<stdio. h> /*Library file access*/
#include<conio. h> /*Library file access*/
void main( ) /* Function Heading*/
{
float radius, area; /*Variable declarations*/
/*Output Statement(prompt)*/
printf("Enter the radius :");
/*Input Statement*/
scanf("%f", &radius);
/*Assignment Statement*/
area = 3. 14159*radius*radius;
/*Output Statement*/
printf("Area of the circle :", area);
getch( );
}
Program output:- Enter the radius: 3 Area of the circle: 28. 27431 The following points must be considered to understand the above program:- 1. The program is typed in lowercase. C is case sensitive i. e. uppercase and lowercase characters are not equivalent in C. It is customary to type C instructions in lowercase. Comments and messages(such as those printed using printf() ) can be typed in anycase. 2. The first line is a comment that identifies the purpose of the program. 3. The instruction #include <stdio. h> contains a reference to a special file called stdio. h . This file contains the definition of certain functions required to read and print data such as printf() and scanf() . It is a header file and hence the extension . h. 4. Similarly #include <conio. h> links the file conio. h which is another header file that contains the definitions of functions used for reading and printing data at the console. The function getch() is defined in conio. h. # denotes a preprocessor directive. More about this in a later article. 5. The instruction void main() is a heading for the function main( ). The keyword void denotes the return type of main and indicates that the function does not return any value to the program after the program has finished executing. The empty parantheses ( ) after main indicates that this function does not include any arguments. Program execution always begins from main( ). 6. The remaining five lines of the program are indented and enclosed in a pair of braces { }. These five lines comprise the compound statement within the function main( ). 7. The instruction float radius, area; is a variable declaration. It establishes the symbolic names ‘radius’ and ‘area’ as floating point variables. These variables can accept values of type ‘float ‘ i. e numbers containing a decimal point or an exponent. 8. The next four instructions are expression statements. The instruction printf(“Enter the radius :”); generates a request for information namely,the value for the radius. This statement generates a prompt where the user enters the value . 9. The value of the radius is read into (or stored in) the variable radius with the help of the scanf ( ) function. The instruction scanf(“%f”, &radius); is used for reading data. “%f” is a conversion character which is used to accept a floating point value. 10. The next instruction, area = 3. 14159*radius*radius; is called an assignment statement. This instruction calculates the area by using the value of radius entered by the user and assigns the value to the variable area. 11. The next printf( ) statement prints the message Area of the circle followed by the calculated area. 12. The statement getch(); is used to pause the screen so that you can read the output. If getch( ) is not used the screen will just flash and go away. This function waits for the user to input some character(as it accepts a character as input), after the program has finished executing. Any key present on the keyboard pressed by the user is accepted by the getch function as input and its ASCII value is returned to main( ). Example2: Below is a variation of the above program: Code:
/*program to calculate the area of a circle using a user defined function*/
#include <stdio. h>
#include <conio. h>
#define PI 3. 14159
float process(float radius);/*function prototype*/
void main()
{
float area,radius;
printf("\n Enter the radius:");
scanf("%f", &radius);
area= process(radius);
printf("Area =%f", area);
getch();
}
float process( float r);
{
float a; /*local variable declaration*/
a= PI*r*r;
return(a);
}
This version utilizes a separate programmer defined function called process, to calculate the area. Within this function, r is an argument (also called a parameter) that accepts the value of radius supplied to process from main, and a is the calculated result returned to main. A reference to the function appears in main( ), within the statement area= process(radius); In this statement, the value of area being returned from the function process is stored in the variable area. The main function is preceeded by a function prototype, which indicates that there is a user defined function called process which is defined after main and that it accepts a floating point argument and returns a floating point value. If the user defined function process, was defined before main( ), the function prototype would,generally, have not been required. More explanation about this when I write about functions in a later article. This program also contains a symbolic constant, PI, which represents the numeric value 3. 14159. This is a form of shorthand that exists for the programmers convenience. When the program is actually compiled, the symbolic constant will automatically be replaced by its numerical value. The output of this program is the same as that of the previous program. This article was a brief introduction, it gives an idea of C programming. The next article will talk about the fundamental concepts of C which include the C character set, Identifiers and keywords, data types in detail, constants,variables, variable declarations, expressions, statements and symbolic constants .  Use Functions.php to Create an Advanced WordPress Theme Posted on: 18 May 2012, 9:00 am One of the best-kept secrets when it comes to WordPress theme design is the power that can be wielded by a well-crafted “functions.php” file. This file resides within the theme’s main folder and is separate from the side-wide functions file which WordPress uses to produce its basic and included functions. When put to good use, it can extend the functionality of both the theme itself, and the WordPress Dashboard. One of the most common uses for this custom functions file is the creation of a theme-specific control panel that allows users to determine theme appearance options on their own, without so much as a single edit to the theme’s actual files. It’s the perfect option for novice users and has real benefits for theme developers. Why is it Important to Develop a Theme Control Panel?It’s certainly true that any WordPress theme can be designed strictly as a set of PHP template files without any interaction with the Dashboard at all. In fact, that’s how the majority of themes designed by the wider WordPress community currently function. But that’s limiting, especially given the appeal of this particular content management software to a large subset of first-time bloggers, web design novices, and newcomers to the idea of content management at large. Using PHP arrays and functions to create a custom control panel gives a developer far wider credit and appeal among the 60 million people who constitute the WordPress user base. And it ensures they won’t dump a theme because they can’t figure out how to customize things like the color of links, the image in the site’s masthead, or whether the sidebar resides on the left or right side of the page. Giving these new users a way to alter a theme using point-and-click options keeps them in the fold longer, guides them toward more advanced techniques, and contributes to the sterling reputation enjoyed by WordPress among both new and advanced users. Creating this control panel is easy; it takes just a few steps and some basic PHP knowledge to complete. Step 1: Create a “Functions.php” File to Do the JobIf you’re like most WordPress theme designers, you’ve probably crafted one or more themes that simply don’t have a “functions.php” file because you saw no need to add functions to the existing set of WordPress features. In that case, it’s time to create a file in the appropriate directory so that the Dashboard can be told which settings to customize, how to customize them, and how users should be presented with their options. This functions file should be created in the following directory: Code:
/public_html/wp-content/themes/relevant-theme-folder/
Feel free to create the file in a text editor, save it with a .php file extension, and then upload it to the server. This will allow for direct editing of the file, which is simply easier than managing the same file in both a remote and local location. When the file has been created and uploaded, open it for editing and proceed. Step 2: Define Theme Control Panel Variables for Easy Functions CodingThe next step in the process is to start the new “functions.php” file with two variables that will ease the process of developing custom functions and settings input for users. After the starting PHP tag, two lines of code will be placed in the file: Code:
$longname = "Advanced Theme with a Control Panel";
$formname = "advanced";
These two variables will be used throughout the Dashboard control panel page that is being created. The initial $longname variable should contain the name of the theme, identical to the theme’s name as determined in the opening lines of its “style.css” file. This will display as the title of the control panel page, the title of the link to the control panel’s page in the Dashboard sidebar, and in some other areas of the theme. The shorter $formname variable will be used to identify each settings selection form element on the control panel page, which is generated in the ensuing steps. Step 3: Getting Comfortable with PHP Arrays and Initializing the Beginning of the FunctionThe entire process of specifying which settings can be customized will be done using a series of PHP arrays that define and fulfill certain variables. These arrays are identical in every way, except for the first series of arrays, which actually declares the page’s title to users and begins the process of printing the settings onto the control panel page: Code:
$prefs = array (
array ( "name" => $longname." Customization Settings",
"type" => "title"),
array ( "type" => "open"),
⋮
In this array, the $prefs variable is defined using several variables and it’s available for use in the creation of PHP functions a few steps later. The title of the page is the first thing that we define using this array, and it uses the $longname variable for consistency. The text after $longname can be customized to a user’s desires, but remember that this title will have to be consistent in the sidebar link to the control panel, as well. Step 4: Defining a Customization for the Theme’s DisplayNext, we define an array for every single option that a user can customize, from header images to footer text and everything in between. The things that can be customized are entirely up to the theme developer, but it’s important to remember that a PHP array must be created for each option. Additionally, every array must include a number of variables and definitions that help print the options on the page and give their selection meaning: Code:
array (
"name" => "Homepage Welcome Text",
"desc" => "This text will display immediately above entries to greet new visitors and inform them of the latest happenings going on at your website.",
"id" => $formname."_hello",
"type" => "text",
"std" => "Welcome to my home on the internet! I've had some really popular posts lately, which you might want to check out. These posts are below. Enjoy your stay!",)
),
This is the only option array we will be defining, so it was closed with double parentheses and a comma. If this was only the first of many arrays, it would be closed with just one parentheses and trailed by a comma. Please keep this in mind, as an erroneous double-comma will close the entire array and lead to a large number of printed PHP errors on the administration page if there are arrays after this closing statement. In the example above, several variables are defined that name the setting itself, describe its function, name the form element, and set the standard (or default) text to be displayed on a theme user’s homepage. The variables above work as follows: - “name” is the printed name of the setting and must be a descriptive title for the form element.
- “desc” describes what the setting customizes and why a user might wish to put their custom approach in print.
- “id” is the identification of the HTML form element that is printed on the page, for database and CSS styling purposes.
- “type” defines which kind of HTML element is being printed on the page, including checkboxes, radio buttons, text boxes, and drop-down selections.
- “std” is the default setting for the user-customizable option. It can be the default option in a drop-down list, the checkbox or radio button selected by default, or the standard text placed into a text box that a user can rewrite or delete.
Each of these variables must be defined uniquely from all the others in the same array. No form can have the same name, title, or ID. The type and default options can obviously be the same or similar, but there’s little reason for them to be and users may find themselves quite confused in that case. When the array of options has been completed, it’s time to close up shop and print a simple line that brings the series of arrays to an end: Code:
array("type" => "close"));
Step 5: Turning a Bunch of Arrays into a Valid Control Panel PageThe PHP arrays are the most important part of the process when it comes to defining user customizations. However, they are virtually useless unless they’re paired with a printed control panel page. That must be done with a complex PHP function that is placed in “functions.php” directly below the arrays themselves: Code:
function advanced_customizations_page() {
global $longname, $formname, $prefs;
if ($_GET['page'] == basename(__FILE__)) {
if ('save' == $_REQUEST['action']) {
foreach ($prefs as $value) {
update_option($value['id'], $_REQUEST[ $value['id'] ]);
}
foreach ($prefs as $value) {
if (isset($_REQUEST[ $value['id'] ])) {
update_option($value['id'], $_REQUEST[ $value['id'] ]);
}
else {
delete_option($value['id']);
}
}
header("Location: themes.php?page=functions.php&saved=true");
die;
}
else if ('reset' == $_REQUEST['action']) {
foreach ($prefs as $value) {
delete_option($value['id']);
}
header("Current location: themes.php?page=functions.php&reset=true");
die;
}
}
add_menu_page($longname." Customization Settings", "".$longname." Customization Settings", 'edit_themes', basename(__FILE__), 'advanced_customizations_page');
function advanced_customizations_page() {
global $longname, $formname, $prefs;
if ($_REQUEST['saved']) echo '
Success! '.$themename.' customization settings have been saved.
';
if ($_REQUEST['reset']) echo '
Success! '.$themename.' settings have been reset.
';
⋮
?>
The three functions above are essential to the process. The first one instructs the control panel to print the settings arrays onto the page and save the information into database cells, which are created on the fly. The second function creates a link in the Dashboard sidebar that leads to the new theme options page. And the final set of functions prints confirmation of user activity so that they’re not left to assume whether or not they’ve been successful in customizing their installed WordPress theme. Step 6: Printing Form Elements and Finishing the Last StepsThe hard work of PHP coding is now effectively finished, but the production of HTML must now be completed. Every customized WordPress options page is styled the same way; the WordPress software wraps these pages in a div tag: This tells the standard WordPress stylesheet to apply to the text boxes, drop-down boxes, textual elements, and other design cues on the page. Within this HTML, both the $longname and $formname variables can be used for expediency in producing code and uniquely-named form elements. Each type of form element (text, select, checkbox, etc.) must be individually styled and surrounded by the following PHP tag: Code:
< ?php case "checkbox": ?>
Code is placed within this tag to style checkboxes, and then the code is closed with another tag that tells the software to move on to the next set of HTML code if a checkbox is not the current element being displayed and styled: Code:
< ?php break; case "select": ?>
With these tags in place, and every HTML form element completely styled, the custom themes options page is now complete. Be sure to test the completed page for HTML or PHP errors, and make sure that the preferences defined in the Dashboard are being reflected on the page’s index and other templates after selection. If everything checks out, the process is complete and the results can be shared with the wider WordPress community.  What’s New in Chrome 19 Posted on: 17 May 2012, 11:24 am  I doubt you noticed but Chrome 19 was released this week. I rarely mention Chrome’s updates because, well, they’re rarely worth mentioning. However, I’ve discovered a few hidden gems in the latest browser… Tab SyncingThe big new feature is tab syncing. If you’re using Chrome on two or more PCs/smartphones, you should see an “Other devices” link on the new tab page. Click it and you can open synchronized links. I say “should” because I haven’t been able to get it working. Tab syncing has been available in Firefox for a while so I’m surprised it’s taken quite so long to appear in Chrome. Hopefully, you’ll have better luck than I did. CSS3 calc() SupportThe webkit team has finally implemented one of my favorite CSS3 features: the little-known calc() function. It allows you to define calculated dimensions, e.g. Code:
#myelement { width: calc(50% - 2em + 4px); }
Chrome supports calc() with the -webkit prefix. Firefox uses -moz and IE9 is happy without prefixes. To use it effectively, you’ll need fallback code such as: Code:
#myelement
{
width: 46%;
width: -webkit-calc(50% - 2em + 4px);
width: -moz-calc(50% - 2em + 4px);
width: -o-calc(50% - 2em + 4px);
width: calc(50% - 2em + 4px);
}
Combined Settings PageChoosing tool > Settings now displays a side menu with History, Extensions, Settings and Help. The Help page provides a couple of links and the update checker which normally appears on the “About” dialog (will that disappear soon?) New JavaScript/ECMAScript 5.1 (Harmony) FeaturesA number of experimental JavaScript features have made their way from the Harmony specification into Chrome’s V8 engine. However, they’re not available by default — you’ll need to “Enable Experimental JavaScript” in chrome://flags. Language structures such as collections and proxies look great, but it’ll be some time before they’re available in all browsers. Security and Bug Fixes21 issues have been fixed in Chrome 19 and Google has paid almost $15,000 to eagle-eyed security hackers. Chrome has remained fast and stable. It looks set to knock IE from the top of the browser usage chart during the summer of 2012. I’m not convinced any other vendor can prevent Google’s domination of the web and the software we use to access it.  iOS to IE10 Metro: Building Cross-Browser Plugin-Free Experiences Posted on: 16 May 2012, 9:00 am  If you’ve built a plugin-free browsing experience for the iPad, a few changes will make it ready for the new IE10 plugin-free experience on Windows 8. As more browsers adopt the plugin-free approach, now is a good time to start thinking about it. I’ll show you how to do this in a few steps by writing code that works well in all modern browsers. Today we’re going to work with a MSNBC plugin-free experience for rich media. It breaks down to two things: styles and scripts. To modify the files of MSNBC, I will be using a proxy application known as Fiddler. You can download this tool from http://fiddler2.com. This tool allows me to modify remote files as though they were on my local machine. If you have direct access to your own site, you can ignore Fiddler, and work directly with your files. Fiddler provides a great way for testing changes without the risk of breaking your live site. Step 1: Declare Standards Mode and Valid Markup for Modern BrowsersIn order to use the HTML5 elements that we’ll be utilizing below, you’ll first need to ensure that you are operating in standards mode. One way to do this is to include the HTML5 doctype at the top of your document: Step 2: Update your CSS Vendor PrefixesThe CSS language is undergoing a lot of change as new features are suggested, updated, and standardized. In order to allow developers to learn these new features, browser vendors typically offer experimental implementations via prefixed properties. A key part of using vendor prefixes responsibly is to ensure that prefixes from each vendor are included in your site to allow for the broadest level of feature support. In many cases, especially when building an iPad-centric site, you may focus solely on -webkit properties, omitting the prefixes that target other browsers such as -o, -ms, and -moz. The end result of this is that you greatly limit the target devices that can render your plugin-free site as well as provide a degraded experience for users of other modern browsers, many of which could serve up equally engaging functionality. For instance, we find the following on MSNBC: Code:
background: -webkit-gradient(
linear,
left top,
left bottom,
color-stop(1, rgba(192,192,192,.6)),
color-stop(0.5, rgba(0,0,0,.6))
);
With the growing trend towards an HTML5 plugin-free experience, it’s important to expand these rules to provide the vendor prefixes of other major browsers as well: Code:
background: -webkit-linear-gradient(
top, rgba( 0, 0, 0, 0.0 ) 0%, rgba( 0, 0, 0, 0.6 ) 50% );
background: -moz-linear-gradient(
top, rgba( 0, 0, 0, 0.0 ) 0%, rgba( 0, 0, 0, 0.6 ) 50% );
background: -ms-linear-gradient(
top, rgba( 0, 0, 0, 0.0 ) 0%, rgba( 0, 0, 0, 0.6 ) 50% );
background: -o-linear-gradient(
top, rgba( 0, 0, 0, 0.0 ) 0%, rgba( 0, 0, 0, 0.6 ) 50% );
background: linear-gradient(
top, rgba( 0, 0, 0, 0.0 ) 0%, rgba( 0, 0, 0, 0.6 ) 50% );
While more verbose, the benefits to broad browser feature support certainly outweigh the extra typing involved. In addition, there are a number of great tools that can break down this workload, such as SASS and Compass, -prefix-free, or even CSS Snippets in the upcoming Visual Studio 2011. Also, if you’re working predominantly in JavaScript and would like to save time determining which features are supported by your client’s browser, review the instructions in A Best Practice for Programming with Vendor Prefixes on the IEBlog. Step 3: Get Rid of Browser Sniffing MethodsThere are two methods used to determine the capabilities of the user’s browser and device. One method, which unfortunately is somewhat popular, is browser sniffing. This method consists of examining the navigator object for certain patterns or values: Code:
if ( navigator.userAgent.indexOf("iPad") > -1 ) {
// Load HTML5 Experience
} else {
// Load Flash Experience
}
The above code looks at the user agent string for the value “iPad”, and if found delivers a plugin-free HTML5 experience. Otherwise, it’s assumed you are on a device that has Flash installed. This will result in a broken experience for non-iPad users who are browsing with plugins disabled, even though their browser is capable of handling HTML5 features. Here is an attempt to find the version of Internet Explorer: Code:
if ( tests.IE ) {
j = /msie.(\d\.\d+)/i;
k = navigator.userAgent.match(j)[1];
}
The user agent string is tested for a pattern that attempts to target the version number. This pattern looks for a single digit, followed by a period, followed by any number of additional digits. While this test will find values like “MSIE 8.0” and “MSIE 9.0”, it will not identify the latest version of Internet Explorer, which identifies itself as “MSIE 10.0”, as only one digit is expected before the period. These are just a couple examples of why browser sniffing is not a best practice. The user agent string is not immutable—it is a read-write value that is easily changed by plugins, or even the user. Most modern browsers include the ability to easily change this value from their development tools, which some users take advantage of to get around poorly-developed websites. If we disable plugins, or visit MSNBC from a device/browser that doesn’t have Flash, we would expect it to attempt a plugin-free experience. Unfortunately, this is not the case. Rather than seeing an HTML5 experience, we’re instead asked to download Flash. This is because the site puts the user in one of two categories: an iPad user, or a Flash-enabled user. 
Feature DetectionRather than trying to guess what a browser is capable of by sniffing its user agent string (which will fail you eventually), it is much wiser to actually test features directly in the browser. If you wanted to test the browser’s ability to deliver video and audio via HTML5, you could actually attempt to create these elements via JavaScript, and see if the browser understands them. This practice is called feature detection: Code:
if ( !!document.createElement(“video”).canPlayType ) {
// Load HTML5 Video
} else {
// Load Flash Video
}
In the above example, we start by testing whether the canPlayType method exists on our newly-created video tag. We’re using double-negation to cast the response to a Boolean. If the browser understands what a video element is, the canPlayType method will be present. If the video element is unknown to the browser, the canPlayType method will not exist. If this test passes, we load our HTML5 video. If the test does not pass, we attempt to load Flash. Deeper feature detection could take place here, because Flash may not be on the machine, or may be disabled. Feature detection is the preferred method of determining what a browser is capable of, as there is no guesswork involved. If the browser passes properly-constructed tests, it absolutely supports the features you would like to use. Many great tools exist to provide feature tests for you. Once such tool, which provides over 40 tests, is Modernizr. This tool creates a global object called “Modernizr” which contains the results of your tests. With Modernizr, testing for HTML5 video support is extremely easy: Code:
if ( Modernizr.video ) {
// Load HTML5 Video
}
MSNBC engages in browser sniffing to see if the device accessing the page is an iPad or not. Our first step is to remove the browser sniffing code, and replace it with feature detection code. Before we can modify browser sniffing code, we first need to locate it. While in Internet Explorer, pressing F12 will pull up our Developer Tools. Within the tools, open the Script tab and do a search for “userAgent”. This search will seek out any instance of this property name in all of the site’s script files. We’re interested in the result from line 41 of http://www.msnbc.msn.com/id/37156949/. 
Now that we know what we want to edit, we can open up Fiddler and load up our traffic. Once Fiddler is opened, perform a hard-refresh (Ctrl+F5 in IE) on the MSNBC page. This results in all of the page sessions being listed in Fiddler. 
Looking carefully, you’ll notice our resource is the third from the top. Next we can set up an AutoResponder for this session file so that anytime it is requested, a custom file is substituted in the place of the server response: - Right-click this session and select “Decode Selected Sessions” from the context menu.
- Select the AutoResponder tab on the right.
- Click the “Enable automatic responses” checkbox in the AutoResponder tab.
- Drag the selected session from the left panel into the AutoResponder tab.
At this point, you should have an entry within your AutoResponder tab with the following rules: - If URI matches: EXACT:http://www.msnbc.msn.com/id/37156949/
- Then respond with: *200-SESSION_3
Right-click the entry in the AutoResponder and select Edit Response. In the popup that follows, switch to the SyntaxView tab where we will find the source for this file. As expected, line 41 contains our browser sniffing code: Code:
if ( !(navigator.userAgent.toLowerCase().indexOf("ipad")>-1) ){
// Flash Experience
}
Rather than test the contents of the userAgent, we’re going to instead look for support for the HTML5 video tag. Switch the above condition to the following: Code:
if ( !document.createElement("video").canPlayType ) {
// Flash Experience
}
This test checks to see if we cannot use the video element. If canPlayType comes back as undefined, it will be cast to true and the first code block will be entered, setting up the Flash experience. Step 4: Update Touch and Pointer EventsSafari supports both a touch event model and a mouse event model. Internet Explorer 10 groups touch, mouse, and stylus events into a single abstract item known as a pointer. In fact, Internet Explorer 10 is the first browser to work for all input types, across all devices. This abstraction cuts down drastically on the amount of effort involved to determine which event model you ought to bind to and how to detect user-interaction. This pointer is then handled through MSPointer events. If necessary, you can determine the type of pointer by accessing the pointerType property. 
As Internet Explorer doesn’t support Apple’s proprietary event model, which includes touch events like touchstart, touchmove, and touchend, MSNBC’s event listeners will need to be amended to listen for MSPointer events like MSPointerDown, MSPointerUP, and MSPointerMove. Due to the difference in event model implementations, use a feature detection tool like Modernizr or code like this to target all major event models: Code:
if (window.navigator.msPointerEnabled) {
myCanvas.addEventListener("MSPointerMove", paint, false);
} else {
myCanvas.addEventListener("mousemove", paint, false);
myCanvas.addEventListener(“touchmove”, paint, false);
}
MSNBC only supports touch events, which we will need to change so that visitors who happen to be using a mouse can still interact with the page. Our events are tied up in http://www.msnbc.msn.com/id/43662671/15: Code:
document.addEventListener("touchstart", touchHandler, false);
document.addEventListener("touchmove", touchHandler, false);
document.addEventListener("touchend", touchHandler, false);
We’re going to update this to include the MSPointer events as well: Code:
if (window.navigator.msPointerEnabled) {
document.addEventListener("MSPointerDown", touchHandler, false);
document.addEventListener("MSPointerMove", touchHandler, false);
document.addEventListener("MSPointerUp", touchHandler, false);
} else {
document.addEventListener("touchstart", touchHandler, false);
document.addEventListener("touchmove", touchHandler, false);
document.addEventListener("touchend", touchHandler, false);
document.addEventListener("mousedown", touchHandler, false);
document.addEventListener("mousemove", touchHandler, false);
document.addEventListener("mouseup", touchHandler, false);
}
First, we’re checking for the presence of pointers. Since the MSPointer covers the mouse, fingers, and pens, we don’t need anything else besides them. We fall back, if necessary, to provide both touch and mouse events. Next, we need to create cases for these event types in http://www.msnbc.com/id/44937131/. Currently, MSNBC starts with the following: Code:
if ( event.type == "touchstart" ) {
/* Start drag logic */
} else
if ( event.type == "touchmove" ) {
/* Drag logic */
} else
if ( event.type == "touchend" ) {
/* Complete drag logic */
}
We’ll modify this to listen for all of the registered event types: Code:
if ( event.type.match( /(down|start)$/i ) ) {
/* Start drag logic */
} else
if ( event.type.match( /move$/i ) ) {
/* Drag logic */
} else
if ( event.type.match( /(up|end)$/i ) ) {
/* Complete drag logic */
}
The above uses the match method and a series of regular expressions to determine which event was raised. If the event raised ends with a case-insensitive “down” or “start”, we begin our drag code. If the event ends with a case-insensitive “move”, we perform the actual drag logic itself. And lastly, if the event ends with a case-insensitive “up” or “end”, we end our dragging event. Note: other events may be caught here as well, like onresizeend and keyup. Be sure to consider this in your project. The above is an implementation of Ted Johnson’s solution in Handling Multi-touch and Mouse Input in All Browsers. The drag logic itself initially relies upon the event.targetTouches TouchList. This member does not exist in Internet Explorer. The drag logic attempts to gather the pageX and pageY properties from the first item in the TouchList, however, in Internet Explorer these values are found directly on the event object: Code:
var curX = event.targetTouches[0].pageX;
Using the logical OR operator, I instruct curX to hold the value of event.pageX as long as event.pageX is present on the event object. If this property is not found, look within the targetTouches list: Code:
var curX = event.pageX || event.targetTouches[0].pageX;
If event.pageX is not found, we fall back to assigning the value of targetTouches[0].pageX to our variable. Another important item to keep in mind is that this site initially responds to touchmove. When this event is raised while touching the playlist, the code attempts to reposition the playlist based upon your touch movement. There is no hovering when it comes to touch—you’re either touching, or you’re not. Now that we have mouse events tied into this logic, we have introduced the possibility for hovering. So while touchmove is free to reposition our playlist when it is over the playlist, we don’t want to do the same for mousemove. In fact, we only want the mousemove event to reposition the playlist when the mouse button is pressed. For further reading, and examples on how to target all browsers, see Handling Multi-touch and Mouse Input in All Browsers. Testing Both ExperiencesRecall our feature detection from earlier, how we first check to see if HTML5 video support is in the user’s browser. If it is, we give them HTML5. If it is not, we give them Flash. One easy way to test our work is to use a browser, or document mode, that doesn’t support HTML5 features. This is very easy to test with Internet Explorer: - Press F12 to reveal the Developer Tools
- Change your Document Mode to Internet Explorer 7 Standards
- Refresh the page
If our feature detection condition was written properly, you should now be watching a Flash-based presentation. Switching your Document Mode back into Internet Explorer 9 Standards (or “Standards” if you’re using IE10), will return you to the HTML5 experience. Get it Done!Hopefully this post helps to define the types of changes that will allow your iOS site to work properly in IE10 Metro and other plugin-free environments. By including best practices such as feature detection and responsibly using vendor prefixes for great new features, you should be able to provide your users with a great experience, regardless of which browser or device they’re using. To assist with testing in other plugin-free environments, download Internet Explorer 10 (currently available only in the Windows 8 CP) and begin testing today!  Two New Proposals to Solve the CSS3 Vendor Prefix Crisis Posted on: 15 May 2012, 9:41 am  Web developers have been concerned about the vendor prefix crisis since February 2012. To summarize the issue, this is what should happen in an ideal world: - Vendors implement experimental CSS3 properties using their own prefix, e.g. -webkit-transform, -moz-transform, -ms-transform, -o-transform.
- Developers can use the technologies today without breaking cross-browser compatibility. Properties can be listed with their prefixed and unprefixed names to ensure they work everywhere.
- Once a property becomes a W3C recommendation, all browser vendors can provide a stable unprefixed property, e.g. transform.
- Optionally, developers can remove the prefixed properties from their stylesheets. However, it’s not strictly necessary if the unprefixed property is defined last and CSS cascade rules apply.
This is what occurs in the real world: - Vendors implement experimental CSS3 properties using their own prefix. In some cases, vendors promote them as an HTML5 “standard” even if they’re device-specific or never submitted to the W3C.
- Some developers use the proprietary property from a single vendor, e.g. only -webkit-transform. This might be owing to ignorance, laziness or because they’re testing a limited number of devices.
- Once a property becomes a W3C recommendation, all browser vendors can provide a stable unprefixed property, e.g. transform…
- but developers neglect to change their stylesheets. The site looks good in some browsers but worse in others even when they support the standard W3C specification.
- The vendors become concerned and add support for other prefixes into their browser, i.e. Opera implements the -webkit prefix for some properties. The prefix process is broken and, while it’s too early to predict the outcome, the majority of developers consider it to be a bad move.
We have discussed the issues at length on SitePoint; there are no easy solutions. However, two interesting proposals have been raised by W3C members during the past week. Option 1: Unprefixed Properties are Supported From Day OneThe first proposal comes from Florian Rivoal, Opera’s W3C representative: When a browser vendor implements a new CSS feature, it should support it, from day 1, both prefixed and unprefixed, the two being aliased. If a style sheet contains both prefixed and unprefixed, the last one wins, according to the cascade. Authors should write their style sheets using the unprefixed property, and only add a prefixed version of the property (below the unprefixed one) if they discover a bug or inconsistency that they need to work around in a particular browser. If a large amount of content accumulates using the a particular vendor prefix to work around an issue with the early implementation in that browser, the vendor could decide to freeze the behavior of the prefixed property while continuing to improve the unprefixed one.
For example, you could use the following transform code in your CSS: Code:
transform: rotate(30deg);
The property would be ignored by all browsers which had not implemented transforms. If there were a difference between two or more implementations, e.g. webkit browsers rotated anti-clockwise by default, you could override the property accordingly, e.g. Code:
transform: rotate(30deg);
-webkit-transform: rotate(-30deg);
It’s a simple solution and easy to implement. Most existing stylesheets would continue to work and prefixed properties would rarely be necessary. In most cases, you would never need to update your CSS again. However, what would happen if webkit changed rotation to the W3C-approved clockwise direction? Developers would need to fix their stylesheets by removing or rearranging the -webkit-transform: rotate(-30deg); property. Unfortunately, not everyone uses the same version of the webkit engine at the same time. You could encounter a situation where your site works in Chrome but not in Safari for several months. Option 2: A New Vendor-Draft ModifierThe second proposal comes from François Remy: Let’s introduce the “!vendor-draft” value modifier. I propose we use unprefixed properties from start, but with a token explaining which version of the property we built our CSS for:
/> border-radius: 3px !webkit-draft; Any browser which is not webkit but implemented border-radius in a way that is compatible with the “webkit draft” can support the declaration. This is different from vendor prefixes: other browsers don’t impersonate webkit, they just acknowledge they support one specific property the way the webkit draft defines it. Browsers which are not compatible with that draft will just ignore the declaration. Browsers that change their implementation of a property are encouraged to iterate their “!vendor-draft” flag (using a version number, if appropriate).
This solves the issue by changing the property value rather than its name (in a similar way to the !important modifier). Again, the following transform code could be used: Code:
transform: rotate(30deg);
But a default anti-clockwise rotation could be fixed in any browser adhering to a webkit specification: Code:
transform: rotate(30deg);
transform: rotate(-30deg) !webkit-draft;
If a browser subsequently supported the W3C specification, the second property would be ignored. It would also be possible to implement draft versioning, e.g. Code:
transform: rotate(30deg);
transform: rotate(-30degrees) !webkit-draft;
transform: rotate(-30deg) !webkit-draft-2;
It’s a flexible solution which finally addresses the issue of properties evolving over time. Unfortunately, it’s more difficult to implement and could take months to appear in browsers even if all vendors agreed today. It may be technically better, but it’s a fundamentally different approach which could break existing stylesheets. In the short term, vendors would probably support both prefixes and value modifiers — and that would lead to confusion. I like both solutions. From a coding perspective, vendor-draft modifiers seems the most logical option but I doubt it can be considered until vendors “complete” CSS3 and begin work on CSS4. Supporting unprefixed properties is more practical but will certainly cause versioning issues which couldn’t be fixed in CSS alone. But perhaps that’s the price you pay for using experimental technology? Do you have a preference for either of these options? Or is it too late to prevent a vendor prefix catastrophe?  An Overview of the Web Storage API Posted on: 15 May 2012, 9:00 am  Web developers have long yearned for a way to store data long term. Cookies are an option, but they can only store 4KB of data. Additionally, cookies are sent to the server with each HTTP request. This means that cookies, especially large ones, can consume considerable network bandwidth. There have been other attempts to implement storage techniques, but for the most part they have been hacks. Then, along came HTML5 and the Web Storage API to the rescue. The Web Storage API defines two types of storage areas ― local storage and session storage. Local storage is persistent data which remains until it is explicitly deleted, or until the browser’s cache is cleared. According to the specification, browsers should allocate at least 5MB of local storage per domain. The second storage type, session storage, is also persistent data, however the data is tied to a “top-level browsing context” (i.e. a browser tab or window). Session data remains until it is either deleted or the browsing context is closed. Session storage is particularly useful when a user is interacting with multiple instances of the same website. In such a situation, using local storage could result in the different instances overwriting each others data. The two types of storage areas are accessed through global objects named “localStorage” and “sessionStorage”. Both storage areas implement the exact same API. Data is stored as key/value pairs, and all data is stored in string form. When adding data to storage, it is implicitly converted to a string. However, when the string data is retrieved from storage it needs to be explicitly converted to the appropriate data type using functions such as parseInt(). When dealing with objects, the JSON.parse() and JSON.stringify() methods should be used for serialization and deserialization. Detecting Storage SupportThe Web Storage API, like many other HTML5 features, is not supported by all browsers. To check if a browser supports storage, use the function shown below. The function checks for the existence of the global “localStorage” object. A similar function could be created to check for session storage, but it can be safely assumed that if one storage area exists, then so does the other. Code:
function localStorageSupported() {
try {
return "localStorage" in window && window["localStorage"] !== null;
} catch (e) {
return false;
}
}
Storing DataData is added to storage using the setItem() method. setItem() takes a key and value as arguments. If the key does not already exist in storage, then the key/value pair is added. If the key is already present, then the value is updated. Several example setItem() usages are shown below. The examples show how to add data of various types to local and session storage. Notice that the “key” argument must always be a string, while the type of “value” can vary. Code:
localStorage.setItem("key", "value");
sessionStorage.setItem("foo", 3.14);
localStorage.setItem("bar", true);
sessionStorage.setItem("baz", JSON.stringify(object));
Data can also be added to storage using object property assignment statements. The previous setItem() examples have been rewritten below using assignment statements. Note that the assignment to “key” on the first line will fail silently. This is because the storage areas have a built in function named key() that will be covered later. For this reason, the API methods are the preferred way to access storage. Code:
localStorage.key = "value"; // this fails silently
sessionStorage.foo = 3.14;
localStorage["bar"] = true;
sessionStorage["baz"] = JSON.stringify(object);
If a site attempts to store too much data, eventually the browser’s storage quota will be exceeded and an exception will be thrown. To handle this case, try-catch blocks should be used when storing data. An example of this is shown below. Code:
try {
localStorage.setItem("key", "value");
} catch (e) {
alert("Exceeded Storage Quota!");
}
Reading Stored DataTo read data from storage, the getItem() method is used. getItem() takes a lookup key as its sole argument. If the key exists in storage, then the corresponding value is returned. If the key does not exist, then null is returned. The following examples use the getItem() method to retrieve the data stored in the setItem() examples. Code:
var string = localStorage.getItem("key");
var number = sessionStorage.getItem("foo");
var boolean = localStorage.getItem("bar");
var object = JSON.parse(sessionStorage.getItem("baz"));
Stored data can also be accessed by reading properties of the “localStorage” and “sessionStorage” objects. The previous getItem() examples have been rewritten below using object property syntax. Code:
var string = localStorage.key;
var number = sessionStorage.foo;
var boolean = localStorage["bar"];
var object = JSON.parse(sessionStorage["baz"]);
Iterating Over Stored DataOften times, it is necessary to programmatically loop over all of the items in storage. The loop’s upper bound is determined by the “length” property of the particular storage area. The stored keys can be retrieved one at a time using the key() method. key() takes a single integer parameter that acts as an index to the storage area. An example of looping over each key/value pair in “localStorage” is shown below. Of course, session storage can be processed in a similar fashion by substituting “sessionStorage” for “localStorage”. Code:
for (var i = 0; i < localStorage.length; i++) {
var key = localStorage.key(i);
var value = localStorage.getItem(key);
// do something with the key and value
}
Deleting Stored DataWhen data is no longer needed, it should be explicitly removed. This is especially true for local storage, as it will persist even after the browser is closed. To delete individual key/value pairs from storage, the removeItem() method is used. The removeItem() method takes the key to be deleted as its only parameter. If the key is not present then nothing will happen. Examples of the removeItem() method are shown below. Code:
localStorage.removeItem("key");
sessionStorage.removeItem("foo");
localStorage.removeItem("bar");
sessionStorage.removeItem("baz");
The delete operator can also be used to remove stored data. The previous example is rewritten below using delete instead of removeItem(). Code:
delete localStorage.key;
delete sessionStorage.foo;
delete localStorage["bar"];
delete sessionStorage["baz"];
While removeItem() is used to delete individual pieces of data, the clear() method is used to delete all stored data. Usages of the clear() method are shown below. Code:
localStorage.clear();
sessionStorage.clear();
The storage EventA user can potentially have several instances of the same site open at any given time. Changes made to a storage area in one instance need to be reflected in the other instances. The Web Storage API accomplishes this synchronization using the “storage” event. When a storage area is changed, a “storage” event is fired for any other tabs/windows that are sharing the storage area. Note that a “storage” event is not fired for the tab/window that changes the storage area. Storage areas can be changed by calls to setItem(), removeItem(), and clear(). However, not all calls to these methods actually change the storage area. For example, calling clear() on an empty storage area or removeItem() on a key that does not exist will not change the storage area, and therefore will not fire an event. The “storage” event object has several fields of interest which are described below. Following the description of the fields is an example “storage” event handler. - “key” ― This field is the key argument of setItem() or removeItem(), or null when clear() caused the event to be fired.
- “newValue” ― The “value” argument to setItem() is reflected in this field. Calls to removeItem() and clear() cause this field to be null.
- “oldValue” ― This field holds the key’s value prior to a call to setItem() or removeItem(). Calls to clear() cause this field to be null.
- “url” ― The “url” field stores the address of the page whose storage area was affected.
- “storageArea” ― The “storageArea” field corresponds to the local or session storage area that was changed.
Code:
window.addEventListener("storage", function(event) {
var key = event.key;
var newValue = event.newValue;
var oldValue = event.oldValue;
var url = event.url;
var storageArea = event.storageArea;
// handle the event
});
Example PageThe following code implements a sample page for manipulating local storage. The page is also available online here. The example covers the entire local storage API, including the “storage” event. In order to see the “storage” event in action, the page must be open in at least two separate tabs/windows of the same browser. The “storage” event will also only work if the page is served over HTTP (i.e. the file:// protocol will not work). Code:
<!DOCTYPE html>
<html>
<head>
<title>Web Storage Example</title>
<meta charset="UTF-8" />
<script>
"use strict";
window.addEventListener("load", function(event) {
var key = document.getElementById("key");
var value = document.getElementById("value");
var add = document.getElementById("add");
var remove = document.getElementById("remove");
var clear = document.getElementById("clear");
var content = document.getElementById("content");
add.addEventListener("click", function(event) {
if (key.value !== "") {
try {
localStorage.setItem(key.value, value.value);
} catch (e) {
alert("Exceeded Storage Quota!");
}
refreshContents();
}
});
remove.addEventListener("click", function(event) {
if (key.value !== "") {
localStorage.removeItem(key.value);
refreshContents();
}
});
clear.addEventListener("click", function(event) {
localStorage.clear();
refreshContents();
});
window.addEventListener("storage", function(event) {
var k = event.key;
var newValue = event.newValue;
var oldValue = event.oldValue;
var url = event.url;
var storageArea = event.storageArea;
alert("EVENT:\n" + k + "\n" + newValue + "\n" + oldValue + "\n" + url + "\n" + storageArea);
refreshContents();
});
function refreshContents() {
var str = "";
for (var i = 0, len = localStorage.length; i < len; i++) {
var k = localStorage.key(i);
var v = localStorage.getItem(k);
str += "'" + k + "' = '" + v + "'<br />";
}
key.value = "";
value.value = "";
content.innerHTML = str;
}
refreshContents();
});
</script>
</head>
<body>
Key: <input type="text" id="key" /><br />
Value: <input type="text" id="value" /><br />
<input type="button" id="add" value="Add to Storage" />
<input type="button" id="remove" value="Remove from Storage" />
<input type="button" id="clear" value="Clear Storage" /><br />
Contents of Local Storage:<br />
<span id="content"></span>
</body>
</html>
Things to Remember- Local storage persists until it is explicitly deleted or the browser’s cache is cleared.
- Session storage persists until it is explicitly deleted or the browsing context is closed.
- Data stored by one browser is not accessible by another browser. For example, data stored by Chrome is not seen by Firefox.
- Objects should be stored as JSON strings.
- For security reasons, sensitive data should not be stored, especially in local storage.
- Changes to a storage area cause a “storage” event to be fired.
- As with many other HTML5 features, web storage is not yet implemented consistently.
Storage image via Shutterstock  Ubuntu 12.04 LTS Precise Pangolin: Networking tips and tricks Posted on: 14 May 2012, 9:00 am  Networking is often regarded to be complicated and very difficult to manage but as it forms an essential role in the day-to-day use of your computer the purpose of this article is to expose a few ‘tips and tricks’ that will serve to improve your computers connectivity and overall performance by showing you how easy it is to take control of Ubuntu 12.04, LTS Precise Pangolin. So let’s get started … What is my local IP addressIt may be a easy question to begin with, but in a world of complexity it is often the simple questions that get overlooked. Using the graphical tools:Right click on the ‘networking icon’ in the top panel of the Ubuntu desktop and choose ‘Connection Information’ as shown below: 
The resulting dialogue box will then provide feedback on your current settings. Using the command line interface:On the other hand, for those individuals who are beginning to enjoy the power of Terminal or for those of you who use a server (via the Console or Putty or similar). If you have a wireless based connection, run: If you have a ‘wired’ connection, run The results for ‘ifconfig’ will look something like this: Code:
eth0 Link encap:Ethernet HWaddr 00:1d:92:65:09:e1
inet addr:192.168.1.100 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::21d:92ff:fe65:9e1/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:510 errors:0 dropped:0 overruns:0 frame:0
TX packets:315 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:80353 (80.3 KB) TX bytes:38731 (38.7 KB)
Interrupt:42 Base address:0xa000
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:108 errors:0 dropped:0 overruns:0 frame:0
TX packets:108 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:8176 (8.1 KB) TX bytes:8176 (8.1 KB)
And because the command line provides us with additional opportunities, if you would like to quickly identify all the available ethernet devices on your computer, you can run Code:
ifconfig -a | grep eth
The result will look something like this: Code:
eth0 Link encap:Ethernet HWaddr 00:1d:92:65:09:e1
Well done, but just before we finish-up I would like to take this opportunity to show you another useful command that can help identify all the network interfaces available to your system. Known as the ‘lshw’ command, this tool will not only detail your ethernet devices but it will also provide a plethora of information on your hardware’s ‘other’ capabilities. To use this tool, simply run the following command and wait a few seconds whilst Ubuntu quieries your devices: Code:
sudo lshw -class network
And the result will look something like this: Code:
*-network
description: Ethernet interface
product: RTL8111/8168B PCI Express Gigabit Ethernet controller
vendor: Realtek Semiconductor Co., Ltd.
physical id: 0
bus info: pci@0000:02:00.0
logical name: eth0
version: 01
serial: 00:1d:92:65:09:e1
size: 100Mbit/s
capacity: 1Gbit/s
width: 64 bits
clock: 33MHz
capabilities: pm vpd msi pciexpress bus_master cap_list rom ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt 1000bt-fd autonegotiation
configuration: autonegotiation=on broadcast=yes driver=r8169 driverversion=2.3LK-NAPI duplex=full firmware=N/A ip=192.168.1.160 latency=0 link=yes multicast=yes port=MII speed=100Mbit/s
resources: irq:43 ioport:d800(size=256) memory:feaff000-feafffff memory:feac0000-feadffff
Sometimes you’ve just ‘gotta’ love the details, but now we know something about our computer we can begin to take control :-) How do I create a static IP address with the Network ManagerThe following instruction shows you how to create a fixed (or static) IP address with the Network Manager. This approach is best suited to all desktop users who may require the need to keep the functionality of the Network Manager or for those that use netbooks, laptops and and other wireless connections that may require a DHCP based option in the future. Don’t worry, it is all very simple: Click the network menu on the top panel (the ‘up/down’ arrows icon) and select ‘Edit Connections’. Alternatively you can choose System Settings > Network > Choose your ‘Network Connection’ from the left hand panel and select ‘Options’. 
Now choose the relevant connection and click edit. For example, if you are using a ‘wired connection’, choose the ‘wired’ tab to find your connection. 
In the resulting dialogue box you should: - Select the ‘IPv4 Settings’ tab and change the ‘Method’ to ‘Manual’.
- Click Add and complete each field with your IP address, network mask and default gateway.Always press the ‘Enter/Return’ when you’ve finished typing each address otherwise the dialogue will fail to accept your new settings and the ‘save’ button will remain inactive/greyed-out.
- Include the IP addresses of the DNS servers. Multiple addresses should be separated by commas.
- Click Save and close the remaining dialogue boxes.
And there you go … If all is well you should be able to view web sites and/or view your local network but in some situations and depending on your network topology a reboot may be necessary. To confirm your new settings, simply check your connection settings as shown previously (see above) But what if I need DHCP again?
/> If you ever need to return to a dynamically assigned IP address simply re-run the previous steps. Find your current connection, select the ‘IPv4 Settings’ tab and change the ‘Method’ to ‘Automatic (DHCP)’. To finalise this reversal click save and reboot (depending on the network conditions and how the DHCP server is configured). Disable the Network Manager and ‘hard-code’ a static IP addressThis solution explains how to create a fixed (or static) IP address without using the Network Manager. The Network Manager is a very nice feature, but only suitable for individuals who require dynamically assigned connections or those who require wireless connectivity. Yes, it is true to say that these are both very popular in homes and offices throught the world but for those of us who use and prefer the benefit of a ‘wired connection’ using the Network Manager does come at the cost of performance. So this solution uses the traditional approach to ‘hard-coding’ your network connection and it is most suitable to those individuals who demand maximum performance or absolute stability. By using this approach you should note that we will not be removing the Network Manager, merely disabling it with the intention to capitalise on the performance gains by by-passing or side-stepping this device. These performance gains will not only be noticed in terms of network speed but also in terms of the computer in general.
Again, don’t worry, the process to disable the Network Manager is very simple but it will require us to run various ‘commands’ in Terminal in order to complete some steps. So let’s begin by making a backup of our original file. In Terminal type: Code:
sudo cp /etc/NetworkManager/NetworkManager.conf /etc/NetworkManager/NetworkManager.conf.bak
This will serve to back-up our original file to ‘/etc/NetworkManager/NetworkManager.conf.bak’. Hopefully you will not need it, but if you ever need to restore the original file simply open Terminal and reverse the command like so: ‘sudo cp /etc/NetworkManager/NetworkManager.conf.bak /etc/NetworkManager/NetworkManager.conf’ and reboot.
And with the confidence that we are fully backed-up we shall now proceed to disable the Network Manager. In Terminal, type: Code:
sudo gedit /etc/NetworkManager/NetworkManager.conf
This will open the ‘NetworkManager.conf’ file in our text editor. Now change: managed=false to managed=true So it looks like this: 
When done, save the file and close it. You can re-enable the network manager at any time by simply reversing the steps shown above or by restoring your back-up file. Remember to reboot in order to apply these changes.
Now we have successfully disabled the Network Manager we can proceed to create our Static IP address by making some direct changes to the ‘interface’ file; but with safety in mind let’s begin by making a backup of our original file. In Terminal and type: Code:
sudo cp /etc/network/interfaces /etc/network/interfaces.bak
This will back-up our original file to /etc/network/interfaces.bak. Again, it is not expected that we will need it but if you ever need to restore it open Terminal and reverse the command like so: sudo cp /etc/network/interfaces.bak /etc/network/interfaces
Now lets add our static IP address. In Terminal type: Code:
sudo gedit /etc/network/interfaces
Authenticate yourself in the usual way and then replace the file contents as shown below, where xxx represents values relevant to your needs: Code:
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address xxx.xxx.xxx.xxx
netmask xxx.xxx.xxx.xxx
network xxx.xxx.xxx.xxx
broadcast xxx.xxx.xxx.xxx
gateway xxx.xxx.xxx.xxx
And to help you out, here is an example with an explanation of the values concerned: Code:
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 192.168.1.100 (this is my computers IP address)
netmask 255.255.255.0 (this is my subnet mask)
network 192.168.1.0 (this is my network base address)
broadcast 192.168.1.255 (this is my broadcast address)
gateway 192.168.1.254 (this is my gateway/router's ip address)
When complete, simply save and close the file and reboot your computer to complete these steps. We are re-booting our computer at this point in order to ‘dis-engage’ the Network Manager, and once complete you can always re-configure your IP address at any time by making the necessary changes to the ‘interfaces’ file (shown above) and using the following command to restart your networking service: ‘sudo /etc/init.d/networking restart’. After you restart your computer you will discover (visually) that nothing has changed but as a consequence you should be experiencing a ‘more’ responsive computer and network connection. Should you ever want to re-enable the Network Manager. Simply reverse the steps we have taken above and/or restore you back-up files and reboot and as we created them with the ‘cp’ or copy command – unless you delete them, your original backup files will always remain for future reference.
Create Virtual Network Adapters (add more than 1 IP address to a single ethernet card)In some situations this can be very useful and as an extension to our previous solution of ‘disabling the network manager and hard-coding a static IP address’ I will now show you how to assign more than one IP address to the same ethernet card: In Terminal type: Code:
sudo gedit /etc/network/interfaces
Authenticate yourself and then replace the file contents like so, where xxx represents values relevant to your needs: Code:
auto lo
iface lo inet loopback
auto eth0
iface eth0 static
address xxx.xxx.xxx.xxx
netmask xxx.xxx.xxx.xxx
network xxx.xxx.xxx.xxx
broadcast xxx.xxx.xxx.xxx
gateway xxx.xxx.xxx.xxx
auto eth0:0
iface eth0:0 static
address xxx.xxx.xxx.xxx
netmask xxx.xxx.xxx.xxx
gateway xxx.xxx.xxx.xxx
And to make this as simple as possible, here is an example: Code:
auto lo
iface lo inet loopback
auto eth0
iface eth0 static
address 192.168.1.100
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.254
auto eth0:0
iface eth0:0 static
address 192.168.1.101
netmask 255.255.255.0
gateway 192.168.1.254
By doing this I will be adding two IP addresses to my a single ethernet card. It will not only have the IP address of 192.168.1.100 but it will also have the alternative address of 192.168.1.101 (as a virtual instance). The trick is to follow the virtual naming scheme (i.e. eth0:0, eth0:1, eth0:2 etc …) and to ensure that every instance maintains a unique IP address. In this way you can create as many ‘instances’ of an IP address as required. To illustrate this point, let’s add a third IP address to our example: Code:
auto lo
iface lo inet loopback
auto eth0
iface eth0 static
address 192.168.1.100
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.254
auto eth0:0
iface eth0:0 static
address 192.168.1.101
netmask 255.255.255.0
gateway 192.168.1.254
iface eth0:1 static
address 192.168.1.102
netmask 255.255.255.0
gateway 192.168.1.254
When complete, remember to reboot your computer to apply the changes or open Terminal and type: Code:
sudo /etc/init.d/networking restart
You can then run ‘ifconfig’ to view your new settings. Have fun ..! Change your computer’s hostnameYou may like your current computer name, or you may want to change it. In this short recipe I will show you how to view and change your computer name with relative ease … In Terminal type: Code:
sudo gedit /etc/hostname
The file will probably look something like this: To change the name of your computer, simply delete the existing content and replace as required. Remember, the actual name can be anything your want as long as you remember some basic principles: - Desktops generally use a singular name (as shown above) whereas all servers or ‘desktops acting as servers’ should be in the format of computername.computerdomain.suffix.
- On a local network computers should refrain from using the standard or typical internet based suffix or TLD unless your local DNS can account for such similarities.
- Use ‘internet friendly’ names and do not use a computer name that already exists on your network.
- Do not use spaces or non-internet friendly characters.
Once complete, simply choose ‘save’, ‘close’ the file and reboot your computer to see the changes. Your new computer name will be in the top-left hand side of the login screen but if you missed this or need to confirm your current or new hostname at any time. Open Terminal and type: And the result should reflect the changes you made … Managing the Hosts fileThe hosts file file consists of a list of IP addresses and corresponding hostnames. Most users may never need to touch this area of their computer but there maybe an occasion when you need to edit the hosts file on your machine. This can because of any number of reasons (i.e. reversing the effect of malicious activity) or it can be because your are trying to make your life that little ‘quicker’ buy ‘hard-coding’ the address of an internal or external web site. Similarly, if your network contains computers whose IP addresses that are not listed in an existing DNS record, then it is recommended that you add them to the hosts file. So with this in mind I will now show you how to manage you hosts file. Before you begin, you can make a back-up of this file by simply typing the following command in to Terminal: Code:
sudo cp /etc/hosts /etc/hosts.bak
Now, to proceed and customise your hosts file simply return to the command line and type: Code:
sudo gedit /etc/hosts
A typical desktop file will look like this (simply substitue the example values with those relevant to your computer): Code:
127.0.0.1 localhost
127.0.1.1 ubuntu-computername
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
However, having said that and just for the record, for the ‘server’ or ‘desktop server’ version of the same file should look more like this: Code:
127.0.0.1 localhost.localdomain localhost
192.168.1.100 ubuntu-computername.ubuntu-domainname.lan ubuntu-computername
# The following lines are desirable for IPv6 capable hosts
::1 localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
You will notice that my examples include the IPv6 instruction and this is entirely at your discretion as it depends on whether your network supports it. For example, you may ignore these values (not include them or comment them out by placing a ‘hash’ character at the beginning of the line) like so if your computer does not use IPv6. Code:
# The following lines are desirable for IPv6 capable hosts
#::1 ip6-localhost ip6-loopback
#fe00::0 ip6-localnet
#ff00::0 ip6-mcastprefix
#ff02::1 ip6-allnodes
#ff02::2 ip6-allrouters
Of course, disabling IPv6 is optional and can sometimes improve performance but if you are in doubt, simply ignore them (but as they sometimes say in ‘old blighty’ – ‘don’t fix what ain’t broke’). So getting back on track … In your hosts file you may want to include a list or pre-identified servers and workstations in order to speed-up name resolution like so: Code:
192.168.1.200 servername1 www servername1.localdomain.lan
192.168.1.200 servername2 mail servername2.localdomain.lan
In my example I have included an alias in addition to the actual names – i.e. servername1 is also known as www and servername2 is also known as mail. You do not need to do this as my other examples will show.
Windows (and Mac) users should notice that this process very similar to customisng the ‘hosts’ file on any Windows/Mac based operating system and the resulting file could look like this: Code:
127.0.0.1 localhost
127.0.1.1 ubuntu-computername
# PUT YOU COMMENT AFTER A HASH (#) FOR REFERENCE - NOT REQUIRED BUT USEFUL
192.168.1.200 www.website1.com
192.168.1.201 www.website2.com
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
Consequently, my computer will now use the IP address for www.website1.com instead of searching a DNS record thereby ensuring that my ability to view the website in question would be quicker than before. Taking this one step further … and by giving it a little twist. For those of you who wish to excercise some ‘parental power’ you could easily use this as a way to block direct access to some ‘unwanted web sites’ by sending someone who expects to go to www.website1.com to www.website2.com, like so: Code:
#192.168.1.200 www.website1.com
192.168.1.201 www.website1.com
192.168.1.201 www.website2.com
192.168.1.202 www.website3.com
192.168.1.123 www.website4.com
192.168.1.167 www.website5.com
Notice I have commented out the real address of website1 with a hash (#) and that both website1 and website 2 now have the same IP address … (the IP address being the actual address of website2) It isn’t a perfect of solution by any means but it is food for thought and can serve as a starting point for future development ;-) How to re-configure DNS resolutionThe purpose of this section is to show you how to configure the appropriate nameserver to use when resolving IP address to hostnames and vice versa. It is not intended to explain how to configure the system as a name server as this is something I will be covering in a future article. You should only affect this file if you are not using the Network Manager and want to use a static IP address. The resolv.conf file is the resolver configuration file and it is used to configure workstation or server access to the Internet Domain Name System (DNS). This file defines which nameservers to use and in what order they are tried. You should therefore put the most reliable server first. It is convention that up to three name servers are supported. However, if no nameserver option is given, the resolver will attempt to connect to the name server on the local host.
Resolv.conf still does this, but with the release of the Precise Pangolin a few things have changed, and regardless as to whether you are running a desktop or a server your system is probably running the resolveconf program: ‘Resolveconf’ is a small program that resides in ‘/etc/resolvconf’ that dynamically modifies the nameserver information on boot. It is a useful tool, but for our purposes it can be disruptive, so we are going to work around it by simply adding a new entry to our ‘/etc/network/interfaces’ file: In Terminal type: Code:
sudo gedit /etc/network/interfaces
Now add the following nameserver line to your file, changing XXX to something more applicable to your needs: Code:
dns-nameservers xxx.xxx.xxx.xxx xxx.xxx.xxx.xxx
Similar to the example shown above here is the new file using Google’s public nameservers: Code:
auto lo
iface lo inet loopback
auto eth0
iface eth0 static
address 192.168.1.100
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.254
dns-nameservers 8.8.8.8 8.8.4.4
When complete, click ‘save’, then ‘close’ the file and reboot to apply the changes. On reboot, you can see that the new nameserver information has now been applied to our ‘resolve.conf’ file by opening Terminal and typing: Code:
cat /etc/resolv.conf
Which may look something like this: Code:
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 8.8.8.8
nameserver 8.8.4.4
nameserver 127.0.0.1
So having made your changes, to query the DNS capabilities of your system, simply return to the command line and type: Code:
nslookup www.sitepoint.com
or alternatively try Code:
dig www.sitepoint.com
And that’s it for now … but most of all, have fun :-) So until next time … I hope that you continue to enjoy using Ubuntu 12.04 LTS Precise Pangolin.  Get Hired Posted on: 13 May 2012, 5:00 pm  In my series on Putting a Stop to Abusive Clients, I’ve talked a lot from the seller’s perspective. But before I put the final wraps on the series, I’m going to take a slight detour to discuss things from the buyer’s side of the fence. Let’s talk about how to get hired. Over the past few days, I’ve had to post two different job opportunities; one for a full-time sales rep, and the other for some contract web work. The responses I’ve gotten have been interesting, to say the least. One of the things I deliberately do is include both an email and my direct phone number as contact points. Which you chose may very well mean the difference between getting hired and getting ignored. Within minutes of posting the ad for the contract position, I received a phone call. Shortly afterwards, I received a second call from another firm. Both took the time to find out my objectives and what I’m trying to accomplish before talking up their firm. The rest sent an email with some variation of “check out my website“ and “call me back.” Who do you suppose I’m considering? Hiding behind Web 2.0Recently, my son’s scoutmaster left a voice mail message about an upcoming Eagle ceremony for one of the other boys in his troop, and that his attendance was “mandatory.” The only problem was, all he gave us was the name of the church where the ceremony was being held … no address, no city, nada. After a Google search turned up just one church with that name several cities over, I asked my son to confirm if this was indeed the right church. So on the day of the ceremony, he made phone calls and left voice mail messages, trying to find out. No one, not the scoutmaster, his patrol leader nor any of the other boys in his troop responded. Finally, out of desperation, he posted the question on Facebook. Within 15 minutes, three boys replied. I fear this does not bode well for the future of our youth. Too often, we use Web 2.0 tools to avoid direct interaction. For instance, it’s easy to hide behind marketing to avoid selling. Don’t fall into that trap. When I give you the choice, pick up the phone and call me. Why would I say that? Two reasons. One: I’m really, really busy. When you call me, you get first-mover advantage, because you’ve taken a task off my all-too-busy plate—the need to follow up on all the emails responses I received. I really don’t have time to “check out your website,” and then “give you a call.” Besides, your website probably contains the same generic fluff as everyone else’s. How about you demonstrate why you’re different and why I ought to hire you? You can do that by picking up the phone and having an actual conversation with me. Reason Number Two is: it shows me you have initiative as well as people skills. You see, if I really have a need, I’m going to want to talk with you to determine if you are someone who can fill that need. If I’m the one hiding behind web 2.0 tools, asking you to communicate with me via email or Facebook, I may not be a genuine prospect at all. I might be someone who’s merely “interested,” or not far enough along in the buying cycle to waste valuable time with. But if I’ve offered my phone number, than means I’d like to speak with a living, breathing person. That person could be you. Here’s another tip: When I ask you to follow up if you haven’t heard back from me by such-and-such date, that might be a test. Calling me back shows me you want the gig. What I didn’t mention is that there was a third firm that called; but he got the short straw—my voice mail—and never called back. If you have a genuine lead, keep pursuing it, even if they aren’t returning your calls. If you saw my desk, you’d know why I didn’t call you back. Image credit It’s not too late to get my free guide, 27.5 Must-Ask Questions for Consultative Selling. Just follow me on Twitter and I’ll send you a link.  What do you need to know about HTML5 video Posted on: 12 May 2012, 9:00 am  HTML5 keeps on stunning the Internet community with revolutionary web features. One of the key HTML5 enhancements is the advanced video support. With a new HTML5 standard, users don’t need any special plugins to stream video in web browsers both on PC or any portable device. Still in spite of the growing popularity of HTML5 standard, most web developers and designers are reluctant to migrate to the new markup language, maybe because of the absence of a complete HTML5 specification or lack of practical information on HTML5 сoding. In this post, I’d like to take a deeper look at HTML5 video element and explain its main points in plain English. <video> tag vs. <object> tagThe <object> tag referrs to an embedded element within a web page: audio, video, Java applet, ActiveX, PDF, or Flash. The markup for this tag is fairly cryptic. Thus, if you wanted to embed a Flash video into a web page, you had to insert the following code: Code:
<object id=0 type="application/x-shockwave-flash" data=player_flv_maxi.swf width=420 height=240
<param name="movie" value=player_flv_maxi.swf />
<param name="wmode" value="opaque" />
<param name="allowFullScreen" value="true" />
<param name="allowScriptAccess" value="sameDomain" />
<param name="quality" value="high" />
<param name="menu" value="true" />
<param name="autoplay" value="false" />
<param name="autoload" value="false" />
<param name="FlashVars" value="flv=Wildlife.flv&width=420&height=240&autoplay=0&autoload=0&buffer=5&buffermessage=&playercolor=464646&loadingcolor=999898&buttoncolor=ffffff&buttonovercolor=dddcdc&slidercolor=ffffff&sliderovercolor=dddcdc&showvolume=1&showfullscreen=1&playeralpha=100&title=Wildlife.flv&margin=0&buffershowbg=0" />
To play this, users can’t do without a Flash player plugin which is ndispensable for all modern browsers except Google Chrome since the player is already pre-installed in the browser. HTML5 introduces the new <video> tag which replaces the former <object> tag for Flash video embedment. The benefits of using HTML5 <video> tag are numerous. It brings not only minimalism and simplicity of video code, but also the ease of search bots to properly index your video file. Website developers can add a video to a page in the same way they would add an image, since the basic markup necessary for </video><video> in HTML5 is refreshingly simple and straightforward: Code:
</video><video width="320" height="240" controls autoplay poster="video.jpg">
<source src="movie.mp4" type="video/mp4" />
<source src="movie.ogg" type="video/ogg" />
Your browser does not support the video tag.
</video>
Such code can be easily composed even by a not tech-savvy specialist. In the simplest way the code may be reduced to:<video src="movie.mp4" controls width="320" height="480"></video> Video AttributesAs you can see, the <video> tag is used just like any other tags in HTML. Between opening and closing tags you can place various attributes to get the video player you want. Several of the attributes are boolean (e.g. controls, loop, muted) – no value is required. So by including or omitting them, you set the value “true” or “false” respectively. HTML5 specialists also recommend inserting the following line within video tag:
/> Video not playing? <a href="pics/video.mp4">Download the file instead. ControlsThe browsers supporting HTML5 video have the video players already built-in. All of them include a standard set of controls: Play, Pause, Seek, Volume. However, each browser provides its own look for the video player: from the minimal approach of Chrome and IE to the more elaborate controls of Firefox, Opera and Safari. If you want to keep controls the same across all browsers, or integrate the player with our website design, you can create our own controls from scratch. Here are some useful resources: - VideoJS is an HTML5 video player built with Javascript and CSS;
- Sublime Video is a sleek cloud-based HTML5 video player with advanced feature set, a paidware;
- Projekktor is an open source HTML5 video player built with pure JavaScript; it also uses Flash when there is no native H.264 support;
- Tutorial “How to build a custom HTML5 video player with jQuery and CSS3” from Opera developers.
Video sourceThe <video> tag allows multiple <source> elements which can link to one and the same video in different formats, for example: Code:
<source src='movie.webm' type='video/webm; codecs="vp8.0, vorbis"'/>
<source src='movie.ogv' type='video/ogg; codecs="theora, vorbis"'/>
<source src='movie.mp4' type='video/mp4; codecs="avc1.4D401E, mp4a.40.2"'/>
As you see, the source tag has two attributes, src and type. The “type” attribute specifies the MIME type and possibly a list of codecs, which helps the browser to determine whether it can decode the file. By default, the browser will use the first recognized format. All modern browsers support at least one HTML5 video format. Browser SupportFor up to date information on browser support, you can check out the YouTube HTML5 Page CodecsThere’s a long debate on which video formats/codecs to pursue and consensus hasn’t been reached yet. As a result, in the draft of HTML5 specification any references to a particular codec were removed. Instead, the following creteria to the video codec were put forward: - it should have good compression, good image quality, and low decode processor use;
- be royalty-free;
- feature hardware video decoder
Three codecs were suggested for HTML5 video element: H.264, OGG Theora, and WebM VP8. Here are their advantages and disadvantages. H.264Pros
/> It gives good quality video and small file sizes. It outputs excellent video both for low-bandwidth, low-CPU mobile devices and high-bandwidth, high-CPU modern PCs and everything in between. It’s free for Internet end-users. Cons
/> The underlying compression mechanisms in H.264 are patented and adopters have to pay royalties for commercial use to a licensing consortium called MPEG-LA. OGG TheoraPros
/> It’s a royalty-free codec and is not encumbered by any known patents other than the original VP3 patents, which have been licensed royalty-free. Cons
/> Theora generates high quality videos with comparatively larger file sizes. Plus it is a lot harder to find tools to convert to OGG Theora. WebM VP8Pros
/> In 2010, Google acquired On2 – the company behind VP8, and published the video codec specification as open source, and all the patents as royalty-free. Cons While Google claims that WebM has the highest video quality of all the web codecs, most independent sources find that either H.264 is slightly better or there is very little difference between the two. The problem is that it can be very difficult to find tools to encode video to WebM. Until a complete consensus on video codecs issue is reached, web developers have to convert video to all these three formats. There’s some helpful software which deal with HTML5 video preparing: - Free Video Converter 3.0 by Freemake.com is a Windows software that encodes both desktop and online video to H.264, WebM and Theora OGG, the resulted videos go together with a sample of HTML5 video embedding;
- alternatively, you can receive HTML5 source files as a result of video conversion with the help of the video tools listed here.
Some webmasters also combine HTML5 <video&ht; element with Flash-based code, so that a video could be played in any browser, including old IE versions. No doubt, HTML5 video still has a lot of benefits if compared to Flash. However, it’s still debatable whether H.264, WebM and Theora OGG will remain the default video formats supported in the video element. And since the specification of HTML5 video formats depends a lot on the decisions of Apple, Microsoft and Google corporations, the future of the whole new standard seems vague but still promising.  Celebrate 20 Years of Wolfenstein 3D in Your Browser Posted on: 12 May 2012, 9:00 am  Perhaps I’m showing my age but is it really 20 years since Wolfenstein 3D exploded onto the PC gaming scene? To celebrate that momentous occasion, the full game can now be played online within your browser at: wolfenstein.bethsoft.com
/>  (Note the game is recommended for those over 12 and banned in Germany and several other countries). The site states it’s compatible with IE9, Firefox, Chrome and Safari — although Opera seems to work if you’re not too bothered by a few graphical glitches. The game is mouse-enabled (set it within the configuration options) although few PCs had mice in 1992 and you’ll find keyboard control best. Wolfenstein was released as DOS shareware in 1992. The web was largely unknown and bulletin boards were the reserve of rich geeks but, despite a lack of social networks and online file sharing, word spread and so did thousands of 720kB floppy disks. Suddenly, there was a reason to use a PC for more than Lotus-123 spreadsheets. So why the fuss? Wolfenstein started the 3D first-person gaming genre. In 1992, there were relatively few 3D games and most resorted to isometric graphics (Marble Madness, Paperboy), wire-frame (Star Wars, Elite, Starglider) or faked overlaid 2D sprites (Outrun, Chase HQ, Space Harrier). True 3D games were available in the arcades (I-Robot, Hard Drivin’) but they took themselves a little too seriously and couldn’t be replicated on the 16-bit PCs of the day. I remember playing Wolfenstein for the first time; it changed my perceptions about what could be achieved on a PC. While it looks basic today, having the freedom to explore realistic 3D rooms blasting stuff was revolutionary — and shouldn’t have been possible given the hardware limitations. More importantly, the game was fun; you played a prisoner trying to escape from a Nazi-controlled castle in World War II. The VGA gore was amusing and you could defeat a robotically-enhanced Hitler at the end of the game. That said, not everything was perfect. The walking movement was unrealistically smooth and the corridor map was always rectangular — combine that with may hours game play and Wolfenstein remains the only game which made me feel genuinely queasy! iD Software’s success with Wolfenstein led to Doom a year later — it’s fair to say you wouldn’t be playing Call of Duty today if it weren’t for those two ground-breaking games. A version of Wolfenstein was released on almost every computer and gaming platform (even Nintendo permitted the gore-fest on their family-friendly consoles, although iD were instructed to replace guard dogs with large rats). The browser version if faithful to the original DOS version and permits you to play every level. Actually, it probably plays and sounds better than it did on the latest 386 PCs we had in 1992. Technically, the game is implemented using JavaScript and HTML5 audio. I first thought it was rendered using a canvas element but, thanks to further investigation by Matt Vaughan (below), it’s actually 320 horizontally-stacked DIVs which have their background, vertical size and top location modified as you move around. It’s clever but slightly unusual solution. The full page weight is a little over 800kB of mostly uncompressed JavaScript — impressive given that most sites use that for their home page. But who cares about the technical details … Happy Birthday Wolfenstein 3D and thanks for 20 great years of great gaming. 
Quote:SitePoint » Tech
News, opinion, and fresh thinking for web developers and designers. The official podcast of sitepoint.com.RubySource: The Robot Factory – Part One Posted on: 10 October 2011, 7:05 pm Adding and Deleting Resources in Sinatra In this tutorial I’m going to go through how to use Sinatra to add and remove resources to and from a database. To demonstrate this, I’m going to build a tiny web app called The Robot Factory that allows users to ‘build’ a production line of robots. Each robot will be saved to a database with randomly chosen head, body and legs and can also be deleted after it has been built. You can see the final version running here – http://robotfactory.heroku.com/ . Read the original:
/> RubySource: The Robot Factory – Part One DesignFestival: Showcase of Logo Designs from 20 Inspiring Designers Posted on: 10 October 2011, 7:05 pm Logo design is its own form of art. Designers must integrate branded colors, shapes, and even words into a logo all the while balancing minimalist designs that can be use on the web or on billboards. It’s certainly a challenge. This collection of logos represent a fresh batch of up and coming designers who have come up with some noteworthy concepts Read More:
/> DesignFestival: Showcase of Logo Designs from 20 Inspiring Designers PHPMaster: Creating a Mobile Photo Blog, Part 1 Posted on: 10 October 2011, 7:05 pm  It seems like everyone these days is texting away on their mobile phone or updating their social network status every 5 minutes. It’s no surprise that the convenience of being able to access the Internet from anywhere at any time has made sharing messages and pictures so popular. I can’t imagine going anywhere without my cell phone on the off chance that something interesting might happen and I can document it as if I were the first news reporter on the scene. This is the first article in a two-part series in which I will show you how to create a photo blog as part of your personal website which you can update from your phone simply by sending an email.
Read the original:
/> PHPMaster: Creating a Mobile Photo Blog, Part 1 BuildMobile: What’s Coming for Developers in Ice Cream Sandwich? Posted on: 9 October 2011, 9:33 pm It’s now widely understood that Google will be unveiling the next version of its Android operating system, Ice Cream Sandwich (ICS), next week on the 11th of October . It will launch along with a new flagship phone from Samsung, but along with it is a promise to get the new tasty treat OS on to many of the recently released phones . If they back this up, this means that there will soon be a lot of phones out there running the newest version of Googles OS. Read More:
/> BuildMobile: What’s Coming for Developers in Ice Cream Sandwich? PHPMaster: Documentation Makes the World Go Round Posted on: 9 October 2011, 9:33 pm  You’re working on a software project, probably not a new situation if you’re reading this, and happen upon specific functionality you need for your project. Being the efficient (and lazy) developer that you are, you recognize that this functionality is general enough that it’s probably been needed by someone before and a library of some sort has been written for it. Why reinvent the wheel? So you jump on your preferred search engine, find a likely candidate, skim over the landing page, and conclude that this library meets your requirements.
See the article here:
/> PHPMaster: Documentation Makes the World Go Round RubySource: Rails Deep Dive: Loccasions, Making Events Posted on: 7 October 2011, 7:01 pm Our last post flushed out the Events model and created a very basic home page. Hopefully, by the end of this post, we will be able to add, modify, and delete events from our user home page. CRUDdy Events Unless you’ve just been unfrozen from a decades long, icy slumber, you know what CRUDifying a model entails. Taken from:
/> RubySource: Rails Deep Dive: Loccasions, Making Events BuildMobile: Farewell, Steve. Posted on: 7 October 2011, 7:01 pm PHPMaster: Regular Expressions Posted on: 7 October 2011, 7:01 pm  ^[A-Za-z0-9-_.+%]+@[A-Za-z0-9-.]+.[A-Za-z]2,4$ It makes all the sense of ancient Egyptian hieroglyphics to you, although those little pictures at least look like they have meaning. But this… this looks like gibberish. What does it mean? It means oleomarg32@hotmail.com , Fiery.Rebel@veneuser.info , robustlamp+selfmag@gmail.ca , or nearly any other simple email address because this is a pattern written in a language that describes how to match text in strings
Visit site:
/> PHPMaster: Regular Expressions CSS3 Gems: The calc() Function Posted on: 7 October 2011, 9:52 am  There are many hidden gems in the modular CSS3 specifications. In this post we’ll look at calc(); an incredibly useful property which may change the way you approach layout design. The CSS3 calc() function is primarily used to calculate lengths, numbers, angles, transition/animation times or sound frequencies. However, it allows you to mix measurement types — a powerful concept in CSS. Consider a website layout containing two floated elements. You want both elements to be an equal width separated by a 60px horizontal margin. Sounds easy? It’s not a problem in fixed-width design; if the page width is 960px, both elements will be 450px. But what about fluid or responsive layouts? It’s not possible to determine the page width so most developers would set each element to, say, 45%. The 10% margin will only be 60px if the page happens to be 600px; a wider or narrower browser window will enlarge or contract the margin accordingly. Fortunately, the new calc() function allows us to calculate widths. In this case, we want both elements to be 50% minus 30px, e.g. Code:
#element1, #element2 { float: left; width: calc(50% - 30px); } #element2 { margin-left: 60px; }
Perhaps you want a margin which is relative to the font size — such as 4em? No problem: Code:
#element1, #element2 { width: calc(50% - 2em); }
Or maybe you want a 2px border around both elements: Code:
#element1, #element2 { width: calc(50% - 2em - 4px); border: 2px solid #000; }
I recommend you keep calculations simple, but it’s possible to use complex formulas, e.g. Code:
#element1, #element2 { width: calc((50% + 2em)/2 + 14px); }
Browser SupportThe calc() function is a W3C recommendation so guess which browser offers native support? You’re wrong. At the time of writing, it’s just Internet Explorer 9. Firefox also supports it with a prefix; -moz-calc(). It’s not been implemented in webkit (Chrome and Safari) or Opera yet but, it’s so useful, I suspect we won’t need to wait long. Fortunately, you can use progressive enhancement in your stylesheets: Code:
#element1, #element2 { width: 45%; /* all browsers */ width: -moz-calc(50% - 30px); /* Firefox 4+ */ width: calc(50% - 30px); /* IE9+ and future browsers */ }
Remember that you’d also need to adjust margins accordingly, e.g. Code:
#element2 { margin-left: 10%; /* all browsers */ margin-left: -moz-calc(60px); /* Firefox 4+ */ margin-left: calc(60px); /* IE9+ and future browsers */ }
CSS3 min() and max()If you like calc(), you’ll love the min() and max() functions. They accept two or more comma-separated values and return the minimum or maximum accordingly, e.g. Code:
#myelement { width: max(300px, 30%, 30em); font-size: min(10px, 0.6em); }
The functions will be especially useful when using relative font sizes to ensure text does not become too large or small. Unfortunately, min() and max() are not currently supported in any of the latest browsers. Let’s hope they appear soon. BuildMobile: Roll Your Own Framework With Backbone.js Posted on: 6 October 2011, 5:14 pm Let’s make a collective decision here. We’ll stop treating A-grade mobile phones as aliens, and see them for what they are: powerful, capable devices, running powerful rendering engines. Throwing a framework at your app, such as jQuery Mobile, Sencha, or anything that gives you the popular iOS-like native look and feel, instantly boxes you into a set of choices, design and functionality-wise. Originally posted here:
/> BuildMobile: Roll Your Own Framework With Backbone.js PHPMaster: Introducing Superglobals Posted on: 6 October 2011, 5:14 pm  Superglobals are specially-defined array variables in PHP that make it easy for you to get information about a request or its context. They are called superglobal because they are always accessible, regardless of the scope — that is, you can access them from any function, class or file without having to do anything special. The superglobal variables are: $GLOBALS , $_SERVER , $_GET , $_POST , $_FILES , $_COOKIE , $_SESSION , $_REQUEST and $_ENV .
More here:
/> PHPMaster: Introducing Superglobals HuffPost + Pinned Sites: Reinventing the Big News Experience Posted on: 6 October 2011, 10:30 am  The Huffington Post is a leading social news and opinion site—”The Internet Newspaper.” HuffPost covers it all—politics, media, business, entertainment, living, style, sustainable “green” living, world news, technology, nonprofits, college life, books, education, religion, travel, arts, food, comedy: it’s a top destination for news, blogs, and original content. The site reaches more than 26M unique visitors monthly. HuffPost wants to serve their readers relevant and timely “Big News” and encourage engagement with comments and social posts. Taking advantage of Internet Explorer 9 and Windows 7 developer tools, HuffPost has created an immersive, app-like web experience with new Pinned Site features: The result was great for both readers and HuffPost’s business. Users who pinned the site … - Spent 49% more time on the site
- Were 14% more likely to stay on site
- Viewed 11% more pages
And that’s exactly what HuffPost was hoping for—more engagement. HuffPost developers used these tools to keep readers coming back for more by designing an always-active presence in users’ Windows 7 Taskbar, where IE9 has share exceeding 20% worldwide and approaching 30% in the US. Paul Berry, CTO of Huffington Post, describes the approach they took in this video. Want to do the same thing? It takes about a day to replicate the development work that HuffPost did. Go to BuildMyPinnedSite for ideas and code samples. A simpler version (with most of the benefit) can be done in 15 minutes. Links in this case study will take you directly to specific MSDN Pinned Sites sections, so you can dive deeper into the details and check out code samples and demos. The SituationOne of the core principles of IE9 is putting sites at the center of the user’s experience. Users go to their browser to visit websites, not for the browser itself. Developers should have the tools to build engaging user experiences—and the browser should get out of the way. While much of the web today is static and content-focused, more and more sites are emerging that are interactive, personalized, and social. It’s clearly where the web is headed these days. HuffPost realizes that success means getting their relevant and targeted local content to readers, and encouraging them to contribute themselves. It also means using the whole PC to stay in front of readers—not simply relying on a browser URL, search, or mobile apps. Developers at HuffPost are busy. They’re focused on site content and functionality, so they don’t have time to explore every feature on every platform. Features they do consider must be simple. They must be high impact. And they must immediately enhance the user’s experience. Here are the three criteria HuffPost ranks features against, and some questions you should be asking yourself when considering new browser features.
start="1"> - Customer Engagement
- Does it reach the customer in a timely and relevant fashion?
- Is it part of the customer’s everyday workflow?
- Does it help the customer get to our content faster?
- Does it take our customer deeper into the site experience?
- Customer Value
- Does it inspire the customer to stay and interact longer?
- Will it increase the opportunity for our customer to engage with ads and premium experiences?
- Is it “cutting edge” and “must have” for the customer?
- Does it enhance the everyday experience?
- Does it build loyalty and brand value?
- Engineering Values
- Is it simple and sustainable from a development perspective?
- Does it build on a credible, long-term platform with a mature customer base?
- Does it sync with the mission and values of the business?
- Bottom line—is it is profitable to use on a given project?
HuffPost wanted their web experience to feel more like an app. Social engagement was also a priority. When readers are engaged, they visit more often, go deeper into the site, and stay longer. They evaluated Internet Explorer 9 Pinned Sites features to see how the features would affect customer engagement and value. Right away, they were pleased with the “quick win” and “immersive” potential. Ease of implementation, standards, performance, and sustainability were must-haves, because platforms—along with 3rd party APIs for social integration and mobile devices—continue to consume their limited development bandwidth. The SolutionSimple to learn, simple to develop. Devs learned about IE9 Pinned Site implementation through the MSDN IE9 Code Samples Library and IETestDrive Pinned Sites, which included easy-to-follow scenarios with “show code” pop-ups. IE9’s Pinned Site APIs and Built-In F12 Developer Tools were also very useful. Like many online news sites, HuffPost primarily uses JavaScript in publishing news from their Content Management system. That made JavaScript-based Pinned Sites features easy to add and test into the existing system with almost no custom code. The hard part was determining what content to serve and when to serve it. They decided to showcase their Big News sections because it’s what sets them apart from competitive news sites. The end-to-end effort? 3 days to go-live. - Design = 2 Days, shared across Marketing, Editors, and Product Planning
- Development = 1 Day, 1 Developer to build, test, and deploy

HuffPost in IE9 is a clean, branded experience that puts content and interactivity in the focus. Pinned Site features are designed to increase customer engagement through Windows 7, outside the browser. A Deeper Look at Huffington Post in IE9Drilling into the experience, here is what HuffPost did to reinvent their site in just 1 Day, with 1 Developer: Step 1: Map to your current brand look and feel. HuffPost defined the navigation button colors, home page, window size, and tool tips using pinned site metadata. IE9 does the rest. 
Step 2: Let your users know. Then remind them! HuffPost wants readers using IE9 to pin their site. The site automatically checks when users have not yet pinned it, and prompts them to drag the tab to pin. All done with just 15 lines of code. Users can now drag the tab to the Taskbar and start the Pinned Site experience. 
Step 3: HuffPost on every taskbar. HuffPost wanted a brand experience that looked “clean and shiny” like an everyday part of their users’ experience. They designed 5 Favicons in X-Icon Editor with the colors associated with each news section. Readers can simply pin their favorite section directly to their taskbar to jump back into the HuffPost experience with a single click. 
Step 4: Bring them back again and again! News changes by the minute. When big news hits, readers need to know. HuffPost wants to make sure that their readers are the first. Notifications are a great way to unobtrusively alert readers to breaking news without disruptive noise or unnecessary emails. Custom Icon Overlay and Toolbar Flash capture users’ attention directly on the Taskbar. 
Step 5: Go deeper with jump lists. Readers are delighted when they discover new content, and HuffPost wants to encourage exploring the site. Dynamic Jump Lists contain “hot” keywords like celebrity names, political opinion, or entertainment buzz, making it easier for readers to stumble on news that’s interesting. Each Jump List is personalized by news section and updates every 15 minutes. Users can right-click the pinned site to see a fresh Jump List. How easy is that?!? 
Step 6: Go social with thumbnail toolbar. It seems small and simple, but it makes a big difference. One-click Thumbnail Toolbars on their Taskbar make it easy to “Like” and “tweet” stories. Users can then easily share stories with their friends, which in turn gives HuffPost’s content an even bigger audience. 
Summary & Next StepsHuffPost measures success in terms of Customer Value against their Cost to Code. A small development investment—1 Day, 1 Developer—to create an immersive reader experience really paid off. Developing for IE9 is straightforward, especially when your goal is to deliver great content directly to your customers. Unlocking the potential of Windows 7 and IE9 keeps your focus where it should be—on the content, and ultimately, on your customers. Huffington Post’s Success Metrics—exceeded! HuffPost is thrilled with how a little effort (1 Day, 1 Developer) paid off on their readership goals: Users that pinned the site… - Spent 49% more time on the site
- Were 14% more likely to stay on site
- Viewed 11% more pages
Site experience benefits: - Created a personalized experience by letting users pin the news content they want with one-click access
- Increased user engagement through notification, pulling users back into their “Big News”
- Was low cost to code and easy to sustain using existing technologies like JavaScript
Ready to go? Learn how to do what they did. See it in action! Check out the Huffington Post in IE9. There are loads of resources for developers, including code samples, technical docs, APIs, and more below: Easy clicks! Links referenced in this case study: SitePoint Content Partner This tutorial has been made possible by the support of Microsoft. We strive to work together to develop the SitePoint content that’s most useful and relevant to you. Involve Your Users Posted on: 6 October 2011, 5:19 am  Many of us are involved in large scale websites and e-commerce. One element many of the above don’t excel at is user-generated content. I love user-generated content, and so do many. Survey results are showing that people trust others before company propaganda, so beef up your reviews if you sell products online, and look for alternative content you could provide by empowering your community. Here’s a great story. I like to think of myself as a savvy web user. I can see through those automated emails, and the nag screens to sign up as a member on many websites. I’m also a regular traveler, for both business and pleasure. I recently took a trip abroad, and when I returned, I penned a few reviews on a site of which I’m a member: TripAdvisor. This is where they got really smart. I’ve already written a dozen or so over the last few years, however I neglect to review everywhere I stay or eat (heck, that would fill my weekends!). About a week after my last reviews were published, I received an email, titled ‘People love your reviews!’ Opening it, I was given statistics on how many people had read my reviews, and how many had given them a helpful rating. The email ended with a great hook: “You’re only 1 review away from your next badge. Keep going! What did you do this weekend?“ I was hooked! That night I penned another two or three reviews, just to earn my next badge. Do I need that next badge, or does it provide me with any tangible value? Nope. Do humans in general like to feel rewarded for their work? Yes! Here I am, giving up my valuable time to write reviews to post on another website, which makes their money from all this user generated content. Well done to them! Well done to me for also earning that extra badge of honor. How can you incorporate some of these ideas in your website? Maybe a ‘Review this product’ promotion, or a ‘Write a guest blog post’ may work – put your thinking caps on, you may land on a winner. If it really goes well, I may end up writing on there too – as soon as I write that next dozen reviews for my next badge! RubySource: How Can a .NET Developer Get Started on Ruby or Rails? Posted on: 5 October 2011, 8:28 pm
Quote:SitePoint » Design
News, opinion, and fresh thinking for web developers and designers. The official podcast of sitepoint.com.DesignFestival: Showcase of Logo Designs from 20 Inspiring Designers Posted on: 10 October 2011, 7:05 pm Logo design is its own form of art. Designers must integrate branded colors, shapes, and even words into a logo all the while balancing minimalist designs that can be use on the web or on billboards. It’s certainly a challenge. This collection of logos represent a fresh batch of up and coming designers who have come up with some noteworthy concepts Read More:
/> DesignFestival: Showcase of Logo Designs from 20 Inspiring Designers PHPMaster: Introducing Superglobals Posted on: 6 October 2011, 5:14 pm  Superglobals are specially-defined array variables in PHP that make it easy for you to get information about a request or its context. They are called superglobal because they are always accessible, regardless of the scope — that is, you can access them from any function, class or file without having to do anything special. The superglobal variables are: $GLOBALS , $_SERVER , $_GET , $_POST , $_FILES , $_COOKIE , $_SESSION , $_REQUEST and $_ENV .
More here:
/> PHPMaster: Introducing Superglobals DesignFestival: Position Text Labels on Forms Using CSS Posted on: 5 October 2011, 8:28 pm In this post, I’ll explain three common approaches to positioning text labels on web forms using CSS: top-positioned text labels left-aligned text labels right-aligned text labels Using Top-positioned Text Labels Positioning labels at the top of their form elements is probably the easiest layout to achieve, as we only need to tell the label to take up the entire width of its parent element. As our form elements/labels are inside ordered list items (which are block elements), each pair will naturally fall onto a new line, as you can see from Figure 9. All we have to do is get the form elements and labels onto different lines. Follow this link:
/> DesignFestival: Position Text Labels on Forms Using CSS PHPMaster: File Uploads with PHP Posted on: 5 October 2011, 8:28 pm  What do pictures in an online photo album, email attachments in a web-based mail client, and data files submitted to an online application for batch processing all have in common? They all rely on the ability to upload files across the Internet from the user’s web browser. Indeed, uploading files is an important feature of many of the sites and web-based applications we use on a daily basis. In this post, I show you how to add support for file uploads to your site using PHP
Visit link:
/> PHPMaster: File Uploads with PHP BuildMobile: Mobile Finds Its Voice Posted on: 3 October 2011, 9:30 pm Over the last decade, mobile technology has evolved more rapidly than any other area of computing. My first mobile – purchased just 12 years ago – felt like a brick, and although it could send and receive text messages, that functionality lay so many menus deep, I never used it. As a voice-only device, my first mobile merely replicated the functionality of a landline telephone. View post:
/> BuildMobile: Mobile Finds Its Voice DesignFestival: 20 Best Resources for Creating Autumn Designs Posted on: 3 October 2011, 9:30 pm ‘Tis Autumn at last and time to start designing for the times! This is one of the seasons where you have lots of options. You can stick with the Halloween vibe or go with a harvest tone, but where to begin? We’ve rounded up a few ideas you can start with from your standard design elements and tools — from backgrounds to brushes and even some CSS color palettes to get your create juices flowing. Backgrounds Whether you’re designing for a newsletter or brochures , backgrounds set the stage. More:
/> DesignFestival: 20 Best Resources for Creating Autumn Designs BuildMobile: 5 Fab Films from Breaking Development Posted on: 2 October 2011, 10:13 pm The Dallas 2011 Schedule for Breaking Development is a thing of real beauty, and the team are being awesome in sharing with the world the videos of the presentations after the event. Herein we bring you the Fab 5 to add to the Ace 8 we pointed to earlier. At this stage, you can finish watching the Dallas event over the weekend, right here and right now, you can look forward to watching the Nashville event in the near future, but best of all you can start planning your Orlando trip for April 2012. Just go! A quick aside: following the Nashville conference, some of the finest minds in mobile took it upon themselves to go on holiday together and they called it MobileWood . Originally posted here:
/> BuildMobile: 5 Fab Films from Breaking Development BuildMobile: What’s New in Windows Phone Mango Posted on: 29 September 2011, 10:43 pm Ever since Windows Phone first shipped almost a year ago there has been almost endless discussion about what the next update/version will include. The first major update earlier in the year saw the introduction of copy-and-paste, clearly something that was supposed to be in the first release but just didn’t make the pre-Christmas deadline set in order to ship the first round of devices. Since then the focus has been on Windows Phone Mango, an update to not only the consumer experience on the device but also a major refresh of all the development tools, APIs and even marketplace. Follow this link:
/> BuildMobile: What’s New in Windows Phone Mango DesignFestival: JavaScript Design Patterns Deconstructed Posted on: 29 September 2011, 10:43 pm All sophisticated design patterns throw up the same fundamental question — is there a concrete advantage to using it in the first place? Without understanding the benefits, it could be very easy to think that it’s just a pointlessly verbose and over-engineered solution, or that it’s only following some kind of fashion. But there are real and important benefits to using this kind of pattern, and it isn’t an attempt to make JavaScript “more like” any other language, or to mimic classical inheritance. More:
/> DesignFestival: JavaScript Design Patterns Deconstructed DesignFestival: 5 Areas of Your New Design Business You Need to Optimize Posted on: 29 September 2011, 3:56 am So, you’re a new freelancer — perhaps even an intermediate one by now — but you’re so caught up in getting “real work” done that you’ve not paid much attention to the processes you havein place for dealing with the administrivia and business management. Few people think about this stuff early on, because they are either trying to please their first clients with great work, or sitting by the phone waiting for a prospect to appear. But now that you’ve got some jobs done and the money’s coming in fairly steadily, it’s time to start looking at optimizing your business processes and better yet, where possible, automating them. Continue Reading:
/> DesignFestival: 5 Areas of Your New Design Business You Need to Optimize RubySource: Rails Deep Dive: Loccasions, Spork, Events and Authorization Posted on: 28 September 2011, 10:04 pm In our last post, we ended with very basic authentication working. However, we are faking out the events_path in our sign_in spec, which is where we’ll start. A successful sign-in redirects to the user events page which, presumably, has a list of the events owned by that user. Let’s go back to Mockbuilder and crank out a layout for our events page. View original post here:
/> RubySource: Rails Deep Dive: Loccasions, Spork, Events and Authorization BuildMobile: Android Layouts: Resolution and Orientation Solutions Posted on: 25 September 2011, 7:00 pm Android applications face a number of challenges that other mobile platforms may not have to deal with (yet). Android is available on a wide variety of hardware, each having a different screen size and pixel density (DPI), sometimes with a physical keyboard and sometimes without a touch screen (e.g. Google TV). More here:
/> BuildMobile: Android Layouts: Resolution and Orientation Solutions BuildMobile: Creating a Graph With Quartz 2D Posted on: 25 September 2011, 6:59 pm When I joined the team I have been working with recently, they were trying to create a graph using Core Plot, a popular third party library. It didn’t go well though, there were two big problems. First, they couldn’t use a custom image for the graph’s background, as was required by the designer. Read More:
/> BuildMobile: Creating a Graph With Quartz 2D DesignFestival: The 3 Most Prevalent Movie Poster Design Trends of 2011 Posted on: 25 September 2011, 6:59 pm Well, the big summer blockbusters have come and gone at this point. With Harry Potter’s last installment over with and the latest round of Marvel movies exiting theaters everywhere, we’re wondering if there’s anything to look forward to for the rest of the year! The good news is that we have had lots of movies in 2011, so we have lots of designs to analyze. For decades, the big marketing mogul of movies has been posters. So what’s been happening View article:
/> DesignFestival: The 3 Most Prevalent Movie Poster Design Trends of 2011
|