<?xml version="1.0" encoding="UTF-8"?> <rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
> <channel><title>SitePoint » Learn CSS &#124; HTML5 &#124; JavaScript &#124; Wordpress &#124; Tutorials-Web Development &#124; Reference &#124; Books and More &#187; Tech</title> <atom:link href="http://www.sitepoint.com/category/tech/feed/" rel="self" type="application/rss+xml" /><link>http://www.sitepoint.com</link> <description></description> <lastBuildDate>Mon, 21 May 2012 05:40:39 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" /> <item><title>An Introduction to C</title><link>http://www.sitepoint.com/an-introduction-to-c/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=an-introduction-to-c</link> <comments>http://www.sitepoint.com/an-introduction-to-c/#comments</comments> <pubDate>Sat, 19 May 2012 15:00:53 +0000</pubDate> <dc:creator>Surabhi Saxena</dc:creator> <category><![CDATA[Web Tech]]></category> <guid
isPermaLink="false">http://www.sitepoint.com/?p=53509</guid> <description><![CDATA[C. You've all heard about it, but how much do you actually know about it? In this piece, Surabhi introduces us to this powerful language.]]></description> <content:encoded><![CDATA[<p></p><p><strong>Introduction</strong></p><p>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 <strong><em>middle level language.  </em></strong></p><p>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.</p><p>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.<div
id='div-gpt-ad-1328644474660-10' style='width:728px; height:90px;'> <script type='text/javascript'>googletag.cmd.push(function() { googletag.display('div-gpt-ad-1328644474660-10'); });</script> </div></p><p><strong>History of C:</strong></p><p>C was developed in the 1970&#8242;s by <strong>Dennis Ritchie</strong> at <strong>Bell Telephone Laboratories</strong>,Inc. (now a part of AT&amp;T).  It is an outgrowth of two earlier languages, called BCPL and B, which were also developed at Bell Laboratories.</p><p>The <strong>Combined Programming Language(CPL)</strong> 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, <strong>Basic CPL(BCPL)</strong> was developed by <strong>Martin Richards</strong> 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 <strong>B</strong> was developed by <strong>Ken Thompson</strong> 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.</p><p>C was largely confined to use within Bell Labs until 1978, when Brian Kernighan and Ritchie published a definitive description of the language . The <strong>Kerninghan and Ritchie description of C</strong> is commonly referred to as <em><strong>&#8216;K &amp;R C&#8217;</strong></em>.</p><p>Following the publication of &#8216;K&amp;R C&#8217;,computer professionals, impressed with C&#8217;s many desirable features, began to promote the use of C.  By the mid 1980&#8242;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.</p><p>Early commercial implementations of C differed a little from Kerninghan and Ritchie&#8217;s original description, resulting in minor incompatibilities between different implementations.  As a result, <strong>the American National Standards Institute(ANSI committee X3J11)</strong>  developed a standardized definition of C.  Virtually all commercial compilers and interpreters adhere to the ANSI standard.  Many provide additional features of their own.</p><p><strong>C and Systems Programming:</strong></p><p>There are several features of C, which make it suitable for systems programming.  They are as follows:</p><ul><li>C is a machine independent and highly portable language.</li><li>It is easy to learn; it has only 28 keywords.</li><li>It has a comprehensive set of operators to tackle business as well as scientific applications with ease.</li><li>Users can create their own functions and add to the C library to perform a variety of tasks.</li><li>C language allows the manipulation of bits, bytes and addresses.</li><li>It has a large library of functions.</li><li>C operates on the same data types as the computer, so the codes generated are fast and efficient.</li></ul><p><strong>Structure of a C Program:</strong></p><p>Every C program consists of one or more modules called <strong><em>functions. </em></strong>One of the functions must be called <strong><em>main</em></strong>. The program will always begin by executing the <em>main</em> 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.</p><p>Any other function defintions must be defined separately, either ahead or after main( ).  Each function must contain:</p><p>1.  A <strong><em>function heading</em></strong>, which consists of the <strong><em>function name</em></strong>, followed by an optional list of arguments, enclosed in parantheses.</p><p>2.  A <strong><em>return type</em></strong> written before the function name.  It denotes the type of data that the function will return to the program.</p><p>3.  A list of <strong><em>argument declarations</em></strong>, if arguments are included in the heading.</p><p>4.  A <strong><em>compound statement</em></strong>, which comprises the remainder of the function.</p><p>The arguments(also called parameters) are symbols that represent information being passed between the function and other parts of the program.</p><p>Each compound statement is enclosed between a pair of braces{ }.  The braces may contain one or more elementary statements (called <strong><em>expression statements</em></strong>) and other compound statements. Thus compound statements may be nested one within another.  Each expression statement must end with a semicolon(;).</p><p><strong><em>Comments (remarks)</em></strong> 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&#8217;s principal features or in explaining the underlying logic of various program features.</p><p><span
style="text-decoration: underline"><strong>Components of C Language:</strong></span></p><p>There are five main components of the C Language:-</p><p>1. <strong>The character set:</strong> 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. ).</p><p>2. <strong>Data Types:</strong> The C language is designed to handle five <em>primary data types, </em>namely, <em>character, integer, float, double and void;</em> and <em>secondary data types </em>like<em> array, pointer, structure, union and enum. </em></p><p><strong>3. </strong><strong>Constants:</strong> A constant<strong> </strong>is a fixed value entity that does not change its value throughout program execution.</p><p>4. <strong>Variables:</strong> 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.</p><p>5. <strong>Keywords:</strong> Keywords are <strong><em>reserved</em></strong> words which have been assigned specific meanings in the C language.  Keywords cannot be used as variable names.</p><p>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.</p><p><strong>Example 1:</strong> The following program reads in the radius of a circle, calculates the area and then prints the result.</p><pre style="padding-left: 30px">/* program to calculate the area of a circle*/
#include&lt;stdio. h&gt; /*Library file access*/
#include&lt;conio. h&gt; /*Library file access*/
void main( )            /* Function Heading*/
    {
       float radius, area; /*Variable declarations*/
       /*Output Statement(prompt)*/
       printf("Enter the radius :");
      /*Input Statement*/
      scanf("%f", &amp;radius);
      /*Assignment Statement*/
      area = 3. 14159*radius*radius;
      /*Output Statement*/
      printf("Area of the circle :", area);
       getch( );
     }</pre><p
style="padding-left: 30px">Program output:-</p><p
style="padding-left: 30px">Enter the radius: 3</p><p
style="padding-left: 30px">Area of the circle: 28. 27431</p><p>The following points must be considered to understand the above program:-</p><p>1. The program is typed in lowercase. C is <strong>case sensitive</strong> 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 <code>printf() )</code> can be typed in anycase.</p><p>2. The first line is a comment that identifies the purpose of the program.</p><p>3. The instruction<strong> #include &lt;stdio. h&gt;</strong> 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.</p><p>4. Similarly <strong>#include &lt;conio. h&gt;</strong> 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 <strong><code>getch()</code></strong> is defined in conio. h.  # denotes a preprocessor directive.  More about this in a later article.</p><p>5. The instruction <strong>void main()</strong> is a heading for the function main( ).  The keyword <strong>void</strong> 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( ).</p><p>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( ).</p><p>7.  The instruction <strong>float radius, area;</strong>  is a <strong><em>variable declaration. </em></strong> It establishes the symbolic names &#8216;radius&#8217; and &#8216;area&#8217; as floating point variables. These variables can accept values of type &#8216;float &#8216; i. e numbers containing a decimal point or an exponent.</p><p>8.  The next four instructions are <strong><em> expression statements. </em></strong>The instruction <strong>printf(&#8220;Enter the radius :&#8221;);</strong> generates a request for information namely,the value for the radius.  This statement generates a prompt where the user enters the value .</p><p>9.  The value of the radius is read into (or stored in) the variable <em>radius </em>with the help of the scanf ( ) function.  The instruction<strong> scanf(&#8220;%f&#8221;, &amp;radius);</strong> is used for reading data.   &#8220;%f&#8221; is a <strong><em>conversion character</em></strong> which is used to accept a floating point value.</p><p>10.  The next instruction, <strong>area = 3. 14159*radius*radius;</strong> is called an <strong><em> assignment statement. </em></strong>This instruction calculates the area by using the value of radius entered by the user and assigns the value to the variable <em>area. </em></p><p>11.  The next printf( ) statement prints the message <em>Area of the circle </em>followed by the calculated area.</p><p>12.  The statement <strong>getch();</strong> 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( ).</p><p><strong>Example2:</strong> Below is a variation of the above program:</p><pre>/*program to calculate the area of a circle using a user defined function*/
#include &lt;stdio. h&gt;
#include &lt;conio. h&gt;
#define PI 3. 14159
float process(float radius);/*function prototype*/
void main()
    {
      float area,radius;
      printf("\n Enter the radius:");
      scanf("%f", &amp;radius);
      area= process(radius);
      printf("Area =%f", area);
      getch();
     }
float process( float r);
     {
     float a; /*local variable declaration*/
     a= PI*r*r;
     return(a);
     }</pre><p>This version utilizes a separate programmer defined function called <strong><em>process</em></strong>, to calculate the area.  Within this function, r is an argument (also called a parameter) that accepts the value of radius supplied to <strong><em> process</em></strong> from <strong><em>main</em></strong>, and a is the calculated result returned to main.  A reference to the function appears in main( ), within the statement area= process(radius);</p><p>In this statement, the value of area being returned from the function <em>process </em>is stored in the variable area.</p><p>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 <em>process, </em>was defined before main( ), the function prototype would,generally, have not been required.</p><p>More explanation about this when I write about functions in a later article.</p><p>This program also contains a <strong><em>symbolic constant, PI, </em></strong>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.</p><p>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 .</p> <span
id="pty_trigger"></span><div
style='padding:20px 0px 50px 0px;'><div
style='float:left;padding-left:40px;'><div
id='div-gpt-ad-1335489406190-0' style='width:300px; height:100px;'> <script type='text/javascript'>googletag.cmd.push(function() { googletag.display('div-gpt-ad-1335489406190-0'); });</script> </div></div><div
style='float:right;padding-right:40px;'><div
id='div-gpt-ad-1335489406190-1' style='width:300px; height:100px;'> <script type='text/javascript'>googletag.cmd.push(function() { googletag.display('div-gpt-ad-1335489406190-1'); });</script> </div></div><div
style='clear:both'></div></div><div
style='clear:both'></div>]]></content:encoded> <wfw:commentRss>http://www.sitepoint.com/an-introduction-to-c/feed/</wfw:commentRss> <slash:comments>5</slash:comments> </item> <item><title>What&#8217;s New in Chrome 19</title><link>http://www.sitepoint.com/chrome-19-whats-new/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=chrome-19-whats-new</link> <comments>http://www.sitepoint.com/chrome-19-whats-new/#comments</comments> <pubDate>Thu, 17 May 2012 17:24:05 +0000</pubDate> <dc:creator>Craig Buckler</dc:creator> <category><![CDATA[CSS3]]></category> <category><![CDATA[Discussion]]></category> <category><![CDATA[Gems]]></category> <category><![CDATA[JavaScript]]></category> <category><![CDATA[News & Trends]]></category> <category><![CDATA[Open Source]]></category> <category><![CDATA[Opinion]]></category> <category><![CDATA[Web Tech]]></category> <category><![CDATA[browser]]></category> <category><![CDATA[chrome]]></category> <category><![CDATA[Google Tutorials & Articles]]></category> <guid
isPermaLink="false">http://www.sitepoint.com/?p=54727</guid> <description><![CDATA[<img
width="50" height="50" src="http://www.sitepoint.com/wp-content/uploads/1/files/2011/05/518-chrome-11-50x50.png" class="attachment-thumbnail wp-post-image" alt="518-chrome-11" title="518-chrome-11" />Craig looks at several interesting features which have appeared in Google Chrome 19.]]></description> <content:encoded><![CDATA[<img
width="50" height="50" src="http://www.sitepoint.com/wp-content/uploads/1/files/2011/05/518-chrome-11-50x50.png" class="attachment-thumbnail wp-post-image" alt="518-chrome-11" title="518-chrome-11" /><p></p><p>I doubt you noticed but Chrome 19 was released this week. I rarely mention Chrome&#8217;s updates because, well, they&#8217;re rarely worth mentioning. However, I&#8217;ve discovered a few hidden gems in the latest browser&hellip;</p><h2>Tab Syncing</h2><p>The big new feature is tab syncing. If you&#8217;re using Chrome on two or more PCs/smartphones, you <em>should</em> see an <em>&#8220;Other devices&#8221;</em> link on the new tab page. Click it and you can open synchronized links. I say <em>&#8220;should&#8221;</em> because I haven&#8217;t been able to get it working.</p><p>Tab syncing has been available in Firefox for a while so I&#8217;m surprised it&#8217;s taken quite so long to appear in Chrome. Hopefully, you&#8217;ll have better luck than I did.</p><h2>CSS3 calc() Support</h2><p>The webkit team has finally implemented one of my favorite CSS3 features: the little-known <a
href="http://www.sitepoint.com/css3-calc-function/">calc() function</a>. It allows you to define calculated dimensions, e.g.</p><pre><code>
#myelement { width: calc(50% - 2em + 4px); }
</code></pre><p>Chrome supports calc() with the -webkit prefix. Firefox uses -moz and IE9 is happy without prefixes. To use it effectively, you&#8217;ll need fallback code such as:<div
id='div-gpt-ad-1328644474660-10' style='width:728px; height:90px;'> <script type='text/javascript'>googletag.cmd.push(function() { googletag.display('div-gpt-ad-1328644474660-10'); });</script> </div></p><pre><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);
}
</code></pre><h2>Combined Settings Page</h2><p>Choosing tool &gt; 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 &#8220;About&#8221; dialog <em>(will that disappear soon?)</em></p><h2>New JavaScript/ECMAScript 5.1 (Harmony) Features</h2><p>A number of <a
href="http://blog.chromium.org/2012/02/future-of-javascript-take-peek-today.html">experimental JavaScript features</a> have made their way from the Harmony specification into Chrome&#8217;s V8 engine. However, they&#8217;re not available by default &#8212; you&#8217;ll need to &#8220;Enable Experimental JavaScript&#8221; in <a
href="http://www.sitepoint.com//flags" class="broken_link">chrome://flags</a>. Language structures such as collections and proxies look great, but it&#8217;ll be some time before they&#8217;re available in all browsers.</p><h2>Security and Bug Fixes</h2><p>21 issues have been fixed in Chrome 19 and Google has paid almost $15,000 to eagle-eyed security hackers.</p><p>Chrome has remained fast and stable. It looks set to knock IE from the top of the <a
href="http://www.sitepoint.com/browser-trends-may-2012/">browser usage chart</a> during the summer of 2012. I&#8217;m not convinced any other vendor can prevent Google&#8217;s domination of the web and the software we use to access it.</p> <span
id="pty_trigger"></span><div
style='padding:20px 0px 50px 0px;'><div
style='float:left;padding-left:40px;'><div
id='div-gpt-ad-1335489406190-0' style='width:300px; height:100px;'> <script type='text/javascript'>googletag.cmd.push(function() { googletag.display('div-gpt-ad-1335489406190-0'); });</script> </div></div><div
style='float:right;padding-right:40px;'><div
id='div-gpt-ad-1335489406190-1' style='width:300px; height:100px;'> <script type='text/javascript'>googletag.cmd.push(function() { googletag.display('div-gpt-ad-1335489406190-1'); });</script> </div></div><div
style='clear:both'></div></div><div
style='clear:both'></div>]]></content:encoded> <wfw:commentRss>http://www.sitepoint.com/chrome-19-whats-new/feed/</wfw:commentRss> <slash:comments>5</slash:comments> </item> <item><title>Two New Proposals to Solve the CSS3 Vendor Prefix Crisis</title><link>http://www.sitepoint.com/css3-vendor-prefix-crisis-solutions-2/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=css3-vendor-prefix-crisis-solutions-2</link> <comments>http://www.sitepoint.com/css3-vendor-prefix-crisis-solutions-2/#comments</comments> <pubDate>Tue, 15 May 2012 15:41:07 +0000</pubDate> <dc:creator>Craig Buckler</dc:creator> <category><![CDATA[CSS Tutorials]]></category> <category><![CDATA[CSS3]]></category> <category><![CDATA[Discussion]]></category> <category><![CDATA[HTML & CSS]]></category> <category><![CDATA[HTML5]]></category> <category><![CDATA[News & Trends]]></category> <category><![CDATA[Web Tech]]></category> <category><![CDATA[CSS]]></category> <category><![CDATA[HTML5 Dev Center]]></category> <category><![CDATA[HTML5 Tutorials & Articles]]></category> <category><![CDATA[vendor prefixes]]></category> <guid
isPermaLink="false">http://www.sitepoint.com/?p=54609</guid> <description><![CDATA[<img
width="50" height="50" src="http://www.sitepoint.com/wp-content/uploads/1/files/2012/02/641-css-vendor-prefix-crisis-50x50.jpg" class="attachment-thumbnail wp-post-image" alt="641-css-vendor-prefix-crisis" title="641-css-vendor-prefix-crisis" />Craig discusses two new proposals which could prevent the CSS3 vendor prefix catastrophe before it begins.]]></description> <content:encoded><![CDATA[<img
width="50" height="50" src="http://www.sitepoint.com/wp-content/uploads/1/files/2012/02/641-css-vendor-prefix-crisis-50x50.jpg" class="attachment-thumbnail wp-post-image" alt="641-css-vendor-prefix-crisis" title="641-css-vendor-prefix-crisis" /><p></p><p>Web developers have been concerned about the <a
href="http://www.sitepoint.com/w3c-css-webkit-prefix-crisis/">vendor prefix crisis</a> since February 2012. To summarize the issue, this is what should happen in an ideal world:</p><ol><li>Vendors implement experimental CSS3 properties using their own prefix, e.g. -webkit-transform, -moz-transform, -ms-transform, -o-transform.</li><li>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.</li><li>Once a property becomes a W3C recommendation, all browser vendors can provide a stable unprefixed property, e.g. transform.</li><li>Optionally, developers can remove the prefixed properties from their stylesheets. However, it&#8217;s not strictly necessary if the unprefixed property is defined last and CSS cascade rules apply.</li></ol><p>This is what occurs in the real world:</p><ol><li>Vendors implement experimental CSS3 properties using their own prefix. In some cases, vendors promote them as an HTML5 <em>&#8220;standard&#8221;</em> even if they&#8217;re device-specific or never submitted to the W3C.</li><li>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&#8217;re testing a limited number of devices.</li><li>Once a property becomes a W3C recommendation, all browser vendors can provide a stable unprefixed property, e.g. transform&hellip;</li><li>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.</li><li>The vendors become concerned and add support for other prefixes into their browser, i.e. <a
href="http://www.sitepoint.com/opera-css3-webkit-prefix/">Opera implements the -webkit prefix for some properties</a>. The prefix process is broken and, while it&#8217;s too early to predict the outcome, the majority of developers consider it to be a bad move.</li></ol><p>We have discussed the issues at length on SitePoint; <a
href="http://www.sitepoint.com/css3-vendor-prefix-crisis-solutions/">there are no easy solutions</a>. However, two interesting proposals have been raised by W3C members during the past week.<div
id='div-gpt-ad-1328644474660-10' style='width:728px; height:90px;'> <script type='text/javascript'>googletag.cmd.push(function() { googletag.display('div-gpt-ad-1328644474660-10'); });</script> </div></p><h2>Option 1: Unprefixed Properties are Supported From Day One</h2><p>The first proposal comes from Florian Rivoal, Opera&#8217;s W3C representative:</p><blockquote><p> 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.</p><p>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.</p><p>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.</p></blockquote><p>For example, you could use the following transform code in your CSS:</p><pre><code>
transform: rotate(30deg);
</code></pre><p>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.</p><pre><code>
transform: rotate(30deg);
-webkit-transform: rotate(-30deg);
</code></pre><p>It&#8217;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.</p><p>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 <code>-webkit-transform: rotate(-30deg);</code> 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.</p><h2>Option 2: A New Vendor-Draft Modifier</h2><p>The second proposal comes from Fran&ccedil;ois Remy:</p><blockquote><p> Let&#8217;s introduce the &#8220;!vendor-draft&#8221; 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:<br
/> <code>border-radius: 3px !webkit-draft;</code></p><p>Any browser which is not webkit but implemented border-radius in a way that is compatible with the &#8220;webkit draft&#8221; can support the declaration. This is different from vendor prefixes: other browsers don&#8217;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 &#8220;!vendor-draft&#8221; flag (using a version number, if appropriate).</p></blockquote><p>This solves the issue by changing the property value rather than its name (in a similar way to the <code>!important</code> modifier). Again, the following transform code could be used:</p><pre><code>
transform: rotate(30deg);
</code></pre><p>But a default anti-clockwise rotation could be fixed in any browser adhering to a webkit specification:</p><pre><code>
transform: rotate(30deg);
transform: rotate(-30deg) !webkit-draft;
</code></pre><p>If a browser subsequently supported the W3C specification, the second property would be ignored.</p><p>It would also be possible to implement draft versioning, e.g.</p><pre><code>
transform: rotate(30deg);
transform: rotate(-30degrees) !webkit-draft;
transform: rotate(-30deg) !webkit-draft-2;
</code></pre><p>It&#8217;s a flexible solution which finally addresses the issue of properties evolving over time.</p><p>Unfortunately, it&#8217;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&#8217;s a fundamentally different approach which could break existing stylesheets. In the short term, vendors would probably support both prefixes and value modifiers &#8212; and that would lead to confusion.</p><p>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 <em>&#8220;complete&#8221;</em> CSS3 and begin work on CSS4.</p><p>Supporting unprefixed properties is more practical but will certainly cause versioning issues which couldn&#8217;t be fixed in CSS alone. But perhaps that&#8217;s the price you pay for using experimental technology?</p><p>Do you have a preference for either of these options? Or is it too late to prevent a vendor prefix catastrophe?</p> <span
id="pty_trigger"></span><div
style='padding:20px 0px 50px 0px;'><div
style='float:left;padding-left:40px;'><div
id='div-gpt-ad-1335489406190-0' style='width:300px; height:100px;'> <script type='text/javascript'>googletag.cmd.push(function() { googletag.display('div-gpt-ad-1335489406190-0'); });</script> </div></div><div
style='float:right;padding-right:40px;'><div
id='div-gpt-ad-1335489406190-1' style='width:300px; height:100px;'> <script type='text/javascript'>googletag.cmd.push(function() { googletag.display('div-gpt-ad-1335489406190-1'); });</script> </div></div><div
style='clear:both'></div></div><div
style='clear:both'></div>]]></content:encoded> <wfw:commentRss>http://www.sitepoint.com/css3-vendor-prefix-crisis-solutions-2/feed/</wfw:commentRss> <slash:comments>33</slash:comments> </item> <item><title>Ubuntu 12.04 LTS Precise Pangolin: Networking tips and tricks</title><link>http://www.sitepoint.com/ubuntu-12-04-lts-precise-pangolin-networking-tips-and-tricks/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=ubuntu-12-04-lts-precise-pangolin-networking-tips-and-tricks</link> <comments>http://www.sitepoint.com/ubuntu-12-04-lts-precise-pangolin-networking-tips-and-tricks/#comments</comments> <pubDate>Mon, 14 May 2012 15:00:50 +0000</pubDate> <dc:creator>Jonathan Hobson</dc:creator> <category><![CDATA[Web Tech]]></category> <category><![CDATA[WebOS]]></category> <category><![CDATA[Ubuntu]]></category> <guid
isPermaLink="false">http://www.sitepoint.com/?p=54343</guid> <description><![CDATA[<img
width="50" height="39" src="http://www.sitepoint.com/wp-content/uploads/1/files/2012/04/ubuntu-50x39.png" class="attachment-thumbnail wp-post-image" alt="ubuntu" title="ubuntu" />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 &#8216;tips and tricks&#8217; that will serve to improve your computers connectivity and overall performance by showing you how easy [...]]]></description> <content:encoded><![CDATA[<img
width="50" height="39" src="http://www.sitepoint.com/wp-content/uploads/1/files/2012/04/ubuntu-50x39.png" class="attachment-thumbnail wp-post-image" alt="ubuntu" title="ubuntu" /><p></p><p>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 &#8216;tips and tricks&#8217; 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.</p><p>So let&#8217;s get started &#8230;</p><h2>What is my local IP address</h2><p>It may be a easy question to begin with, but in a world of complexity it is often the simple questions that get overlooked.</p><h3>Using the graphical tools:</h3><p>Right click on the &#8216;networking icon&#8217; in the top panel of the Ubuntu desktop and choose &#8216;Connection Information&#8217; as shown below:</p><p><a
href="http://www.sitepoint.com/?attachment_id=54344" rel="attachment wp-att-54344"><img
class="alignnone size-full wp-image-54344" src="http://www.sitepoint.com/wp-content/uploads/1/files/2012/05/u1.jpg" alt="" width="500" height="486" /></a></p><p>The resulting dialogue box will then provide feedback on your current settings.</p><h3>Using the command line interface:</h3><p>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).<div
id='div-gpt-ad-1328644474660-10' style='width:728px; height:90px;'> <script type='text/javascript'>googletag.cmd.push(function() { googletag.display('div-gpt-ad-1328644474660-10'); });</script> </div></p><p>If you have a wireless based connection, run:</p><pre>iwconfig</pre><p>If you have a &#8216;wired&#8217; connection, run</p><pre>ifconfig</pre><p>The results for &#8216;ifconfig&#8217; will look something like this:</p><pre>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)</pre><p>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</p><pre>ifconfig -a | grep eth</pre><p>The result will look something like this:</p><pre>eth0      Link encap:Ethernet  HWaddr 00:1d:92:65:09:e1</pre><p>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 &#8216;lshw&#8217; command, this tool will not only detail your ethernet devices but it will also provide a plethora of information on your hardware&#8217;s &#8216;other&#8217; capabilities.</p><p>To use this tool, simply run the following command and wait a few seconds whilst Ubuntu quieries your devices:</p><pre>sudo lshw -class network</pre><p>And the result will look something like this:</p><pre>  *-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</pre><p>Sometimes you&#8217;ve just &#8216;gotta&#8217; love the details, but now we know something about our computer we can begin to take control :-)</p><h2>How do I create a static IP address with the Network Manager</h2><p>The following instruction shows you how to create a fixed (or static) IP address with the Network Manager.</p><p>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&#8217;t worry, it is all very simple:</p><p>Click the network menu on the top panel (the &#8216;up/down&#8217; arrows icon) and select &#8216;Edit Connections&#8217;.</p><p>Alternatively you can choose System Settings &gt; Network &gt; Choose your &#8216;Network Connection&#8217; from the left hand panel and select &#8216;Options&#8217;.</p><p><a
href="http://www.sitepoint.com/?attachment_id=54345" rel="attachment wp-att-54345"><img
class="alignnone size-full wp-image-54345" src="http://www.sitepoint.com/wp-content/uploads/1/files/2012/05/u2.jpg" alt="" width="500" height="400" /></a></p><p>Now choose the relevant connection and click edit.</p><p>For example, if you are using a &#8216;wired connection&#8217;, choose the &#8216;wired&#8217; tab to find your connection.</p><p><a
href="http://www.sitepoint.com/?attachment_id=54346" rel="attachment wp-att-54346"><img
class="alignnone size-full wp-image-54346" src="http://www.sitepoint.com/wp-content/uploads/1/files/2012/05/u3.jpg" alt="" width="500" height="583" /></a></p><p>In the resulting dialogue box you should:</p><ul><li>Select the &#8216;IPv4 Settings&#8217; tab and change the &#8216;Method&#8217; to &#8216;Manual&#8217;.</li><li>Click Add and complete each field with your IP address, network mask and default gateway.Always press the &#8216;Enter/Return&#8217; when you&#8217;ve finished typing each address otherwise the dialogue will fail to accept your new settings and the &#8216;save&#8217; button will remain inactive/greyed-out.</li><li>Include the IP addresses of the DNS servers. Multiple addresses should be separated by commas.</li><li>Click Save and close the remaining dialogue boxes.</li></ul><p>And there you go &#8230;</p><p>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.</p><p>To confirm your new settings, simply check your connection settings as shown previously (see above)</p><p><strong>But what if I need DHCP again?</strong><br
/> If you ever need to return to a dynamically assigned IP address simply re-run the previous steps. Find your current connection, select the &#8216;IPv4 Settings&#8217; tab and change the &#8216;Method&#8217; to &#8216;Automatic (DHCP)&#8217;. To finalise this reversal click save and reboot (depending on the network conditions and how the DHCP server is configured).</p><h2>Disable the Network Manager and &#8216;hard-code&#8217; a static IP address</h2><p>This solution explains how to create a fixed (or static) IP address without using the Network Manager.</p><p>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 &#8216;wired connection&#8217; using the Network Manager does come at the cost of performance. So this solution uses the traditional approach to &#8216;hard-coding&#8217; your network connection and it is most suitable to those individuals who demand maximum performance or absolute stability.</p><blockquote><p>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.</p></blockquote><p>Again, don&#8217;t worry, the process to disable the Network Manager is very simple but it will require us to run various &#8216;commands&#8217; in Terminal in order to complete some steps.</p><p>So let&#8217;s begin by making a backup of our original file.</p><p>In Terminal type:</p><pre>sudo cp /etc/NetworkManager/NetworkManager.conf /etc/NetworkManager/NetworkManager.conf.bak</pre><blockquote><p>This will serve to back-up our original file to &#8216;/etc/NetworkManager/NetworkManager.conf.bak&#8217;. 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: &#8216;sudo cp /etc/NetworkManager/NetworkManager.conf.bak /etc/NetworkManager/NetworkManager.conf&#8217; and reboot.</p></blockquote><p>And with the confidence that we are fully backed-up we shall now proceed to disable the Network Manager.</p><p>In Terminal, type:</p><pre>sudo gedit /etc/NetworkManager/NetworkManager.conf</pre><p>This will open the &#8216;NetworkManager.conf&#8217; file in our text editor.</p><p>Now change:</p><p>managed=false</p><p>to</p><p>managed=true</p><p>So it looks like this:</p><p><a
href="http://www.sitepoint.com/?attachment_id=54347" rel="attachment wp-att-54347"><img
class="alignnone size-full wp-image-54347" src="http://www.sitepoint.com/wp-content/uploads/1/files/2012/05/u4.jpg" alt="" width="500" height="409" /></a></p><p>When done, save the file and close it.</p><blockquote><p>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.</p></blockquote><p>Now we have successfully disabled the Network Manager we can proceed to create our Static IP address by making some direct changes to the &#8216;interface&#8217; file; but with safety in mind let&#8217;s begin by making a backup of our original file.</p><p>In Terminal and type:</p><pre>sudo cp /etc/network/interfaces /etc/network/interfaces.bak</pre><blockquote><p>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</p></blockquote><p>Now lets add our static IP address.</p><p>In Terminal type:</p><pre>sudo gedit /etc/network/interfaces</pre><p>Authenticate yourself in the usual way and then replace the file contents as shown below, where xxx represents values relevant to your needs:</p><pre>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</pre><p>And to help you out, here is an example with an explanation of the values concerned:</p><pre>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)</pre><p>When complete, simply save and close the file and reboot your computer to complete these steps.</p><p>We are re-booting our computer at this point in order to &#8216;dis-engage&#8217; the Network Manager, and once complete you can always re-configure your IP address at any time by making the necessary changes to the &#8216;interfaces&#8217; file (shown above) and using the following command to restart your networking service: &#8216;sudo /etc/init.d/networking restart&#8217;.</p><p>After you restart your computer you will discover (visually) that nothing has changed but as a consequence you should be experiencing a &#8216;more&#8217; responsive computer and network connection.</p><blockquote><p>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 &#8216;cp&#8217; or copy command &#8211; unless you delete them, your original backup files will always remain for future reference.</p></blockquote><h2>Create Virtual Network Adapters (add more than 1 IP address to a single ethernet card)</h2><p>In some situations this can be very useful and as an extension to our previous solution of &#8216;disabling the network manager and hard-coding a static IP address&#8217; I will now show you how to assign more than one IP address to the same ethernet card:</p><p>In Terminal type:</p><pre>sudo gedit /etc/network/interfaces</pre><p>Authenticate yourself and then replace the file contents like so, where xxx represents values relevant to your needs:</p><pre>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</pre><p>And to make this as simple as possible, here is an example:</p><pre>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</pre><p>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).</p><p>The trick is to follow the virtual naming scheme (i.e. eth0:0, eth0:1, eth0:2 etc &#8230;) and to ensure that every instance maintains a unique IP address. In this way you can create as many &#8216;instances&#8217; of an IP address as required.</p><p>To illustrate this point, let&#8217;s add a third IP address to our example:</p><pre>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</pre><p>When complete, remember to reboot your computer to apply the changes or open Terminal and type:</p><pre>sudo /etc/init.d/networking restart</pre><p>You can then run &#8216;ifconfig&#8217; to view your new settings.</p><p>Have fun ..!</p><h2>Change your computer&#8217;s hostname</h2><p>You may like your current computer name, or you may want to change it.</p><p>In this short recipe I will show you how to view and change your computer name with relative ease &#8230;</p><p>In Terminal type:</p><pre>sudo gedit /etc/hostname</pre><p>The file will probably look something like this:</p><pre>ubuntu-computername</pre><p>To change the name of your computer, simply delete the existing content and replace as required.</p><p>Remember, the actual name can be anything your want as long as you remember some basic principles:</p><ul><li>Desktops generally use a singular name (as shown above) whereas all servers or &#8216;desktops acting as servers&#8217; should be in the format of computername.computerdomain.suffix.</li><li>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.</li><li>Use &#8216;internet friendly&#8217; names and do not use a computer name that already exists on your network.</li><li>Do not use spaces or non-internet friendly characters.</li></ul><p>Once complete, simply choose &#8216;save&#8217;, &#8216;close&#8217; the file and reboot your computer to see the changes.</p><p>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.</p><p>Open Terminal and type:</p><pre>sudo hostname</pre><p>And the result should reflect the changes you made &#8230;</p><h2>Managing the Hosts file</h2><p>The 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 &#8216;quicker&#8217; buy &#8216;hard-coding&#8217; 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.</p><p>Before you begin, you can make a back-up of this file by simply typing the following command in to Terminal:</p><pre>sudo cp /etc/hosts /etc/hosts.bak</pre><p>Now, to proceed and customise your hosts file simply return to the command line and type:</p><pre>sudo gedit /etc/hosts</pre><p>A typical desktop file will look like this (simply substitue the example values with those relevant to your computer):</p><pre>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</pre><p>However, having said that and just for the record, for the &#8216;server&#8217; or &#8216;desktop server&#8217; version of the same file should look more like this:</p><pre>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</pre><p>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.</p><p>For example, you may ignore these values (not include them or comment them out by placing a &#8216;hash&#8217; character at the beginning of the line) like so if your computer does not use IPv6.</p><pre># 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</pre><p>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 &#8216;old blighty&#8217; &#8211; &#8216;don&#8217;t fix what ain&#8217;t broke&#8217;).</p><p>So getting back on track &#8230;</p><p>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:</p><pre>192.168.1.200		servername1 www servername1.localdomain.lan
192.168.1.200		servername2 mail servername2.localdomain.lan</pre><blockquote><p>In my example I have included an alias in addition to the actual names &#8211; 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.</p></blockquote><p>Windows (and Mac) users should notice that this process very similar to customisng the &#8216;hosts&#8217; file on any Windows/Mac based operating system and the resulting file could look like this:</p><pre>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</pre><p>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.</p><p>Taking this one step further &#8230; and by giving it a little twist.</p><p>For those of you who wish to excercise some &#8216;parental power&#8217; you could easily use this as a way to block direct access to some &#8216;unwanted web sites&#8217; by sending someone who expects to go to www.website1.com to www.website2.com, like so:</p><pre>#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</pre><p>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 &#8230; (the IP address being the actual address of website2)</p><p>It isn&#8217;t a perfect of solution by any means but it is food for thought and can serve as a starting point for future development ;-)</p><h2>How to re-configure DNS resolution</h2><p>The 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.</p><blockquote><p>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.</p></blockquote><p>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:</p><p>&#8216;Resolveconf&#8217; is a small program that resides in &#8216;/etc/resolvconf&#8217; 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 &#8216;/etc/network/interfaces&#8217; file:</p><p>In Terminal type:</p><pre>sudo gedit /etc/network/interfaces</pre><p>Now add the following nameserver line to your file, changing XXX to something more applicable to your needs:</p><pre>dns-nameservers xxx.xxx.xxx.xxx xxx.xxx.xxx.xxx</pre><p>Similar to the example shown above here is the new file using Google&#8217;s public nameservers:</p><pre>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</pre><p>When complete, click &#8216;save&#8217;, then &#8216;close&#8217; the file and reboot to apply the changes.</p><p>On reboot, you can see that the new nameserver information has now been applied to our &#8216;resolve.conf&#8217; file by opening Terminal and typing:</p><pre>cat /etc/resolv.conf</pre><p>Which may look something like this:</p><pre># 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</pre><p>So having made your changes, to query the DNS capabilities of your system, simply return to the command line and type:</p><pre>nslookup www.sitepoint.com</pre><p>or alternatively try</p><pre>dig www.sitepoint.com</pre><p>And that&#8217;s it for now &#8230; but most of all, have fun :-)</p><p>So until next time &#8230;</p><p>I hope that you continue to enjoy using Ubuntu 12.04 LTS Precise Pangolin.</p> <span
id="pty_trigger"></span><div
style='padding:20px 0px 50px 0px;'><div
style='float:left;padding-left:40px;'><div
id='div-gpt-ad-1335489406190-0' style='width:300px; height:100px;'> <script type='text/javascript'>googletag.cmd.push(function() { googletag.display('div-gpt-ad-1335489406190-0'); });</script> </div></div><div
style='float:right;padding-right:40px;'><div
id='div-gpt-ad-1335489406190-1' style='width:300px; height:100px;'> <script type='text/javascript'>googletag.cmd.push(function() { googletag.display('div-gpt-ad-1335489406190-1'); });</script> </div></div><div
style='clear:both'></div></div><div
style='clear:both'></div>]]></content:encoded> <wfw:commentRss>http://www.sitepoint.com/ubuntu-12-04-lts-precise-pangolin-networking-tips-and-tricks/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item><div><div
class="post_box two_ads" style="float:left;padding-left:2px;"><div
id='div-gpt-ad-1328645237920-0' style='width:728px; height:90px;'> <script type='text/javascript'>googletag.cmd.push(function() { googletag.display('div-gpt-ad-1328645237920-0'); });</script> </div></div></div><div
class="clear">&nbsp;</div> <item><title>Celebrate 20 Years of Wolfenstein 3D in Your Browser</title><link>http://www.sitepoint.com/wolfenstein-3d-html5-browser-game/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=wolfenstein-3d-html5-browser-game</link> <comments>http://www.sitepoint.com/wolfenstein-3d-html5-browser-game/#comments</comments> <pubDate>Sat, 12 May 2012 15:00:27 +0000</pubDate> <dc:creator>Craig Buckler</dc:creator> <category><![CDATA[Gems]]></category> <category><![CDATA[HTML & CSS]]></category> <category><![CDATA[HTML5]]></category> <category><![CDATA[JavaScript]]></category> <category><![CDATA[News & Trends]]></category> <category><![CDATA[Opinion]]></category> <category><![CDATA[Reviews]]></category> <category><![CDATA[canvas]]></category> <category><![CDATA[game]]></category> <category><![CDATA[HTML5 Dev Center]]></category> <category><![CDATA[HTML5 Tutorials & Articles]]></category> <guid
isPermaLink="false">http://www.sitepoint.com/?p=54596</guid> <description><![CDATA[<img
width="50" height="50" src="http://www.sitepoint.com/wp-content/uploads/1/files/2012/05/673-wolfenstein-browser-50x50.png" class="attachment-thumbnail wp-post-image" alt="673-wolfenstein-browser" title="673-wolfenstein-browser" />Wolfenstein 3D was released 20 years ago. To celebrate the ground-breaking FPS game, you can now play an HTML5 version in your browser.]]></description> <content:encoded><![CDATA[<img
width="50" height="50" src="http://www.sitepoint.com/wp-content/uploads/1/files/2012/05/673-wolfenstein-browser-50x50.png" class="attachment-thumbnail wp-post-image" alt="673-wolfenstein-browser" title="673-wolfenstein-browser" /><p></p><p>Perhaps I&#8217;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:</p><p><a
href="http://wolfenstein.bethsoft.com/"><strong>wolfenstein.bethsoft.com</strong><br
/> <img
src="http://blogs.sitepointstatic.com/images/tech/673-wolfenstein-browser-screen.png" width="500" height="320" alt="Wolfenstein 3D browser version" class="center" style="margin: 5px auto 20px auto" /></a></p><p><em>(Note the game is recommended for those over 12 and banned in Germany and several other countries).</em></p><p>The site states it&#8217;s compatible with IE9, Firefox, Chrome and Safari &#8212; although Opera seems to work if you&#8217;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&#8217;ll find keyboard control best.</p><p>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.<div
id='div-gpt-ad-1328644474660-10' style='width:728px; height:90px;'> <script type='text/javascript'>googletag.cmd.push(function() { googletag.display('div-gpt-ad-1328644474660-10'); });</script> </div></p><p>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&#8217;) but they took themselves a little too seriously and couldn&#8217;t be replicated on the 16-bit PCs of the day.</p><p>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 &#8212; and shouldn&#8217;t have been possible given the hardware limitations.</p><p>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 &#8212; combine that with may hours game play and Wolfenstein remains the only game which made me feel genuinely queasy!</p><p>iD Software&#8217;s success with Wolfenstein led to Doom a year later &#8212; it&#8217;s fair to say you wouldn&#8217;t be playing <em>Call of Duty</em> today if it weren&#8217;t for those two ground-breaking games.</p><p>A version of Wolfenstein was released on almost every computer and gaming platform <em>(even Nintendo permitted the gore-fest on their family-friendly consoles, although iD were instructed to replace guard dogs with large rats)</em>. 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.</p><p>Technically, the game is implemented using JavaScript and HTML5 audio. I first thought it was rendered using a <code>canvas</code> element but, thanks to further investigation by Matt Vaughan (below), it&#8217;s actually 320 horizontally-stacked DIVs which have their background, vertical size and top location modified as you move around. It&#8217;s clever but slightly unusual solution. The full page weight is a little over 800kB of mostly uncompressed JavaScript &#8212; impressive given that most sites use that for their home page.</p><p>But who cares about the technical details &hellip; <a
href="http://wolfenstein.bethsoft.com/"><strong>Happy Birthday Wolfenstein 3D</strong></a> and thanks for 20 great years of great gaming.</p> <span
id="pty_trigger"></span><div
style='padding:20px 0px 50px 0px;'><div
style='float:left;padding-left:40px;'><div
id='div-gpt-ad-1335489406190-0' style='width:300px; height:100px;'> <script type='text/javascript'>googletag.cmd.push(function() { googletag.display('div-gpt-ad-1335489406190-0'); });</script> </div></div><div
style='float:right;padding-right:40px;'><div
id='div-gpt-ad-1335489406190-1' style='width:300px; height:100px;'> <script type='text/javascript'>googletag.cmd.push(function() { googletag.display('div-gpt-ad-1335489406190-1'); });</script> </div></div><div
style='clear:both'></div></div><div
style='clear:both'></div>]]></content:encoded> <wfw:commentRss>http://www.sitepoint.com/wolfenstein-3d-html5-browser-game/feed/</wfw:commentRss> <slash:comments>9</slash:comments> </item> <item><title>Scalable Vector Graphics: an Overview</title><link>http://www.sitepoint.com/svg-scalable-vector-graphics-overview/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=svg-scalable-vector-graphics-overview</link> <comments>http://www.sitepoint.com/svg-scalable-vector-graphics-overview/#comments</comments> <pubDate>Fri, 11 May 2012 18:30:38 +0000</pubDate> <dc:creator>Craig Buckler</dc:creator> <category><![CDATA[Client Side Coding]]></category> <category><![CDATA[Design]]></category> <category><![CDATA[HTML & CSS]]></category> <category><![CDATA[HTML5]]></category> <category><![CDATA[Web Tech]]></category> <category><![CDATA[canvas]]></category> <category><![CDATA[HTML5 Dev Center]]></category> <category><![CDATA[SVG]]></category> <guid
isPermaLink="false">http://www.sitepoint.com/?p=54386</guid> <description><![CDATA[<img
width="50" height="50" src="http://www.sitepoint.com/wp-content/uploads/1/files/2012/05/672-svg-basics-50x50.png" class="attachment-thumbnail wp-post-image" alt="672-svg-basics" title="672-svg-basics" />Craig provides a concise overview of Scalable Vector Graphics and its associated technologies.]]></description> <content:encoded><![CDATA[<img
width="50" height="50" src="http://www.sitepoint.com/wp-content/uploads/1/files/2012/05/672-svg-basics-50x50.png" class="attachment-thumbnail wp-post-image" alt="672-svg-basics" title="672-svg-basics" /><p></p><p>In my recent article, we discussed <a
href="http://www.sitepoint.com/7-reasons-to-consider-svgs-instead-of-canvas/">7 Reasons to Consider SVGs Instead of Canvas</a>. SVGs are ideal if you require a scalable diagram such as a chart or logo which can be altered or animated using JavaScript DOM methods.</p><p>So &hellip; <em>what are SVGs and how do we use them?</em> This is the first part in a series articles about the vector image format.</p><h2>What Are SVGs?</h2><p>SVGs are vector graphics. Rather than defining the color of each pixel like you would in a bitmap (JPEG, PNG, GIF, BMP etc.), vector graphics define lines and shapes, e.g. draw a black line from co-ordinate 0,0 to 100,100. This has a number of advantages: vectors are easy to modify, generally require smaller files and are scalable to any dimension without losing quality &#8212; which makes them ideal for responsive web design. Bitmaps remain the best choice for photographs or very complex images (note that SVGs can include embedded bitmaps).</p><p><img
src="http://blogs.sitepointstatic.com/images/tech/672-svg-basics-vector.png" width="339" height="267" alt="vector vs bitmap comparison" class="center" style="margin:20px auto" /></p><p>SVG is a royalty-free web standard maintained by the <a
href="http://www.w3.org/Graphics/SVG/">W3C SVG Working Group</a>. Version 1.0 of the technology was originally proposed in 1999. <a
href="http://www.w3.org/TR/SVG11/">Version 1.1</a> is the most recent standard with <a
href="http://www.w3.org/Graphics/SVG/WG/wiki/Roadmap">version 2.0</a> expected in 2013.<div
id='div-gpt-ad-1328644474660-10' style='width:728px; height:90px;'> <script type='text/javascript'>googletag.cmd.push(function() { googletag.display('div-gpt-ad-1328644474660-10'); });</script> </div></p><p>There are a couple of other flavors: <a
href="http://www.w3.org/TR/SVGTiny12/">SVG Tiny</a> and <a
href="http://www.w3.org/TR/SVGMobile/">SVG Mobile</a>. These are simplified profiles or subsets of the full SVG specification which target devices with reduced computational and display capabilities. These standards largely relate to how rendering engines parse the image; an SVG 1.1 file can be rendered on a device which supports SVG Tiny but some effects such as gradients and opacities would not be applied.</p><h2>How are SVGs Defined?</h2><p>SVGs are declared using eXtensible Markup Language (XML). It uses tags like HTML &#8212; the following code draws a white circle with a black border:</p><pre><code>
&lt;circle cx=&quot;100&quot; cy=&quot;100&quot; r=&quot;50&quot; stroke-width=&quot;4&quot; stroke=&quot;#000&quot; fill=&quot;#fff&quot; /&gt;
</code></pre><p>Be aware that XML is stricter than HTML. You cannot, for example, omit a closing tag since this will make the file invalid and the SVG will not be rendered.</p><p>The W3C SVG1.1 specification defines 14 main features:</p><ol><li><strong>Basic shapes</strong>: straight lines, polygons, circles, ellipses, and rectangles with or without rounded corners.</li><li><strong>Paths</strong>: outlined or filled paths containing curved or straight lines.</li><li><strong>Text</strong>: on straight or curved paths in any direction.</li><li><strong>Painting</strong>: fills and outlines using solid colors, gradients, patterns, transparency, and markers (line terminators such as arrow heads).</li><li><strong>Color</strong>: fill and stroke properties defined using standard 3 or 6-digit hex or rgb values.</li><li><strong>Gradients and patterns</strong>: CSS3-like gradient declarations or bitmap backgrounds.</li><li><strong>Clipping, masking and compositing</strong>: using elements to outline regions which can be painted.</li><li><strong>Filters</strong>: effects applied to all elements within a container, e.g. blurring, lighting, color adjustments, etc.</li><li><strong>Linking</strong>: hyperlinks to other documents.</li><li><strong>Interactivity</strong>: attaching event handlers using JavaScript.</li><li><strong>DOM Scripting</strong>: accessing and manipulating SVG elements using the Document Object Model.</li><li><strong>Animation</strong>: built-in animations using Synchronized Multimedia Integration Language (SMIL).</li><li><strong>Fonts</strong>: text glyphs defined in an SVG file which can be used as a standard font.</li><li><strong>Metadata</strong>: titles, descriptions, subjects, creators and other properties about the SVG image.</li></ol><h2>Cascading Stylesheets in SVGs</h2><p>SVGs also support embedded or external CSS rules. Like HTML, the selectors can target tag types or IDs and classes assigned to specific elements. CSS properties and values generally follow element attributes. For example, this CSS renders every circle in the SVG with the same white fill and black border color:</p><pre><code>
circle
{
	stroke: #000;
	fill: #fff;
}
</code></pre><h2>SVG Creation Tools</h2><p>Creating SVGs in a text editor is possible but it&#8217;s a slow process, error-prone and not much fun. Fortunately, there are several open source and commercial tools which allow designers and non-programmers to easily create SVG images:</p><ul><li><a
href="http://www.inkscape.org/">Inkscape</a></li><li><a
href="http://www.openoffice.org/">OpenOffice</a> or <a
href="">LibreOffice</a> Draw</li><li><a
href="http://svg-edit.googlecode.com/svn/branches/2.5.1/editor/svg-editor.html">svg-edit</a></li></ul><p>Therefore, a design team could create a great-looking chart which a programmer can modify by applying real data to specific elements.</p><p>However, note that some graphics packages may not create the most optimal code or apply their own XML extensions.</p><h2>SVG Browser Support</h2><p>Although the technology has been available for more than a decade, SVG use within browsers was held back by Internet Explorer which first provided support in IE9. Today, most desktop and mobile browsers can handle SVGs and it is a recognized HTML5 standard.</p><p>Browser implementations vary, but SVGs can either be:</p><ul><li>viewed as a separate file directly in a web browser.</li><li>embedded as an XML section within an HTML page.</li><li>defined as an external page resource within <code>img</code>, <code>object</code> or the old <code>embed</code> tags (or as an <code>iframe</code>, although that&#8217;s effectively viewing the SVG file)</li><li>set as background image in CSS.</li></ul><p>There are a number of plug-in and shim options if you require SVG support in Internet Explorer 8.0 and below. Several fallback to Vector Markup Language (VML); a technology used in Microsoft products which influenced the SVG standard:</p><ul><li><a
href="http://raphaeljs.com/">Rapha&euml;l</a> &#8212; JavaScript/VML</li><li><a
href="http://www.amplesdk.com/">AmpleSDK</a> &#8212; JavaScript/VML</li><li><a
href="http://code.google.com/p/svgweb/">svgweb</a> &#8212; JavaScript/Flash</li><li><a
href="http://xmlgraphics.apache.org/batik/">Batik</a> &#8212; Java toolkit</li></ul><h2>SVG Performance in Browsers</h2><p>SVG XML must be parsed to render images on-screen and represented in memory as a Document Object Model. As with HTML pages, performance will be affected if you attempt to move or manipulate SVGs containing a large number of elements. In extreme cases, the redraw will be noticeable.</p><p>For this reason, it&#8217;s often preferable to use the HTML5 <code>canvas</code> tag for fast action games with hundreds of animated items. However, you may be able to adopt SVGs for some aspects, e.g. a player&#8217;s spaceship could be a simple SVG which can be moved, rotated, scaled and warped over a <code>canvas</code>-generated background.</p><h2>SVGs and Accessibility</h2><p>Owing to their XML data structure, <a
href="http://www.w3.org/TR/SVG-access/">SVGs provide better accessibility</a> than bitmap images. At a basic level, meta data, short text and long text alternatives can be applied to any SVG image.</p><p>That said, screen reader support is poor. SVGs were not considered a viable browser technology until the release of IE9 so vendors did not consider them a priority. The situation will undoubtedly improve.</p><p>In the short term, you could consider transforming SVG XML into a text-based alternative using XSLT.</p><h2>SVGs and Search Engine Optimization</h2><p>Unlike bitmaps, XML is inherently machine-readable so static SVG files can be read, parsed and indexed by search engine bots. Google has been indexing SVG content since August 2010 and results can be found in the standard and image search systems.</p><p>Replacing a few PNGs with SVGs is unlikely to improve your rankings. However, if you&#8217;re displaying data as images without textual fall-backs, switching to SVGs could offer an SEO boost.</p><p>In my next SVG article we&#8217;ll create our first images without the use of a graphics package!</p> <span
id="pty_trigger"></span><div
style='padding:20px 0px 50px 0px;'><div
style='float:left;padding-left:40px;'><div
id='div-gpt-ad-1335489406190-0' style='width:300px; height:100px;'> <script type='text/javascript'>googletag.cmd.push(function() { googletag.display('div-gpt-ad-1335489406190-0'); });</script> </div></div><div
style='float:right;padding-right:40px;'><div
id='div-gpt-ad-1335489406190-1' style='width:300px; height:100px;'> <script type='text/javascript'>googletag.cmd.push(function() { googletag.display('div-gpt-ad-1335489406190-1'); });</script> </div></div><div
style='clear:both'></div></div><div
style='clear:both'></div>]]></content:encoded> <wfw:commentRss>http://www.sitepoint.com/svg-scalable-vector-graphics-overview/feed/</wfw:commentRss> <slash:comments>6</slash:comments> </item> <item><title>My Website&#8217;s Broken: 5 Steps to Determine What&#8217;s Wrong</title><link>http://www.sitepoint.com/5-steps-fix-broken-websites/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=5-steps-fix-broken-websites</link> <comments>http://www.sitepoint.com/5-steps-fix-broken-websites/#comments</comments> <pubDate>Wed, 09 May 2012 15:30:03 +0000</pubDate> <dc:creator>Craig Buckler</dc:creator> <category><![CDATA[Best Practices]]></category> <category><![CDATA[Cloud]]></category> <category><![CDATA[Disaster]]></category> <category><![CDATA[Disaster Recovery]]></category> <category><![CDATA[failover]]></category> <category><![CDATA[Resources]]></category> <category><![CDATA[Web Hosting]]></category> <category><![CDATA[Web Tech]]></category> <category><![CDATA[disaster recovery]]></category> <category><![CDATA[website]]></category> <guid
isPermaLink="false">http://www.sitepoint.com/?p=54311</guid> <description><![CDATA[<img
width="50" height="50" src="http://www.sitepoint.com/wp-content/uploads/1/files/2012/05/013-surviving-failure-50x50.jpg" class="attachment-thumbnail wp-post-image" alt="013-surviving-failure" title="013-surviving-failure" />Your website's down but you're convinced nothing has changed? Craig's 5-step guide could help diagnose those pesky performance problems.]]></description> <content:encoded><![CDATA[<img
width="50" height="50" src="http://www.sitepoint.com/wp-content/uploads/1/files/2012/05/013-surviving-failure-50x50.jpg" class="attachment-thumbnail wp-post-image" alt="013-surviving-failure" title="013-surviving-failure" /><p></p><p>We&#8217;ve all been there. Your wonderful website has been running successfully for months then &#8212; BAM &#8212; it disappears. Or, more often, certain features stop functioning. Despite your protests that nothing has changed, your client isn&#8217;t happy. Prepare yourself for a few frustrating hours of problem probing.</p><h2>Step 1: Identify the Issue</h2><p>This might sound obvious, but I&#8217;ve known many developers open their IDE and start hacking at random code. It&#8217;s more important to determine the issue than the cause at this stage. Is the site unavailable? Is a particular page or function failing? Is it limited to specific browsers?</p><h2>Step 2: Test Resource Availability</h2><p>Nine times out of ten, the problem will be caused by a connectivity issue at your end or the client&#8217;s. If you can&#8217;t access any other pages, it&#8217;s not surprising that your website has disappeared. That said, it&#8217;s not always obvious; certain IP ranges, countries or sections of the internet can become temporarily blocked.</p><p>Test your site from a variety of locations &#8212; a <a
href="http://www.publicproxyservers.com/">public proxy server</a> will help identify whether it&#8217;s a local or global problem. If possible, examine the status of other sites running from the same server or web host.<div
id='div-gpt-ad-1328644474660-10' style='width:728px; height:90px;'> <script type='text/javascript'>googletag.cmd.push(function() { googletag.display('div-gpt-ad-1328644474660-10'); });</script> </div></p><p>One less obvious problem is disk space. If you&#8217;re running a busy site, server logs can rapidly use the available space even when your application&#8217;s storage requirements are low.</p><p>Remember that you might be using resources on other servers. This includes CDN-hosted files, database servers, or remotely-hosted APIs such as those for Google Maps, YouTube, Twitter, advertising services etc.</p><p>You should also check your server loads. A major traffic spike or Denial of Service attack will cause access problems.</p><p>Finally, is your domain registration valid and is the DNS server responding as it should?</p><h2>Step 3: Identify What Changed</h2><p>Once you&#8217;ve rejected connectivity, traffic, DNS and disk space, it&#8217;s time to determine what changed. 999 times out of 1,000 the problem will have been caused by an update.</p><p>You may not have touched the files but are you sure others haven&#8217;t? Check with everyone who has access but don&#8217;t necessarily believe them. Here&#8217;s a typical conversation you&#8217;ll encounter&hellip;</p><p><strong>Client:</strong> My sites not working. What are you going to do about it?<br
/> <strong>You:</strong> I&#8217;ll fix it. Have you made any changes recently?<br
/> <strong>Client:</strong> No. It was like that when I got here.<br
/> <em>&hellip;five hour&#8217;s frantic investigation&hellip;</em><br
/> <strong>You:</strong> You changed X, didn&#8217;t you?<br
/> <strong>Client:</strong> X? Oh yes, I changed X. I did that when I was fiddling with Y and Z.</p><p>Your application may not be directly to blame. Has your web host updated the OS, language runtime, database software or file permissions? While vendors attempt to ensure PHP, Ruby, Python, MySQL, PostgreSQL, etc. remain backward compatible, features will almost certainly change or break between editions.</p><h2>Step 4: Reject the Edge Cases</h2><p>Although rare, you should look for signs of cracking. Software such as <a
href="http://www.sitepoint.com/10-wordpress-security-tips/">WordPress</a>, Joomla and OScommerce are obvious targets, however, changes are often subtle because the cracker wants to retain access. For example, you might discover that a file explorer add-on has been installed or phishing pages have appeared deep within the file structure.</p><p>Finally, you should never rule out hardware problems. Corrupt memory chips or disk sectors could be responsible for any number of bizarre issues. If possible, evaluate your application on a similar set-up or install a separate test version on the same server.</p><h2>Step 5: Fix Your App</h2><p>Once you have eliminated the impossible, whatever remains, however improbable, must be the truth. Perhaps your code isn&#8217;t as perfect as you thought&hellip;</p><p>Do you have any tips for diagnosing website or application problems? What was the most difficult issue you encountered?</p> <span
id="pty_trigger"></span><div
style='padding:20px 0px 50px 0px;'><div
style='float:left;padding-left:40px;'><div
id='div-gpt-ad-1335489406190-0' style='width:300px; height:100px;'> <script type='text/javascript'>googletag.cmd.push(function() { googletag.display('div-gpt-ad-1335489406190-0'); });</script> </div></div><div
style='float:right;padding-right:40px;'><div
id='div-gpt-ad-1335489406190-1' style='width:300px; height:100px;'> <script type='text/javascript'>googletag.cmd.push(function() { googletag.display('div-gpt-ad-1335489406190-1'); });</script> </div></div><div
style='clear:both'></div></div><div
style='clear:both'></div>]]></content:encoded> <wfw:commentRss>http://www.sitepoint.com/5-steps-fix-broken-websites/feed/</wfw:commentRss> <slash:comments>3</slash:comments> </item> <item><title>Are You as Smart as Kevin Yank? Take the PHP &amp; MySQL Quiz and Find Out.</title><link>http://www.sitepoint.com/are-you-as-smart-as-kevin-yank-take-the-php-mysql-quiz-and-find-out/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=are-you-as-smart-as-kevin-yank-take-the-php-mysql-quiz-and-find-out</link> <comments>http://www.sitepoint.com/are-you-as-smart-as-kevin-yank-take-the-php-mysql-quiz-and-find-out/#comments</comments> <pubDate>Wed, 09 May 2012 06:24:16 +0000</pubDate> <dc:creator>Mick Gibson</dc:creator> <category><![CDATA[PHP & MySQL News & Interviews]]></category> <category><![CDATA[PHP & MySQL Tutorials]]></category> <category><![CDATA[Tech]]></category> <category><![CDATA[Tutorials]]></category> <category><![CDATA[Web Developer Quiz]]></category> <category><![CDATA[Web Tech]]></category> <guid
isPermaLink="false">http://www.sitepoint.com/?p=54479</guid> <description><![CDATA[<img
width="50" height="43" src="http://www.sitepoint.com/wp-content/uploads/1/files/2012/04/php-mysql-50x43.png" class="attachment-thumbnail wp-post-image" alt="php-mysql" title="php-mysql" />We all know Kevin Yank is a pretty smart guy. Now&#8217;s your chance to see if you&#8217;re as smart as Kev, by taking the PHP &#38; MySQL Quiz (which accompanies his new book &#8220;PHP &#38; MySQl: Novice to Ninja&#8220;) Jump in now, and take on the elephant in the room :)]]></description> <content:encoded><![CDATA[<img
width="50" height="43" src="http://www.sitepoint.com/wp-content/uploads/1/files/2012/04/php-mysql-50x43.png" class="attachment-thumbnail wp-post-image" alt="php-mysql" title="php-mysql" /><p></p><p><a
href="http://www.sitepoint.com/launch/d724a6" rel="attachment wp-att-53906"><img
class="alignright size-medium wp-image-53906" title="PHP &amp; MySQL: Novice to Ninja" src="http://www.sitepoint.com/wp-content/uploads/1/files/2012/04/phpmysql5-cover-86x115.jpg" alt="PHP &amp; MySQL: Novice to Ninja" width="86" height="115" /></a>We all know <a
href="http://www.sitepoint.com/launch/d724a6">Kevin Yank</a> is a pretty smart guy.</p><p>Now&#8217;s your chance to see if you&#8217;re as smart as Kev, by taking the <strong><a
href="http://www.sitepoint.com/quiz-phpmysql" target="_blank">PHP &amp; MySQL Quiz</a></strong> (which accompanies his new book &#8220;<a
href="http://www.sitepoint.com/launch/d724a6 ">PHP &amp; MySQl: Novice to Ninja</a>&#8220;)</p><p><strong><a
href="http://www.sitepoint.com/quiz-phpmysql" target="_blank">Jump in now</a>,</strong> and take on the elephant in the room :)</p><p
style="text-align: center;"><a
href="http://www.sitepoint.com/quiz-phpmysql"><img
class="aligncenter size-full wp-image-54486" title="Take the PHP &amp; MySQL Quiz" src="http://www.sitepoint.com/wp-content/uploads/1/files/2012/05/php-mysql5-quiz.jpg" alt="Take the PHP &amp; MySQL Quiz" width="500" height="454" /></a></p> <span
id="pty_trigger"></span><div
style='padding:20px 0px 50px 0px;'><div
style='float:left;padding-left:40px;'><div
id='div-gpt-ad-1335489406190-0' style='width:300px; height:100px;'> <script type='text/javascript'>googletag.cmd.push(function() { googletag.display('div-gpt-ad-1335489406190-0'); });</script> </div></div><div
style='float:right;padding-right:40px;'><div
id='div-gpt-ad-1335489406190-1' style='width:300px; height:100px;'> <script type='text/javascript'>googletag.cmd.push(function() { googletag.display('div-gpt-ad-1335489406190-1'); });</script> </div></div><div
style='clear:both'></div></div><div
style='clear:both'></div>]]></content:encoded> <wfw:commentRss>http://www.sitepoint.com/are-you-as-smart-as-kevin-yank-take-the-php-mysql-quiz-and-find-out/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item><div><div
class="post_box two_ads" style="float:left;padding-left:2px;"><div
id='div-gpt-ad-1328645237920-1' style='width:728px; height:90px;'> <script type='text/javascript'>googletag.cmd.push(function() { googletag.display('div-gpt-ad-1328645237920-1'); });</script> </div></div></div><div
class="clear">&nbsp;</div> <item><title>XSS Attacks, Redis DB, REST, and More</title><link>http://www.sitepoint.com/xss-attacks-redis-db-rest-and-more/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=xss-attacks-redis-db-rest-and-more</link> <comments>http://www.sitepoint.com/xss-attacks-redis-db-rest-and-more/#comments</comments> <pubDate>Wed, 09 May 2012 05:25:33 +0000</pubDate> <dc:creator>Timothy Boronczyk</dc:creator> <category><![CDATA[PHP]]></category> <guid
isPermaLink="false">http://www.sitepoint.com/?p=54470</guid> <description><![CDATA[<img
width="50" height="15" src="http://www.sitepoint.com/wp-content/uploads/1/files/2012/03/phpmaster-50x15.png" class="attachment-thumbnail wp-post-image" alt="phpmaster" title="phpmaster" />on PHPMaster, we present tutorials on protecting yourself from cross-site scripting attacks, using Redis with the Predis library, understanding REST, using an Access database with PHP, and working with text and CSV files. Be sure to visit phpmaster.com for more great articles!]]></description> <content:encoded><![CDATA[<img
width="50" height="15" src="http://www.sitepoint.com/wp-content/uploads/1/files/2012/03/phpmaster-50x15.png" class="attachment-thumbnail wp-post-image" alt="phpmaster" title="phpmaster" /><p></p><h2><a
href="http://phpmaster.com/php-security-cross-site-scripting-attacks-xss/">PHP Security: Cross-site Scripting Attacks (XSS)</a></h2><p>Every PHP programmer has the responsibility to understand how attacks can be carried out against their code to exploit possible security vulnerabilities. Learn about cross-site scripting (XSS) attacks and how you can prevent them in your PHP scripts.</p><hr
/><h2><a
href="http://phpmaster.com/an-introduction-to-redis-in-php-using-predis/">An Introduction to Redis in PHP Using Predis</a></h2><p>Redis is an open-source data structure server with an in-memory data set that does much more than simple key/value storage. This article introduces you to some of the basic yet powerful commands that Redis has to offer using the Predis library.</p><hr
/><h2><a
href="http://phpmaster.com/rest-can-you-do-more-than-spell-it-1/">REST: Can you do more than spell it?</a></h2><p>Though you&#8217;ll often see the words &#8220;REST&#8221; and &#8220;architecture&#8221; together, REST is not a specific architecture. This four-part series introduces you to REST, a set of principles that define how a server and client can communicate with each other (and external resources) in a straightforward and robust manner.</p><hr
/><h2><a
href="http://phpmaster.com/using-an-access-database-with-php/">Using an Access database with PHP</a></h2><p>Sometimes a client will already have a database and ask that we make it available on the Web, and sometimes that database is in Access. Never fear, for PHP can easily work with Access databases using an ODBC driver. Learn the essential elements you&#8217;ll need to put an existing Access database online.<div
id='div-gpt-ad-1328644474660-10' style='width:728px; height:90px;'> <script type='text/javascript'>googletag.cmd.push(function() { googletag.display('div-gpt-ad-1328644474660-10'); });</script> </div></p><hr
/><h2><a
href="http://phpmaster.com/working-with-files-in-php/">Working with Files in PHP</a></h2><p>You&#8217;re familiar with databases such as MySQL and Access, but data can also be stored in files. This article gives you an introduction into working with text and CSV files, as well as find out information about the files (such as permissions and the last time it was modified).</p><hr
/> <span
id="pty_trigger"></span><div
style='padding:20px 0px 50px 0px;'><div
style='float:left;padding-left:40px;'><div
id='div-gpt-ad-1335489406190-0' style='width:300px; height:100px;'> <script type='text/javascript'>googletag.cmd.push(function() { googletag.display('div-gpt-ad-1335489406190-0'); });</script> </div></div><div
style='float:right;padding-right:40px;'><div
id='div-gpt-ad-1335489406190-1' style='width:300px; height:100px;'> <script type='text/javascript'>googletag.cmd.push(function() { googletag.display('div-gpt-ad-1335489406190-1'); });</script> </div></div><div
style='clear:both'></div></div><div
style='clear:both'></div>]]></content:encoded> <wfw:commentRss>http://www.sitepoint.com/xss-attacks-redis-db-rest-and-more/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Laconic: a New Way to Generate DOM Content from JavaScript</title><link>http://www.sitepoint.com/laconic-javascript-dom-content-generation/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=laconic-javascript-dom-content-generation</link> <comments>http://www.sitepoint.com/laconic-javascript-dom-content-generation/#comments</comments> <pubDate>Tue, 08 May 2012 15:00:48 +0000</pubDate> <dc:creator>Craig Buckler</dc:creator> <category><![CDATA[JavaScript]]></category> <category><![CDATA[JavaScript & Ajax Tutorials]]></category> <category><![CDATA[JavaScript & CSS]]></category> <category><![CDATA[jQuery]]></category> <category><![CDATA[Opinion]]></category> <category><![CDATA[DOM]]></category> <category><![CDATA[javascript]]></category> <category><![CDATA[jQuery Tutorials & Articles]]></category> <guid
isPermaLink="false">http://www.sitepoint.com/?p=54308</guid> <description><![CDATA[<img
width="50" height="50" src="http://www.sitepoint.com/wp-content/uploads/1/files/2009/01/dom-exception-tree-150x150.jpg" class="attachment-thumbnail wp-post-image" alt="DOM Exception Tree" title="DOM Exception Tree" />Craig looks at Laconic: a small standalone JavaScript library for easy content creation using standard DOM insertion methods.]]></description> <content:encoded><![CDATA[<img
width="50" height="50" src="http://www.sitepoint.com/wp-content/uploads/1/files/2009/01/dom-exception-tree-150x150.jpg" class="attachment-thumbnail wp-post-image" alt="DOM Exception Tree" title="DOM Exception Tree" /><p></p><p>Content can be inserted into your page using innerHTML or outerHTML&hellip;</p><pre><code>
var container = document.getElementById(&quot;container&quot;);
container.innerHTML = &quot;&lt;p&gt;Here's some new &lt;strong&gt;DOM&lt;/strong&gt; content.&lt;/p&gt;&quot;;
</code></pre><p><em>(Note that jQuery also uses innerHTML for DOM content manipulation).</em></p><p>It&#8217;s fast and easy &#8212; but it&#8217;s not without problems:</p><ol><li>Invalid HTML strings can be inserted which make errors difficult to spot and debug.</li><li>You may encounter browser issues if you attempt complex activities such as using or modifying nodes in the resulting DOM content.</li><li>Although it&#8217;s well supported, innerHTML is a proprietary technology and not part of the W3C DOM. It offends the standards gods.</li></ol><p>So let&#8217;s look at the DOM-based alternative:</p><pre><code>
var newpara = document.createElement(&quot;p&quot;);
var newstrong = document.createElement(&quot;strong&quot;);
newstrong.appendChild(document.createTextNode(&quot;DOM&quot;));
newpara.appendChild(document.createTextNode(&quot;Here's some new &quot;));
newpara.appendChild(newstrong);
newpara.appendChild(document.createTextNode(&quot; content.&quot;));
var container = document.getElementById(&quot;container&quot;);
container.appendChild(newpara);
</code></pre><p>Nasty. It&#8217;s three times longer, slower to execute and still prone to human error.<div
id='div-gpt-ad-1328644474660-10' style='width:728px; height:90px;'> <script type='text/javascript'>googletag.cmd.push(function() { googletag.display('div-gpt-ad-1328644474660-10'); });</script> </div></p><p>Several years ago I devised by own solution, <a
href="http://www.optimalworks.net/resources/betterinnerhtml/">BetterInnerHTML</a>, which loaded an HTML string as XML, recursed the structure and inserted appropriate nodes into the DOM. It worked, but I was never totally happy with performance or issues such as HTML entities.</p><p>Fortunately, Joe Stelmach has devised an alternative. It&#8217;s a small standalone utility named <a
href="https://github.com/joestelmach/laconic">Laconic</a> which uses a logical JavaScript notation to map directly to HTML, e.g.</p><pre><code>
$.el.p(
	&quot;Here's some new &quot;,
	$.el.strong(&quot;DOM&quot;),
	&quot; content.&quot;
).appendTo(document.getElementById(&quot;container&quot;));
</code></pre><p>Attributes are supported using object literal notation:</p><pre><code>
// produce &lt;div class=&quot;example&quot;&gt;&lt;div&gt;Content&lt;/div&gt;&lt;/div&gt;
$.el.div(
	{ &quot;class&quot;: &quot;example&quot;},
	$.el.div(&quot;Content&quot;)
);
</code></pre><p>I like it. While innerHTML remains the best option for quick and dirty DOM content generation, Laconic will be useful in those odd situations when it fails to work as expected.</p><p>For more information and downloads, refer to:</p><ul><li><a
href="https://github.com/joestelmach/laconic">Laconic on GitHub</a></li><li><a
href="http://joestelmach.github.com/laconic/">Laconic example page</a></li></ul> <span
id="pty_trigger"></span><div
style='padding:20px 0px 50px 0px;'><div
style='float:left;padding-left:40px;'><div
id='div-gpt-ad-1335489406190-0' style='width:300px; height:100px;'> <script type='text/javascript'>googletag.cmd.push(function() { googletag.display('div-gpt-ad-1335489406190-0'); });</script> </div></div><div
style='float:right;padding-right:40px;'><div
id='div-gpt-ad-1335489406190-1' style='width:300px; height:100px;'> <script type='text/javascript'>googletag.cmd.push(function() { googletag.display('div-gpt-ad-1335489406190-1'); });</script> </div></div><div
style='clear:both'></div></div><div
style='clear:both'></div>]]></content:encoded> <wfw:commentRss>http://www.sitepoint.com/laconic-javascript-dom-content-generation/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>Judgment Day Arrives: Opera Implements the CSS3 Webkit Prefix</title><link>http://www.sitepoint.com/opera-css3-webkit-prefix/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=opera-css3-webkit-prefix</link> <comments>http://www.sitepoint.com/opera-css3-webkit-prefix/#comments</comments> <pubDate>Sat, 05 May 2012 12:05:30 +0000</pubDate> <dc:creator>Craig Buckler</dc:creator> <category><![CDATA[Android]]></category> <category><![CDATA[CSS3]]></category> <category><![CDATA[Discussion]]></category> <category><![CDATA[HTML & CSS]]></category> <category><![CDATA[HTML5]]></category> <category><![CDATA[iOS]]></category> <category><![CDATA[JavaScript]]></category> <category><![CDATA[JavaScript & CSS]]></category> <category><![CDATA[Mobile Web Dev]]></category> <category><![CDATA[Mobile Web Development]]></category> <category><![CDATA[Opinion]]></category> <category><![CDATA[Web Tech]]></category> <category><![CDATA[apple]]></category> <category><![CDATA[HTML5 Dev Center]]></category> <category><![CDATA[HTML5 Tutorials & Articles]]></category> <category><![CDATA[microsoft]]></category> <category><![CDATA[Mozilla]]></category> <category><![CDATA[opera]]></category> <category><![CDATA[webkit]]></category> <guid
isPermaLink="false">http://www.sitepoint.com/?p=54305</guid> <description><![CDATA[<img
width="50" height="50" src="http://www.sitepoint.com/wp-content/uploads/1/files/2012/02/641-css-vendor-prefix-crisis-50x50.jpg" class="attachment-thumbnail wp-post-image" alt="641-css-vendor-prefix-crisis" title="641-css-vendor-prefix-crisis" />Opera is implementing 14 regularly-used webkit-prefixed properties in their browser. Is this the beginning of the end for CSS3 vendor prefixes?]]></description> <content:encoded><![CDATA[<img
width="50" height="50" src="http://www.sitepoint.com/wp-content/uploads/1/files/2012/02/641-css-vendor-prefix-crisis-50x50.jpg" class="attachment-thumbnail wp-post-image" alt="641-css-vendor-prefix-crisis" title="641-css-vendor-prefix-crisis" /><p></p><p>In February 2012, we reported the minutes of W3C meeting where <a
href="http://www.sitepoint.com/w3c-css-webkit-prefix-crisis/">Mozilla, Opera and Microsoft discussed implementing -webkit prefixes</a> in non-webkit browsers. The reason: some developers use only webkit prefixes &#8212; their sites look good in some browsers, but broken in others even when they offer the same level of CSS3 support. The issue is especially prevalent on mobile browsers and many developers fail to look beyond their high-end Apple or Android devices.</p><p><a
href="http://dev.opera.com/articles/view/opera-mobile-emulator-experimental-webkit-prefix-support/">Opera has now announced support for 14 CSS3 webkit properties</a> in their Mobile Emulator. The implementation will eventually reach all editions of their desktop and mobile browsers. If you&#8217;re thinking <em>&#8220;Opera has a tiny market share&#8221;</em>, think again: <a
href="http://www.sitepoint.com/browser-trends-may-2012/">it&#8217;s the world&#8217;s most-used mobile browser</a>.</p><p>Perhaps I&#8217;m being overly dramatic, but Charlton Heston&#8217;s famous line comes to mind: <em>&#8220;They finally, really did it. You manics. You blew it up!&#8221;</em></p><h2>Opera -webkit Aliasing</h2><p>Opera analyzed stylesheets from 10,000 popular websites to determine which CSS values/properties would receive -webkit aliases:<div
id='div-gpt-ad-1328644474660-10' style='width:728px; height:90px;'> <script type='text/javascript'>googletag.cmd.push(function() { googletag.display('div-gpt-ad-1328644474660-10'); });</script> </div></p><table
summary="Opera CSS webkit aliases" width="70%" style="text-align:left !important;margin:20px auto"><tr><th>-o- prefix</th><th>-webkit- alias</th></tr><tr><td>-o-linear-gradient</td><td>-webkit-linear-gradient</td></tr><tr><td>box-shadow</td><td>-webkit-box-shadow</td></tr><tr><td>-o-transform</td><td>-webkit-transform</td></tr><tr><td>-o-transform-origin</td><td>-webkit-transform-origin</td></tr><tr><td>border-radius</td><td>-webkit-border-radius</td></tr><tr><td>border-top-left-radius</td><td>-webkit-border-top-left-radius</td></tr><tr><td>border-top-right-radius</td><td>-webkit-border-top-right-radius</td></tr><tr><td>border-bottom-left-radius</td><td>-webkit-border-bottom-left-radius</td></tr><tr><td>border-bottom-right-radius</td><td>-webkit-border-bottom-right-radius</td></tr><tr><td>-o-transition</td><td>-webkit-transition</td></tr><tr><td>-o-transition-delay</td><td>-webkit-transition-delay</td></tr><tr><td>-o-transition-duration</td><td>-webkit-transition-duration</td></tr><tr><td>-o-transition-property</td><td>-webkit-transition-property</td></tr><tr><td>-o-transition-timing-function</td><td>-webkit-transition-timing-function</td></tr></table><p>If the browser encounters a property such as <code>-webkit-border-radius</code>, it will apply that effect. If you&#8217;ve defined <code>-webkit-border-radius</code>, <code>-o-border-radius</code> and <code>border-radius</code>, normal CSS cascading rules apply and the last defined rule or most appropriate selector will be applied, e.g.</p><pre><code>
#myelement
{
	-o-border-radius: 3px;
	border-radius: 6px;
	-webkit-border-radius: 9px;
}
</code></pre><p>All properties are considered to have equal priority so Opera applies a border radius of 9px.</p><p>With regard to differences in behavior, Opera state:</p><blockquote><p> As far as we can tell, the behavior the properties that we have aliased is identical in WebKit and Opera, or at least close enough that the differences will not matter in practice. If it turns out that there are differences big enough to cause breakage, we will consider our options, one of which is to align the behavior of our -webkit- prefixed variant to what WebKit actually does.</p></blockquote><p>Opera make a reasonable case to justify their decision. While they understand the complaints, their primary goal is to create a browser which works well for users &#8212; who outnumber developers by many thousands to one.</p><h2>The Backlash</h2><p>Most developers understand the problem but disagree with the solution. It&#8217;s crude and has the potential to break the web. Taking the decision to it&#8217;s logical extreme, all vendors would support every prefix but any implementation differences would render the CSS property useless.</p><p>The solution rewards bad development practices. While Opera advises you use all vendor prefixes, they will exacerbate the problem:</p><ul><li>Less conscientious developers will see this as justification for only targeting webkit browsers.</li><li>If your site uses differing -webkit and -o values, it will now be affected by CSS cascade rules. Is it easier to analyze and retest your code or simply remove the Opera properties?</li><li>It will become easier to accidentally omit the -o prefix since sites will work as expected.</li></ul><p>Several problems have already been reported. For example, Modernizr evaluates prefixes in turn until it finds one the browser supports. Therefore:</p><pre><code>
Modernizr.prefixed("transition");
</code></pre><p>now returns <code>WebkitTransition</code> in Opera. Transitions are new to Opera and the browser doesn&#8217;t support every webkit CSS and JavaScript property. If you want to adjust or disable effects in Opera, you can&#8217;t rely on Modernizr-like detection code. You may even need to implement <a
href="http://www.sitepoint.com/why-browser-sniffing-stinks/">nasty browser sniffing</a>.</p><p>However, my biggest issue is this: <em>where are all these problem sites?</em> Has user experience suffered from the lack of rounded corner, gradient, shadow, transition and transform effects? Are those sites genuinely broken or has Opera taken a (marketing) opportunity to make their browser look better?</p><p>Since Opera has analyzed 10,000 websites they can contact the owners directly. At the very least, they could publish a &#8220;hall of shame&#8221; which provides examples and highlights the technical issues. Many developers would happily contact companies on Opera&#8217;s behalf. Some would be prepared to fix sites for free since it could lead to future contracts.</p><p>There are <a
href="http://www.sitepoint.com/css3-vendor-prefix-crisis-solutions/">no easy solutions to the vendor prefix crisis</a>. I understand Opera&#8217;s reasons but, regardless of how this is implemented, it&#8217;s inevitable that something will end up broken.</p><p><strong>Some good news:</strong> Microsoft has announced they will not support webkit prefixes in Internet Explorer (although there&#8217;s nothing to prevent them reversing that decision). Mozilla is yet to reveal their intentions &#8212; they will be watching Opera&#8217;s situation closely.</p> <span
id="pty_trigger"></span><div
style='padding:20px 0px 50px 0px;'><div
style='float:left;padding-left:40px;'><div
id='div-gpt-ad-1335489406190-0' style='width:300px; height:100px;'> <script type='text/javascript'>googletag.cmd.push(function() { googletag.display('div-gpt-ad-1335489406190-0'); });</script> </div></div><div
style='float:right;padding-right:40px;'><div
id='div-gpt-ad-1335489406190-1' style='width:300px; height:100px;'> <script type='text/javascript'>googletag.cmd.push(function() { googletag.display('div-gpt-ad-1335489406190-1'); });</script> </div></div><div
style='clear:both'></div></div><div
style='clear:both'></div>]]></content:encoded> <wfw:commentRss>http://www.sitepoint.com/opera-css3-webkit-prefix/feed/</wfw:commentRss> <slash:comments>29</slash:comments> </item> <item><title>Add a Web Console to Your Toolbox, Part 1</title><link>http://www.sitepoint.com/add-a-web-console-to-your-toolbox-part-1/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=add-a-web-console-to-your-toolbox-part-1</link> <comments>http://www.sitepoint.com/add-a-web-console-to-your-toolbox-part-1/#comments</comments> <pubDate>Thu, 03 May 2012 15:00:43 +0000</pubDate> <dc:creator>Jeff Friesen</dc:creator> <category><![CDATA[HTML5]]></category> <category><![CDATA[JavaScript]]></category> <category><![CDATA[Web Tech]]></category> <guid
isPermaLink="false">http://www.sitepoint.com/?p=54167</guid> <description><![CDATA[<img
width="50" height="28" src="http://www.sitepoint.com/wp-content/uploads/1/files/2012/05/Screen-Shot-2012-05-02-at-4.06.54-PM-50x28.png" class="attachment-thumbnail wp-post-image" alt="Screen Shot 2012-05-02 at 4.06.54 PM" title="Screen Shot 2012-05-02 at 4.06.54 PM" />In this tutorial, Jeff teaches us how to make a completely interactive terminal, compatible with the top five browsers, make sure you do not miss this one.]]></description> <content:encoded><![CDATA[<img
width="50" height="28" src="http://www.sitepoint.com/wp-content/uploads/1/files/2012/05/Screen-Shot-2012-05-02-at-4.06.54-PM-50x28.png" class="attachment-thumbnail wp-post-image" alt="Screen Shot 2012-05-02 at 4.06.54 PM" title="Screen Shot 2012-05-02 at 4.06.54 PM" /><p></p><p>A <em>console</em> is a software artifact for reading line-oriented textual input from the keyboard and writing line-oriented textual output to the screen. Consoles are often used to implement operating system<a
href="http://en.wikipedia.org/wiki/Command-line_interface" target="_blank">command-line interfaces</a>, but are also handy in <a
href="http://en.wikipedia.org/wiki/Adventure_game#Text_adventure" target="_blank">text-based adventure games</a> and other contexts.</p><p>Although text-oriented consoles are not as popular as they once were because of the proliferation of graphical user interfaces, they can be useful to <a
href="http://en.wikipedia.org/wiki/Power_user" target="_blank">power users</a> who are not intimidated by this style of interface. Also, consoles can open up a new class of web application such as the embedded browser <a
href="http://en.wikipedia.org/wiki/Shell_(computing)" target="_blank">shell</a>.</p><p>This article begins a two-part series that presents a JavaScript-based console library for use with web applications that may benefit from this style of user interface. Part 1 introduces you to the library&#8217;s simple API along with a browser shell application that serves as a useful demonstration of this API. Part 2 shows you how the library is implemented so that you can modify it to meet additional requirements.<div
id='div-gpt-ad-1328644474660-10' style='width:728px; height:90px;'> <script type='text/javascript'>googletag.cmd.push(function() { googletag.display('div-gpt-ad-1328644474660-10'); });</script> </div></p><h2>Explore the Console Library</h2><p>The console library consists of a global object named <code>Console</code> with several properties. This arrangement minimizes pollution of the global namespace. Furthermore, it reflects my desire to avoid supporting multiple consoles, as I find it easier to implement a singleton console.<br
/> <code>Console</code> provides the following features:</p><ul></ul><ul><li>easy initialization based on number of desired rows and columns (the <code>&lt;canvas&gt;</code> tag requires only an <code>id</code> attribute)</li></ul><ul></ul><ul><li>canvas placed in tab order and gains keyboard focus immediately for browsers such as Firefox</li></ul><ul></ul><ul><li>clear console capability</li></ul><ul></ul><ul><li>green on black text with monospace font</li></ul><ul></ul><ul><li>visible cursor that marks the current input position</li></ul><ul></ul><ul><li>text echoing capability</li></ul><ul></ul><ul><li>vertically scrollable when text flows past the lower-right character position</li></ul><ul></ul><ul><li>simplified editing in terms of the backspace key</li></ul><ul></ul><ul><li>automatically call a function when no input is available</li></ul><ul></ul><ul><li>supports FireFox, Internet Explorer, Chrome, Opera, and Safari</li></ul><p>Although <code>Console</code> encapsulates multiple accessible properties, I consider only four of them to be members of the &#8220;public&#8221; API. The other properties should not be accessed; they exist to support the following four properties and could change in a subsequent version of the library:</p><ul></ul><ul><li><code>init(canvasName, numCols, numRows)</code> initializes the console. The string passed to <code>canvasName</code> must match the value of an existing <code>&lt;canvas&gt;</code> element&#8217;s <code>id</code> attribute. The integer passed to<code>numCols</code> identifies the desired number of columns (e.g., 80), and the integer passed to <code>numRows</code> identifies the desired number of rows (e.g., 25). The console is cleared and the cursor position is set (0, 0). The resulting console displays green text on a black background. This function does not return a value.</li></ul><ul></ul><ul><li><code>clear()</code> clears the console and sets the cursor position to (0, 0). This function does not return a value.</li></ul><ul></ul><ul><li><code>getLine(callback)</code> returns a line of input and echoes this input to the console. It first checks if a line has been entered by noting whether a newline character (indicated by the user having pressed the key labeled Enter or Return) is present in the input. If so, the line is returned without the newline character. If a newline is not present, or if there is no input, this function returns null. When a function is passed to <code>callback</code>, that function is called when nothing has been entered.</li></ul><ul></ul><ul><li><code>echo(msg)</code> echoes the string passed to <code>msg</code> to the console starting at the cursor position, which is updated. The console scrolls vertically when the message flows past the lower-right corner. This function recognizes <code>\b</code> (backspace) and <code>\n</code> (newline) special characters. Also, it does not return a value.</li></ul><p>The <code>getLine(callback)</code> function does not block the current thread while waiting for the user to press Enter/Return. Instead, it returns immediately. It does so because JavaScript code runs on a single thread. (HTML5&#8242;s web workers are an exception, and are beyond the scope of this article.) Blocking this thread for longer than what the browser considers acceptable causes the browser to display a dialog box that reports an unresponsive script.</p><p>The console library is easy to use. After defining a <code>&lt;canvas&gt;</code> element, and after initializing and echoing any preliminary text to the console, repeatedly execute a function via JavaScript&#8217;s<code>setInterval()</code> function. Each execution should invoke <code>getLine(callback)</code> (with an optional callback function) and then take appropriate action based on <code>getLine()</code>&#8216;s return value. Listing 1 presents the HTML for a simple demonstration of this library.</p><pre>&lt;html&gt;
   &lt;head&gt;
      &lt;title&gt;
         Console Demo
      &lt;/title&gt;
      &lt;meta http-equiv="X-UA-Compatible" content="IE=Edge"/&gt;
      &lt;script src="../Console/Console.js"&gt;
      &lt;/script&gt;
   &lt;/head&gt;
   &lt;body style="text-align: center"&gt;
      &lt;p&gt;
      &lt;h2&gt;
        Console Demo
      &lt;/h2&gt;
      &lt;canvas id="mycanvas"&gt;
      HTML5 canvas element not supported by this browser.
      &lt;/canvas&gt;
      &lt;p&gt;
      You might have to press the Tab key or click the canvas to give it keyboard focus.
      &lt;/p&gt;
      &lt;script&gt;
         Console.init("mycanvas", 64, 16);
         Console.echo("&gt;");
         function tick()
         {
            var line = Console.getLine();
            if (line != null)
            {
               if (line != "")
                  Console.echo(line+"\n");
               Console.echo("&gt;");
            }
         }
         setInterval("tick()", 50); // Invoke tick() every 50 milliseconds.
      &lt;/script&gt;
   &lt;/body&gt;
&lt;/html&gt;</pre><p><strong>Listing 1:</strong> Echoing entered text on the console</p><p>Listing 1 describes <code>ConsoleDemo.html</code>. This listing is fairly straightfoward, except perhaps for the <code>&lt;meta&gt;</code> element. This element enforces a <a
href="http://blogs.msdn.com/b/askie/archive/2009/03/23/understanding-compatibility-modes-in-internet-explorer-8.aspx" target="_blank">compatibility mode</a> &#8211; use latest standards rendering mode &#8212; so that the console will work under Internet Explorer 9 (and probably higher versions of this browser). Otherwise, Explorer outputs an error message about the Canvas API&#8217;s <code>getContext()</code> function not being defined.</p><p>Listing 1 continues with a <code>&lt;script&gt;</code> element that includes the contents of a JavaScript source file named <code>Console.js</code>. This file defines the console library and is located in a <code>Console</code> directory that&#8217;s accessed relative to <code>ConsoleDemo.html</code>. The code file that&#8217;s attached to this article contains <code>ConsoleDemo.html</code> and <code>Console.js</code> in appropriate directories relative to each other, so you should be able to run <code>ConsoleDemo</code> without problems.</p><p>The body of this HTML file specifies a <code>&lt;canvas&gt;</code> element whose <code>id</code> attribute is assigned <code>mycanvas</code>. No other attribute is required because the console library takes care of them. The body also contains a <code>&lt;script&gt;</code> element that presents the console demonstration code.</p><p>The code first initializes the canvas to a 64-column-by-16-row drawing area &#8212; I chose these values because they were the dimensions of the text screen on my old TRS-80 Model III microcomputer. The code then echoes a <code>&gt;</code> character to the console as the initial input line&#8217;s prompt.</p><p>At this point, a function named <code>tick()</code> is defined for repeated execution. This function will be executed every 50 milliseconds courtesy of the <code>setInterval("tick()", 50)</code> function call. Each invocation attempts to retrieve and echo back to the console a line of input.</p><p><code>tick()</code> first invokes <code>getLine()</code> without passing a callback function because none is needed in this example. If this function returns null because nothing has been entered or the user is typing some input (and has not yet pressed Enter/Return), nothing further happens. Otherwise, if the returned line is not equal to the empty string (only Enter/Return was pressed), the entered text followed by a newline is echoed to the console. At this point, a <code>&gt;</code> prompt is echoed to inform the user that another line of input is expected.</p><p>Figure 1 shows you the resulting console in the context of Firefox.</p><p><img
src="http://www.sitepoint.com/wp-content/uploads/1/files/2012/05/figure1.jpg"/></p><p><strong>Figure 1:</strong> You don&#8217;t have to press Tab to start using the console on Firefox.</p><h2>Encounter a Browser Shell</h2><p>A <a
href="http://en.wikipedia.org/wiki/Shell_(computing)" target="_blank"><em>shell</em></a> provides an operating system&#8217;s user interface, and its primary purpose is to run programs. Modern operating systems feature graphical shells, but many also feature traditional command-line-oriented shells (e.g, Unix&#8217;s Korn and Bourne shells). A similar shell can be embedded within a web page via the console library, and this <em>browser shell</em> can be used to execute browser-oriented commands.I&#8217;ve created a browser shell application as a useful demonstration of the console library. Figure 2 reveals this application&#8217;s console in the context of the Internet Explorer 9 browser.</p><p><a
href="http://www.sitepoint.com/wp-content/uploads/1/files/2012/05/figure2.jpg"><img
src="http://www.sitepoint.com/wp-content/uploads/1/files/2012/05/figure2.jpg" alt="" title="figure2" width="848" height="680" class="alignleft size-full wp-image-54250" /></a></p><p><strong>Figure 2:</strong> The browser shell currently supports four commands.</p><p>Figure 2 reveals an interesting anomaly: geolocation information is not immediately displayed. Instead, latitude and longitude data is often presented multiple lines later in the browser. You will learn the reason while exploring Listing 2.</p><pre>&lt;html&gt;
   &lt;head&gt;
      &lt;title&gt;
         Browser Shell
      &lt;/title&gt;
      &lt;meta http-equiv="X-UA-Compatible" content="IE=Edge"/&gt;
      &lt;script src="../Console/Console.js"&gt;
      &lt;/script&gt;
   &lt;/head&gt;
   &lt;body style="text-align: center"&gt;
      &lt;p&gt;
      &lt;h2&gt;
        Browser Shell
      &lt;/h2&gt;
      &lt;canvas id="mycanvas"&gt;
      HTML5 canvas element not supported by this browser.
      &lt;/canvas&gt;
      &lt;p&gt;
      You might have to press the Tab key or click the canvas to give it keyboard focus.
      &lt;/p&gt;
      &lt;script&gt;
         Console.init("mycanvas", 64, 22);
         Console.echo("Browser Shell 1.0\n\n");
         Console.echo("Type 'help' (without the quotes) to obtain help\n\n");
         Console.echo("&gt;");
         var geo = "";
         function callback()
         {
            if (geo == "")
               return;
            Console.echo(geo+"\n");
            Console.echo("&gt;");
            geo = "";
         }
         function tick()
         {
            var line = Console.getLine(callback);
            if (line != null)
            {
               line = line.trim();
               if (line == "browser")
                  Console.echo(navigator.<wbr>userAgent+"\n\n"); else if (line == "cls") Console.clear(); else if (line == "geo") { Console.echo("querying location info...may take a few moments\n\n"); function report_error(error) { geo = error.message; if (geo == "") // geo is "" on Safari geo = "unknown error"; } function report_geolocation_query(</wbr><wbr>position) { geo = "Lat: "+position.coords.latitude+", Lon: "+position.coords.latitude; } navigator.geolocation.</wbr><wbr>getCurrentPosition(report_</wbr><wbr>geolocation_query, report_error); } else if (line == "help") { Console.echo("Available commands...\n"); Console.echo("browser -- display current browser info\n"); Console.echo("cls -- clear screen\n"); Console.echo("geo -- obtain geolocation information\n"); Console.echo("help -- display this help text\n\n"); } else if (line != "") Console.echo("bad command\n"); Console.echo("&gt;"); } } setInterval("tick()", 50); // Invoke tick() every 50 milliseconds. &lt;/script&gt; &lt;/body&gt; &lt;/html&gt;</wbr></pre><p><strong>Listing 2:</strong> Interpreting and executing commands</p><p>Listing 2 presents <code>BrowserShell.html</code>. This listing has a similar layout to Listing 1 and should be fairly easy to follow. After initializing and echoing preliminary text to the console, the <code>tick()</code>function is repeatedly executed to get the next line of input, trim whitespace from both ends, check for one of four possible commands, and execute the command. If an invalid command is entered, <code>bad command</code> is echoed to the console. Regardless, the user is then prompted to enter the next command.</p><p>The <code>geo</code> command is the most complex to implement. It obtains geolocation information about the user via the <a
href="http://www.w3.org/TR/geolocation-API/" target="_blank">Geolocation API</a>, which is asynchronous to avoid blocking the JavaScript thread.<code>navigator.geolocation.<wbr>getCurrentPosition(report_</wbr><wbr>geolocation_query, report_error)</wbr></code> queries the user to grant permission to obtain geolocation information, proceeds to get that information when the user accepts, and then invokes one of two callback functions:</p><ul></ul><ul><li><code>report_geolocation_query(<wbr>position)</wbr></code> is invoked (upon success) with a <code>Position</code> argument that stores the geolocation data via its <code>coords</code> member, of Document Object Model type<code>Coordinates</code>. This DOM interface includes <code>latitude</code> and <code>longitude</code> fields of DOM type <code>double</code>.</li></ul><ul></ul><ul><li><code>report_error(error)</code> is invoked (upon failure) with a <code>PositionError</code> argument that stores the reason for failure via its <code>message</code> member, of DOM type <code>DOMString</code>, and its <code>code</code> member, of DOM type <code>unsigned short</code>.</li></ul><p>Each of these callbacks extracts information from its passed argument and builds a string that it assigns to the <code>geo</code> variable. During testing on Safari, I discovered that this browser wouldn&#8217;t let me obtain geolocation information. Furthermore, it assigned the empty string to <code>message</code>. To address this situation, I coded <code>report_error(error)</code> to assign <code>"unknown error"</code> to <code>message</code>. (I could have output a message based on <code>error.code</code> whose value was 2 &#8212; the position is unavailable. I leave making this change with you as an exercise.)</p><p>Listing 2 declares a <code>callback()</code> function that it passes as an argument to <code>getLine(callback)</code>. This function is invoked each time <code>getLine(callback)</code> detects that there is no input. After verifying that something has been assigned to <code>geo</code>, <code>callback()</code> echoes this variable&#8217;s value followed by a <code>&gt;</code> prompt to the console, and then assigns the empty string to this variable (to avoid having <code>geo</code>&#8216;s value repeatedly output).</p><p>Why don&#8217;t I echo <code>geo</code>&#8216;s value within <code>report_geolocation_query(<wbr>position)</wbr></code> and <code>report_error(error)</code> (and then I wouldn&#8217;t need <code>geo</code> but could use a local variable) instead of going to the trouble of passing a callback function to <code>getLine(callback)</code>? If I did so, that navigation data could be output in the midst of entering a command, resulting in a mess. For example, while entering <code>help</code> I might end up with the following intermixed output:</p><pre>&gt;helLat: 49.88, Lon: 49.88
&gt;p</pre><h2>Conclusion</h2><p>Console is a useful tool for embedding a simple console into web pages. The previous browser shell application gives you an idea of what&#8217;s possible. You might want to extend this application with additional commands, such as a <code>dir</code> command for obtaining a directory listing of <a
href="http://www.w3.org/TR/webstorage/" target="_blank">web storage</a>. However, you first need to understand how this library works, and that is the subject of Part 2.</p><table
width="60%" border="1" align="center"><tbody><tr><th
bgcolor="#0000c0"><span
style="color: #ffffff;">Note</span></th></tr><tr><td>All files pertaining to this article are located in <a
href="http://www.sitepoint.com/wp-content/uploads/1/files/2012/05/code.zip" target="_blank">code.zip</a>.</td></tr></tbody></table> <span
id="pty_trigger"></span><div
style='padding:20px 0px 50px 0px;'><div
style='float:left;padding-left:40px;'><div
id='div-gpt-ad-1335489406190-0' style='width:300px; height:100px;'> <script type='text/javascript'>googletag.cmd.push(function() { googletag.display('div-gpt-ad-1335489406190-0'); });</script> </div></div><div
style='float:right;padding-right:40px;'><div
id='div-gpt-ad-1335489406190-1' style='width:300px; height:100px;'> <script type='text/javascript'>googletag.cmd.push(function() { googletag.display('div-gpt-ad-1335489406190-1'); });</script> </div></div><div
style='clear:both'></div></div><div
style='clear:both'></div>]]></content:encoded> <wfw:commentRss>http://www.sitepoint.com/add-a-web-console-to-your-toolbox-part-1/feed/</wfw:commentRss> <slash:comments>8</slash:comments> </item> <item><title>Watch Kevin Yank Introduce his NEW book &#8220;PHP &amp; MYSQL: Novice to Ninja&#8221;</title><link>http://www.sitepoint.com/watch-kevin-yank-introduce-his-new-book-php-mysql-novice-to-ninja/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=watch-kevin-yank-introduce-his-new-book-php-mysql-novice-to-ninja</link> <comments>http://www.sitepoint.com/watch-kevin-yank-introduce-his-new-book-php-mysql-novice-to-ninja/#comments</comments> <pubDate>Thu, 03 May 2012 05:42:39 +0000</pubDate> <dc:creator>Mick Gibson</dc:creator> <category><![CDATA[Open Source]]></category> <category><![CDATA[PHP]]></category> <category><![CDATA[PHP & MySQL News & Interviews]]></category> <category><![CDATA[PHP & MySQL Reviews and Apps]]></category> <category><![CDATA[PHP & MySQL Tutorials]]></category> <category><![CDATA[Server Side Coding]]></category> <category><![CDATA[Server Side Essentials]]></category> <guid
isPermaLink="false">http://www.sitepoint.com/?p=54224</guid> <description><![CDATA[<img
width="50" height="30" src="http://www.sitepoint.com/wp-content/uploads/1/files/2012/05/Screen-shot-2012-05-03-at-3.37.51-PM-50x30.png" class="attachment-thumbnail wp-post-image" alt="Screen shot 2012-05-03 at 3.37.51 PM" title="Screen shot 2012-05-03 at 3.37.51 PM" />&#8221; &#8230; Just as PHP and MySQL have grown from the young upstarts of the web development world into mature, stable platforms for billion-dollar businesses, this book that I’ve been writing again and again for over a decade has grown up &#8230; It’s time to write PHP like the big kids do…&#8221;  This is how Kevin Yank [...]]]></description> <content:encoded><![CDATA[<img
width="50" height="30" src="http://www.sitepoint.com/wp-content/uploads/1/files/2012/05/Screen-shot-2012-05-03-at-3.37.51-PM-50x30.png" class="attachment-thumbnail wp-post-image" alt="Screen shot 2012-05-03 at 3.37.51 PM" title="Screen shot 2012-05-03 at 3.37.51 PM" /><p></p><p><em>&#8221; &#8230; Just as PHP and MySQL have grown from the young upstarts of the web development world into mature, stable platforms for billion-dollar businesses, this book that I’ve been writing again and again for over a decade has grown up &#8230; It’s time to write PHP like the big kids do…&#8221; </em></p><p>This is how Kevin Yank describes the 5th edition of his just-released book &#8220;<a
href="http://www.sitepoint.com/launch/d724a6">PHP &amp; MYSQL: Novice to Ninja</a>&#8220;</p><p>Watch Kevin as he introduces you to his NEW book!</p><p><iframe
src="http://player.vimeo.com/video/41422400?byline=0&amp;portrait=0" frameborder="0" width="600" height="338"></iframe></p><p><strong>As part of the launch of Kevin&#8217;s book, it&#8217;s now on special with &#8211; <a
href="http://www.sitepoint.com/launch/d724a6 ">SAVINGS of up to 50%</a></strong></p><p>&nbsp;</p><p>&nbsp;</p> <span
id="pty_trigger"></span><div
style='padding:20px 0px 50px 0px;'><div
style='float:left;padding-left:40px;'><div
id='div-gpt-ad-1335489406190-0' style='width:300px; height:100px;'> <script type='text/javascript'>googletag.cmd.push(function() { googletag.display('div-gpt-ad-1335489406190-0'); });</script> </div></div><div
style='float:right;padding-right:40px;'><div
id='div-gpt-ad-1335489406190-1' style='width:300px; height:100px;'> <script type='text/javascript'>googletag.cmd.push(function() { googletag.display('div-gpt-ad-1335489406190-1'); });</script> </div></div><div
style='clear:both'></div></div><div
style='clear:both'></div>]]></content:encoded> <wfw:commentRss>http://www.sitepoint.com/watch-kevin-yank-introduce-his-new-book-php-mysql-novice-to-ninja/feed/</wfw:commentRss> <slash:comments>8</slash:comments> </item> <item><title>Does Google Drive Better than its Competitors?</title><link>http://www.sitepoint.com/google-drive-review/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=google-drive-review</link> <comments>http://www.sitepoint.com/google-drive-review/#comments</comments> <pubDate>Wed, 02 May 2012 15:21:20 +0000</pubDate> <dc:creator>Craig Buckler</dc:creator> <category><![CDATA[Android]]></category> <category><![CDATA[Cloud]]></category> <category><![CDATA[Disaster Recovery]]></category> <category><![CDATA[iOS]]></category> <category><![CDATA[News & Trends]]></category> <category><![CDATA[Reviews]]></category> <category><![CDATA[Technology]]></category> <category><![CDATA[drive]]></category> <category><![CDATA[Dropbox]]></category> <category><![CDATA[file]]></category> <category><![CDATA[Google Tutorials & Articles]]></category> <category><![CDATA[synchronization]]></category> <guid
isPermaLink="false">http://www.sitepoint.com/?p=54150</guid> <description><![CDATA[<img
width="50" height="50" src="http://www.sitepoint.com/wp-content/uploads/1/files/2012/05/668-google-drive-50x50.jpg" class="attachment-thumbnail wp-post-image" alt="668-google-drive" title="668-google-drive" />Craig reviews Google Drive - a new service which takes aim at Dropbox, SkyDrive, iCloud and similar file synchronization applications.]]></description> <content:encoded><![CDATA[<img
width="50" height="50" src="http://www.sitepoint.com/wp-content/uploads/1/files/2012/05/668-google-drive-50x50.jpg" class="attachment-thumbnail wp-post-image" alt="668-google-drive" title="668-google-drive" /><p></p><p>Rumors of a Google cloud-based file storage service have been circulating since 2006 but Google Drive was finally released on April 24, 2012. That&#8217;s an unusually long gestation period for a company that normally releases first then tweaks (or abandons) later.</p><p>Google Drive is a direct competitor to established players such as <a
href="http://www.dropbox.com">Dropbox</a>, <a
href="http://www.sugarsync.com/">SugarSync</a>, <a
href="http://www.box.com/">Box</a>, <a
href="https://www.cubby.com/">Cubby</a>, <a
href="http://www.skydrive.com/">Microsoft SkyDrive</a> and <a
href="http://www.icloud.com/">Apple iCloud</a>. But is it better?</p><h2>Google Drive Features</h2><p><img
src="http://blogs.sitepointstatic.com/images/tech/668-google-drive-online.jpg" width="360" height="199" alt="Google Drive" class="right" /></p><p>It&#8217;s important to realize that Google Drive is a replacement for Google Docs (GDocs). Once you sign-up with your Google account, the <a
href="http://docs.google.com/">docs.google.com</a> URL will redirect to <a
href="http://docs.google.com/">drive.google.com</a>. The web interface is fundamentally the same and you can add, create, edit and delete files and folders as before.</p><p>Replacing GDocs is a clever idea. The projects are compatible and your cloud-based documents can be browsed from your desktop &#8212; an attractive feature for those migrating from Microsoft Office. It&#8217;s also apparent Google has learned lessons from <a
href="http://www.sitepoint.com/google-scraps-wave/">doomed projects such as Wave</a>; it&#8217;s easier to piggy-back on the success of an existing project than build a new user base from scratch. GDoc&#8217;s 40 million users have little reason not to adopt Google Drive.<div
id='div-gpt-ad-1328644474660-10' style='width:728px; height:90px;'> <script type='text/javascript'>googletag.cmd.push(function() { googletag.display('div-gpt-ad-1328644474660-10'); });</script> </div></p><p>To make the most of Google Drive, you need to install the desktop application on your PCs, tablets and smart phones. Native applications are currently available for Windows, Mac, Android and iOS but you can be certain that other platforms including Linux and Blackberry will appear shortly.</p><p>The desktop application creates a folder on your device. Its files and sub-folders are automatically synchronized to the web and your other devices. Google offer a generous 5GB of free space with competitive plans including 100GB for $60 per year.</p><p><img
src="http://blogs.sitepointstatic.com/images/tech/668-google-drive-desktop.png" width="522" height="379" alt="Google Drive" class="center" /></p><h2>How Does it Compare?</h2><p>Following sign-up, you&#8217;ll need to wait for around 24 hours before your existing Docs account is converted. I suspect Google will convert all accounts at some point in the future.</p><p>The desktop application is simple to install &#8212; assuming it doesn&#8217;t throw fatal errors. Many Windows users have reported similar experiences to me although installing <em>Microsoft&#8217;s Visual C++ 2008 SP1 Redistributable</em> rectified my issues. Once installed, there&#8217;s a little configuration to set the Google Drive folder and the application will run in the background so you can forget about it. On my system, it required a little over 30MB memory to execute &#8212; not horrendous, but Dropbox uses less than half that.</p><p>If you&#8217;ve used similar services you&#8217;ll understand how Google Drive works. The main difference is that you&#8217;ll find Google Docs files in your synchronized folder. Resources such as PDFs are downloaded as-is so you can open them directly.</p><p>Native Google documents are simply URL links which open the file in a browser. While that&#8217;s practical, it means you can&#8217;t open files offline and you don&#8217;t have a real backup in the event of connectivity or service problems. I&#8217;m not convinced it&#8217;s a major drawback but an option for automatic conversion to desktop formats such as TXT, RTF, DOC, ODT, XLS and PDF would be a bonus.</p><p>Finally, there&#8217;s the issue of trust. From an ownership perspective, the terms and conditions are clear:</p><blockquote><p>You retain ownership of any intellectual property rights that you hold in that content. In short, what belongs to you stays yours.</p></blockquote><p>Privacy is another matter&hellip;</p><blockquote><p>When you upload or otherwise submit content to our Services, you give Google (and those we work with) a worldwide license to use, host, store, reproduce, modify, create derivative works (such as those resulting from translations, adaptations or other changes we make so that your content works better with our Services), communicate, publish, publicly perform, publicly display and distribute such content. The rights you grant in this license are for the limited purpose of operating, promoting, and improving our Services, and to develop new ones. This license continues even if you stop using our Services.</p></blockquote><p>Could Google take a sneaky peek at your files to provide context-sensitive advertising? Put it this way, I suggest caution if you&#8217;re planning to upload documents containing personal information. But the same can be said for every online service since the dawn of the web.</p><h2>Google Docs Summary</h2><p>In essence, there&#8217;s little to distinguish Google Drive from its competitors. Google has copied the best features from Dropbox and, while that&#8217;s no bad thing, it doesn&#8217;t offer a compelling reason to switch. <em>Yet</em>.</p><p>More competition is great for users, though. Google may drive down storage prices and you can install different services concurrently to obtain many gigabytes of free backup space.</p><p><strong>Pros:</strong></p><ul><li>The service works.</li><li>Generous 5GB of free space and inexpensive storage plans.</li><li>Automatic Google Docs synchronization.</li><li>Google will evolve the product rapidly.</li></ul><p><strong>Cons:</strong></p><ul><li>Currently limited to Windows, Mac, iOS and Android platforms.</li><li>Some rough edges; application installation problems and less-efficient memory use.</li><li>Google document synchronization is a little kludgey.</li><li>Fewer features, no API and less capable than competing products.</li><li>Potential trust issues.</li></ul><p>Have you installed Google Drive? Do you prefer it to competing services? Should Dropbox be concerned? Do you trust Google keep their eyes off your data?</p> <span
id="pty_trigger"></span><div
style='padding:20px 0px 50px 0px;'><div
style='float:left;padding-left:40px;'><div
id='div-gpt-ad-1335489406190-0' style='width:300px; height:100px;'> <script type='text/javascript'>googletag.cmd.push(function() { googletag.display('div-gpt-ad-1335489406190-0'); });</script> </div></div><div
style='float:right;padding-right:40px;'><div
id='div-gpt-ad-1335489406190-1' style='width:300px; height:100px;'> <script type='text/javascript'>googletag.cmd.push(function() { googletag.display('div-gpt-ad-1335489406190-1'); });</script> </div></div><div
style='clear:both'></div></div><div
style='clear:both'></div>]]></content:encoded> <wfw:commentRss>http://www.sitepoint.com/google-drive-review/feed/</wfw:commentRss> <slash:comments>23</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using memcached
Database Caching 46/135 queries in 0.817 seconds using memcached
Object Caching 3196/3380 objects using memcached

Served from: www.sitepoint.com @ 2012-05-20 23:07:38 -->
