<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Duy Do blog</title>
	<atom:link href="http://duydo.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://duydo.com</link>
	<description>technology, software development, review</description>
	<lastBuildDate>Tue, 10 Aug 2010 17:13:45 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Spring 3 + JPA 2.0 + Hibernate 3.5.1-Final + Wicket 1.4.9 + Maven 2</title>
		<link>http://duydo.com/spring-3-hibenate-3-5-wicket-maven/</link>
		<comments>http://duydo.com/spring-3-hibenate-3-5-wicket-maven/#comments</comments>
		<pubDate>Mon, 25 Jan 2010 08:10:06 +0000</pubDate>
		<dc:creator>Duy Do</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[hibernate3]]></category>
		<category><![CDATA[jpa2]]></category>
		<category><![CDATA[maven]]></category>
		<category><![CDATA[spring3]]></category>
		<category><![CDATA[wicket]]></category>

		<guid isPermaLink="false">http://duydo.com/?p=269</guid>
		<description><![CDATA[This is just a quick note for someone want to use Spring 3, Jpa 2, Hibernate 3, Wicket within Maven 2 project.
You can download an example project at here and remember that only Spring version from 3.0.1  supports JPA 2 fully.
I. Add properties and dependencies into your POM.XML file
1. Add properties
&#60;properties&#62;
    ...]]></description>
			<content:encoded><![CDATA[<p>This is just a quick note for someone want to use Spring 3, Jpa 2, Hibernate 3, Wicket within Maven 2 project.</p>
<p>You can download an example project at <a href="http://dl.dropbox.com/u/1598491/wicket-spring-jpa-hibernate.zip">here</a> and remember that only Spring version from 3.0.1  supports JPA 2 fully.</p>
<p><strong>I. Add properties and dependencies into your POM.XML file</strong></p>
<p>1. Add properties</p>
<pre name="code" class="xml">&lt;properties&gt;
       ...
       &lt;wicket.version&gt;1.4.9&lt;/wicket.version&gt;
       &lt;spring.version&gt;3.0.2.RELEASE&lt;/spring.version&gt;
       &lt;hibernate.version&gt;3.5.1-Final&lt;/hibernate.version&gt;
&lt;/properties&gt;
</pre>
<p>2.  Add Wicket dependencies</p>
<pre name="code" class="xml">&lt;!--  WICKET DEPENDENCIES --&gt;
&lt;dependency&gt;
    &lt;groupId&gt;org.apache.wicket&lt;/groupId&gt;
    &lt;artifactId&gt;wicket&lt;/artifactId&gt;
    &lt;version&gt;${wicket.version}&lt;/version&gt;
&lt;/dependency&gt;
&lt;dependency&gt;
   &lt;groupId&gt;org.apache.wicket&lt;/groupId&gt;
   &lt;artifactId&gt;wicket-extensions&lt;/artifactId&gt;
   &lt;version&gt;${wicket.version}&lt;/version&gt;
&lt;/dependency&gt;

&lt;!--  WICKET-SPRING DEPENDENCIES --&gt;
 &lt;dependency&gt;
 &lt;groupId&gt;org.apache.wicket&lt;/groupId&gt;
 &lt;artifactId&gt;wicket-spring&lt;/artifactId&gt;
 &lt;version&gt;${wicket.version}&lt;/version&gt;
 &lt;/dependency&gt;
</pre>
<p>3. Add Spring 3 dependencies<strong><br />
</strong></p>
<pre name="code" class="xml">&lt;!--  SPRING DEPENDENCIES --&gt;
 &lt;dependency&gt;
 &lt;groupId&gt;org.springframework&lt;/groupId&gt;
 &lt;artifactId&gt;spring-core&lt;/artifactId&gt;
 &lt;version&gt;${spring.version}&lt;/version&gt;
 &lt;/dependency&gt;
 &lt;dependency&gt;
 &lt;groupId&gt;org.springframework&lt;/groupId&gt;
 &lt;artifactId&gt;spring-web&lt;/artifactId&gt;
 &lt;version&gt;${spring.version}&lt;/version&gt;
 &lt;/dependency&gt;
 &lt;dependency&gt;
 &lt;groupId&gt;org.springframework&lt;/groupId&gt;
 &lt;artifactId&gt;spring-beans&lt;/artifactId&gt;
 &lt;version&gt;${spring.version}&lt;/version&gt;
 &lt;/dependency&gt;
 &lt;dependency&gt;
 &lt;groupId&gt;org.springframework&lt;/groupId&gt;
 &lt;artifactId&gt;spring-aop&lt;/artifactId&gt;
 &lt;version&gt;${spring.version}&lt;/version&gt;
 &lt;/dependency&gt;
 &lt;dependency&gt;
 &lt;groupId&gt;org.springframework&lt;/groupId&gt;
 &lt;artifactId&gt;spring-context&lt;/artifactId&gt;
 &lt;version&gt;${spring.version}&lt;/version&gt;
 &lt;/dependency&gt;
 &lt;dependency&gt;
 &lt;groupId&gt;org.springframework&lt;/groupId&gt;
 &lt;artifactId&gt;spring-context-support&lt;/artifactId&gt;
 &lt;version&gt;${spring.version}&lt;/version&gt;
 &lt;/dependency&gt;
 &lt;dependency&gt;
 &lt;groupId&gt;org.springframework&lt;/groupId&gt;
 &lt;artifactId&gt;spring-tx&lt;/artifactId&gt;
 &lt;version&gt;${spring.version}&lt;/version&gt;
 &lt;/dependency&gt;
 &lt;dependency&gt;
 &lt;groupId&gt;org.springframework&lt;/groupId&gt;
 &lt;artifactId&gt;spring-jdbc&lt;/artifactId&gt;
 &lt;version&gt;${spring.version}&lt;/version&gt;
 &lt;/dependency&gt;
 &lt;dependency&gt;
 &lt;groupId&gt;org.springframework&lt;/groupId&gt;
 &lt;artifactId&gt;spring-orm&lt;/artifactId&gt;
 &lt;version&gt;${spring.version}&lt;/version&gt;
 &lt;/dependency&gt;
 &lt;dependency&gt;
 &lt;groupId&gt;org.springframework&lt;/groupId&gt;
 &lt;artifactId&gt;spring-test&lt;/artifactId&gt;
 &lt;version&gt;${spring.version}&lt;/version&gt;
 &lt;scope&gt;test&lt;/scope&gt;
 &lt;/dependency&gt;
</pre>
<p>4. Add JPA 2.o /Hibernate 3 dependencies</p>
<pre name="code" class="xml">&lt;!-- HIBERNATE 3.5.1 JPA --&gt;
 &lt;dependency&gt;
 &lt;groupId&gt;org.hibernate.java-persistence&lt;/groupId&gt;
 &lt;artifactId&gt;jpa-api&lt;/artifactId&gt;
 &lt;version&gt;2.0-cr-1&lt;/version&gt;
 &lt;/dependency&gt;
 &lt;dependency&gt;
 &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
 &lt;artifactId&gt;hibernate-entitymanager&lt;/artifactId&gt;
 &lt;version&gt;${hibernate.version}&lt;/version&gt;
 &lt;/dependency&gt;
&lt;!-- C3p0 for Datasource --&gt;
 &lt;dependency&gt;
 &lt;groupId&gt;c3p0&lt;/groupId&gt;
 &lt;artifactId&gt;c3p0&lt;/artifactId&gt;
 &lt;version&gt;0.9.0.4&lt;/version&gt;
 &lt;/dependency&gt;

&lt;!-- H2 DEPENDENCIES for testing --&gt;
 &lt;dependency&gt;
 &lt;groupId&gt;com.h2database&lt;/groupId&gt;
 &lt;artifactId&gt;h2&lt;/artifactId&gt;
 &lt;version&gt;1.2.125&lt;/version&gt;
 &lt;/dependency&gt;
</pre>
<p><strong>II. Create applicationContext.xml for Spring 3</strong><br />
1. Create application.properties for datasource and jpa configuration:</p>
<pre name="code" class="xml"># connection pool config (c3p0 ComboPooledDataSource)
# all time values are in seconds
c3p0.minPoolSize=2
c3p0.maxPoolSize=20
c3p0.maxConnectionAge=21600
c3p0.maxIdleTime=3600
c3p0.idleConnectionTestPeriod=300

# Development config with H2 database
jdbc.driver=org.h2.Driver
jdbc.url=jdbc:h2:~/your_database
jdbc.username=sa
jdbc.password=

jpa.databasePlatform=org.hibernate.dialect.HSQLDialect
jpa.generateDdl=true
jpa.showSql=true
</pre>
<p>2. An example applicatonContext.xml:</p>
<pre name="code" class="xml"> &lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;beans xmlns="http://www.springframework.org/schema/beans"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
 xmlns:tx="http://www.springframework.org/schema/tx" xmlns:p="http://www.springframework.org/schema/p"
 xmlns:aop="http://www.springframework.org/schema/aop"
 xsi:schemaLocation="http://www.springframework.org/schema/beans  http://www.springframework.org/schema/beans/spring-beans-3.0.xsd  http://www.springframework.org/schema/context  http://www.springframework.org/schema/context/spring-context-3.0.xsd  http://www.springframework.org/schema/tx  http://www.springframework.org/schema/tx/spring-tx-3.0.xsd  http://www.springframework.org/schema/aop  http://www.springframework.org/schema/aop/spring-aop-3.0.xsd"&gt;

 &lt;context:annotation-config /&gt;
 &lt;context:component-scan base-package="com.duydo.model" /&gt;
 &lt;tx:annotation-driven transaction-manager="transactionManager" /&gt;

 &lt;context:property-placeholder location="classpath:application.properties"/&gt;

 &lt;bean id="dataSource"&gt;
 &lt;property name="driverClass"&gt;
 &lt;value&gt;${jdbc.driver}&lt;/value&gt;
 &lt;/property&gt;
 &lt;property name="jdbcUrl"&gt;
 &lt;value&gt;${jdbc.url}&lt;/value&gt;
 &lt;/property&gt;
 &lt;property name="user"&gt;
 &lt;value&gt;${jdbc.username}&lt;/value&gt;
 &lt;/property&gt;
 &lt;property name="password"&gt;
 &lt;value&gt;${jdbc.password}&lt;/value&gt;
 &lt;/property&gt;
 &lt;property name="minPoolSize"&gt;
 &lt;value&gt;${c3p0.minPoolSize}&lt;/value&gt;
 &lt;/property&gt;
 &lt;property name="maxPoolSize"&gt;
 &lt;value&gt;${c3p0.maxPoolSize}&lt;/value&gt;
 &lt;/property&gt;
 &lt;property name="checkoutTimeout"&gt;
 &lt;!-- Give up waiting for a connection after this many milliseconds --&gt;
 &lt;value&gt;20000&lt;/value&gt;
 &lt;/property&gt;
 &lt;property name="maxIdleTime"&gt;
 &lt;value&gt;${c3p0.maxIdleTime}&lt;/value&gt;
 &lt;/property&gt;
 &lt;property name="idleConnectionTestPeriod"&gt;
 &lt;value&gt;${c3p0.idleConnectionTestPeriod}&lt;/value&gt;
 &lt;/property&gt;
 &lt;/bean&gt;

 &lt;bean
 class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor" /&gt;

 &lt;bean id="entityManagerFactory"
 class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"&gt;
 &lt;property name="persistenceUnitName" value="wsjhPU" /&gt;
 &lt;property name="dataSource" ref="dataSource" /&gt;
 &lt;property name="jpaVendorAdapter"&gt;
 &lt;bean&gt;
 &lt;property name="databasePlatform" value="${jpa.databasePlatform}" /&gt;
 &lt;property name="showSql" value="${jpa.showSql}" /&gt;
 &lt;property name="generateDdl" value="${jpa.generateDdl}" /&gt;
 &lt;/bean&gt;
 &lt;/property&gt;
 &lt;/bean&gt;
 &lt;bean id="transactionManager"&gt;
 &lt;property name="entityManagerFactory" ref="entityManagerFactory" /&gt;
 &lt;property name="dataSource" ref="dataSource" /&gt;
 &lt;/bean&gt;

 &lt;bean id="wicketApplication" class="com.duydo.WicketApplication"/&gt;

&lt;/beans&gt;
</pre>
<p><strong>III. Modify your PERSISTENCE.XML as following</strong></p>
<pre name="code" class="xml">&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;persistence version="2.0"
 xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"&gt;
 &lt;persistence-unit name="wsjhPU" transaction-type="RESOURCE_LOCAL"&gt;
 &lt;provider&gt;org.hibernate.ejb.HibernatePersistence&lt;/provider&gt;
 &lt;/persistence-unit&gt;
&lt;/persistence&gt;
</pre>
<p><strong>IV. Modify your WEB.XML as following</strong></p>
<pre name="code" class="xml">&lt;?xml version="1.0" encoding="ISO-8859-1"?&gt;
&lt;web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
 version="2.4"&gt;

 &lt;display-name&gt;wicket-spring-jpa-hibernate&lt;/display-name&gt;

 &lt;context-param&gt;
 &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
 &lt;param-value&gt;classpath:applicationContext.xml&lt;/param-value&gt;
 &lt;/context-param&gt;

 &lt;filter&gt;
 &lt;filter-name&gt;open.entitymanager.in.view&lt;/filter-name&gt;
 &lt;filter-class&gt;org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter&lt;/filter-class&gt;
 &lt;/filter&gt;

 &lt;filter&gt;
 &lt;filter-name&gt;wicket.wicket-spring-jpa-hibernate&lt;/filter-name&gt;
 &lt;filter-class&gt;org.apache.wicket.protocol.http.WicketFilter&lt;/filter-class&gt;
 &lt;init-param&gt;
 &lt;param-name&gt;applicationFactoryClassName&lt;/param-name&gt;
 &lt;param-value&gt;org.apache.wicket.spring.SpringWebApplicationFactory&lt;/param-value&gt;
 &lt;/init-param&gt;
 &lt;init-param&gt;
 &lt;param-name&gt;configuration&lt;/param-name&gt;
 &lt;param-value&gt;development&lt;/param-value&gt;
 &lt;/init-param&gt;
 &lt;/filter&gt;

 &lt;filter-mapping&gt;
 &lt;filter-name&gt;open.entitymanager.in.view&lt;/filter-name&gt;
 &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
 &lt;/filter-mapping&gt;

 &lt;filter-mapping&gt;
 &lt;filter-name&gt;wicket.wicket-spring-jpa-hibernate&lt;/filter-name&gt;
 &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
 &lt;/filter-mapping&gt;

 &lt;listener&gt;
 &lt;listener-class&gt;org.springframework.web.context.ContextLoaderListener&lt;/listener-class&gt;
 &lt;/listener&gt;
&lt;/web-app&gt;</pre>
]]></content:encoded>
			<wfw:commentRss>http://duydo.com/spring-3-hibenate-3-5-wicket-maven/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Effective JPA: Use Enumeration Effectively</title>
		<link>http://duydo.com/effective-jpa-persist-an-enumerationeffectively/</link>
		<comments>http://duydo.com/effective-jpa-persist-an-enumerationeffectively/#comments</comments>
		<pubDate>Sun, 24 Jan 2010 04:51:09 +0000</pubDate>
		<dc:creator>Duy Do</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[effective]]></category>
		<category><![CDATA[enum]]></category>
		<category><![CDATA[enumeration]]></category>
		<category><![CDATA[jpa]]></category>

		<guid isPermaLink="false">http://duydo.com/?p=294</guid>
		<description><![CDATA[How to persist an enumeration effectively? Here is my experience.]]></description>
			<content:encoded><![CDATA[<p>How to persist an enumeration effectively? Here is my experience.</p>
<p>I will use Wordpress for example. We all know that every <strong>post </strong>in wordpress blog system has a <strong>status </strong>with possible values: draft, pending-review, published&#8230;</p>
<p>There are some ways to model the post entity. We can save <strong>status </strong>as an integer value in database: draft -> 0, pending-review -> 1, published -> 2</p>
<p><strong>Version 1</strong></p>
<pre name="code" class="java">
@Entity
public class Post {
	private Integer status;

	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}
}
</pre>
<p>Well that&#8217;s ok. A client can use:</p>
<pre name="code" class="java">
	Post post = ...;
	//Draft post
	post.setStatus(0);
	repository.store(post);
</pre>
<p>But this is not safe, the client can set any integer value for status. For more save, we can define constants for status values like that:</p>
<pre name="code" class="java">
public class PostStatus {
	public static final Integer DRAFT = 0;
	public static final Integer PENDING_REVIEW = 1;
	public static final Integer PUBLISHED = 2;
}
</pre>
<p>The client can use:</p>
<pre name="code" class="java">
	Post post = ...;
	//Draft post
	post.setStatus(PostStatus.DRAFT);
	repository.store(post);
</pre>
<p>But it is still not safe, because the client maybe do not use <strong>PostStatus</strong> class. So for more safe, what we need to do?<br />
Yes, we can force the client use <strong>PostStatus</strong> by declaring <strong>PostStatus</strong> as an Enum and make it dependency in <strong>Post</strong> class:</p>
<p><strong>Version 2</strong></p>
<pre name="code" class="java">
public enum PostStatus {
	DRAFT, PENDING_REVIEW, PUBLISHED;
}
</pre>
<pre name="code" class="java">
@Entity
public class Post {
	@Enumerated
	private PostStatus status;

	public PostStatus getStatus() {
		return status;
	}

	public void setStatus(PostStatus status) {
		this.status = status;
	}
}
</pre>
<p>And now client can use it:</p>
<pre name="code" class="java">
	Post post = ...;
	//Draft post
	post.setStatus(PostStatus.DRAFT);
	repository.store(post);
</pre>
<p>Well, it is better. But wait&#8230;<br />
We know that JPA persists all enum constants in order we declare them in PostStatus with value started from 0. This is limitation, we can not change order of constants, we only can append a new constant. How does we solve this limitation? </p>
<p><strong>Version 3</strong></p>
<p>Enum type in Java 5 is wonderful, we can add constructor and do some business logic in it. Apply it we can re-write PostStatus like this:</p>
<pre name="code" class="java">
public enum PostStatus {
	DRAFT(0),
	PENDING_REVIEW(1),
	PUBLISHED(2);

	private final Integer value;
	private PostStatus(Integer value) {
		this.value = value;
	}
	public Integer getValue() {
		return value;
	}
}
</pre>
<p> And Post class is re-wrote like this:</p>
<pre name="code" class="java">
@Entity
public class Post {
	private Integer status;

	public PostStatus getStatus() {
		//TODO we need a helper to convert status value to PostStatus enum
		return ...;
	}

	public void setStatus(PostStatus status) {
		this.status = status.getValue();
	}
}
</pre>
<p>Great!!!</p>
<p>Now client can use code safety and we can add many constants as we want into PostStatus without worry about order of them.</p>
<p>It reminds me of the sentence the guy talked in Java4Ever trailer: &#8220;Look how beautiful, robust, secure, portable and scalable it is&#8221; <img src='http://duydo.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://duydo.com/effective-jpa-persist-an-enumerationeffectively/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Install Thrift on Ubuntu</title>
		<link>http://duydo.com/install-thrift-on-ubuntu/</link>
		<comments>http://duydo.com/install-thrift-on-ubuntu/#comments</comments>
		<pubDate>Sun, 10 Jan 2010 04:02:44 +0000</pubDate>
		<dc:creator>Duy Do</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[thrift]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://duydo.com/?p=285</guid>
		<description><![CDATA[A quick note for installing Thrift on Ubuntu]]></description>
			<content:encoded><![CDATA[<p>A quick note for installing Thrift on Ubuntu</p>
<p>0. Install basic lib</p>
<pre name="code" class="xml">sudo apt-get install build-essential libboost-dev automake libtool flex bison pkg-config</pre>
<p>1. Get Thrift:</p>
<pre name="code" class="xml">wget http://www.apache.org/dyn/closer.cgi?path=/incubator/thrift/0.2.0-incubating/thrift-0.2.0-incubating.tar.gz</pre>
<p>2. Install Thrift</p>
<pre name="code"  class="xml">tar zxvf thrift-0.2.0-incubating.tar.gz
cd thrift-0.2.0-incubating
./bootstrap.sh
./configure --with-boost=/usr/local
make
sudo make install</pre>
<p>3. Done <img src='http://duydo.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://duydo.com/install-thrift-on-ubuntu/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Re-launch blog with my own theme</title>
		<link>http://duydo.com/re-launch-blog-with-my-own-theme/</link>
		<comments>http://duydo.com/re-launch-blog-with-my-own-theme/#comments</comments>
		<pubDate>Fri, 01 Jan 2010 04:58:56 +0000</pubDate>
		<dc:creator>Duy Do</dc:creator>
				<category><![CDATA[Misc]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[grid]]></category>
		<category><![CDATA[microformat]]></category>

		<guid isPermaLink="false">http://duydo.com/?p=266</guid>
		<description><![CDATA[



Cái blog của mình nó đi vào trạng thái offline  gần cả năm rồi. Cả năm không viết lách cái gì cả, đôi lúc cũng muốn  viết, cùng muốn chia sẻ với mọi người nhưng rồi cái cục lười biếng của  mình nó đã chiến thắng.
Vì nhu cầu muốn được &#8220;tự do ...]]></description>
			<content:encoded><![CDATA[<div>
<div>
<div>
<div>
<p>Cái blog của mình nó đi vào trạng thái offline  gần cả năm rồi. Cả năm không viết lách cái gì cả, đôi lúc cũng muốn  viết, cùng muốn chia sẻ với mọi người nhưng rồi cái cục lười biếng của  mình nó đã chiến thắng.</p>
<p>Vì nhu cầu muốn được &#8220;tự do đục khoét&#8221; cái blog và những thứ khác nên  quyết định chuyển qua dùng domain và host riêng nhưng rồi cũng làm  biếng chỉ mua host &amp; domain để đó cả mấy tháng trời mà không làm gì.  Hôm nay là một ngày đẹp trời quyết định cài đặt lại blog vớí theme mới  sau một thời gian dài làm biếng <img src="../wp-includes/images/smilies/icon_biggrin.gif" alt=":D" /> .</p>
<p>Lịch sử làm cái theme này cũng gắn liền với cái sự làm biếng của  mình. Ban đầu định dành ra khoản 1 tuần để thiết kế cái theme này, nhưng  1 tuần trôi qua rồi tuần thứ 2, 3&#8230; mình vẫn chưa làm xong. Đến tuần  thứ 7 mới thực sự bước vào làm.</p>
<p>Nói vậy chứ không làm biếng lắm, tuần 1 lên kế hoạch tìm kiếm nghiên  cứu làm sao thiết kế cái giao diện nhìn cho nó ngon ngon 1 chút. Ban đầu  định sẽ dùng BluePrint CSS framework và những thứ có sẵn để làm nhưng  sau đó quyết định sẽ thiết kế và viết mọi thứ từ đầu.</p>
<p>Quyết định thế nhưng lúc này trong đầu không có nhiều kiến thức về  xây dựng giao diện người dùng với XHTML/CSS, theo thói quen là nhờ bác  Google hỗ trợ.</p>
<p>Search tới search lui mình cũng lần ra được nhiều tên tuổi nổi tiếng  trong làng design như <a href="http://www.markboultondesign.com/" target="_blank">Mark Boulton</a>, <a href="http://subtraction.com/" target="_blank">Khoi Vinh</a>&#8230; Và cũng  từ đây mình tìm thấy những khái niệm, nguyên lý và kỹ thuật thiết kế  giao diện cho Web như: Eye Tracking, Grid System, Typography&#8230;</p>
<p>Để tìm hiểu những vấn đề này mình đã đọc những bài viết và sách sau:</p>
<ol>
<li><a href="http://www.thegridsystem.org/2009/articles/interview-with-khoi-vinh/" target="_blank">Interview  with Khoi Vinh about Grid System</a></li>
<li><a href="http://www.smashingmagazine.com/2009/08/20/typographic-design-survey-best-practices-from-the-best-blogs/" target="_blank">Typographic  Design Patterns and Best Practice</a></li>
<li>Save the Pixel &#8211; Ben Hunt</li>
<li>Don&#8217;t make me think &#8211; Steven Krug</li>
<li>Design for the Web &#8211; Mark Bouton</li>
<li>More Eric Myer on CSS &#8211; <a target="_blank">Eric A. Meyer</a></li>
<li>Design In Browser &#8211; Andy</li>
<li>&#8230;&#8230;.</li>
</ol>
<p>6 tuần dành để đọc sách và nghiên cứu những vấn đề về web, về UI thấy  cũng rất thú vị. Cảm thấy có  hứng thú mình bắt tay vào thực hành những  thứ vừa tìm hiểu được và kết quả thu được là cái theme này cùng với 1  số thư viện để dùng lại:</p>
<ol>
<li>Mini Grid System library &#8211; grid.css</li>
<li>Typography library &#8211; typography.css</li>
</ol>
<p>Đây là lần đầu tiên mình làm giao diện web ngay từ đầu 1 cách bài  bản, mặc dù theme này chưa hoàn thiện nhưng mình cảm thấy rất tự hào về  nó.</p>
<p>Để đánh dấu sự kiện này mình đã đặt tên theme là <strong>TwoMice</strong> (2 con chuột) cho dễ nhớ vì mình và vợ đều tuổi con chuột :&#8221;&gt;.</p>
<p>Thỉnh thoảng làm biếng cũng có lợi <img src="../wp-includes/images/smilies/icon_wink.gif" alt=";-)" /></p>
</div>
</div>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://duydo.com/re-launch-blog-with-my-own-theme/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Google Wave Account</title>
		<link>http://duydo.com/google-wave-account/</link>
		<comments>http://duydo.com/google-wave-account/#comments</comments>
		<pubDate>Mon, 20 Jul 2009 08:35:52 +0000</pubDate>
		<dc:creator>Duy Do</dc:creator>
				<category><![CDATA[Misc]]></category>
		<category><![CDATA[Google Wave]]></category>

		<guid isPermaLink="false">http://doquocduy.wordpress.com/?p=200</guid>
		<description><![CDATA[Có lẽ mình là 1 trong số những developer Việt Nam đầu tiên may mắn có được tài khoản Google Wave. Đang tìm hiểu về Google Wave, có gì hay ho sẽ chia sẻ với anh em :D. Đây là tài khoản Google Wave của mình: duydo@wavesandbox.com, anh em nào hứng thú với Google Wave thì chúng ta cùng tìm hiểu, thảo luận.]]></description>
			<content:encoded><![CDATA[<p>Có lẽ mình là 1 trong số những developer Việt Nam đầu tiên may mắn có được tài khoản Google Wave. Đang tìm hiểu về Google Wave, có gì hay ho sẽ chia sẻ với anh em <img src='http://duydo.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> . Đây là tài khoản Google Wave của mình: duydo@wavesandbox.com, anh em nào hứng thú với Google Wave thì chúng ta cùng tìm hiểu, thảo luận.</p>
<p><span id="more-200"></span></p>
<p>Làm quả screenshot cho vui nhà vui cửa <img src='http://duydo.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /><br />
<a href="http://picasaweb.google.com/lh/photo/-Sg2Km02b7RPrK5nVW4mYA?authkey=Gv1sRgCNDY4aSC4oe3QA&amp;feat=embedwebsite"><img src="http://lh3.ggpht.com/_kUX1O17s63c/SmQriUv1CKI/AAAAAAAAB9w/W487kLzhubY/s400/screenshot_01%202009-07-20%2015.13.jpg" alt="" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://duydo.com/google-wave-account/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Đi Quảng Ngãi &#8211; Sài Gòn bằng xe máy</title>
		<link>http://duydo.com/di-qu%e1%ba%a3ng-ngai-sai-gon-b%e1%ba%b1ng-xe-may/</link>
		<comments>http://duydo.com/di-qu%e1%ba%a3ng-ngai-sai-gon-b%e1%ba%b1ng-xe-may/#comments</comments>
		<pubDate>Thu, 11 Jun 2009 04:51:33 +0000</pubDate>
		<dc:creator>Duy Do</dc:creator>
				<category><![CDATA[Misc]]></category>
		<category><![CDATA[Quãng Ngãi]]></category>
		<category><![CDATA[Sài Gòn]]></category>
		<category><![CDATA[Xe Máy]]></category>

		<guid isPermaLink="false">http://doquocduy.wordpress.com/?p=192</guid>
		<description><![CDATA[Tết rồi mình và bạn gái làm một chuyến từ Quảng Ngãi vào Sài Gòn bằng xe máy. Xuất phát tại Quãng Ngãi lúc 10h sáng, mình đi một mạch đến Nha Trang vào lúc 8h tối. Ơ lại Nha Trang chơi, 10h sáng hôm sau xuất phát đi SG, chạy đến 8h tối thì ...]]></description>
			<content:encoded><![CDATA[<p>Tết rồi mình và bạn gái làm một chuyến từ Quảng Ngãi vào Sài Gòn bằng xe máy. Xuất phát tại Quãng Ngãi lúc 10h sáng, mình đi một mạch đến Nha Trang vào lúc 8h tối. Ơ lại Nha Trang chơi, 10h sáng hôm sau xuất phát đi SG, chạy đến 8h tối thì tới Thủ Đức.</p>
<p><span id="more-192"></span></p>
<p>Trong quá trình đi minh ít khi nào dừng lại nghỉ, chủ yếu đi vệ sinh hoặc khát nước thì dừng lại. Cảm giác đi lên đèo thích lắm <img src='http://duydo.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> . Rất tiếc là lúc đó mình chưa có máy quay phim chứ không giờ có được thước phim &#8221; Hành trình Quảng Ngãi &#8211; Sài Gòn bằng xe máy&#8221; cho ae thưởng ngoạn rồi hehe.</p>
<p>Ban đầu đi ai cũng không cho nhưng mình và bạn gái quyết định đi một chuyến cho biết cảm giác. Thật sự thì đi cũng không nguy hiểm như mọi người thường nghĩ. Kinh nghiệm của mình đi xe máy là phải luôn có kính chiếu hậu để quan sát dòng xe cộ phía sau, luôn cho xe chạy cách xe ô tô hoặc xe máy khác một khoảng cách an toàn, không bám đuôi hoặc cắt ngang đầu xe khác. Và khi đi phải nhìn xa xa để tránh mấy con chó hay chạy băng qua đường. Đang chạy tốc độ cao mà đụng mấy con này là coi như toi mạng. Chuyến đi này mình chỉ tốn 165.000 tiền xăng.</p>
<p>Tết này mình cũng chạy xe máy về Quảng Ngãi, anh em nào muốn thử cảm giác đi xe máy thì mình hẹn ngày lập hội đi cùng <img src='http://duydo.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://duydo.com/di-qu%e1%ba%a3ng-ngai-sai-gon-b%e1%ba%b1ng-xe-may/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Page Speed</title>
		<link>http://duydo.com/page-speed/</link>
		<comments>http://duydo.com/page-speed/#comments</comments>
		<pubDate>Sat, 06 Jun 2009 16:16:52 +0000</pubDate>
		<dc:creator>Duy Do</dc:creator>
				<category><![CDATA[Misc]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Page Speed]]></category>
		<category><![CDATA[Performance]]></category>

		<guid isPermaLink="false">http://doquocduy.wordpress.com/?p=187</guid>
		<description><![CDATA[Page Speed is a Firefox add-on (integrated with Firebug), which has been using to improve the performance of  web pages at Google. This is very, very useful tool for web developers.
When you run Page Speed, you get immediate suggestions on how you can change your web pages to improve their speed. For example, Page Speed ...]]></description>
			<content:encoded><![CDATA[<p>Page Speed is a Firefox add-on (integrated with Firebug), which has been using to improve the performance of  web pages at Google. This is very, very useful tool for web developers.</p>
<p>When you run Page Speed, you get immediate suggestions on how you can change your web pages to improve their speed. For example, Page Speed automatically optimizes images for you, giving you a compressed image that you can use immediately on your web site. It also identifies issues such as JavaScript and CSS loaded by your page that wasn&#8217;t actually used to display the page, which can help reduce time your users spend waiting for the page to download and display.</p>
<p>You can download and install Page Speed at <a href="http://code.google.com/speed/page-speed">here</a></p>
]]></content:encoded>
			<wfw:commentRss>http://duydo.com/page-speed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fluent Interface</title>
		<link>http://duydo.com/fluent-interface/</link>
		<comments>http://duydo.com/fluent-interface/#comments</comments>
		<pubDate>Tue, 24 Mar 2009 17:45:18 +0000</pubDate>
		<dc:creator>Duy Do</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[OOP]]></category>

		<guid isPermaLink="false">http://doquocduy.wordpress.com/?p=153</guid>
		<description><![CDATA[Recently, I&#8217;ve played with my own  framework. I found a new term, called &#8220;Fluent Interface&#8220;. There is a great article on bliki of Martin Fowler about this term, you can read it if you have not heard about it yet.
The idea of  &#8220;Fluent Interface&#8221; is instead of returning void in  setter methods of an object, ...]]></description>
			<content:encoded><![CDATA[<p>Recently, I&#8217;ve played with my own  framework. I found a new term, called &#8220;<strong>Fluent Interface</strong>&#8220;. There is <a href="http://martinfowler.com/bliki/FluentInterface.html" target="_blank">a great article</a> on bliki of Martin Fowler about this term, you can read it if you have not heard about it yet.</p>
<p>The idea of  &#8220;Fluent Interface&#8221; is instead of returning <code>void</code> in  setter methods of an object, returning an object to promote object chaining.</p>
<p><span id="more-153"></span></p>
<p><strong>Example:</strong></p>
<pre lang="java">class Query {
    private String props;
    private String table;
    private String condition;

    public Query select(String props) {
        this.props = props;
        return this;
    }

    public Query from(String table) {
        this.table = table;
        return this;
    }

    public Query where(String condition) {
        this.condition = condition;
        return this;
    }

    public String buildQuery() {
        return String.format("SELECT %s FROM %s WHERE %s", props, table, condition);
    }
}</pre>
<p><strong>Instead of:</strong></p>
<pre lang="java">Query q = new Query();
q.select("username");
q.from("user");
q.where("username = 'duydo'");
String sql = q.buildQuery();</pre>
<p><strong>We can write:</strong></p>
<pre lang="java">Query q = new Query();
String sql = q.select(”username”).from(”user”).where(”username = ‘duydo’”).buildQuery();</pre>
<p>This will make code more readable, but be careful when use this technique.</p>
]]></content:encoded>
			<wfw:commentRss>http://duydo.com/fluent-interface/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Einstein &#8211; Nguyễn Xuân Xanh</title>
		<link>http://duydo.com/einstein-nguyen-xuan-xanh/</link>
		<comments>http://duydo.com/einstein-nguyen-xuan-xanh/#comments</comments>
		<pubDate>Wed, 18 Feb 2009 17:51:35 +0000</pubDate>
		<dc:creator>Duy Do</dc:creator>
				<category><![CDATA[People]]></category>

		<guid isPermaLink="false">http://doquocduy.wordpress.com/?p=142</guid>
		<description><![CDATA[Đầu năm nay công việc không được tốt, tình thần không được thỏa mái nên tôi quyết định nghỉ việc ở công ty.
Mấy hôm nay rảnh rỗi ngồi ở nhà nên tôi tìm đọc lại một số bài viết về Einstein. Đi khắp các nhà sách trong thành phố gần mấy tháng nay mà vẫn ...]]></description>
			<content:encoded><![CDATA[<p>Đầu năm nay công việc không được tốt, tình thần không được thỏa mái nên tôi quyết định nghỉ việc ở công ty.</p>
<p>Mấy hôm nay rảnh rỗi ngồi ở nhà nên tôi tìm đọc lại một số bài viết về Einstein. Đi khắp các nhà sách trong thành phố gần mấy tháng nay mà vẫn không tìm được cuốn sách viết về Einstein của Nguyễn Xuân Xanh. Hôm kia cùng &#8220;bà xã&#8221; đi vào nhà sách Nguyễn Văn Cừ (CMT8) vô tình thấy cuốn sách này, thế là bưng về nhà ngay.</p>
<p><span id="more-142"></span></p>
<p style="text-align:center;"><img class="aligncenter" title="Einstein" src="http://msnbcmedia3.msn.com/j/msnbc/Components/Photos/z_Projects_in_progress/050418_Einstein/050405_einstein_tongue.widec.jpg" alt="" width="298" height="371" /></p>
<p>Có thể nói đây là cuốn sách tiếng Việt đầy đủ nhất về cuộc đời của Einstein, cùng với những phát kiến vĩ đại của ông trong ngành Vật Lý Lý Thuyết. Đọc cuốn sách này tôi càng thấu hiểu vì sao Einstein đã đi đến kết luận: <em><strong>Trí tưởng tượng quan trọng hơn tri thức</strong></em> (<strong><em>Imagination is more important than knowledge</em></strong>). Đọc cuốn sách này giúp tôi hiểu hơn về một số nhà khoa học khác cùng thời với ông như Max Planck (người tìm ra hằng số planck h) , Pauli, Bohr, Erwin Schrodinger (người tìm ra phương trình sóng Schrodinger), Heisenberg (cơ học lượng tử)&#8230;</p>
<p>Ngoài hoạt động khoa học, Einstein còn tham gia hoạt động chính trị. Ông đã từ bỏ nước Đức ra đi lúc 15 tuổi  vì chủ nghĩa bài trừ Do Thái do Hitler khởi xưởng. Cuộc sống khó khăn, tình hình chính trị rối ren nhưng không hề ngăn cản nổi ông trên con đường đi tìm chân lý khoa học, kể cả chân lý chính trị và đạo đức.</p>
<p>Một cuốn sách đáng để chúng ta đọc, suy ngẫm và học tập.</p>
]]></content:encoded>
			<wfw:commentRss>http://duydo.com/einstein-nguyen-xuan-xanh/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Einstein’s Secret to Amazing Problem Solving (10 ways you can use)</title>
		<link>http://duydo.com/einstein%e2%80%99s-secret-to-amazing-problem-solving/</link>
		<comments>http://duydo.com/einstein%e2%80%99s-secret-to-amazing-problem-solving/#comments</comments>
		<pubDate>Fri, 21 Nov 2008 02:39:32 +0000</pubDate>
		<dc:creator>Duy Do</dc:creator>
				<category><![CDATA[People]]></category>
		<category><![CDATA[Problem Solving]]></category>

		<guid isPermaLink="false">http://doquocduy.wordpress.com/?p=131</guid>
		<description><![CDATA[
Einstein is quoted as having said that if he had one hour to save the world he would spend fifty-five minutes defining the problem and only five minutes finding the solution.
This quote does illustrate an important point: before jumping right into solving a problem, we should step back and invest time and effort to improve ...]]></description>
			<content:encoded><![CDATA[<p style="text-align:center;"><img src="http://litemind.com/wp-content/uploads/2008/11/einstein-portrait.jpg" alt="Albert Einstein" /></p>
<p>Einstein is quoted as having said that if he had one hour to save the world he would spend <em>fifty-five minutes defining the problem and only five minutes finding the solution</em>.</p>
<p>This quote does illustrate an important point: before jumping right into solving a problem, we should step back and invest time and effort to improve our understanding of it. Here are 10 strategies you can use to see problems from many different perspectives and master what is the most important step in problem solving: <strong>clearly defining the problem in the first place!</strong></p>
<p><strong><span id="more-131"></span><br />
</strong></p>
<h2>The Problem Is To Know What the Problem Is</h2>
<p><strong>The definition of the problem will be the focal point of all your problem-solving efforts</strong>. As such, it makes sense to devote as much attention and dedication to problem definition as possible. What usually happens is that as soon as we have a problem to work on we’re so eager to get to solutions that we neglect spending any time refining it.</p>
<p>What most of us don’t realize — and what supposedly Einstein might have been alluding to — is that <strong>the quality of the solutions we come up with will be in direct proportion to the quality of the description of the problem we’re trying to solve</strong>. Not only will your solutions be more abundant and of higher quality, but they’ll be achieved much, much more easily. Most importantly, you’ll have the confidence to be tackling a worthwhile problem.</p>
<h2>Problem Definition Tools and Strategies</h2>
<p>The good news is that getting different perspectives and angles in order to clearly define a problem is a <strong>skill that can be learned and developed</strong>. As such, there are many strategies you can use to perfect it. Here are the 10 most effective ones I know.</p>
<p><!--more--></p>
<h3>1. Rephrase the Problem</h3>
<p>When a Toyota executive asked employees to brainstorm “ways to increase their productivity”, all he got back were blank stares. When he rephrased his request as “ways to make their jobs easier”, he could barely keep up with the amount of suggestions.</p>
<p>Words carry strong implicit meaning and, as such, play a major role in how we perceive a problem. In the example above, ‘be productive’ might seem like a sacrifice you’re doing for the company, while ‘make your job easier’ may be more like something you’re doing for your own benefit, but from which the company also benefits. In the end, the problem is still the same, but the feelings — and the points of view — associated with each of them are vastly different.</p>
<p>Play freely with the problem statement, rewording it several times. For a methodic approach, take single words and substitute variations. ‘Increase sales’? Try replacing ‘increase’ with ‘attract’, ‘develop’, ‘extend’, ‘repeat’ and see how your perception of the problem changes. A rich vocabulary plays an important role here, so you may want to use a thesaurus or <a title="10 Sure-Fire Strategies to Improve Your Vocabulary" href="http://litemind.com/10-strategies-improve-vocabulary/">develop your vocabulary</a>.</p>
<h3>2. Expose and Challenge Assumptions</h3>
<p>Every problem — no matter how apparently simple it may be — comes with a long list of assumptions attached. Many of these assumptions may be inaccurate and could make your problem statement inadequate or even misguided.</p>
<p>The first step to get rid of bad assumptions is to make them explicit. Write a list and expose as many assumptions as you can — especially those that may seem the most obvious and ‘untouchable’.</p>
<p>That, in itself, brings more clarity to the problem at hand. But go further and test each assumption for validity: think in ways that they might not be valid and their consequences. What you will find may surprise you: that many of those bad assumptions are self-imposed — with just a bit of scrutiny you are able to safely drop them.</p>
<p>For example, suppose you’re about to enter the restaurant business. One of your assumptions might be ‘restaurants have a menu’. While such an assumption may seem true at first, try challenging it and maybe you’ll find some very interesting business models (such as one restaurant in which customers bring dish ideas for the chef to cook, for example).</p>
<h3>3. Chunk Up</h3>
<p>Each problem is a small piece of a greater problem. In the same way that you can explore a problem laterally — such as by playing with words or challenging assumptions — you can also explore it at different “altitudes”.</p>
<p>If you feel you’re overwhelmed with details or looking at a problem too narrowly, look at it from a more general perspective. In order to make your problem more general, ask questions such as: <em>“What’s this a part of?”</em>, <em>“What’s this an example of?”</em> or <em>“What’s the intention behind this?”</em>.</p>
<p>For a detailed explanation of how this principle works, check the article <em><a title="Boost Your Brainstorm Effectiveness with the Why Habit" href="http://litemind.com/boost-brainstorm-effectiveness-why-habit/">Boost Your Brainstorm Effectiveness with the Why Habit</a></em>.</p>
<p>Another approach that helps a lot in getting a more general view of a problem is replacing words in the problem statement with <em><a title="Hyponymy" href="http://en.wikipedia.org/wiki/Hypernym">hypernyms</a></em>. Hypernyms are words that have a broader meaning than the given word. (For example, a hypernym of ‘car’ is ‘vehicle’). A great, free tool for finding hypernyms for a given word is <a title="WordNet Web Search" href="http://wordnet.princeton.edu/perl/webwn">WordNet</a> (just search for a word and click on the ‘S:’ label before the word definitions).</p>
<h3>4. Chunk Down</h3>
<p>If each problem is part of a greater problem, it also means that each problem is composed of many smaller problems. It turns out that decomposing a problem in many smaller problems — each of them more specific than the original — can also provide greater insights about it.</p>
<p>‘Chunking the problem down’ (making it more specific) is especially useful if you find the problem overwhelming or daunting.</p>
<p>Some of the typical questions you can ask to make a problem more specific are: <em>“What are parts of this?”</em> or <em>“What are examples of this?”</em>.</p>
<p>Just as in ‘chunking up’, word substitution can also come to great use here. The class of words that are useful here are <em><a title="Hyponymy" href="http://en.wikipedia.org/wiki/Hypernym">hyponyms</a></em>: words that are stricter in meaning than the given one. (E.g. two hyponyms of ‘car’ are ‘minivan’ and ‘limousine’). <a href="http://wordnet.princeton.edu/perl/webwn">WordNet</a> can also help you finding hyponyms.</p>
<h3>5. Find Multiple Perspectives</h3>
<p>Before rushing to solve a problem, always make sure you look at it from different perspectives. Looking at it with different eyes is a great way to have instant insight on new, overlooked directions.</p>
<p>For example, if you own a business and are trying to ‘increase sales’, try to view this problem from the point of view of, say, a customer. For example, from the customer’s viewpoint, this may be a matter of adding features to your product that one would be willing to pay more for.</p>
<p>Rewrite your problem statement many times, each time using one of these different perspectives. How would your competition see this problem? Your employees? Your mom?</p>
<p>Also, imagine how people in various roles would frame the problem. How would a politician see it? A college professor? A nun? Try to find the differences and similarities on how the different roles would deal with your problem.</p>
<h3>6. Use Effective Language Constructs</h3>
<p>There isn’t a one-size-fits-all formula for properly crafting the perfect problem statement, but there are some language constructs that always help making it more effective:</p>
<ul>
<li><strong>Assume a myriad of solutions.</strong> An excellent way to start a problem statement is: <em>“In what ways might I…”</em>. This expression is much superior to “How can I…” as it hints that there’s a multitude of solutions, and not just one — or maybe none. As simple as this sounds, the feeling of expectancy helps your brain find solutions.</li>
<li><strong>Make it positive</strong>. Negative sentences require a lot more cognitive power to process and may slow you down — or even derail your train of thought. Positive statements also help you find the real goal behind the problem and, as such, are much more motivating.<br />
For example: instead of finding ways to ‘quit smoking’, you may find that ‘increase your energy’, ‘live longer’ and others are much more worthwhile goals.</li>
<li><strong>Frame your problem in the form of a question.</strong> Our brain loves questions. If the question is powerful and engaging, our brains will do everything within their reach to answer it. We just can’t help it: Our brains will start working on the problem immediately and keep working in the background, even when we’re not aware of it.</li>
<li><strong>If you’re still stuck, consider using the following formula for phrasing your problem statement</strong>:<br />
“In what ways (<strong>action</strong>) (<strong>object</strong>) (<strong>qualifier</strong>) (<strong>end result</strong>)?”<br />
Example: In what ways might I <strong>package</strong> (action) <strong>my book</strong> (object) <strong>more attractively</strong> (qualifier) so <strong>people will buy more of it</strong> (end result)?</li>
</ul>
<h3>7. Make It Engaging</h3>
<p>In addition to using effective language constructs, it’s important to come up with a problem statement that truly excites you so you’re in the best frame of mind for creatively tackling the problem. If the problem looks too dull for you, invest the time adding vigor to it while <em>still keeping it genuine</em>. Make it enticing. Your brain will thank (and reward) you later.</p>
<p>One thing is to ‘increase sales’ (boring), another one is ‘wow your customers’. One thing is ‘to create a personal development blog’, another completely different is to ‘empower readers to live fully’.</p>
<h3>8. Reverse the Problem</h3>
<p>One trick that usually helps when you’re stuck with a problem is turning it on its head.</p>
<p>If you want to win, find out what would make you lose. If you are struggling finding ways to ‘increase sales’, find ways to decrease them instead. Then, all you need to do is reverse your answers. ‘Make more sales calls’ may seem an evident way of increasing sales, but sometimes we only see these ‘obvious’ answers when we look at the problem from an opposite direction.</p>
<p>This seemingly convoluted method may not seem intuitive at first, but turning a problem on its head can uncover rather obvious solutions to the original problem.</p>
<h3>9. Gather Facts</h3>
<p>Investigate causes and circumstances of the problem. Probe details about it — such as its origins and causes. Especially if you have a problem that’s too vague, investigating facts is usually more productive than trying to solve it right away.</p>
<p>If, for example, the problem stated by your spouse is “You never listen to me”, the solution is not obvious. However, if the statement is “You don’t make enough eye contact when I’m talking to you,” then the solution is obvious and you can skip brainstorming altogether. (You’ll still need to work on the implementation, though!)</p>
<p>Ask yourself questions about the problem. What is not known about it? Can you draw a diagram of the problem? What are the problem boundaries? Be curious. Ask questions and gather facts. It is said that a well-defined problem is halfway to being solved: I would add that a perfectly-defined problem is not a problem anymore.</p>
<h3>10. Problem-Solve Your Problem Statement</h3>
<p>I know I risk getting into an infinite loop here, but as you may have noticed, getting the right perspective of a problem is, well, a problem in itself. As such, feel free to use any creative thinking technique you know to help. There are plenty to choose from:</p>
<p>You may want to give yourself an <a title="Get Mentally Fit with an Idea Quota" href="http://litemind.com/get-mentally-fit-with-an-idea-quota/">Idea Quota</a> of problem statements. Or write a <a title="Tackle Any Issue With a List of 100" href="http://litemind.com/tackle-any-issue-with-a-list-of-100/">List of 100</a> problems to solve. <a title="Creative Problem Solving with SCAMPER" href="http://litemind.com/scamper/">SCAMPER</a> your problem definition. These are just some of dozen techniques you can try.</p>
<p>Of course, how much effort you invest in <strong>defining the problem</strong> in contrast to how much effort you invest in <strong>solving your actual problem</strong> is a hard balance to achieve, though one which is attainable with practice.</p>
<p>Personally, I don’t think that 55 minutes of defining a problem versus 5 minutes acting on it is usually a good proportion. The point is that we must be aware of how important problem defining is and correct our tendency to spend too little time on it.</p>
<p>In fact, when you start paying more attention to how you define your problems, you’ll probably find that it is usually much harder than solving them. <em>But you’ll also find that the payoff is well worth the effort.</em></p>
<p><strong>References:</strong></p>
<ul>
<li>Einstein’s Portrait: <a href="http://en.wikipedia.org/wiki/Yousuf_Karsh">Yousuf Karsh</a>.</li>
<li>Einstein’s Quote: <a href="http://www.amazon.com/exec/obidos/ASIN/1580083110/phaedrus0b">Cracking Creativity</a>.</li>
<li>Source : <a href="http://litemind.com/problem-definition/">http://litemind.com</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://duydo.com/einstein%e2%80%99s-secret-to-amazing-problem-solving/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

