<?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>DreamSite WebDreamSite Web | Portfolio online and web space of Andres Pi</title>
	<atom:link href="http://dreamsiteweb.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://dreamsiteweb.com</link>
	<description>Portfolio online and web space of Andres Pi</description>
	<lastBuildDate>Tue, 17 Apr 2012 13:19:09 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>dreamyTip 2.0!</title>
		<link>http://dreamsiteweb.com/dreamytip-2-0/</link>
		<comments>http://dreamsiteweb.com/dreamytip-2-0/#comments</comments>
		<pubDate>Fri, 02 Mar 2012 11:38:21 +0000</pubDate>
		<dc:creator>andres!</dc:creator>
				<category><![CDATA[labs]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[dreamyTip]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Plugin]]></category>

		<guid isPermaLink="false">http://labs.dreamsiteweb.com/?p=218</guid>
		<description><![CDATA[After a while, I released a new version of this simple and lovely tooltip. With the new version of this jQuery plugin you will have a great tooltip with a couple of options like position(top,bottom, left, right), events(click and hover), speed, effect and callbacks very easy. You can check out the demo of the dreamyTip ... <a href="http://dreamsiteweb.com/dreamytip-2-0/"><strong>Read more</strong></a>]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-376" title="dreamyTip" src="http://dreamsiteweb.com/wp-content/uploads/2012/03/dreamyTip.png" alt="dreamyTip - simple and lovely tooltip" width="236" height="130" />After a while, I released a new version of this simple and lovely tooltip. With the new version of this jQuery plugin you will have a great tooltip with a couple of options like position(top,bottom, left, right), events(click and hover), speed, effect and callbacks very easy.<br />
You can check out the demo of the <a href="http://labs.dreamsiteweb.com/jquery/plugins/dreamytip/" target="_blank">dreamyTip here</a> and download the <a href="http://labs.dreamsiteweb.com/jquery/plugins/dreamytip/dreamyTip.zip" target="_blank">demo</a> here or take a look at <a href="https://github.com/andres314/dreamyTip" target="_blank">GitHub</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://dreamsiteweb.com/dreamytip-2-0/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>CSS3 Generator</title>
		<link>http://dreamsiteweb.com/css3-generator/</link>
		<comments>http://dreamsiteweb.com/css3-generator/#comments</comments>
		<pubDate>Sat, 25 Feb 2012 12:53:30 +0000</pubDate>
		<dc:creator>andres!</dc:creator>
				<category><![CDATA[labs]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[border-radius]]></category>
		<category><![CDATA[CSS3]]></category>
		<category><![CDATA[webapp]]></category>

		<guid isPermaLink="false">http://labs.dreamsiteweb.com/?p=214</guid>
		<description><![CDATA[Last week I started working in personal project just to help me to learn some of the new CSS3 features. The idea is to create a Web App for testing and learning this new features.  And there is a lot of great new features, but undoubtedly one of my favorite is the &#8220;border radius&#8220;. After so ... <a href="http://dreamsiteweb.com/css3-generator/"><strong>Read more</strong></a>]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-379" title="CSS3 Generator" src="http://dreamsiteweb.com/wp-content/uploads/2012/02/css3.jpg" alt="CSS3 Generator" width="250" height="188" />Last week I started working in personal project just to help me to learn some of the new <strong>CSS3</strong> features<strong></strong>. The idea is to create a Web App for testing and learning this new features.  And there is a lot of great new features, but undoubtedly one of my favorite is the &#8220;<a href="http://www.w3.org/TR/css3-background/#the-border-radius" target="_blank"><strong>border radius</strong></a>&#8220;. After so many years of using different techniques and tricks, we finally have the solution for the rounded corners!!! That is way I choose this feature to start working in this first step of the Web App, but the idea is upgrade it from time to time with the others new  features. In this link you will find the <a href="http://labs.dreamsiteweb.com/css3/" target="_blank">CSS3 generator Web App</a>, I hope you can find it helpful.</p>
]]></content:encoded>
			<wfw:commentRss>http://dreamsiteweb.com/css3-generator/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Ibope Media Argentina</title>
		<link>http://dreamsiteweb.com/ibope-media-argentina/</link>
		<comments>http://dreamsiteweb.com/ibope-media-argentina/#comments</comments>
		<pubDate>Thu, 23 Feb 2012 22:58:04 +0000</pubDate>
		<dc:creator>andres!</dc:creator>
				<category><![CDATA[Portfolio]]></category>
		<category><![CDATA[Ajax]]></category>
		<category><![CDATA[CMS]]></category>
		<category><![CDATA[CSS3]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://dreamsiteweb.com/?p=340</guid>
		<description><![CDATA[This the website of the leading company television ratings of Argentina. Is a WordPress development based in a custom design, which I led the process taking care of the client needs. It is developed in HTML5 and some flash for the chart. The backend has some changes for a better friendly user experience using custom ... <a href="http://dreamsiteweb.com/ibope-media-argentina/"><strong>Read more</strong></a>]]></description>
			<content:encoded><![CDATA[<p>This the website of the leading company television ratings of Argentina. Is a WordPress development based in a custom design, which I led the process taking care of the client needs. It is developed in HTML5 and some flash for the chart. The backend has some changes for a better friendly user experience using custom fields. It has a basic mobile version and the next step is a full mobile version. </p>
]]></content:encoded>
			<wfw:commentRss>http://dreamsiteweb.com/ibope-media-argentina/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>5 nice JavaSctipt resources</title>
		<link>http://dreamsiteweb.com/5-nice-javasctipt-resources/</link>
		<comments>http://dreamsiteweb.com/5-nice-javasctipt-resources/#comments</comments>
		<pubDate>Mon, 21 Nov 2011 19:04:41 +0000</pubDate>
		<dc:creator>andres!</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[Resources]]></category>
		<category><![CDATA[editor]]></category>
		<category><![CDATA[Framework]]></category>
		<category><![CDATA[Guide]]></category>
		<category><![CDATA[Haskell]]></category>
		<category><![CDATA[ide]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[online]]></category>

		<guid isPermaLink="false">http://labs.dreamsiteweb.com/?p=199</guid>
		<description><![CDATA[This time I&#8217;m sharing some resources that I found helpful while I developed in this great language. As we can read in the website of Mozilla: &#8220;JavaScript (sometimes shortened to JS) is a lightweight, object-oriented language, most known as the scripting language for web pages, but used in many non-browser environments as well&#8221;. Here are ... <a href="http://dreamsiteweb.com/5-nice-javasctipt-resources/"><strong>Read more</strong></a>]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-medium wp-image-385" title="5 NICE JAVASCTIPT RESOURCES " src="http://dreamsiteweb.com/wp-content/uploads/2011/11/javascriptsourceceode-300x225.jpg" alt="5 NICE JAVASCTIPT RESOURCES " width="300" height="225" />This time I&#8217;m sharing some resources that I found helpful while I developed in this great language. As we can read in the website of Mozilla: &#8220;JavaScript (sometimes shortened to JS) is a lightweight, object-oriented language, most known as the scripting language for web pages, but used in many non-browser environments as well&#8221;.<br />
Here are some guidelines, tips and online editors.<br />
<span id="more-199"></span></p>
<h3>Google JavaScript Style Guide:</h3>
<p>Style guidelines for JavaScript developers written by Google team</p>
<p><a href="http://google-styleguide.googlecode.com/svn/trunk/javascriptguide.xml" target="_blank">Link to Google JavaScript Style Guide.</a></p>
<h3>jsFiddle:</h3>
<p>This is an Online Editor for the Web. With this editor you can write JavaScript, use some popular frameworks(<strong>MooTools</strong>, <strong>jQuery</strong>, <strong>Prototype</strong>, <strong>YUI</strong>, <strong>Glow</strong> and <strong>Dojo</strong>) and also you can edit HTML and CSS.</p>
<p><a href="http://www.jsfiddle.net" target="_blank">Link to jsfiddle.</a></p>
<h3>jsPerf, JavaScript performance playground:</h3>
<p><strong>jsPerf</strong> aims to provide an easy way to create and share test cases, comparing the performance of different JavaScript snippets by running benchmarks.</p>
<p><a href="http://jsperf.com/" target="_blank">Link to jsperf.</a></p>
<h3>Mozilla:</h3>
<p>Dedicated section to the JavaScript language itself, the parts that are not specific to Web pages or other host environments.</p>
<p><a href="https://developer.mozilla.org/en/JavaScript" target="_blank">Link to Mozilla JavaScript guideline.</a></p>
<h3>Haskell and JavaScript:</h3>
<p>Great article about <strong>Haskell Functions for JavaScript</strong> and a library, by Ariel Flesler.</p>
<p><a href="http://flesler.blogspot.com/2008/11/haskell-functions-for-javascript.html" target="_blank">Link to Haskell JavaScript Functions for JavaScript.</a></p>
<h3>Bonus:</h3>
<h2>w3schools:</h2>
<p>In the w3schools we can find a JavaScript and HTML DOM Reference. It also has an Online Editor, so you can try what you are reading.</p>
<p><a href="http://www.w3schools.com/jsref/default.asp" target="_blank">Link to w3schools reference.</a></p>
<h2>JavaScript&#8217;s appendChild and the Mythical prependChild:</h2>
<p>A nice article about the JavaScript&#8217;s appendChild() and the Mythical prependChild().</p>
<p><a href="http://developer.practicalecommerce.com/articles/2082-JavaScript-s-appendChild-and-the-Mythical-prependChild-" target="_blank">Link to the article <strong>JavaScript&#8217;s appendChild and the Mythical prependChild</strong>.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://dreamsiteweb.com/5-nice-javasctipt-resources/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Akiyama</title>
		<link>http://dreamsiteweb.com/akiyama-dj/</link>
		<comments>http://dreamsiteweb.com/akiyama-dj/#comments</comments>
		<pubDate>Wed, 19 Oct 2011 21:47:45 +0000</pubDate>
		<dc:creator>andres!</dc:creator>
				<category><![CDATA[Portfolio]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Ajax]]></category>
		<category><![CDATA[CMS]]></category>
		<category><![CDATA[Css]]></category>
		<category><![CDATA[Freelance]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[XHTML]]></category>

		<guid isPermaLink="false">http://www.dreamsiteweb.com/?p=140</guid>
		<description><![CDATA[WordPress development of the website of Akiyama, the DJ equipment brand. I made a custom theme for both, front and back end, and that includes PHP, Ajax, CSS and valid HTML. This was a freelance job for Anbork Studio Artworks.]]></description>
			<content:encoded><![CDATA[<p>WordPress development of the website of Akiyama, the DJ equipment brand. I made a custom theme for both, front and back end, and that includes PHP, Ajax, CSS and valid HTML. This was a freelance job for <a href="http://anbork.com/v3/" target="_blank">Anbork Studio Artworks</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://dreamsiteweb.com/akiyama-dj/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Movistar Team</title>
		<link>http://dreamsiteweb.com/movistar-team/</link>
		<comments>http://dreamsiteweb.com/movistar-team/#comments</comments>
		<pubDate>Mon, 01 Aug 2011 17:30:35 +0000</pubDate>
		<dc:creator>andres!</dc:creator>
				<category><![CDATA[HTML Mockups]]></category>
		<category><![CDATA[Portfolio]]></category>
		<category><![CDATA[Css]]></category>
		<category><![CDATA[Freelance]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[mockup]]></category>
		<category><![CDATA[XHTML]]></category>

		<guid isPermaLink="false">http://www.dreamsiteweb.com/?p=130</guid>
		<description><![CDATA[Store of the Spanish cycling team of Movistar. I participate in the xhtml and css mockup from the PSD files, and some JavaScript helping the user interaction. This was a freelance job for Gruponat.]]></description>
			<content:encoded><![CDATA[<p>Store of the Spanish cycling team of Movistar. I participate in the xhtml and css mockup from the PSD files, and some JavaScript helping the user interaction. This was a freelance job for <a href="http://www.gruponat.com/">Gruponat</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://dreamsiteweb.com/movistar-team/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating a custom WordPress admin</title>
		<link>http://dreamsiteweb.com/creating-a-custom-wordpress-admin/</link>
		<comments>http://dreamsiteweb.com/creating-a-custom-wordpress-admin/#comments</comments>
		<pubDate>Fri, 27 May 2011 01:09:53 +0000</pubDate>
		<dc:creator>andres!</dc:creator>
				<category><![CDATA[labs]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[CMS]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Plugin]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://labs.dreamsiteweb.com/?p=175</guid>
		<description><![CDATA[Have you ever try to customize the wordpress dashboard? I&#8217;m sure that you think about it at least once if you made any development with wordpress. Luckily, WordPress&#8217; flexible nature allows for almost every part of it to be easily changed, Dashboard inclusive. The easy way is to create a plugin for it, so let&#8217;s ... <a href="http://dreamsiteweb.com/creating-a-custom-wordpress-admin/"><strong>Read more</strong></a>]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-387" title="CREATING A CUSTOM WORDPRESS ADMIN" src="http://dreamsiteweb.com/wp-content/uploads/2011/05/wordpress-logo.jpg" alt="CREATING A CUSTOM WORDPRESS ADMIN" width="200" height="188" />Have you ever try to customize <strong>the wordpress dashboard</strong>? I&#8217;m sure that you think about it at least once if you made any development with wordpress. Luckily, WordPress&#8217; flexible nature allows for almost every part of it to be easily changed, Dashboard inclusive. The easy way is to create a <strong>plugin</strong> for it, so let&#8217;s take look on how we can creat a plugin first.<br />
<span id="more-175"></span></p>
<h4>Creating a plugin:</h4>
<p>The first step is to create a folder at &#8220;/wp-content/plugins/&#8221;, for example, called &#8220;custom-admin&#8221;. Save this file inside of the folder and call it custom-admin.php. This file must contain the next code at the begining:</p>
<pre class="brush:applescript">
<?php
/*
Plugin Name: Custom admin
Plugin URI: http://example.com/custom-admin
Description: Custom admin for WordPress.
Author: Your name
Version: 1.0
Author URI: http://example.com
 */ ?>
</pre>
<p>This is the &#8220;header&#8221; and provides information about the plugin to be viewed on the <a title="Administration Panels" href="http://codex.wordpress.org/Administration_Panels#Plugins_-_Add_Functionality_to_your_Blog" target="_blank">Plugin Panel</a>. It provides the name, URI of the plugin, the description, author, and version. Now we have the plugin and we have to activate it from the admin panel like any other plugin. And we ready to start developing our plugin.</p>
<h4>Custom footer</h4>
<p>Now that we are ready to start customazing <strong>the dashboard</strong> let&#8217;s start with something easy, for example, think about adding your own footer. If you want to modify the text you should add a function like this:</p>
<pre class="brush:applescript">
function custom_admin_footer() {
   echo 'This theme was made by <a href="http://example.com">Mr. WordPress</a>.';
}

add_filter('admin_footer', 'custom_admin_footer');</pre>
<p>This will replace the default <em>Thank you for creating with WordPress. | Documentation | Feedback</em> wordpress admin footer.</p>
<h4>Menu Items</h4>
<p>Now, we are going to remove some items from the admin menu with the <a href="http://codex.wordpress.org/Function_Reference/remove_menu_page" target="_blank"><strong>remove_menu_page()</strong></a> function:</p>
<pre class="brush:applescript"><!--?php 	function custom_admin_remove_menu_pages() { 		remove_menu_page('link-manager.php'); 		remove_menu_page('tools.php');	 	}         add_action( 'admin_init', 'custom_admin_remove_menu_pages' ); ?--></pre>
<p>This snippet remove the Links Manager and Tools menu items, and if you want to remove another item, you should change the parameter with the slug of the menu (typically the name of the PHP script for the built in menu items; example: edit-comments.php).</p>
<h4>Dashboard widgtes</h4>
<p>Another thing that we can do is removing the default dashboard widgtes <a href="http://codex.wordpress.org/Dashboard_Widgets_API#Advanced:_Removing_Dashboard_Widgets" target="_blank"><strong>remove_meta_box()</strong></a>:</p>
<pre class="brush:applescript">function custom_admin_remove_dashboard_widgets() {
	remove_meta_box( 'dashboard_quick_press', 'dashboard', 'side' );
	remove_meta_box( 'dashboard_incoming_links', 'dashboard', 'side' );
} 

add_action('wp_dashboard_setup', 'custom_admin_remove_dashboard_widgets' );</pre>
<p>This snippet will remove the <strong>quick press and the incoming links widget</strong> in the home page of the dashboard. Also, we can add a <strong>custom widget</strong> if you want:</p>
<pre class="brush:applescript">function custom_admin_dashboard_widget_function() {
	// Display whatever it is you want to show
	echo "Hello World, I'm a great Dashboard Widget";
} 

// Create the function use in the action hook
function custom_admin_add_dashboard_widgets() {
	wp_add_dashboard_widget('custom_admin_dashboard_widget', 'Example Dashboard Widget', 'custom_admin_dashboard_widget_function');
} 

// Hook into the 'wp_dashboard_setup' action to register our other functions
add_action('wp_dashboard_setup', 'custom_admin_add_dashboard_widgets' );</pre>
<p>You can find more info in the <a target="_blank" href="http://codex.wordpress.org/Dashboard_Widgets_API"><strong>Dashboard Widgets API</strong></a> page.</p>
<h4>Custom CSS for the dashboard</h4>
<p>Another useful tip is adding a custom <strong>CSS</strong> file for the admin panel. This will let you override <strong>the default styles</strong> of the wordpress dashboard. Here is an example of how you can do it:</p>
<pre class="brush:applescript">function custom_admin_css() {
  echo site_url() . "/wp-content/plugins/custom-admin/custom-admin.css";
}

add_action('admin_head','my_wp_admin_css');</pre>
<p>This will add a CSS file at the end of the head tag in the HTML, make sure that path is ok for you. </p>
<h4>Custom admin based on roles</h4>
<p>To finish this post I will show you how you can do different actions depending on the <strong>user role</strong>. As you know, WordPress uses a concept of <a href="http://codex.wordpress.org/Roles_and_Capabilities#Roles"><strong>Roles</strong></a>, designed to give the blog owner the ability to control and assign what users can and cannot do in the blog. So, we can extend this feature, adding or removing menu items, widgets, css and other stuff. For this, the first step is check the user role. For this example, I will only check if the user has an &#8216;administrator&#8217; role with the function  <a href="http://codex.wordpress.org/Function_Reference/current_user_can" target="_blank"><strong>&#8220;current_user_can()&#8221;</strong></a>:</p>
<pre class="brush:applescript">

<?php
function custom_admin_check_user(){
  if(!current_user_can("administrator")):
    custom_admin_is_not_administrator();
  endif;
}
add_action('admin_init', 'custom_admin_check_user');

function custom_admin_is_not_administrator(){
function custom_admin_dashboard_widget_function() {
	// Display whatever it is you want to show
	echo "Hello World, I'm a great Dashboard Widget";
} 

// Create the function use in the action hook
function custom_admin_add_dashboard_widgets() {
	wp_add_dashboard_widget('custom_admin_dashboard_widget', 'Example Dashboard Widget', 'custom_admin_dashboard_widget_function');
} 

// Hook into the 'wp_dashboard_setup' action to register our other functions
add_action('wp_dashboard_setup', 'custom_admin_add_dashboard_widgets' );

}

?> 
</pre>
<p>In the previous code, we are added a custom widget only if the user is not an administrator. Obviusly this bring us a lot of capabilities to customize the dashboard if you want users with differents roles have some custom widget or only some items in the menu. This is what you need. As I wrote at the begining, WordPress is a very flexible CMS and we put our own limits.</p>
]]></content:encoded>
			<wfw:commentRss>http://dreamsiteweb.com/creating-a-custom-wordpress-admin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HTML5: old school vs. new school</title>
		<link>http://dreamsiteweb.com/html5-old-school-vs-new-school/</link>
		<comments>http://dreamsiteweb.com/html5-old-school-vs-new-school/#comments</comments>
		<pubDate>Fri, 13 May 2011 01:05:02 +0000</pubDate>
		<dc:creator>andres!</dc:creator>
				<category><![CDATA[labs]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[attributes]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[input text]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://labs.dreamsiteweb.com/?p=158</guid>
		<description><![CDATA[A time ago post a JavaScript snipet. It was simple snipet that provides a hint that describes the expected value of an input field. So, when text input get focus, the default value disappears and allows the user to write, but if the user doesn’t type anything, the default value returns to the input text ... <a href="http://dreamsiteweb.com/html5-old-school-vs-new-school/"><strong>Read more</strong></a>]]></description>
			<content:encoded><![CDATA[<p>A time ago post a <a title="Text input default value recover jQuery snippet" href="http://labs.dreamsiteweb.com/labs/text-input-default-value-recover-javascript-snippet/" target="_blank">JavaScript snipet</a>. It was simple snipet that provides a hint that describes the expected value of an input field. So, when text input get focus, the default value disappears and allows the user to write, but if the user doesn’t type anything, the default value returns to the input text when the input lose the focus. But the last week I was reading the book <a href="http://www.amazon.com/gp/product/0240813286/ref=cm_li_v_p_self?tag=linkedin-20" target="_blank">HTML5: Designing Rich Internet Applications</a>, and I found some great new attributes.</p>
<p><span id="more-347"></span></p>
<p>One of them is the <strong>Placeholder</strong> attribute, which works exactly as my snipet(well, my snipet add an extra class to the input when get focus, but that is not always necessary). If your browser support <strong>HTML5</strong> you can test it here:</p>
<input style="width:250px"  placeholder="Testing the placeholder attribute" />
<p>&nbsp;</p>
<p>Apart of this one, there are other new great features in <strong>HTML5</strong> that I going to talk about in the future, as I think that <strong>HTML5 </strong> help making easy many task that ussualy were more complex and required the use of <strong>HTML</strong>, <strong>CSS </strong>and <strong>JavaSctip</strong>. Meanwhile you can start checking some of them in <a href="http://www.w3schools.com/html5/default.asp" target="_blank">w3schools</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://dreamsiteweb.com/html5-old-school-vs-new-school/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JavaScript Global Functions</title>
		<link>http://dreamsiteweb.com/javascript-global-functions/</link>
		<comments>http://dreamsiteweb.com/javascript-global-functions/#comments</comments>
		<pubDate>Tue, 12 Apr 2011 09:37:02 +0000</pubDate>
		<dc:creator>andres!</dc:creator>
				<category><![CDATA[labs]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[Global Functions]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Object]]></category>
		<category><![CDATA[Regular Expressions]]></category>
		<category><![CDATA[String]]></category>

		<guid isPermaLink="false">http://labs.dreamsiteweb.com/?p=135</guid>
		<description><![CDATA[In my last post, where I wrote about the Javascript problems with the float point numbers, I told that I would be writing about the JavaScript Global Functions. So here we are. This time I will talk about a few global functions that I think that could be useful and I hope that it will ... <a href="http://dreamsiteweb.com/javascript-global-functions/"><strong>Read more</strong></a>]]></description>
			<content:encoded><![CDATA[<p>In my <a href="http://labs.dreamsiteweb.com/labs/floating-point-numbers-in-javascript/" target="_blank">last post</a>, where I wrote about the Javascript problems with the float point numbers, I told that I would be writing about the JavaScript Global Functions. So here we are. This time I will talk about a few global functions that I think that could be useful and I hope that it will give you curious enough to investigate further.</p>
<p><span id="more-135"></span></p>
<h4>Strings and Regular Expressions:</h4>
<p><strong>Regular Expression</strong> is not something exclusive of JavaScipt. You can use it in many languages and it provides a concise and flexible means for matching strings of text, such as particular characters, words, or patterns of characters.</p>
<p>A regular expression, often called a <strong>pattern</strong>,  is an expression used to perform pattern-matching and &#8220;search-and-replace&#8221; functions on text. At first it seems to be very complex, but is very helpful, so is important learn how to use it. Luckily, JavaScript has several global functions that you can use when you have to work with strings. These are just some of then:</p>
<h5>string.search(regexp)</h5>
<p>The <strong>search()</strong> method, as its name says, searches for a match between a regular expression and a string and will returns the position of the match, or -1 if no match is found.&nbsp;
</p>
<pre class="brush:applescript">var theString = “search me”
document.write(theString.search("me"));  //output: 7</pre>
<h5>string.substr(start,length)</h5>
<p>The <strong>substr()</strong> method extracts the characters from a string, beginning at &#8220;start&#8221; and through the specified number of character, and returns the new sub string.</p>
<pre class="brush:applescript">var str="Hello world!";
document.write(str.substr(3)+"
"); //output: lo world!
document.write(str.substr(3,4)); //output lo w</pre>
<p>These functions are fine to make simple task, but it can get complicated without the use of regular expressions. Just to give an example, here a I leave a function to validate an e-mail just with global functions:</p>
<pre class="brush:applescript">function validate(email){
 if(email.search("@") == -1){
 return false;
 }else if(email.substring(0, email.search("@")).length&gt;1){
 email = email.substr(email.search("@"));
 email = email.split(".");
 if(email.length&gt;1){
 for(i=0;i&lt;email.length;i++){
 if(email[i] == " "){
 return false;
 }
 }
 return true;
 }else{
 return false;
 }
 }else{
 return false;
 }
}</pre>
<p>And here is an alternative function, much simpler, with a regular expression:</p>
<pre class="brush:applescript">function validate2(email) {
if (/^w+([.-]?w+)*@w+([.-]?w+)*(.w{2,3})+$/.test(email)){
    return true;
}else{
    return false;
}
}</pre>
<h4>Math Object</h4>
<p>The <strong>Math</strong> object allows you to perform mathematical tasks. You can use this to avoid a lot of looping and conditions. For example, if you need to get the the largest number in an array of numbers, you can do something like this with a loop:</p>
<pre class="brush:applescript">var myNumbers = [5,635,98,17,500,950];
var max = 0;
for(var i=0;i max){
  max = myNumbers[i];
}
}
alert(max);</pre>
<p>But it is easier and better perform this:</p>
<pre class="brush:applescript">Math.max(5,635,98,17,500,950); // returns 950</pre>
<p><strong>Math.max</strong> returns the number with the highest value. If no arguments are given, the result is &#8220;-Infinity&#8221;. On the other hand, if you want to get the lowest value you can perform <strong>Math.min</strong> method.</p>
<p>Also, maybe you have negative numbers and you want to get the absolute value of a number, to compare o do something else with it, what you need is the <strong>abs()</strong> method.</p>
<pre class="brush:applescript">Math.abs(-7) // returns 7</pre>
<p></P>
<p></P></p>
<h4>Links of reference:</h4>
<ul>
<li><a href="http://www.jslab.dk/tools.regex.php" target="_blank">JavaScript Regex Generator</a></li>
<li><a href="http://en.wikipedia.org/wiki/Regular_expression" target="_blank">Wikipedia article about regular expression</a></li>
<li><a href="http://www.w3schools.com/js/js_obj_regexp.asp" target="_blank">JavaScript RegExp Object</a></li>
<li><a href="http://www.w3schools.com/jsref/jsref_obj_string.asp" target="_blank">JavaScript String Object</a></li>
<li><a href="http://www.w3schools.com/jsref/jsref_obj_math.asp" target="_blank">JavaScript Math Object</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://dreamsiteweb.com/javascript-global-functions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Construccions Torres i Fills</title>
		<link>http://dreamsiteweb.com/construccions-torres-i-fills/</link>
		<comments>http://dreamsiteweb.com/construccions-torres-i-fills/#comments</comments>
		<pubDate>Thu, 17 Mar 2011 06:25:46 +0000</pubDate>
		<dc:creator>andres!</dc:creator>
				<category><![CDATA[Drupal]]></category>
		<category><![CDATA[Portfolio]]></category>
		<category><![CDATA[WebDesign]]></category>
		<category><![CDATA[CMS]]></category>
		<category><![CDATA[Css]]></category>
		<category><![CDATA[Freelance]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[XHTML]]></category>

		<guid isPermaLink="false">http://www.dreamsiteweb.com/?p=123</guid>
		<description><![CDATA[Drupal customization for an institutional site, with a custom theme from a new design, that was made by Greta Gustavino supervised by me. This was a freelance work for Keepu.]]></description>
			<content:encoded><![CDATA[<p>Drupal customization for an institutional site, with a custom theme from a new design, that was made by <a href="http://www.linkedin.com/pub/greta-guastavino/34/a44/445" target="_blank">Greta Gustavino</a> supervised by me. This was a freelance work for <a href="http://www.keepu.es/" target="_blank">Keepu</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://dreamsiteweb.com/construccions-torres-i-fills/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

