Budding racing drivers will feel like they’re out on the circuit for real in the…

November 5th, 2012 by Terrence Miao No comments »

Budding racing drivers will feel like they’re out on the circuit for real in the full size car – if they are willing to part with £90,000, a toy for big boys …

Read more: http://www.dailymail.co.uk/sciencetech/article-2226172/The-90-000-Formula-1-simulator-indistinguishable-real-thing-actually-move.html

» Read more: Budding racing drivers will feel like they’re out on the circuit for real in the…

November 2nd, 2012 by Terrence Miao 12 comments »

Reshared post from +Chai Ang

Embedded Link

IntelliJ IDEA Productivity Tips. Part 1
People unfamiliar with IntelliJ IDEA keep always asking me, why it’s better than other products. Today we have decided to make a short overview of some very basic features, that let developers be more productive every day.
In this episod we will show how to use basic shortcuts for test-driven development. The video comes with transcription in subtitles. Check yourself, if you know and use all these basic features.

To make it even more easy to re…

Google+: View post on Google+

Thinking in TDD (Test Driven Development)

November 2nd, 2012 by Terrence Miao 5 comments »

Attending a TDD workshop. Uncle Bob's Bowling game Kata is used to as TDD demonstration. This totally change my previous view about TDD.

TDD is not just simple as:

1. write a failed test 
2. write production code
3. make test pass

or this Red-Green-Refactor pattern. Actually, 

• TDD is design in front, a top down not bottom up approach
• When you practice TDD, you will guarantee have 100% code test coverage. No one line code more, no one line code less. One line code deleted and your test will fail
• Small change in TDD iteration could reduce cycle time
• Debugging no more. Practicing TDD you don't really need debug your code. So that's why average developers use Eclipse, good developers use IntelliJ, great developers use VI
• Copy & paste becomes a problem in TDD. As we all know average developers code code, good developers copy & paste code, great developers steal code. But TDD reduces duplicated code and prevent copy & paste programming
• Believe it or not, TDD can finish coding quicker than traditional write production code first, then write test development cycle 

Reference: Bowling Game Kata, _http://butunclebob.com/files/downloads/Bowling%20Game%20Kata.ppt_

Google+: View post on Google+

Hitting a wall this week when an application broken in CI due to newly added email…

November 1st, 2012 by Terrence Miao 2 comments »

Hitting a wall this week when an application broken in CI due to newly added email notification service.

Basically, after each transaction, an email sent out to notify customer. Unfortunately, may I say fortunately, for a great job done by the infrastructure and security teams, local and CI are blocked to access SMTP server. 

Project is in the Spring boat. It's blissful experience that Spring has native email service implementation and support, concisely and quickly to turn it on. To get CI go through, the first hint is to replace real email service with mocked one. It should support unit and functional test. However, it can't touch the existing beautiful code, even a single character.

There are a lot these email / SMTP server solutions: Apache James, jsmtpd … our congenial friend +Dean Budd Deano Balsano tipped Dumbster long time ago. But they all lost touch, out of fashion now. New boy is in town and his name is Subetha SMTP.

Let the code do the talk …

Reference: https://code.google.com/p/subethasmtp/

Embedded Link

» Read more: Hitting a wall this week when an application broken in CI due to newly added email…

Mock SMTP server / email service

November 1st, 2012 by admin No comments »

SubEtha SMTP is a Java library which allows your application to receive SMTP mail with a simple, easy-to-understand API. I use it as Mock SMTP server for CI (Continuous Integration) in a Spring project.

This is applicationContext-email.xml:

<!-- In order to not port clash set port 0 so JVM will bind to any free port then refer to the resolver port -->
<bean id="mockSMTPServer" class="org.subethamail.wiser.Wiser" init-method="start" destroy-method="stop">
    <property name="port" value="0" />
</bean>

<bean id="mailSender" class="org.springframework.beans.factory.config.BeanReferenceFactoryBean">
    <property name="targetBeanName" value="mailSender${mail.smtp.service}" />
</bean>

<bean id="mailSenderImpl" class="org.springframework.mail.javamail.JavaMailSenderImpl">
    <property name="host" value="${mail.host}" />
</bean>

<bean id="mailSenderMock" class="org.springframework.mail.javamail.JavaMailSenderImpl">
    <property name="host" value="#{mockSMTPServer.server.hostName}" />
    <property name="port" value="#{mockSMTPServer.server.port}" />
</bean>

In applicationContext.xml set to Impl (Spring email service implementation) or Mock (mocked email service):

mail.smtp.service=[Impl|Mock]

» Read more: Mock SMTP server / email service

A Really Simple Explanation of What QE (Quantitative easing) Is

October 29th, 2012 by Terrence Miao No comments »

An American borrowed one million U.S. dollars from bank to build a house. After all the borrowed money spent and house finished then this American found he couldn't repay the loan. He run away to Bahamas and left the newly built house to the bank.

The bank had the repossessed house which didn't want. The bank wanted one million dollars back. Writing off one million dollars from the book made hard for the bank to make more loans. Money market became frozen.

Now U.S. Federal Reserve came to help.

Fed Reserve started printer machine, printed one million dollars and gave newly printed money to the bank. So the bank could lend again. Frozen currency market got easing.

Fed Reseve added one million dollars liability because new money, to balance this Fed Reserve sold one million dollars mortgage backed security as low yield sovereign debt to government bond investors.

The result was one million dollars asset added into American property market; the bank had the loan paid back and could continue lending; Fed Reserve provided urgently necessary liquidity to the market; and bond investors got screwed …
 

Google+: View post on Google+

The origin of money

October 28th, 2012 by Terrence Miao 1 comment »

Money fulfills three main functions. First, it must be a medium of exchange, easily traded for goods and services. Second, it must be a store of value, so that it can be saved and used for consumption in the future. Third, it must be a unit of account, a useful measuring-stick.

Some argue that money has its roots in the power of the state. Others claim the origin of money is a purely private matter: it would exist even if governments did not. And It was state intervention, not the private market, that made precious metals work as money.

Read more: http://www.economist.com/node/21560554

Google+: View post on Google+

Most Sacred Heart of Uncle Bob help me to trust you

October 28th, 2012 by Terrence Miao 3 comments »

 More today than I did yesterday.

Originally shared by Deano +Dean Budd 

Read more: http://blog.8thlight.com/uncle-bob/2012/08/13/the-clean-architecture.html

Google+: View post on Google+