<?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/"
	xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"
xmlns:rawvoice="http://www.rawvoice.com/rawvoiceRssModule/"
>

<channel>
	<title>Solution Hacker</title>
	<atom:link href="http://www.solutionhacker.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.solutionhacker.com</link>
	<description>This blog provides solutions for enterpreneurs!</description>
	<lastBuildDate>Sun, 05 Feb 2012 00:45:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=350</generator>
<!-- podcast_generator="Blubrry PowerPress/2.0.4" -->
	<itunes:summary>This blog provides solutions for enterpreneurs!</itunes:summary>
	<itunes:author>Solution Hacker</itunes:author>
	<itunes:explicit>no</itunes:explicit>
	<itunes:image href="http://www.solutionhacker.com/wp-content/plugins/powerpress/itunes_default.jpg" />
	<itunes:subtitle>This blog provides solutions for enterpreneurs!</itunes:subtitle>
	<image>
		<title>Solution Hacker</title>
		<url>http://www.solutionhacker.com/wp-content/plugins/powerpress/rss_default.jpg</url>
		<link>http://www.solutionhacker.com</link>
	</image>
		<item>
		<title>Social Stuff</title>
		<link>http://www.solutionhacker.com/uncategorized/social-stuff/</link>
		<comments>http://www.solutionhacker.com/uncategorized/social-stuff/#comments</comments>
		<pubDate>Sun, 05 Feb 2012 00:45:27 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[6. Uncategorized]]></category>

		<guid isPermaLink="false">http://www.solutionhacker.com/?p=892</guid>
		<description><![CDATA[<h2>Social Stuff?</h2>
<ul>
	<li>Idea is similar to social bookmark. Instead of people posting links, they now can post products with their own comments and feelings associated with it.</li>
	<li>We need to make it very easy for people to add a product and share. That is the most critical element for this service.</li>
</ul>
<div class="youtube" style="width: 350; height: 300;"><object width="350" height="300" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="wmode" value="transparent" /><param name="src" value="http://www.youtube.com/v/ys27mBhAdIY" /><embed width="350" height="300" type="application/x-shockwave-flash" src="http://www.youtube.com/v/ys27mBhAdIY" wmode="transparent" /></object></div>
<ul>
	<li>Once users add a product in their profile, they can easily share with their friends in facebook and twitter.</li>
	<li>Users need to categorize the products before sharing. But for Amazon products, we can automatically do it for them.</li>
	<li>If user is not using amazon and provide a regular url for a product, we crawl and list out all the photos on this landing page and ask users to pick one to represent the product.</li>
	<li>We also allow user to post their own picture for the product but we would suggest users to include links so their friends can get it if they want.</li>
	<li>Post price as well.</li>
</ul>
<h2>What motivate them to post products?</h2>
<ul>
	<li>Make it fun and users love to share stuffs with their friends.</li>
	<li>User can use this service to make their own virtual collections and show their friends what they own.</li>
	<li>They can earn social score that can be rewarded somehow down the line.</li>
</ul>
<h2>Why don't user use the facebook to do that?</h2>
<ul>
	<li>Wall moves fast and soon the picture you post is gone.</li>
	<li>Wall is not organized it well. Now they use timeline, it is not for products. We need a catalog!</li>
	<li>People cannot perform product search</li>
</ul>
<h2>How we make money out from it?</h2>
<ul>
	<li>We manipulate the url user post to include our affiliate id for the products that can be found in our affiliate network like Amazon. This way each users doing a post is like our sales and marketing agent that helps us to drive income.</li>
</ul>]]></description>
			<content:encoded><![CDATA[<h2>Social Stuff?</h2>
<ul>
<li>Idea is similar to social bookmark. Instead of people posting links, they now can post products with their own comments and feelings associated with it.</li>
<li>We need to make it very easy for people to add a product and share. That is the most critical element for this service.</li>
</ul>
<div class="youtube" style="width: 350; height: 300;"><object width="350" height="300" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="wmode" value="transparent" /><param name="src" value="http://www.youtube.com/v/ys27mBhAdIY" /><embed width="350" height="300" type="application/x-shockwave-flash" src="http://www.youtube.com/v/ys27mBhAdIY" wmode="transparent" /></object></div>
<ul>
<li>Once users add a product in their profile, they can easily share with their friends in facebook and twitter.</li>
<li>Users need to categorize the products before sharing. But for Amazon products, we can automatically do it for them.</li>
<li>If user is not using amazon and provide a regular url for a product, we crawl and list out all the photos on this landing page and ask users to pick one to represent the product.</li>
<li>We also allow user to post their own picture for the product but we would suggest users to include links so their friends can get it if they want.</li>
<li>Post price as well.</li>
</ul>
<h2>What motivate them to post products?</h2>
<ul>
<li>Make it fun and users love to share stuffs with their friends.</li>
<li>User can use this service to make their own virtual collections and show their friends what they own.</li>
<li>They can earn social score that can be rewarded somehow down the line.</li>
</ul>
<h2>Why don&#8217;t user use the facebook to do that?</h2>
<ul>
<li>Wall moves fast and soon the picture you post is gone.</li>
<li>Wall is not organized it well. Now they use timeline, it is not for products. We need a catalog!</li>
<li>People cannot perform product search</li>
</ul>
<h2>How we make money out from it?</h2>
<ul>
<li>We manipulate the url user post to include our affiliate id for the products that can be found in our affiliate network like Amazon. This way each users doing a post is like our sales and marketing agent that helps us to drive income.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.solutionhacker.com/uncategorized/social-stuff/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Set up your local wordpress development environment</title>
		<link>http://www.solutionhacker.com/implement-your-idea/set-up-your-local-wordpress-development-environment/</link>
		<comments>http://www.solutionhacker.com/implement-your-idea/set-up-your-local-wordpress-development-environment/#comments</comments>
		<pubDate>Mon, 16 Jan 2012 22:22:27 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Developer]]></category>

		<guid isPermaLink="false">http://www.solutionhacker.com/?p=870</guid>
		<description><![CDATA[The article will show you how to get your local Wordpress dev environment up on Mac.
<h2>Steps to follow</h2>
<ol>
	<li>Download and install MAMP (comes with Apache, MySQL and PHP)</li>
	<li>Edit your hosts file</li>
	<li>Download WordPress and set up virtualhost in apache that points to it.</li>
	<li>Edit your wp-config.php file</li>
	<li>Download Coda and import WordPress mode for auto-completion for wordpress syntax.</li>
</ol>
<h2>Code auto-completion for wordpress syntax</h2>
<a href="http://hitchhackerguide.com/2011/02/18/wordpress-syntax-mode-for-panic-coda/">http://hitchhackerguide.com/2011/02/18/wordpress-syntax-mode-for-panic-coda/</a>]]></description>
			<content:encoded><![CDATA[<p>The article will show you how to get your local WordPress dev environment up on Mac.</p>
<h2>Steps to follow</h2>
<ol>
<li>Download and install MAMP (comes with Apache, MySQL and PHP)</li>
<li>Edit your hosts file</li>
<li>Download WordPress and set up virtualhost in apache that points to it.</li>
<li>Edit your wp-config.php file</li>
<li>Download Coda and import WordPress mode for auto-completion for wordpress syntax.</li>
</ol>
<h2>Code auto-completion for wordpress syntax</h2>
<p><a href="http://hitchhackerguide.com/2011/02/18/wordpress-syntax-mode-for-panic-coda/">http://hitchhackerguide.com/2011/02/18/wordpress-syntax-mode-for-panic-coda/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.solutionhacker.com/implement-your-idea/set-up-your-local-wordpress-development-environment/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Power of WordPress Custom Field</title>
		<link>http://www.solutionhacker.com/online-marketing/power-of-wordpress-custom-field/</link>
		<comments>http://www.solutionhacker.com/online-marketing/power-of-wordpress-custom-field/#comments</comments>
		<pubDate>Mon, 09 Jan 2012 07:14:31 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[3. Online Marketing]]></category>

		<guid isPermaLink="false">http://www.solutionhacker.com/?p=835</guid>
		<description><![CDATA[<strong>Custom Fields</strong> are a form of <strong>meta-data</strong> that allows you to store arbitrary information with each WordPress post in <strong>key/value</strong> format. The key is the field name that stay the same for different posts whereas the value is the information that can change on each post and you can store more than one values for each key. Custom field information is stored in a table named "<strong>wp_postmeta</strong>" other than "<strong>wp_post</strong>" table. The schema of the wp_postmeta is quite generic so you can add as many custom fields as you want without changing the schema. This post is to show you some interesting ways I see how people use this metadata in their blogs.

<!--more-->
<h2>How to use the post metadata?</h2>
To use this metadata, you need to know how to pull them out. Below is what you can do:

[php]

//single value

&#60;?php echo get_post_meta($post-&#62;ID, 'key', true); ?&#62;

//multiple values
&#60;?php $songs = get_post_meta($post-&#62;ID, 'songs', false); ?&#62;
&#60;h3&#62;This post is inspired by:&#60;/h3&#62;
&#60;ul&#62;
  &#60;?php foreach($songs as $song) {
      echo '&#60;li&#62;'.$song.'&#60;/li&#62;';
    } ?&#62;
&#60;/ul&#62;
?&#62;
[/php]

Now you know how to get this metadata out from database. What can you do about this metadata? To get some ideas, you can look into a powerful plugins like <strong>Yoast’s WordPress SEO</strong>. It uses the custom fields to manage the html meta for SEO purpose. Many powerful frameworks like <strong>Genesis</strong>, <strong>Headway</strong>, <strong>iThemes</strong> are also utilizing custom fields to control different single post layouts. Here are other ideas:
<ul>
	<li>Only Display Posts with a Specific Custom Field</li>
	<li>Display the Digg Button only when the custom field is present</li>
	<li>Rewrite Guest Author’s name with Custom Fields (need add_filter)</li>
</ul>
[php]

add_filter( 'the_author', 'guest_author_name' );
add_filter( 'get_the_author_display_name', 'guest_author_name' );

function guest_author_name( $name ) {
   global $post;
   $author = get_post_meta( $post-&#62;ID, 'guest-author', true );
   if ( $author )
     $name = $author;
   return $name;
}

[/php]
<ul>
	<li>Custom sidebar. Replace "&#60;?php get_sidebar(); ?&#62;" in  page.php or single.php with the following code:</li>
</ul>
[php]
&#60;?php
global $wp_query;
$postid = $wp_query-&#62;post-&#62;ID;
$sidebar = get_post_meta($postid, &#34;sidebar&#34;, true);
get_sidebar($sidebar);
wp_reset_query();
?&#62;
[/php]
<h2>How to build a custom write panel?</h2>
In fact, there are more and more plugins and frameworks are using custom fields to extend the power of wordpress. Imagine if you need to use <strong>custom field panel</strong> in post to manage all those custom fields, you may spend days to write a post. So, many plugin and framework designers are now using <strong>custom write panel</strong> to hide this from us in order to make our lives easier.]]></description>
			<content:encoded><![CDATA[<p><strong>Custom Fields</strong> are a form of <strong>meta-data</strong> that allows you to store arbitrary information with each WordPress post in <strong>key/value</strong> format. The key is the field name that stay the same for different posts whereas the value is the information that can change on each post and you can store more than one values for each key. Custom field information is stored in a table named &#8220;<strong>wp_postmeta</strong>&#8221; other than &#8220;<strong>wp_post</strong>&#8221; table. The schema of the wp_postmeta is quite generic so you can add as many custom fields as you want without changing the schema. This post is to show you some interesting ways I see how people use this metadata in their blogs.</p>
<p><span id="more-835"></span></p>
<h2>How to use the post metadata?</h2>
<p>To use this metadata, you need to know how to pull them out. Below is what you can do:</p>
<pre class="brush: php; title: ; notranslate">

//single value

&lt;?php echo get_post_meta($post-&gt;ID, 'key', true); ?&gt;

//multiple values
&lt;?php $songs = get_post_meta($post-&gt;ID, 'songs', false); ?&gt;
&lt;h3&gt;This post is inspired by:&lt;/h3&gt;
&lt;ul&gt;
  &lt;?php foreach($songs as $song) {
      echo '&lt;li&gt;'.$song.'&lt;/li&gt;';
    } ?&gt;
&lt;/ul&gt;
?&gt;
</pre>
<p>Now you know how to get this metadata out from database. What can you do about this metadata? To get some ideas, you can look into a powerful plugins like <strong>Yoast’s WordPress SEO</strong>. It uses the custom fields to manage the html meta for SEO purpose. Many powerful frameworks like <strong>Genesis</strong>, <strong>Headway</strong>, <strong>iThemes</strong> are also utilizing custom fields to control different single post layouts. Here are other ideas:</p>
<ul>
<li>Only Display Posts with a Specific Custom Field</li>
<li>Display the Digg Button only when the custom field is present</li>
<li>Rewrite Guest Author’s name with Custom Fields (need add_filter)</li>
</ul>
<pre class="brush: php; title: ; notranslate">

add_filter( 'the_author', 'guest_author_name' );
add_filter( 'get_the_author_display_name', 'guest_author_name' );

function guest_author_name( $name ) {
   global $post;
   $author = get_post_meta( $post-&gt;ID, 'guest-author', true );
   if ( $author )
     $name = $author;
   return $name;
}
</pre>
<ul>
<li>Custom sidebar. Replace &#8220;&lt;?php get_sidebar(); ?&gt;&#8221; in  page.php or single.php with the following code:</li>
</ul>
<pre class="brush: php; title: ; notranslate">
&lt;?php
global $wp_query;
$postid = $wp_query-&gt;post-&gt;ID;
$sidebar = get_post_meta($postid, &quot;sidebar&quot;, true);
get_sidebar($sidebar);
wp_reset_query();
?&gt;
</pre>
<h2>How to build a custom write panel?</h2>
<p>In fact, there are more and more plugins and frameworks are using custom fields to extend the power of wordpress. Imagine if you need to use <strong>custom field panel</strong> in post to manage all those custom fields, you may spend days to write a post. So, many plugin and framework designers are now using <strong>custom write panel</strong> to hide this from us in order to make our lives easier.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.solutionhacker.com/online-marketing/power-of-wordpress-custom-field/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mastering WordPress Shortcodes</title>
		<link>http://www.solutionhacker.com/online-marketing/mastering-wordpress-shortcode/</link>
		<comments>http://www.solutionhacker.com/online-marketing/mastering-wordpress-shortcode/#comments</comments>
		<pubDate>Sun, 01 Jan 2012 04:53:34 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[3. Online Marketing]]></category>
		<category><![CDATA[3.2. SEO]]></category>
		<category><![CDATA[Build Money Site]]></category>

		<guid isPermaLink="false">http://www.solutionhacker.com/?p=627</guid>
		<description><![CDATA[I have used <strong> Wordpress </strong> to build my money site as many <strong> affiliate marketers </strong> suggested. However, this post is not going to show you how to set up a typical <strong> Wordpress Website </strong> . There are many tutorials online that show you how to do this in steps. So, I am not going to repeat it here. The only tip I suggest here is that if you want to have a professional looking website. You should really consider to spend a little money to purchase a <a href="http://www.elegantthemes.com/affiliates/idevaffiliate.php?id=11686"> professional and customizable theme from Elegantthemes.com </a> . Just paying around $30 bucks, you can have full access of tons of their professional themes. Since I have owned quite a number of websites, it is indeed a great deal for me. Anyway, as I said, it is not what I am going to talk about here today. Today, I would like to show you how <strong> wordpress shortcode </strong> works behind the scene.

<!--more-->
<h2>What is wordpress shortcodes?</h2>
The best way to show you the power of <strong> wordpress shortcode </strong> is to give you some examples.

[tabs style="default" title="Wordpress shortcode demo"]

[tab title="Amazon Product"]

[amazon asin="B0047DVWLW" template="Simple Ad Unit"]

[/tab]

[tab title="Price Change History"]

<strong> 3rd party new price </strong>

[rsstag url=http://camelcamelcamel.com/product/B0047DVWLW/new.xml]

<strong> 3rd party used price </strong>

[rsstag url=http://camelcamelcamel.com/product/B0047DVWLW/used.xml]

[/tab]

[tab title="Follow"][twitter_stream search="ipad 2"] [/tab]

[/tabs]

The widget above is created purely using wordpress shortcodes. See the code below:
<pre class="xml" title="code">[tabs style="default" title="Wordpress shortcode demo"]
   [tab title="Amazon Product"] [amazon asin="B0047DVWLW" template="Simple Ad Unit"][/tab]
   [tab title="Facebook Comments"]
      [rsstag url=http://camelcamelcamel.com/product/B0047DVWLW/new.xml]
      [rsstag url=http://camelcamelcamel.com/product/B0047DVWLW/used.xml]
   [/tab]
   [tab title="Follow"] [twitter_stream search="ipad 2"] [/tab]
[/tabs]</pre>
Isn't that cool? With few lines of xml like tag, I am able to create a widget that shows the product summary, its price history and who is following it. As you can see above, I have combined 4 different shortcodes from 4 different plugins into one widget. At the high level, there are 2 kinds of shortcodes: <strong> layout </strong> and <strong> content </strong> . <strong> Layout shortcodes </strong> are helping you to present the content in a nice looking way. <strong> Content shortcodes </strong> are to help you to pull the content from different sources in a simple way.
<h2>Shortcode in Template</h2>
If you are creating a product detail page, you can open your wordpress editor to type in the shortcode like above. However, if you have quit a bit of products, this process will be very tedious. If you are a tech person, you could create a script to load your products' content into wordpress database's post table. But if you want to use wordpress as the data entry UI, you can create a product detail template that leverages the shortcodes using the specific method below:

[php]
&#60;?php echo do_shortcode(&#34;[shortcode]&#34;); ?&#62;
[/php]

You can also use shortcode dynamically based on the custom field setting like below:

[php]
&#60;?php
if(get_post_meta($post-&#62;ID, 'gallery', true)) {
    $shortcode = get_post_meta($post-&#62;ID, 'gallery', true);
    echo do_shortcode(&#34;$shortcode&#34;);
 }
 else { echo ''; }
?&#62;
[/php]
<h2>How to create your own wordpress shortcodes?</h2>
There are times you cannot find any shortcode that fits your need exactly. Two things you can do:
<ol>
	<li>Customize an existing one from other plugin.</li>
	<li>Build one from scratch yourself.</li>
</ol>
However, both require you to have good understanding how shortcodes work behind the scene. Don't worry. It is not that difficult if you have a little bit of coding skill. To define your own wordpress shortcode, you first write a function of what you want the shortcode to do. Then you register the function via add_shortcode(tagName, functionName). Here is an example to define the shortcode name bartag with attribute foo. The extract method below taking the return of another function shortcode_atts that is used to define the default attribute value(s). If an attribute is not in this default list, it will not even be interpreted.

[php]
// [bartag foo=&#34;foo-value&#34;]
  function bartag_func( $atts ) {
     extract( shortcode_atts( array(
        'foo' =&#62; 'something',
        'bar' =&#62; 'something else',
     ), $atts ) );
    return &#34;foo = {$foo}&#34;;
  }
  add_shortcode( 'bartag', 'bartag_func' );
[/php]

Now you have an good idea how to define a function. Here we are going to create a shortcode to make Google chart creation easier (ie. no need to remember the parameters and url).

Creating a Google chart is quite simple, you just need to simply define a url under "img" will do the magic. However, the url uses some short parameters that you may need to look them up in order to create the url correctly. To make it easier, we create the shortcode above to make the parameters more explicit and hide the google url for you. With this shortcode, now you can create a sparkline chart as following.

[php]
function chart_shortcode( $atts ) {
   extract(shortcode_atts(array(
     'data' =&#62; '',
     'colors' =&#62; '',
     'size' =&#62; '400x200',
     'bg' =&#62; 'ffffff',
     'title' =&#62; '',
     'labels' =&#62; '',
     'advanced' =&#62; '',
     'type' =&#62; 'pie'
   ), $atts));

switch ($type) {
case 'line' :
   $charttype = 'lc'; break;
case 'xyline' :
   $charttype = 'lxy'; break;
case 'sparkline' :
   $charttype = 'ls'; break;
case 'meter' :
   $charttype = 'gom'; break;
case 'scatter' :
   $charttype = 's'; break;
case 'venn' :
   $charttype = 'v'; break;
case 'pie' :
   $charttype = 'p3'; break;
case 'pie2d' :
   $charttype = 'p'; break;
default :
   $charttype = $type;
break;
}

if ($title) $string .= '&#38;chtt='.$title.'';
if ($labels) $string .= '&#38;chl='.$labels.'';
if ($colors) $string .= '&#38;chco='.$colors.'';
$string .= '&#38;chs='.$size.'';
$string .= '&#38;chd=t:'.$data.'';
$string .= '&#38;chf='.$bg.'';

return '&#60;img title=&#34;'.$title.'&#34; src=&#34;http://chart.apis.google.com/chart?cht='.$charttype.''.$string.$advanced.'&#34; alt=&#34;'.$title.'&#34; /&#62;';
}
add_shortcode('chart', 'chart_shortcode');
[/php]

After you write this code, save it under plugin file named google-chart.php and put the following header above the function.

[php]

&#60;?php
/**
* @package Google Chart
* @version 1.0
*/
/*
Plugin Name: Google Chart Shortcode
Plugin URI:
Description: This is google chart shortcode plugin
Author: Raymond Hon
Version: 1.0
Author URI: http://www.solutionhacker.com
*/

...

&#60;/php&#62;

[/php]

Then you can activate this plugin in Wordpress. If it is activated, you can put the following wordpress shortcode in your post and generate the chart as below:
<p style="text-align: center;">[chart data="0,12,24,26,32,64,54,24,22,20,8,2,0,0,3" bg="F7F9FA" size="200x100" type="sparkline"]</p>
<p style="text-align: left;">[[chart data="0,12,24,26,32,64,54,24,22,20,8,2,0,0,3" bg="F7F9FA" size="200x100" type="sparkline"]]</p>

<h2 style="text-align: left;">When wordpress shortcode meets custom fields in post</h2>
Congratulation! If you follow my tutorial above, you have just equipped the key skill that can take your wordpress website to the next level.  However, I am not going to stop here. I would like to show you how you can use shortcode with custom field. First, you can write a shortcode to extract custom field value and use it in your post. To do that, you can build a plugin following the code below:

[php]
add_shortcode('field', 'shortcode_field');
function shortcode_field($atts){
     extract(shortcode_atts(array(
                  'post_id' =&#62; NULL,
               ), $atts));
  if(!isset($atts[0])) return;
       $field = esc_attr($atts[0]);
       global $post;
       $post_id = (NULL === $post_id) ? $post-&#62;ID : $post_id;
       return get_post_meta($post_id, $field, true);
}

[/php]

Once you can extract the custom field from post using shortcode, you can use it for UI and/ or post content.]]></description>
			<content:encoded><![CDATA[<p>I have used <strong> WordPress </strong> to build my money site as many <strong> affiliate marketers </strong> suggested. However, this post is not going to show you how to set up a typical <strong> WordPress Website </strong> . There are many tutorials online that show you how to do this in steps. So, I am not going to repeat it here. The only tip I suggest here is that if you want to have a professional looking website. You should really consider to spend a little money to purchase a <a href="http://www.elegantthemes.com/affiliates/idevaffiliate.php?id=11686"> professional and customizable theme from Elegantthemes.com </a> . Just paying around $30 bucks, you can have full access of tons of their professional themes. Since I have owned quite a number of websites, it is indeed a great deal for me. Anyway, as I said, it is not what I am going to talk about here today. Today, I would like to show you how <strong> wordpress shortcode </strong> works behind the scene.</p>
<p><span id="more-627"></span></p>
<h2>What is wordpress shortcodes?</h2>
<p>The best way to show you the power of <strong> wordpress shortcode </strong> is to give you some examples.</p>
<div class="su-tabs su-tabs-style-default">
<div class="su-tabs-nav"><span>Amazon Product</span><span>Price Change History</span><span>Follow</span></div>
<div class="su-tabs-panes">
<div class="su-tabs-pane">
<div style="text-align:center;">
<a href="http://www.amazon.com/Apple-iPad-Tablet-NEWEST-MODEL/dp/B0047DVWLW%3FSubscriptionId%3DAKIAJLSJLJ5EKAQOAS5Q%26tag%3Dextremebuyer-20%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3DB0047DVWLW">Apple iPad 2  Tablet (16GB, Wifi,) NEWEST MODEL</a><br />
<a href="http://www.amazon.com/Apple-iPad-Tablet-NEWEST-MODEL/dp/B0047DVWLW%3FSubscriptionId%3DAKIAJLSJLJ5EKAQOAS5Q%26tag%3Dextremebuyer-20%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3DB0047DVWLW"><img src="http://ecx.images-amazon.com/images/I/312O7GZBacL._SL160_.jpg" /></a><br />
$499.00
</div>
</div>
<div class="su-tabs-pane">
<p><strong> 3rd party new price </strong></p>
<ul>
<li><a class='rsswidget' href='http://camelcamelcamel.com/product/B0047DVWLW?active=price_new' title='Useful URLs: Amazon.com, camelcamelcamel.com [&hellip;]'>Feb 04, 2012 02:33 PM &#8211; $512.00</a></li>
<li><a class='rsswidget' href='http://camelcamelcamel.com/product/B0047DVWLW?active=price_new' title='Useful URLs: Amazon.com, camelcamelcamel.com [&hellip;]'>Feb 04, 2012 09:55 AM &#8211; $500.00</a></li>
<li><a class='rsswidget' href='http://camelcamelcamel.com/product/B0047DVWLW?active=price_new' title='Useful URLs: Amazon.com, camelcamelcamel.com [&hellip;]'>Feb 03, 2012 07:28 PM &#8211; $512.00</a></li>
<li><a class='rsswidget' href='http://camelcamelcamel.com/product/B0047DVWLW?active=price_new' title='Useful URLs: Amazon.com, camelcamelcamel.com [&hellip;]'>Feb 03, 2012 02:06 PM &#8211; $521.00</a></li>
<li><a class='rsswidget' href='http://camelcamelcamel.com/product/B0047DVWLW?active=price_new' title='Useful URLs: Amazon.com, camelcamelcamel.com [&hellip;]'>Feb 03, 2012 07:41 AM &#8211; $508.00</a></li>
<li><a class='rsswidget' href='http://camelcamelcamel.com/product/B0047DVWLW?active=price_new' title='Useful URLs: Amazon.com, camelcamelcamel.com [&hellip;]'>Feb 03, 2012 03:06 AM &#8211; $499.98</a></li>
<li><a class='rsswidget' href='http://camelcamelcamel.com/product/B0047DVWLW?active=price_new' title='Useful URLs: Amazon.com, camelcamelcamel.com [&hellip;]'>Feb 02, 2012 04:56 PM &#8211; $508.00</a></li>
<li><a class='rsswidget' href='http://camelcamelcamel.com/product/B0047DVWLW?active=price_new' title='Useful URLs: Amazon.com, camelcamelcamel.com [&hellip;]'>Feb 02, 2012 11:55 AM &#8211; $499.95</a></li>
<li><a class='rsswidget' href='http://camelcamelcamel.com/product/B0047DVWLW?active=price_new' title='Useful URLs: Amazon.com, camelcamelcamel.com [&hellip;]'>Feb 01, 2012 09:12 PM &#8211; $499.00</a></li>
<li><a class='rsswidget' href='http://camelcamelcamel.com/product/B0047DVWLW?active=price_new' title='Useful URLs: Amazon.com, camelcamelcamel.com [&hellip;]'>Feb 01, 2012 03:58 PM &#8211; $495.99</a></li>
</ul>
<p><strong> 3rd party used price </strong></p>
<ul>
<li><a class='rsswidget' href='http://camelcamelcamel.com/product/B0047DVWLW?active=price_used' title='Useful URLs: Amazon.com, camelcamelcamel.com [&hellip;]'>Feb 04, 2012 02:33 PM &#8211; $425.00</a></li>
<li><a class='rsswidget' href='http://camelcamelcamel.com/product/B0047DVWLW?active=price_used' title='Useful URLs: Amazon.com, camelcamelcamel.com [&hellip;]'>Feb 03, 2012 07:28 PM &#8211; $424.75</a></li>
<li><a class='rsswidget' href='http://camelcamelcamel.com/product/B0047DVWLW?active=price_used' title='Useful URLs: Amazon.com, camelcamelcamel.com [&hellip;]'>Feb 02, 2012 10:35 PM &#8211; $429.99</a></li>
<li><a class='rsswidget' href='http://camelcamelcamel.com/product/B0047DVWLW?active=price_used' title='Useful URLs: Amazon.com, camelcamelcamel.com [&hellip;]'>Feb 02, 2012 11:55 AM &#8211; $419.99</a></li>
<li><a class='rsswidget' href='http://camelcamelcamel.com/product/B0047DVWLW?active=price_used' title='Useful URLs: Amazon.com, camelcamelcamel.com [&hellip;]'>Feb 01, 2012 09:12 PM &#8211; $429.75</a></li>
<li><a class='rsswidget' href='http://camelcamelcamel.com/product/B0047DVWLW?active=price_used' title='Useful URLs: Amazon.com, camelcamelcamel.com [&hellip;]'>Feb 01, 2012 03:58 PM &#8211; $415.00</a></li>
<li><a class='rsswidget' href='http://camelcamelcamel.com/product/B0047DVWLW?active=price_used' title='Useful URLs: Amazon.com, camelcamelcamel.com [&hellip;]'>Feb 01, 2012 11:18 AM &#8211; $399.00</a></li>
<li><a class='rsswidget' href='http://camelcamelcamel.com/product/B0047DVWLW?active=price_used' title='Useful URLs: Amazon.com, camelcamelcamel.com [&hellip;]'>Feb 01, 2012 02:01 AM &#8211; $410.00</a></li>
<li><a class='rsswidget' href='http://camelcamelcamel.com/product/B0047DVWLW?active=price_used' title='Useful URLs: Amazon.com, camelcamelcamel.com [&hellip;]'>Jan 31, 2012 09:32 PM &#8211; $399.00</a></li>
<li><a class='rsswidget' href='http://camelcamelcamel.com/product/B0047DVWLW?active=price_used' title='Useful URLs: Amazon.com, camelcamelcamel.com [&hellip;]'>Jan 31, 2012 04:58 PM &#8211; $390.00</a></li>
</ul>
</div>
<div class="su-tabs-pane">
<ul class="tweet_list">
<li>
<div class="tweet">
<div class="tweet_avatar">
<a class="tweet_avatar" href="https://twitter.com/satoru__t"><img src="http://a3.twimg.com/profile_images/1560840874/274944_100002080854413_7355470_n_normal.jpg" alt="satoru__t's avatar" title="satoru__t's avatar" border="0"/></a>
</div>
<div class="tweet_header">
	<a class="tweet_user" href="https://twitter.com/satoru__t">satoru__t</a> <span class="tweet_name">satoru__t</span>
</div>
<div class="tweet_text">
	iPad2を手に入れた。※会社から支給された。
</div>
<div class="tweet_footer">
	19 seconds ago <span class="tweet_footer_hidden"><a class="tweet_action tweet_reply" href="https://twitter.com/intent/tweet?in_reply_to=165992302655971329">reply</a> <a class="tweet_action tweet_retweet" href="https://twitter.com/intent/retweet?tweet_id=165992302655971329">retweet</a> <a class="tweet_action tweet_favorite" href="https://twitter.com/intent/favorite?tweet_id=165992302655971329">favorite</a></span>
</div>
</div>
</li>
<li>
<div class="tweet">
<div class="tweet_avatar">
<a class="tweet_avatar" href="https://twitter.com/LonFusha4173"><img src="http://a2.twimg.com/profile_images/1802044903/1202425382tumblr_livp6vty6T1qi0papo1_400_normal.jpg" alt="LonFusha4173's avatar" title="LonFusha4173's avatar" border="0"/></a>
</div>
<div class="tweet_header">
	<a class="tweet_user" href="https://twitter.com/LonFusha4173">LonFusha4173</a> <span class="tweet_name">Lon Fusha</span>
</div>
<div class="tweet_text">
	@<a href="http://twitter.com/Tea_bieberNce">Tea_bieberNce</a> Get a free iPad 2 on us ..xoh.me/winipad2 !
</div>
<div class="tweet_footer">
	23 seconds ago <span class="tweet_footer_hidden"><a class="tweet_action tweet_reply" href="https://twitter.com/intent/tweet?in_reply_to=165992286436593665">reply</a> <a class="tweet_action tweet_retweet" href="https://twitter.com/intent/retweet?tweet_id=165992286436593665">retweet</a> <a class="tweet_action tweet_favorite" href="https://twitter.com/intent/favorite?tweet_id=165992286436593665">favorite</a></span>
</div>
</div>
</li>
<li>
<div class="tweet">
<div class="tweet_avatar">
<a class="tweet_avatar" href="https://twitter.com/Ed_rasta"><img src="http://a3.twimg.com/profile_images/1376339409/302107991_normal.jpg" alt="Ed_rasta's avatar" title="Ed_rasta's avatar" border="0"/></a>
</div>
<div class="tweet_header">
	<a class="tweet_user" href="https://twitter.com/Ed_rasta">Ed_rasta</a> <span class="tweet_name">Eduardo Ablan</span>
</div>
<div class="tweet_text">
	RT @<a href="http://twitter.com/ChinoyNacho">ChinoyNacho</a>: RT @<a href="http://twitter.com/CompraEnUSA">CompraEnUSA</a>: Aprovecha y GANATE UN IPAD 2 ! :) &#8211;&gt; Solo síguenos @<a href="http://twitter.com/CompraEnUSA">CompraEnUSA</a> y dinos <a href="http://search.twitter.com/search?q=&#038;tag=YoQuieroElIpad2&#038;lang=all">#YoQuieroElIpad2</a> por qué debe ser tuyo !&#8230;
</div>
<div class="tweet_footer">
	24 seconds ago <span class="tweet_footer_hidden"><a class="tweet_action tweet_reply" href="https://twitter.com/intent/tweet?in_reply_to=165992281235660801">reply</a> <a class="tweet_action tweet_retweet" href="https://twitter.com/intent/retweet?tweet_id=165992281235660801">retweet</a> <a class="tweet_action tweet_favorite" href="https://twitter.com/intent/favorite?tweet_id=165992281235660801">favorite</a></span>
</div>
</div>
</li>
<li>
<div class="tweet">
<div class="tweet_avatar">
<a class="tweet_avatar" href="https://twitter.com/AldoPlouffe4516"><img src="http://a2.twimg.com/profile_images/1802065599/2107882406tumblr_lxn9dtX4Iu1qi0papo1_400_normal.jpg" alt="AldoPlouffe4516's avatar" title="AldoPlouffe4516's avatar" border="0"/></a>
</div>
<div class="tweet_header">
	<a class="tweet_user" href="https://twitter.com/AldoPlouffe4516">AldoPlouffe4516</a> <span class="tweet_name">Aldo Plouffe</span>
</div>
<div class="tweet_text">
	@<a href="http://twitter.com/SofiBelieber99">SofiBelieber99</a> Get a free iPad 2 on us ..xoh.me/winipad2 !
</div>
<div class="tweet_footer">
	30 seconds ago <span class="tweet_footer_hidden"><a class="tweet_action tweet_reply" href="https://twitter.com/intent/tweet?in_reply_to=165992257659478016">reply</a> <a class="tweet_action tweet_retweet" href="https://twitter.com/intent/retweet?tweet_id=165992257659478016">retweet</a> <a class="tweet_action tweet_favorite" href="https://twitter.com/intent/favorite?tweet_id=165992257659478016">favorite</a></span>
</div>
</div>
</li>
<li>
<div class="tweet">
<div class="tweet_avatar">
<a class="tweet_avatar" href="https://twitter.com/AlanMoore21"><img src="http://a3.twimg.com/sticky/default_profile_images/default_profile_4_normal.png" alt="AlanMoore21's avatar" title="AlanMoore21's avatar" border="0"/></a>
</div>
<div class="tweet_header">
	<a class="tweet_user" href="https://twitter.com/AlanMoore21">AlanMoore21</a> <span class="tweet_name">AlanMoore</span>
</div>
<div class="tweet_text">
	Buy Dual Electronics XGPS150A Universal Bluetooth GPS Receiver for iPad 2, iPad, iPod touch, iPhone and Other Smart  <a href="http://t.co/MNOWMCLo">t.co/MNOWMCLo</a>
</div>
<div class="tweet_footer">
	31 seconds ago <span class="tweet_footer_hidden"><a class="tweet_action tweet_reply" href="https://twitter.com/intent/tweet?in_reply_to=165992252198498304">reply</a> <a class="tweet_action tweet_retweet" href="https://twitter.com/intent/retweet?tweet_id=165992252198498304">retweet</a> <a class="tweet_action tweet_favorite" href="https://twitter.com/intent/favorite?tweet_id=165992252198498304">favorite</a></span>
</div>
</div>
</li>
<li>
<div class="tweet">
<div class="tweet_avatar">
<a class="tweet_avatar" href="https://twitter.com/AjiPrasetyo4"><img src="http://a1.twimg.com/profile_images/1514190228/247592_214891855218057_100000917316597_624934_1494812_n_normal.jpg" alt="AjiPrasetyo4's avatar" title="AjiPrasetyo4's avatar" border="0"/></a>
</div>
<div class="tweet_header">
	<a class="tweet_user" href="https://twitter.com/AjiPrasetyo4">AjiPrasetyo4</a> <span class="tweet_name">Aji Prasetyo</span>
</div>
<div class="tweet_text">
	@<a href="http://twitter.com/blink_clothesID">blink_clothesID</a> Menangkan iPad 2 &#038; ratusan hadiah lainnya dgn total 50jt!, Info lbh lanjut :  <a href="http://t.co/mfvXdQNA">t.co/mfvXdQNA</a>
</div>
<div class="tweet_footer">
	38 seconds ago <span class="tweet_footer_hidden"><a class="tweet_action tweet_reply" href="https://twitter.com/intent/tweet?in_reply_to=165992220757987329">reply</a> <a class="tweet_action tweet_retweet" href="https://twitter.com/intent/retweet?tweet_id=165992220757987329">retweet</a> <a class="tweet_action tweet_favorite" href="https://twitter.com/intent/favorite?tweet_id=165992220757987329">favorite</a></span>
</div>
</div>
</li>
<li>
<div class="tweet">
<div class="tweet_avatar">
<a class="tweet_avatar" href="https://twitter.com/CoryPluck1705"><img src="http://a2.twimg.com/profile_images/1802075774/1872618250tumblr_lnpwlmyVDz1qi0papo1_400_normal.jpg" alt="CoryPluck1705's avatar" title="CoryPluck1705's avatar" border="0"/></a>
</div>
<div class="tweet_header">
	<a class="tweet_user" href="https://twitter.com/CoryPluck1705">CoryPluck1705</a> <span class="tweet_name">Cory Pluck</span>
</div>
<div class="tweet_text">
	@<a href="http://twitter.com/tutibieber1">tutibieber1</a> Get a free iPad 2 on us ..xoh.me/winipad2 !
</div>
<div class="tweet_footer">
	45 seconds ago <span class="tweet_footer_hidden"><a class="tweet_action tweet_reply" href="https://twitter.com/intent/tweet?in_reply_to=165992194623287296">reply</a> <a class="tweet_action tweet_retweet" href="https://twitter.com/intent/retweet?tweet_id=165992194623287296">retweet</a> <a class="tweet_action tweet_favorite" href="https://twitter.com/intent/favorite?tweet_id=165992194623287296">favorite</a></span>
</div>
</div>
</li>
<li>
<div class="tweet">
<div class="tweet_avatar">
<a class="tweet_avatar" href="https://twitter.com/gfhofg"><img src="http://a2.twimg.com/profile_images/1565479912/55_normal.gif" alt="gfhofg's avatar" title="gfhofg's avatar" border="0"/></a>
</div>
<div class="tweet_header">
	<a class="tweet_user" href="https://twitter.com/gfhofg">gfhofg</a> <span class="tweet_name">Jay Womack</span>
</div>
<div class="tweet_text">
	Griffin Technology PowerJolt Plus 2 amp Power Charger for iPad, iPhone and iPod (Black)  <a href="http://t.co/jpcwuLbT">t.co/jpcwuLbT</a>
</div>
<div class="tweet_footer">
	46 seconds ago <span class="tweet_footer_hidden"><a class="tweet_action tweet_reply" href="https://twitter.com/intent/tweet?in_reply_to=165992188247941120">reply</a> <a class="tweet_action tweet_retweet" href="https://twitter.com/intent/retweet?tweet_id=165992188247941120">retweet</a> <a class="tweet_action tweet_favorite" href="https://twitter.com/intent/favorite?tweet_id=165992188247941120">favorite</a></span>
</div>
</div>
</li>
<li>
<div class="tweet">
<div class="tweet_avatar">
<a class="tweet_avatar" href="https://twitter.com/EdgarMccomb1618"><img src="http://a3.twimg.com/profile_images/1802080644/320728899tumblr_ljlrtmi6Nz1qi0papo1_400_normal.jpg" alt="EdgarMccomb1618's avatar" title="EdgarMccomb1618's avatar" border="0"/></a>
</div>
<div class="tweet_header">
	<a class="tweet_user" href="https://twitter.com/EdgarMccomb1618">EdgarMccomb1618</a> <span class="tweet_name">Edgar Mccomb</span>
</div>
<div class="tweet_text">
	@<a href="http://twitter.com/KTFNJ">KTFNJ</a> Get a free iPad 2 on us ..xoh.me/winipad2 !
</div>
<div class="tweet_footer">
	49 seconds ago <span class="tweet_footer_hidden"><a class="tweet_action tweet_reply" href="https://twitter.com/intent/tweet?in_reply_to=165992176185126913">reply</a> <a class="tweet_action tweet_retweet" href="https://twitter.com/intent/retweet?tweet_id=165992176185126913">retweet</a> <a class="tweet_action tweet_favorite" href="https://twitter.com/intent/favorite?tweet_id=165992176185126913">favorite</a></span>
</div>
</div>
</li>
<li>
<div class="tweet">
<div class="tweet_avatar">
<a class="tweet_avatar" href="https://twitter.com/FranklynFenney7"><img src="http://a2.twimg.com/profile_images/1802053896/700310818tumblr_ly27laeYMi1qi0papo1_400_normal.jpg" alt="FranklynFenney7's avatar" title="FranklynFenney7's avatar" border="0"/></a>
</div>
<div class="tweet_header">
	<a class="tweet_user" href="https://twitter.com/FranklynFenney7">FranklynFenney7</a> <span class="tweet_name">Franklyn Fenney</span>
</div>
<div class="tweet_text">
	@<a href="http://twitter.com/Daniidejustin">Daniidejustin</a> Well you can get a free iPad 2 at ..xoh.me/winipad2 !
</div>
<div class="tweet_footer">
	53 seconds ago <span class="tweet_footer_hidden"><a class="tweet_action tweet_reply" href="https://twitter.com/intent/tweet?in_reply_to=165992159533740033">reply</a> <a class="tweet_action tweet_retweet" href="https://twitter.com/intent/retweet?tweet_id=165992159533740033">retweet</a> <a class="tweet_action tweet_favorite" href="https://twitter.com/intent/favorite?tweet_id=165992159533740033">favorite</a></span>
</div>
</div>
</li>
</ul></div>
</div>
<div class="su-spacer"></div>
</div>
<p>The widget above is created purely using wordpress shortcodes. See the code below:<br />
<pre><pre class="xml" title="code">[tabs style=&quot;default&quot; title=&quot;Wordpress shortcode demo&quot;]
&nbsp;&nbsp; [tab title=&quot;Amazon Product&quot;] [amazon asin=&quot;B0047DVWLW&quot; template=&quot;Simple Ad Unit&quot;][/tab]
&nbsp;&nbsp; [tab title=&quot;Facebook Comments&quot;]
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[rsstag url=http://camelcamelcamel.com/product/B0047DVWLW/new.xml]
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[rsstag url=http://camelcamelcamel.com/product/B0047DVWLW/used.xml]
&nbsp;&nbsp; [/tab]
&nbsp;&nbsp; [tab title=&quot;Follow&quot;] [twitter_stream search=&quot;ipad 2&quot;] [/tab]
[/tabs]</pre></pre><br />
Isn&#8217;t that cool? With few lines of xml like tag, I am able to create a widget that shows the product summary, its price history and who is following it. As you can see above, I have combined 4 different shortcodes from 4 different plugins into one widget. At the high level, there are 2 kinds of shortcodes: <strong> layout </strong> and <strong> content </strong> . <strong> Layout shortcodes </strong> are helping you to present the content in a nice looking way. <strong> Content shortcodes </strong> are to help you to pull the content from different sources in a simple way.</p>
<h2>Shortcode in Template</h2>
<p>If you are creating a product detail page, you can open your wordpress editor to type in the shortcode like above. However, if you have quit a bit of products, this process will be very tedious. If you are a tech person, you could create a script to load your products&#8217; content into wordpress database&#8217;s post table. But if you want to use wordpress as the data entry UI, you can create a product detail template that leverages the shortcodes using the specific method below:</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php echo do_shortcode(&quot;[shortcode]&quot;); ?&gt;
</pre>
<p>You can also use shortcode dynamically based on the custom field setting like below:</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
if(get_post_meta($post-&gt;ID, 'gallery', true)) {
    $shortcode = get_post_meta($post-&gt;ID, 'gallery', true);
    echo do_shortcode(&quot;$shortcode&quot;);
 }
 else { echo ''; }
?&gt;
</pre>
<h2>How to create your own wordpress shortcodes?</h2>
<p>There are times you cannot find any shortcode that fits your need exactly. Two things you can do:</p>
<ol>
<li>Customize an existing one from other plugin.</li>
<li>Build one from scratch yourself.</li>
</ol>
<p>However, both require you to have good understanding how shortcodes work behind the scene. Don&#8217;t worry. It is not that difficult if you have a little bit of coding skill. To define your own wordpress shortcode, you first write a function of what you want the shortcode to do. Then you register the function via add_shortcode(tagName, functionName). Here is an example to define the shortcode name bartag with attribute foo. The extract method below taking the return of another function shortcode_atts that is used to define the default attribute value(s). If an attribute is not in this default list, it will not even be interpreted.</p>
<pre class="brush: php; title: ; notranslate">
// [bartag foo=&quot;foo-value&quot;]
  function bartag_func( $atts ) {
     extract( shortcode_atts( array(
        'foo' =&gt; 'something',
        'bar' =&gt; 'something else',
     ), $atts ) );
    return &quot;foo = {$foo}&quot;;
  }
  add_shortcode( 'bartag', 'bartag_func' );
</pre>
<p>Now you have an good idea how to define a function. Here we are going to create a shortcode to make Google chart creation easier (ie. no need to remember the parameters and url).</p>
<p>Creating a Google chart is quite simple, you just need to simply define a url under &#8220;img&#8221; will do the magic. However, the url uses some short parameters that you may need to look them up in order to create the url correctly. To make it easier, we create the shortcode above to make the parameters more explicit and hide the google url for you. With this shortcode, now you can create a sparkline chart as following.</p>
<pre class="brush: php; title: ; notranslate">
function chart_shortcode( $atts ) {
   extract(shortcode_atts(array(
     'data' =&gt; '',
     'colors' =&gt; '',
     'size' =&gt; '400x200',
     'bg' =&gt; 'ffffff',
     'title' =&gt; '',
     'labels' =&gt; '',
     'advanced' =&gt; '',
     'type' =&gt; 'pie'
   ), $atts));

switch ($type) {
case 'line' :
   $charttype = 'lc'; break;
case 'xyline' :
   $charttype = 'lxy'; break;
case 'sparkline' :
   $charttype = 'ls'; break;
case 'meter' :
   $charttype = 'gom'; break;
case 'scatter' :
   $charttype = 's'; break;
case 'venn' :
   $charttype = 'v'; break;
case 'pie' :
   $charttype = 'p3'; break;
case 'pie2d' :
   $charttype = 'p'; break;
default :
   $charttype = $type;
break;
}

if ($title) $string .= '&amp;chtt='.$title.'';
if ($labels) $string .= '&amp;chl='.$labels.'';
if ($colors) $string .= '&amp;chco='.$colors.'';
$string .= '&amp;chs='.$size.'';
$string .= '&amp;chd=t:'.$data.'';
$string .= '&amp;chf='.$bg.'';

return '&lt;img title=&quot;'.$title.'&quot; src=&quot;http://chart.apis.google.com/chart?cht='.$charttype.''.$string.$advanced.'&quot; alt=&quot;'.$title.'&quot; /&gt;';
}
add_shortcode('chart', 'chart_shortcode');
</pre>
<p>After you write this code, save it under plugin file named google-chart.php and put the following header above the function.</p>
<pre class="brush: php; title: ; notranslate">

&lt;?php
/**
* @package Google Chart
* @version 1.0
*/
/*
Plugin Name: Google Chart Shortcode
Plugin URI:
Description: This is google chart shortcode plugin
Author: Raymond Hon
Version: 1.0
Author URI: http://www.solutionhacker.com
*/

...

&lt;/php&gt;
</pre>
<p>Then you can activate this plugin in WordPress. If it is activated, you can put the following wordpress shortcode in your post and generate the chart as below:</p>
<p style="text-align: center;"><img title="" src="http://chart.apis.google.com/chart?cht=ls&#038;chs=200x100&#038;chd=t:0,12,24,26,32,64,54,24,22,20,8,2,0,0,3&#038;chf=F7F9FA" alt="" /></p>
<p style="text-align: left;">[chart data="0,12,24,26,32,64,54,24,22,20,8,2,0,0,3" bg="F7F9FA" size="200x100" type="sparkline"]</p>
<h2 style="text-align: left;">When wordpress shortcode meets custom fields in post</h2>
<p>Congratulation! If you follow my tutorial above, you have just equipped the key skill that can take your wordpress website to the next level.  However, I am not going to stop here. I would like to show you how you can use shortcode with custom field. First, you can write a shortcode to extract custom field value and use it in your post. To do that, you can build a plugin following the code below:</p>
<pre class="brush: php; title: ; notranslate">
add_shortcode('field', 'shortcode_field');
function shortcode_field($atts){
     extract(shortcode_atts(array(
                  'post_id' =&gt; NULL,
               ), $atts));
  if(!isset($atts[0])) return;
       $field = esc_attr($atts[0]);
       global $post;
       $post_id = (NULL === $post_id) ? $post-&gt;ID : $post_id;
       return get_post_meta($post_id, $field, true);
}
</pre>
<p>Once you can extract the custom field from post using shortcode, you can use it for UI and/ or post content.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.solutionhacker.com/online-marketing/mastering-wordpress-shortcode/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Top Programmer Code Practice</title>
		<link>http://www.solutionhacker.com/implement-your-idea/design/top-programmer-code-practice/</link>
		<comments>http://www.solutionhacker.com/implement-your-idea/design/top-programmer-code-practice/#comments</comments>
		<pubDate>Sat, 26 Nov 2011 06:53:03 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Design]]></category>

		<guid isPermaLink="false">http://www.solutionhacker.com/?p=236</guid>
		<description><![CDATA[<h2>Information Hiding</h2>
<ol>
	<li>Promote <strong>encapsulation</strong> and <strong>data hiding</strong></li>
	<li>Expose clean API and achieve high decoupling and in turn promote reusability. So, modules can be developed in parallel and fix in isolation.</li>
	<li>Achieved in Java by access control (public, protected, package-private, private). Top level (non-nested) class can only be package-private and private. Public imposes maintenance cost! Once your API public or protected access, you must support it.</li>
	<li>If a class A is only used by one class B, consider to make A private nested class of B.</li>
	<li>Instance fields should never be public. Public mutable field is not thread-safe whereas public immutable field limits you from changing data type. Even you expose constant value, make sure it is public static final on a primitive or on a reference to an immutable object. NOTE: Array is mutable. Use immutable List instead.</li>
	<li>There is one rule that restricts your ability to reduce accessibility of methods. If a method overrides a superclass method, it is not permitted to have a lower access level in the subclass.</li>
</ol>
<h2>Code Against Interface</h2>
<h2>Promote Immutability</h2>
<ol>
	<li>Make its properties private and final</li>
	<li>Take away any API that can change its properties</li>
	<li>Make your class &#34;final&#34; to prevent subclassing.</li>
	<li>Immutable object can be shared and thread-safe</li>
</ol>
<h2>Favor Composition over Inheritance</h2>
<ol>
	<li>It is safe to use inheritance within a package but not cross package</li>
	<li>It is also safe to use inheritance when extending classes specifically designed and documented for extension.</li>
	<li>Interface inheritance is good. The above rules apply to implementation inheritance b/c it will violate encapsulation as subclass depends on implementation details of its superclass and superclass may change from release to release. Sometimes, superclass may break your security rules that you impose on the subclass. To avoid those problems as a whole, use composition. Along with forwarding class, the design is clean.</li>
</ol>
<h2>Scalability vs Performance</h2>
<p>Performance measures whether an application can respond to a request within its defined service-level agreement (SLA). Scalability measures how well an application can maintain its performance under increasing load.</p>
<ol>
	<li><strong>Horizontal scaling</strong> - To scale your system horizontally, the key problem you need to solve is how to replicate the state effectively. <strong>Serialization</strong> is primitive as it will replicate the full state (can be big) even one small field is changed. This approach&#39;s inefficiency hinders linear scalability. To overcome the limitations of Java serialization, <strong>Terracotta</strong> uses <em>bytecode instrumentation</em> (BCI) in the Terracotta client to <strong>identify the exact properties </strong>within stateful objects that change and then replicate <strong>only</strong> those properties across the cluster (fine-grained replication). Bytecode instrumentation is a process through which an application&#39;s behavior can be modified at runtime. <strong>NOTE: Bytecode instrumentation</strong> is a process through which an application&#39;s behavior can be modified at runtime. Terracotta uses BCI to <strong>intercept change</strong>s made to objects so that it can identify those changes and send them to the <strong>Terracotta server</strong> (hmm, it is not purely peer to peer approach).</li>
</ol>
]]></description>
			<content:encoded><![CDATA[<h2>Information Hiding</h2>
<ol>
<li>Promote <strong>encapsulation</strong> and <strong>data hiding</strong></li>
<li>Expose clean API and achieve high decoupling and in turn promote reusability. So, modules can be developed in parallel and fix in isolation.</li>
<li>Achieved in Java by access control (public, protected, package-private, private). Top level (non-nested) class can only be package-private and private. Public imposes maintenance cost! Once your API public or protected access, you must support it.</li>
<li>If a class A is only used by one class B, consider to make A private nested class of B.</li>
<li>Instance fields should never be public. Public mutable field is not thread-safe whereas public immutable field limits you from changing data type. Even you expose constant value, make sure it is public static final on a primitive or on a reference to an immutable object. NOTE: Array is mutable. Use immutable List instead.</li>
<li>There is one rule that restricts your ability to reduce accessibility of methods. If a method overrides a superclass method, it is not permitted to have a lower access level in the subclass.</li>
</ol>
<h2>Code Against Interface</h2>
<h2>Promote Immutability</h2>
<ol>
<li>Make its properties private and final</li>
<li>Take away any API that can change its properties</li>
<li>Make your class &quot;final&quot; to prevent subclassing.</li>
<li>Immutable object can be shared and thread-safe</li>
</ol>
<h2>Favor Composition over Inheritance</h2>
<ol>
<li>It is safe to use inheritance within a package but not cross package</li>
<li>It is also safe to use inheritance when extending classes specifically designed and documented for extension.</li>
<li>Interface inheritance is good. The above rules apply to implementation inheritance b/c it will violate encapsulation as subclass depends on implementation details of its superclass and superclass may change from release to release. Sometimes, superclass may break your security rules that you impose on the subclass. To avoid those problems as a whole, use composition. Along with forwarding class, the design is clean.</li>
</ol>
<h2>Scalability vs Performance</h2>
<p>Performance measures whether an application can respond to a request within its defined service-level agreement (SLA). Scalability measures how well an application can maintain its performance under increasing load.</p>
<ol>
<li><strong>Horizontal scaling</strong> &#8211; To scale your system horizontally, the key problem you need to solve is how to replicate the state effectively. <strong>Serialization</strong> is primitive as it will replicate the full state (can be big) even one small field is changed. This approach&#39;s inefficiency hinders linear scalability. To overcome the limitations of Java serialization, <strong>Terracotta</strong> uses <em>bytecode instrumentation</em> (BCI) in the Terracotta client to <strong>identify the exact properties </strong>within stateful objects that change and then replicate <strong>only</strong> those properties across the cluster (fine-grained replication). Bytecode instrumentation is a process through which an application&#39;s behavior can be modified at runtime. <strong>NOTE: Bytecode instrumentation</strong> is a process through which an application&#39;s behavior can be modified at runtime. Terracotta uses BCI to <strong>intercept change</strong>s made to objects so that it can identify those changes and send them to the <strong>Terracotta server</strong> (hmm, it is not purely peer to peer approach).</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.solutionhacker.com/implement-your-idea/design/top-programmer-code-practice/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hacking CSS</title>
		<link>http://www.solutionhacker.com/uncategorized/hacking-css/</link>
		<comments>http://www.solutionhacker.com/uncategorized/hacking-css/#comments</comments>
		<pubDate>Sat, 08 Jan 2011 03:28:22 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[6. Uncategorized]]></category>

		<guid isPermaLink="false">http://www.solutionhacker.com/?p=484</guid>
		<description><![CDATA[<p>Recently, I have built some of the websites from church and friends via Wordpress, a popular blogging/ CMS system. Being very impressed by the quality of the themes and rich plug-ins, I decide to take a step further to learn about the Wordpress programming model. I can do that via writing my simple Hello world plugin. However, it doesn&#39;t allow me to grasp the full power of Wordpress framework. So, I decide to study about a sophisticated Wordpress theme and find out how it integrated with Wordpress and leveraged its plug-ins. To do that, I need to ramp up CSS, PHP in few days. This article is the quick note that summarized what I have learnt about CSS. Hope it is helpful to you as well.</p>
<p><!--more--></p>
<h2>Class and ID Selector</h2>
<blockquote>
	<p>/* The difference between an ID and a class is that an ID can be used to identify <br />
		one element, whereas a class can be used to identify more than one. */</p>
	<p>/* class selector */<br />
		.intro<br />
		<br />
		/* id selector*/<br />
		#top<br />
		<br />
		/* built-in html element (no need to put symbol) */<br />
		p<br />
		<br />
		/* locate specific element - paragraph with class=jam <br />
		&#160;&#160; (for example &#60;p class=jam&#62;xxx&#60;/p&#62;) */<br />
		p.jam {xxxx}&#160; <br />
		<br />
		/* apply grouping */<br />
		h2, .thisClass, .thatClass {...}<br />
		<br />
		/* nested selector */<br />
		#top{...}<br />
		#top h1{...}<br />
		<br />
		/* state of an element (ex. link) */<br />
		a.snowman:link<br />
		a.snowman:visited<br />
		a.snowman:active<br />
		a.snowman:hover<br />
		<br />
		/* shorthand : margin, padding, border-width where th<br />
		p {<br />
		&#160;&#160;&#160; border-top-width: 1px;<br />
		&#160;&#160;&#160; border-right-width: 5px;<br />
		&#160;&#160;&#160; border-bottom-width: 10px;<br />
		&#160;&#160;&#160; border-left-width: 20px;<br />
		}<br />
		<br />
		//can be<br />
		p {<br />
		&#160;&#160;&#160; border-width: 1px 5px 10px 20px;<br />
		}<br />
		<br />
		//border-width, border-color and border-style shorthand<br />
		p {<br />
		&#160;&#160;&#160; border: 1px red solid;<br />
		}<br />
		<br />
		margin: 1em 10em; // top/bottom = 1em, left/right = 10em<br />
		<br />
		//background-color, background-image, background-repeat, background-position<br />
		body {<br />
		&#160;&#160;&#160; background: white url(<a class="linkification-ext" href="http://www.htmldog.com/images/bg.gif" title="Linkification: http://www.htmldog.com/images/bg.gif">http://www.htmldog.com/images/bg.gif</a>) no-repeat top right;<br />
		}</p>
</blockquote>
<p>&#160;</p>
<h2>Box Model</h2>
<p>All html tags/ elements in html can be think of within its own box/ container. And it can be aligned on the screen in accordance with the CSS box model. Here is the box model in diagram:</p>
<p><a href="http://www.solutionhacker.com/wp-content/uploads/box-model.gif"><img alt="" class="aligncenter size-full wp-image-486" height="317" src="http://www.solutionhacker.com/wp-content/uploads/box-model.gif" title="box-model" width="433" /></a></p>
<p>I keep forgetting where is margin and padding. So, I use the word &#34;MBP&#34; to help me out where M=margin, B=border, P=padding. ;)</p>
<p>At the first glance, it is all about spacing between an element and its neighbors. However, when I see how creative people leverage <a href="http://www.smashingmagazine.com/2009/07/27/the-definitive-guide-to-using-negative-margins/">negative margin</a>. I think it is good to write about it. For margin like &#34;margin: 0px -30px 0px 0px;&#34;,</p>
<p>&#160;</p>
<h2>Display Flow</h2>
<p>Once you understand how the spacing of an element, you need to under the display flow. <strong>Block element</strong> (div, p, h1) will display in an newline while <strong>Inline element</strong> (span, a, img) will display without open up an newline. You can take an element out from its flow via explicitly setting its display properties: <strong>inline, block and none</strong>. &#34;none&#34; here means not showing it at all. The difference between &#34;<strong>display:none</strong>&#34; and &#34;<strong>visibility:hidden</strong>&#34; is &#34;display:none&#34; will take the element out from the flow, so it will not leave an empty space on screen. For example when you want to print an article, you want to just print its content. So, you will do:</p>
<blockquote>
	<p>#navigation, #seeAlso, #comments, #standards {<br />
		&#160;&#160;&#160; display: none;<br />
		}</p>
</blockquote>
<p>To take an element out from the display flow but still showing it, there are 2 common ways:</p>
<ol>
	<li>Floating</li>
	<li>Positioning</li>
</ol>
<p>I will cover these in the layout section.</p>
<h2>Layout</h2>
<p><br />
	margin: -30px 0 15px 0; (clockwise: top, right, bottom, left)<br />
	Imagine margin is like a photo white border that make your photo bigger in size and it is often enforced. <br />
	So, if a photo has margin inside a div like &#34;right 50&#34; and it is <br />
	floating right as well. Because external container doesn&#39;t moved by internal element, margin-right 50 <br />
	will push the photo leftward by 50px instead. And -ve margin here will do the opposite. <br />
	<br />
	When static element (ie. no float) is given a -ve margin on top, left, it pulls the element in that specified direction.<br />
	But for bottom and left, it doesn&#39;t move but move the content surrounding towards it (ie. overlap with it). <br />
	<br />
	Possibility:<br />
	(1) use list to build a table<br />
	(2) Overlap to add emphasis<br />
	(3) Smashing 3D effect for Bevel text<br />
	(4) Layout - Flexible Document Structure<br />
	<br />
	Using negative margins with floats sometimes pisses off older browsers. Some symptoms include:<br />
	<br />
	&#160;&#160;&#160; * Making links unclickable<br />
	&#160;&#160;&#160; * Text becomes difficult to select<br />
	&#160;&#160;&#160; * Tabbing any links disappears when you lose focus<br />
	<br />
	Solution: Just add position:relative and it works!</p>
<h2><br />
	<br />
	Layout</h2>
<h3>Positioning</h3>
<p>position has 4 options: <strong>absolute, relative, static and fixed</strong></p>
<ul>
	<li><strong>absolute</strong> will take the element out from the flow and use top, left, buttom and left coordinate to locate it</li>
	<li><strong>fixed</strong> did the same as absolute but it will not move even u scroll the browser.</li>
</ul>
<h3>Floating</h3>
<p>floating an element will shift it to the right or left of a line, with surrounding content flowing around it. If you don&#39;t want the next element to wrap around the floating object, you can apply the clear property like:<strong> clear:left, clear:right and clear:both</strong></p>
<h2>@ Rules</h2>
<blockquote>
	<p>/* attach a set of css to another css file */<br />
		@import url(xyz.css);&#160; <br />
		<br />
		/* apply its content to a specified media (ex. all, aural, handheld, print, <br />
		&#160;&#160; projection, screen): IE just takes all, screen, print */<br />
		@media print{<br />
		&#160;&#160;&#160; body {xxxx}<br />
		&#160;&#160;&#160; ...<br />
		}<br />
		<br />
		/* embedded external font (not all browser supports it) */<br />
		@font-face {<br />
		&#160;&#160;&#160; font-family: somerandomfontname;<br />
		&#160;&#160;&#160; src: url(somefont.eot);<br />
		&#160;&#160;&#160; font-weight: bold;<br />
		}<br />
		<br />
		p {<br />
		&#160;&#160;&#160; font-family: somerandomfontname;<br />
		&#160;&#160;&#160; font-weight: bold;<br />
		}<br />
		&#160;</p>
</blockquote>
<h2>Reference</h2>
<p><br />
	ref: <a class="linkification-ext" href="http://www.smashingmagazine.com/2009/07/27/the-definitive-guide-to-using-negative-margins/" title="Linkification: http://www.smashingmagazine.com/2009/07/27/the-definitive-guide-to-using-negative-margins/">http://www.smashingmagazine.com/2009/07/27/the-definitive-guide-to-using-negative-margins/</a><br />
	ref: <a class="linkification-ext" href="http://www.htmldog.com/guides/cssbeginner/" title="Linkification: http://www.htmldog.com/guides/cssbeginner/">http://www.htmldog.com/guides/cssbeginner/</a><br />
	ref: <a class="linkification-ext" href="http://www.htmldog.com/reference/cssproperties/" title="Linkification: http://www.htmldog.com/reference/cssproperties/">http://www.htmldog.com/reference/cssproperties/</a><br />
	<a class="linkification-ext" href="http://devzone.zend.com/article/627" title="Linkification: http://devzone.zend.com/article/627">http://devzone.zend.com/article/627</a></p>
]]></description>
			<content:encoded><![CDATA[<p>Recently, I have built some of the websites from church and friends via WordPress, a popular blogging/ CMS system. Being very impressed by the quality of the themes and rich plug-ins, I decide to take a step further to learn about the WordPress programming model. I can do that via writing my simple Hello world plugin. However, it doesn&#39;t allow me to grasp the full power of WordPress framework. So, I decide to study about a sophisticated WordPress theme and find out how it integrated with WordPress and leveraged its plug-ins. To do that, I need to ramp up CSS, PHP in few days. This article is the quick note that summarized what I have learnt about CSS. Hope it is helpful to you as well.</p>
<p><span id="more-484"></span></p>
<h2>Class and ID Selector</h2>
<blockquote>
<p>/* The difference between an ID and a class is that an ID can be used to identify <br />
		one element, whereas a class can be used to identify more than one. */</p>
<p>/* class selector */<br />
		.intro</p>
<p>		/* id selector*/<br />
		#top</p>
<p>		/* built-in html element (no need to put symbol) */<br />
		p</p>
<p>		/* locate specific element &#8211; paragraph with class=jam <br />
		&nbsp;&nbsp; (for example &lt;p class=jam&gt;xxx&lt;/p&gt;) */<br />
		p.jam {xxxx}&nbsp; </p>
<p>		/* apply grouping */<br />
		h2, .thisClass, .thatClass {&#8230;}</p>
<p>		/* nested selector */<br />
		#top{&#8230;}<br />
		#top h1{&#8230;}</p>
<p>		/* state of an element (ex. link) */<br />
		a.snowman:link<br />
		a.snowman:visited<br />
		a.snowman:active<br />
		a.snowman:hover</p>
<p>		/* shorthand : margin, padding, border-width where th<br />
		p {<br />
		&nbsp;&nbsp;&nbsp; border-top-width: 1px;<br />
		&nbsp;&nbsp;&nbsp; border-right-width: 5px;<br />
		&nbsp;&nbsp;&nbsp; border-bottom-width: 10px;<br />
		&nbsp;&nbsp;&nbsp; border-left-width: 20px;<br />
		}</p>
<p>		//can be<br />
		p {<br />
		&nbsp;&nbsp;&nbsp; border-width: 1px 5px 10px 20px;<br />
		}</p>
<p>		//border-width, border-color and border-style shorthand<br />
		p {<br />
		&nbsp;&nbsp;&nbsp; border: 1px red solid;<br />
		}</p>
<p>		margin: 1em 10em; // top/bottom = 1em, left/right = 10em</p>
<p>		//background-color, background-image, background-repeat, background-position<br />
		body {<br />
		&nbsp;&nbsp;&nbsp; background: white url(<a class="linkification-ext" href="http://www.htmldog.com/images/bg.gif" title="Linkification: http://www.htmldog.com/images/bg.gif">http://www.htmldog.com/images/bg.gif</a>) no-repeat top right;<br />
		}</p>
</blockquote>
<p>&nbsp;</p>
<h2>Box Model</h2>
<p>All html tags/ elements in html can be think of within its own box/ container. And it can be aligned on the screen in accordance with the CSS box model. Here is the box model in diagram:</p>
<p><a href="http://www.solutionhacker.com/wp-content/uploads/box-model.gif"><img alt="" class="aligncenter size-full wp-image-486" height="317" src="http://www.solutionhacker.com/wp-content/uploads/box-model.gif" title="box-model" width="433" /></a></p>
<p>I keep forgetting where is margin and padding. So, I use the word &quot;MBP&quot; to help me out where M=margin, B=border, P=padding. <img src='http://www.solutionhacker.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>At the first glance, it is all about spacing between an element and its neighbors. However, when I see how creative people leverage <a href="http://www.smashingmagazine.com/2009/07/27/the-definitive-guide-to-using-negative-margins/">negative margin</a>. I think it is good to write about it. For margin like &quot;margin: 0px -30px 0px 0px;&quot;,</p>
<p>&nbsp;</p>
<h2>Display Flow</h2>
<p>Once you understand how the spacing of an element, you need to under the display flow. <strong>Block element</strong> (div, p, h1) will display in an newline while <strong>Inline element</strong> (span, a, img) will display without open up an newline. You can take an element out from its flow via explicitly setting its display properties: <strong>inline, block and none</strong>. &quot;none&quot; here means not showing it at all. The difference between &quot;<strong>display:none</strong>&quot; and &quot;<strong>visibility:hidden</strong>&quot; is &quot;display:none&quot; will take the element out from the flow, so it will not leave an empty space on screen. For example when you want to print an article, you want to just print its content. So, you will do:</p>
<blockquote>
<p>#navigation, #seeAlso, #comments, #standards {<br />
		&nbsp;&nbsp;&nbsp; display: none;<br />
		}</p>
</blockquote>
<p>To take an element out from the display flow but still showing it, there are 2 common ways:</p>
<ol>
<li>Floating</li>
<li>Positioning</li>
</ol>
<p>I will cover these in the layout section.</p>
<h2>Layout</h2>
<p>
	margin: -30px 0 15px 0; (clockwise: top, right, bottom, left)<br />
	Imagine margin is like a photo white border that make your photo bigger in size and it is often enforced. <br />
	So, if a photo has margin inside a div like &quot;right 50&quot; and it is <br />
	floating right as well. Because external container doesn&#39;t moved by internal element, margin-right 50 <br />
	will push the photo leftward by 50px instead. And -ve margin here will do the opposite. </p>
<p>	When static element (ie. no float) is given a -ve margin on top, left, it pulls the element in that specified direction.<br />
	But for bottom and left, it doesn&#39;t move but move the content surrounding towards it (ie. overlap with it). </p>
<p>	Possibility:<br />
	(1) use list to build a table<br />
	(2) Overlap to add emphasis<br />
	(3) Smashing 3D effect for Bevel text<br />
	(4) Layout &#8211; Flexible Document Structure</p>
<p>	Using negative margins with floats sometimes pisses off older browsers. Some symptoms include:</p>
<p>	&nbsp;&nbsp;&nbsp; * Making links unclickable<br />
	&nbsp;&nbsp;&nbsp; * Text becomes difficult to select<br />
	&nbsp;&nbsp;&nbsp; * Tabbing any links disappears when you lose focus</p>
<p>	Solution: Just add position:relative and it works!</p>
<h2>
<p>	Layout</h2>
<h3>Positioning</h3>
<p>position has 4 options: <strong>absolute, relative, static and fixed</strong></p>
<ul>
<li><strong>absolute</strong> will take the element out from the flow and use top, left, buttom and left coordinate to locate it</li>
<li><strong>fixed</strong> did the same as absolute but it will not move even u scroll the browser.</li>
</ul>
<h3>Floating</h3>
<p>floating an element will shift it to the right or left of a line, with surrounding content flowing around it. If you don&#39;t want the next element to wrap around the floating object, you can apply the clear property like:<strong> clear:left, clear:right and clear:both</strong></p>
<h2>@ Rules</h2>
<blockquote>
<p>/* attach a set of css to another css file */<br />
		@import url(xyz.css);&nbsp; </p>
<p>		/* apply its content to a specified media (ex. all, aural, handheld, print, <br />
		&nbsp;&nbsp; projection, screen): IE just takes all, screen, print */<br />
		@media print{<br />
		&nbsp;&nbsp;&nbsp; body {xxxx}<br />
		&nbsp;&nbsp;&nbsp; &#8230;<br />
		}</p>
<p>		/* embedded external font (not all browser supports it) */<br />
		@font-face {<br />
		&nbsp;&nbsp;&nbsp; font-family: somerandomfontname;<br />
		&nbsp;&nbsp;&nbsp; src: url(somefont.eot);<br />
		&nbsp;&nbsp;&nbsp; font-weight: bold;<br />
		}</p>
<p>		p {<br />
		&nbsp;&nbsp;&nbsp; font-family: somerandomfontname;<br />
		&nbsp;&nbsp;&nbsp; font-weight: bold;<br />
		}<br />
		&nbsp;</p>
</blockquote>
<h2>Reference</h2>
<p>
	ref: <a class="linkification-ext" href="http://www.smashingmagazine.com/2009/07/27/the-definitive-guide-to-using-negative-margins/" title="Linkification: http://www.smashingmagazine.com/2009/07/27/the-definitive-guide-to-using-negative-margins/">http://www.smashingmagazine.com/2009/07/27/the-definitive-guide-to-using-negative-margins/</a><br />
	ref: <a class="linkification-ext" href="http://www.htmldog.com/guides/cssbeginner/" title="Linkification: http://www.htmldog.com/guides/cssbeginner/">http://www.htmldog.com/guides/cssbeginner/</a><br />
	ref: <a class="linkification-ext" href="http://www.htmldog.com/reference/cssproperties/" title="Linkification: http://www.htmldog.com/reference/cssproperties/">http://www.htmldog.com/reference/cssproperties/</a><br />
	<a class="linkification-ext" href="http://devzone.zend.com/article/627" title="Linkification: http://devzone.zend.com/article/627">http://devzone.zend.com/article/627</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.solutionhacker.com/uncategorized/hacking-css/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Session Management – Part 1</title>
		<link>http://www.solutionhacker.com/implement-your-idea/build-your-website/session-management-part-1/</link>
		<comments>http://www.solutionhacker.com/implement-your-idea/build-your-website/session-management-part-1/#comments</comments>
		<pubDate>Wed, 29 Dec 2010 06:36:54 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[Scale]]></category>
		<category><![CDATA[Site Building]]></category>
		<category><![CDATA[cookie]]></category>
		<category><![CDATA[Keep-Alive]]></category>
		<category><![CDATA[persistence connection]]></category>
		<category><![CDATA[scalability]]></category>
		<category><![CDATA[session]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://www.solutionhacker.com/?p=234</guid>
		<description><![CDATA[<p><strong>Session management </strong>is one of the key topics that all serious web developers and architects need to master with. This article will go through several key topics with you. They are:</p>
<ul>
	<li><strong>Persistence vs non-persistence web connection</strong> - web performance!</li>
	<li><strong>Concerns of using cookie</strong> - security and size limitations</li>
	<li><strong>Server side session management challenges</strong> in <strong>scalable</strong> web application</li>
	<li><strong>Achieve linear scalability through stateless servers </strong>- start moving the session to the client</li>
</ul>
<p>Today, I will start walking through all these topics at a high level. A series of articles will be written to further develop on each topic if necessary. Lets start!</p>
<p><!--more--></p>
<h3><strong>Persistence vs non-persistence web connection</strong></h3>
<ol>
	<li>Before HTTP 1.1, HTTP is a <strong>stateless</strong> protocol that doesn&#39;t maintain persistence connection. Each request made by a Web browser, for an image, an HTML page, or other Web object, is made via a <strong>new</strong> connection.</li>
	<li>HTTP 1.1 introduced persistence connection (ie. <strong>Keep-Alive</strong>) that Web browser can established a <strong>single</strong> connection, through which multiple requests could be made.</li>
	<li>But before HTTP 1.1, how can state maintain across <strong>stateless</strong> HTTP request?<br />
		<ul>
			<li>Normally, we keep the <strong>session</strong> in the server side and provide the <strong>session id</strong> to the client that can be used to link subsequent requests to the same session.</li>
			<li>Normally, client (often time web client) will store the session id in <strong>cookie</strong>.</li>
			<li>However, if the cookie is disabled, the session id will normally embedded in the URL (ie <strong>URL Rewriting</strong>).</li>
		</ul>
	</li>
</ol>
<h3><strong>Concerns of using cookie</strong></h3>
<p>What do we need to pay attention when we store info in cookie?</p>
<ol>
	<li>Size limitation and security concerns.</li>
	<li>How long cookie can last? Default = expired when browser exits. In Java, you can do <strong>cookie.setMaxAge(int)</strong> with long future date if you want to keep the info lasting long in the cookie. If you do <strong>setMaxAge(0)</strong>, it will void the cookie.</li>
	<li>Normally, we don&#39;t keep all state info in cookie as the information could be sensitive and we are not able to protect it because it sits in the clients&#39; filesystem. Apart from that, there has limitation in size as well. For these two concerns, we normally just store the session id in the cookie and keep the session in the server side. This approach can save us bandwidth as well.</li>
</ol>
<h3><strong>Server side session management challenges</strong></h3>
<p>At the first glance, session in server side sounds like a great solution. However, when it comes to scale, it always raises the concerns. Imagine you need to replicate client session state across multiple servers to achieve high availability. Both the replication time and memory resource limit will cause your system not able to scale linearly. To solve or minimize this, we selectively pick what kind of info we store in the session, use <strong>sticky</strong> session to avoid one session replication across all the machine or even try to store the state to the client if possible like using rich client UI (ex. <strong>Flex</strong> and <strong>Silverlight</strong>). <span style="color: rgb(0, 128, 0);">A post will be written about this topic later on.</span></p>
<h3>Transient vs Persistent State</h3>
<ol>
	<li>Session in the server can be timed out (~30 minute inactive)</li>
	<li>Session in the server can be persisted in file across Tomcat restart.</li>
	<li><strong>Persistent state</strong> should be stored in database.</li>
	<li>Object putting in session should be <strong>Serializable</strong></li>
	<li>Avoid putting too much info in the session b/c we don&#39;t want to put too much baggage during <strong>session replication</strong>. One server crash b/c of memory depletion can further spread across to other servers via session replication. Not Good! Should we reconsider storing session in client? This <a href="http://dharmeshmistry.wordpress.com/2008/07/18/client-side-session-management/">article</a> talks about it.</li>
	<li>Session replication is needed to support failover. Sticky session for simplicity but suffered data lost when the box is down. We can tell one or two servers as its backup to avoid the session lost. To go for sticky session approach, we need to identify the &#34;sticky&#34; part. What kind of thing we can use to link separate requests? Use <strong>IP address</strong> can potentially overload a box because some Internet service providers use a set of proxy servers to deal with many clients. <span style="color: rgb(0, 128, 0);">This subject can be further developed. We will go back to it later!</span></li>
</ol>
]]></description>
			<content:encoded><![CDATA[<p><strong>Session management </strong>is one of the key topics that all serious web developers and architects need to master with. This article will go through several key topics with you. They are:</p>
<ul>
<li><strong>Persistence vs non-persistence web connection</strong> &#8211; web performance!</li>
<li><strong>Concerns of using cookie</strong> &#8211; security and size limitations</li>
<li><strong>Server side session management challenges</strong> in <strong>scalable</strong> web application</li>
<li><strong>Achieve linear scalability through stateless servers </strong>- start moving the session to the client</li>
</ul>
<p>Today, I will start walking through all these topics at a high level. A series of articles will be written to further develop on each topic if necessary. Lets start!</p>
<p><span id="more-234"></span></p>
<h3><strong>Persistence vs non-persistence web connection</strong></h3>
<ol>
<li>Before HTTP 1.1, HTTP is a <strong>stateless</strong> protocol that doesn&#39;t maintain persistence connection. Each request made by a Web browser, for an image, an HTML page, or other Web object, is made via a <strong>new</strong> connection.</li>
<li>HTTP 1.1 introduced persistence connection (ie. <strong>Keep-Alive</strong>) that Web browser can established a <strong>single</strong> connection, through which multiple requests could be made.</li>
<li>But before HTTP 1.1, how can state maintain across <strong>stateless</strong> HTTP request?
<ul>
<li>Normally, we keep the <strong>session</strong> in the server side and provide the <strong>session id</strong> to the client that can be used to link subsequent requests to the same session.</li>
<li>Normally, client (often time web client) will store the session id in <strong>cookie</strong>.</li>
<li>However, if the cookie is disabled, the session id will normally embedded in the URL (ie <strong>URL Rewriting</strong>).</li>
</ul>
</li>
</ol>
<h3><strong>Concerns of using cookie</strong></h3>
<p>What do we need to pay attention when we store info in cookie?</p>
<ol>
<li>Size limitation and security concerns.</li>
<li>How long cookie can last? Default = expired when browser exits. In Java, you can do <strong>cookie.setMaxAge(int)</strong> with long future date if you want to keep the info lasting long in the cookie. If you do <strong>setMaxAge(0)</strong>, it will void the cookie.</li>
<li>Normally, we don&#39;t keep all state info in cookie as the information could be sensitive and we are not able to protect it because it sits in the clients&#39; filesystem. Apart from that, there has limitation in size as well. For these two concerns, we normally just store the session id in the cookie and keep the session in the server side. This approach can save us bandwidth as well.</li>
</ol>
<h3><strong>Server side session management challenges</strong></h3>
<p>At the first glance, session in server side sounds like a great solution. However, when it comes to scale, it always raises the concerns. Imagine you need to replicate client session state across multiple servers to achieve high availability. Both the replication time and memory resource limit will cause your system not able to scale linearly. To solve or minimize this, we selectively pick what kind of info we store in the session, use <strong>sticky</strong> session to avoid one session replication across all the machine or even try to store the state to the client if possible like using rich client UI (ex. <strong>Flex</strong> and <strong>Silverlight</strong>). <span style="color: rgb(0, 128, 0);">A post will be written about this topic later on.</span></p>
<h3>Transient vs Persistent State</h3>
<ol>
<li>Session in the server can be timed out (~30 minute inactive)</li>
<li>Session in the server can be persisted in file across Tomcat restart.</li>
<li><strong>Persistent state</strong> should be stored in database.</li>
<li>Object putting in session should be <strong>Serializable</strong></li>
<li>Avoid putting too much info in the session b/c we don&#39;t want to put too much baggage during <strong>session replication</strong>. One server crash b/c of memory depletion can further spread across to other servers via session replication. Not Good! Should we reconsider storing session in client? This <a href="http://dharmeshmistry.wordpress.com/2008/07/18/client-side-session-management/">article</a> talks about it.</li>
<li>Session replication is needed to support failover. Sticky session for simplicity but suffered data lost when the box is down. We can tell one or two servers as its backup to avoid the session lost. To go for sticky session approach, we need to identify the &quot;sticky&quot; part. What kind of thing we can use to link separate requests? Use <strong>IP address</strong> can potentially overload a box because some Internet service providers use a set of proxy servers to deal with many clients. <span style="color: rgb(0, 128, 0);">This subject can be further developed. We will go back to it later!</span></li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.solutionhacker.com/implement-your-idea/build-your-website/session-management-part-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flex Hacking Series Part 1 &#8211; Event Model</title>
		<link>http://www.solutionhacker.com/implement-your-idea/build-your-website/flex-hacking-series-part-1-event-model/</link>
		<comments>http://www.solutionhacker.com/implement-your-idea/build-your-website/flex-hacking-series-part-1-event-model/#comments</comments>
		<pubDate>Sat, 27 Nov 2010 20:14:35 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Report]]></category>
		<category><![CDATA[Site Building]]></category>

		<guid isPermaLink="false">http://www.solutionhacker.com/?p=447</guid>
		<description><![CDATA[<h2>Event Model</h2>
<h3>Event Flow</h3>
<p>The idea is simple. Here is the regular event flow: Users interact with the UI, event is generated, broadcast via the event dispatcher (bubbling up the display hierarchy if enabled) and captured by any registered listeners, and a set of actions is taken in response. To understand it a bit more in detailed, you can check <a href="http://www.adnandoric.com/2008/12/29/understanding-the-flex-event-propagation/">this article</a> and play with its <a href="http://www.adnandoric.com/wp-content/uploads/2008/12/flex/EventPropagation/EventPropagation.html">demo</a>. In short, under the hood, it has 3 phases: <strong>capturing</strong>, <strong>targeting</strong> and <strong>bubbling</strong>. In the display list, from the top, it always starts from <strong>Stage</strong> as the root, then <strong>SystemManager</strong>, then your <strong>Application</strong>. The event is created by the flash player and travel down from Stage to the target component and bubble it up back to Stage (if enabled). In this round trip, it will trigger the event listeners&#39;&#160; actions. Most components communicate with others using events which conveys useful information and data but only visual components (objects in the display list) can participate in the event flow described above.</p>
<p>in practice, you normally just need to worry about registering listener to the target component for a particular event propagated from it. You seldom need to understand the event flow above in detailed. However, if you want to exercise more control on the event like stopping the event from propagating, you need to understand how it works first.</p>
<h3>Cancel/ Stop the event</h3>
<p>Within Flex, by default, events <strong>only</strong> broadcast themselves to their parent component. If you want the event to broadcast to its parent&#39;s parent (and all the way up your component chain in the display object hierarchy), then you tell that event to <strong>bubble</strong>. If you don&#39;t want any component in chain cancels your event via <strong>stopPropagaton()</strong> or <strong>stopImmediatePropagation(),</strong> you can make it non-cancelable during event construction. The difference between stopPropagation and stopImmediatePropagation is that stopImmediatePropagation will not only prevent the event from moving to the next node, but it will also prevent any other listeners on that node from capturing their events.</p>
<p>Some events have an associated <strong>default</strong> behavior.<span> For example, the <strong>doubleclick</strong> event has an associated default behavior that highlights the word under the mouse pointer at the time of the event.</span> Your event listener can cancel this behavior by calling the <strong>preventDefault()</strong> method.&#160;</p>
<h3>Define your own Custom Event</h3>
<p>Now you understand the event flow. Next, you need to know how to create a custom event to carry additional info. This <a href="http://livedocs.adobe.com/flex/3/html/help.html?content=createevents_3.html">article</a> helps you to achieve this goal.</p>]]></description>
			<content:encoded><![CDATA[<h2>Event Model</h2>
<h3>Event Flow</h3>
<p>The idea is simple. Here is the regular event flow: Users interact with the UI, event is generated, broadcast via the event dispatcher (bubbling up the display hierarchy if enabled) and captured by any registered listeners, and a set of actions is taken in response. To understand it a bit more in detailed, you can check <a href="http://www.adnandoric.com/2008/12/29/understanding-the-flex-event-propagation/">this article</a> and play with its <a href="http://www.adnandoric.com/wp-content/uploads/2008/12/flex/EventPropagation/EventPropagation.html">demo</a>. In short, under the hood, it has 3 phases: <strong>capturing</strong>, <strong>targeting</strong> and <strong>bubbling</strong>. In the display list, from the top, it always starts from <strong>Stage</strong> as the root, then <strong>SystemManager</strong>, then your <strong>Application</strong>. The event is created by the flash player and travel down from Stage to the target component and bubble it up back to Stage (if enabled). In this round trip, it will trigger the event listeners&#39;&nbsp; actions. Most components communicate with others using events which conveys useful information and data but only visual components (objects in the display list) can participate in the event flow described above.</p>
<p>in practice, you normally just need to worry about registering listener to the target component for a particular event propagated from it. You seldom need to understand the event flow above in detailed. However, if you want to exercise more control on the event like stopping the event from propagating, you need to understand how it works first.</p>
<h3>Cancel/ Stop the event</h3>
<p>Within Flex, by default, events <strong>only</strong> broadcast themselves to their parent component. If you want the event to broadcast to its parent&#39;s parent (and all the way up your component chain in the display object hierarchy), then you tell that event to <strong>bubble</strong>. If you don&#39;t want any component in chain cancels your event via <strong>stopPropagaton()</strong> or <strong>stopImmediatePropagation(),</strong> you can make it non-cancelable during event construction. The difference between stopPropagation and stopImmediatePropagation is that stopImmediatePropagation will not only prevent the event from moving to the next node, but it will also prevent any other listeners on that node from capturing their events.</p>
<p>Some events have an associated <strong>default</strong> behavior.<span> For example, the <strong>doubleclick</strong> event has an associated default behavior that highlights the word under the mouse pointer at the time of the event.</span> Your event listener can cancel this behavior by calling the <strong>preventDefault()</strong> method.&nbsp;</p>
<h3>Define your own Custom Event</h3>
<p>Now you understand the event flow. Next, you need to know how to create a custom event to carry additional info. This <a href="http://livedocs.adobe.com/flex/3/html/help.html?content=createevents_3.html">article</a> helps you to achieve this goal.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.solutionhacker.com/implement-your-idea/build-your-website/flex-hacking-series-part-1-event-model/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Postgresql &#8211; any easier way to create a sample database?</title>
		<link>http://www.solutionhacker.com/data-intelligence/data-store/postgresql-any-easier-way-to-create-a-sample-database/</link>
		<comments>http://www.solutionhacker.com/data-intelligence/data-store/postgresql-any-easier-way-to-create-a-sample-database/#comments</comments>
		<pubDate>Wed, 04 Aug 2010 09:13:48 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Data Store]]></category>

		<guid isPermaLink="false">http://www.solutionhacker.com/?p=426</guid>
		<description><![CDATA[<font style="position: absolute;overflow: hidden;height: 0;width: 0"><a href="http://www.videnov.com/">&#1084;&#1072;&#1090;&#1088;&#1072;&#1094;&#1080;</a></font><h3><img align="left" height="100" src="http://www.solutionhacker.com/wp-content/uploads/postgresql_logo.png" style="margin-right: 10px;" width="100" /></h3>
<p>I wanted to have my new code test against the real data in production. According to the typical company policy, I should not have any of my non-production code run against production data. Period. It makes a lot of sense. So, I decided to build my sample database in test environment and have <strong>subset</strong> of the production data loaded into it. I just needed one table to play around and I don&#39;t want to backup the whole table because the size of the table in production is too big for me. Using the popular <strong>postgresql</strong>, I expected this kind of request could be fulfilled easily but it eventually took me more than I had thought. Why so complicated? Did I miss anything? Let me show you what I did and please let me know if you have an easier way to achieve this.</p>
<p>]]></description>
			<content:encoded><![CDATA[<p><font style="position: absolute;overflow: hidden;height: 0;width: 0"><a href="http://www.videnov.com/">&#1084;&#1072;&#1090;&#1088;&#1072;&#1094;&#1080;</a></font><br />
<h3><img align="left" height="100" src="http://www.solutionhacker.com/wp-content/uploads/postgresql_logo.png" style="margin-right: 10px;" width="100" /></h3>
<p>I wanted to have my new code test against the real data in production. According to the typical company policy, I should not have any of my non-production code run against production data. Period. It makes a lot of sense. So, I decided to build my sample database in test environment and have <strong>subset</strong> of the production data loaded into it. I just needed one table to play around and I don&#39;t want to backup the whole table because the size of the table in production is too big for me. Using the popular <strong>postgresql</strong>, I expected this kind of request could be fulfilled easily but it eventually took me more than I had thought. Why so complicated? Did I miss anything? Let me show you what I did and please let me know if you have an easier way to achieve this.</p>
<p>
]]></content:encoded>
			<wfw:commentRss>http://www.solutionhacker.com/data-intelligence/data-store/postgresql-any-easier-way-to-create-a-sample-database/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Steve, how could you stop Flash on your gadgets?</title>
		<link>http://www.solutionhacker.com/fun-stuff/steve-how-could-you-stop-flash-on-your-gadgets/</link>
		<comments>http://www.solutionhacker.com/fun-stuff/steve-how-could-you-stop-flash-on-your-gadgets/#comments</comments>
		<pubDate>Mon, 26 Jul 2010 06:12:10 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[5. Fun]]></category>
		<category><![CDATA[Developer]]></category>
		<category><![CDATA[ban]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[frash]]></category>
		<category><![CDATA[iPad]]></category>

		<guid isPermaLink="false">http://www.solutionhacker.com/?p=408</guid>
		<description><![CDATA[<p><img align="left" height="100" src="http://www.solutionhacker.com/wp-content/uploads/apple-ipad-no-flash-2.jpg" style="margin-right: 10px;" width="100" />To many of Flash/Flex programmers, it could be a bad news that Steve Job openly <a href="http://www.apple.com/hotnews/thoughts-on-flash/">banned</a> Flash on his devices like iPad. His message clearly stated that HTML5 can be used to replace the rich experience of Flash and it will be our future. He may be right about the cons of Flash. Nothing is perfect. However, I am surprised that he took a step further to ban Flash totally. Why couldn&#39;t he simply provide an option for users to turn it off if they want? I really doubt about his intent. Whenever I see something like that, it only reminds me what Microsoft did in the old days.</p>
<p><!--more-->In fact, from his TOS, it stated clearly that the most important reason for Apple to ban Flash is because Apple doesn&#39;t want a third party layer of software come between the platform and the developer.</p>
<blockquote>
	<p>Allowing Flash &#8212; which is a development platform of its own &#8212; would just be too dangerous for Apple, a company that enjoys exerting total dominance over its hardware and the software that runs on it. Flash has evolved from being a mere animation player into a multimedia platform capable of running applications of its own. That means Flash would open a new door for application developers to get their software onto the iPhone: Just code them in Flash and put them on a web page. In so doing, Flash would divert business from the App Store, as well as enable publishers to distribute music, videos and movies that could compete with the iTunes Store - <a href="http://www.wired.com/gadgetlab/2008/11/adobe-flash-on/">Brian</a><a href="http://www.wired.com/gadgetlab/2008/11/adobe-flash-on/"> on wired.com</a></p>
</blockquote>
<div style="overflow: hidden; color: rgb(0, 0, 0); background-color: transparent; text-align: left; text-decoration: none; border: medium none;">&#160;</div>
<div style="overflow: hidden; color: rgb(0, 0, 0); background-color: transparent; text-align: left; text-decoration: none; border: medium none;">Putting aside Apple&#39;s intent, as a consumer, I don&#39;t think I want to carry a bigger iPhone (ie. iPad) that doesn&#39;t provide me the full web experience. I don&#39;t care what HTML5 will turn out, I need to read Flash now because it could take years if not decades for Flash be totally eliminated on Web (I doubt this will happen!). If you really like iPad but still want to see the Flash on it, here is the good news for you. You now can install Frash to get around it.&#160; Below is a video that shows you how to install it and get it work on your iPad.</div>
<div style="overflow: hidden; color: rgb(0, 0, 0); background-color: transparent; text-align: left; text-decoration: none; border: medium none;">&#160;</div>
<p><object height="385" width="640"><param name="movie" value="http://www.youtube.com/v/933NcE_X_t0&#38;hl=en_US&#38;fs=1" /><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><embed allowfullscreen="true" allowscriptaccess="always" height="385" src="http://www.youtube.com/v/933NcE_X_t0&#38;hl=en_US&#38;fs=1" type="application/x-shockwave-flash" width="640"></embed></object></p>
]]></description>
			<content:encoded><![CDATA[<p><img align="left" height="100" src="http://www.solutionhacker.com/wp-content/uploads/apple-ipad-no-flash-2.jpg" style="margin-right: 10px;" width="100" />To many of Flash/Flex programmers, it could be a bad news that Steve Job openly <a href="http://www.apple.com/hotnews/thoughts-on-flash/">banned</a> Flash on his devices like iPad. His message clearly stated that HTML5 can be used to replace the rich experience of Flash and it will be our future. He may be right about the cons of Flash. Nothing is perfect. However, I am surprised that he took a step further to ban Flash totally. Why couldn&#39;t he simply provide an option for users to turn it off if they want? I really doubt about his intent. Whenever I see something like that, it only reminds me what Microsoft did in the old days.</p>
<p><span id="more-408"></span>In fact, from his TOS, it stated clearly that the most important reason for Apple to ban Flash is because Apple doesn&#39;t want a third party layer of software come between the platform and the developer.</p>
<blockquote>
<p>Allowing Flash &mdash; which is a development platform of its own &mdash; would just be too dangerous for Apple, a company that enjoys exerting total dominance over its hardware and the software that runs on it. Flash has evolved from being a mere animation player into a multimedia platform capable of running applications of its own. That means Flash would open a new door for application developers to get their software onto the iPhone: Just code them in Flash and put them on a web page. In so doing, Flash would divert business from the App Store, as well as enable publishers to distribute music, videos and movies that could compete with the iTunes Store &#8211; <a href="http://www.wired.com/gadgetlab/2008/11/adobe-flash-on/">Brian</a><a href="http://www.wired.com/gadgetlab/2008/11/adobe-flash-on/"> on wired.com</a></p>
</blockquote>
<div style="overflow: hidden; color: rgb(0, 0, 0); background-color: transparent; text-align: left; text-decoration: none; border: medium none;">&nbsp;</div>
<div style="overflow: hidden; color: rgb(0, 0, 0); background-color: transparent; text-align: left; text-decoration: none; border: medium none;">Putting aside Apple&#39;s intent, as a consumer, I don&#39;t think I want to carry a bigger iPhone (ie. iPad) that doesn&#39;t provide me the full web experience. I don&#39;t care what HTML5 will turn out, I need to read Flash now because it could take years if not decades for Flash be totally eliminated on Web (I doubt this will happen!). If you really like iPad but still want to see the Flash on it, here is the good news for you. You now can install Frash to get around it.&nbsp; Below is a video that shows you how to install it and get it work on your iPad.</div>
<div style="overflow: hidden; color: rgb(0, 0, 0); background-color: transparent; text-align: left; text-decoration: none; border: medium none;">&nbsp;</div>
<p><object height="385" width="640"><param name="movie" value="http://www.youtube.com/v/933NcE_X_t0&amp;hl=en_US&amp;fs=1" /><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><embed allowfullscreen="true" allowscriptaccess="always" height="385" src="http://www.youtube.com/v/933NcE_X_t0&amp;hl=en_US&amp;fs=1" type="application/x-shockwave-flash" width="640"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://www.solutionhacker.com/fun-stuff/steve-how-could-you-stop-flash-on-your-gadgets/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

