Thursday, September 16, 2010

android image downloader for ImageView

// ImageDownloader.java
package lib.img.downloder;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FilterInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.lang.ref.WeakReference;

import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.HttpStatus;
import org.apache.http.client.methods.HttpGet;


import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.net.http.AndroidHttpClient;
import android.os.AsyncTask;
import android.util.Log;
import android.widget.ImageView;

public abstract class ImageDownloader {
private static final String LOG_TAG = "ImageDownlader";
public static void download(String url, ImageView imageView){
Context context = imageView.getContext();
Bitmap bitmap = getBitmapFromCache(context, url);
if (bitmap == null)
forceDownload(url, imageView);
else {
cancelPotentialDownload(url, imageView);
imageView.setImageBitmap(bitmap);
}
}
private static void forceDownload(String url, ImageView imageView){
if (url == null) {
imageView.setImageDrawable(null);
return;
}
if (cancelPotentialDownload(url, imageView)) {
BitmapDownloadTask task = new BitmapDownloadTask(url, imageView);
DownloadedDrawable drawable = new DownloadedDrawable(task);
imageView.setImageDrawable(drawable);
imageView.setMinimumHeight(156);
task.execute();
}
}
private static boolean cancelPotentialDownload(String url, ImageView imageView){
BitmapDownloadTask task = getBitmapDownloadTask(imageView);
if (task != null) {
String downloadURL = task.url;
if (downloadURL == null || !downloadURL.equals(url))
task.cancel(true);
return false;
}
return true;
}
private static BitmapDownloadTask getBitmapDownloadTask(ImageView imageView){
if (imageView != null){
Drawable drawable = imageView.getDrawable();
if (drawable instanceof DownloadedDrawable) {
DownloadedDrawable ddrawable = (DownloadedDrawable)drawable;
return ddrawable.getBitmapDownloadTask();
}
}
return null;
}
static Bitmap downloadBitmap(String url){
final AndroidHttpClient client = AndroidHttpClient.newInstance("Android");
final HttpGet getRequest = new HttpGet(url);
try {
HttpResponse response = client.execute(getRequest);
final int statusCode = response.getStatusLine().getStatusCode();
if (statusCode != HttpStatus.SC_OK) {
Log.w("ImageDownloader", "Error " + statusCode + " while retriving bitmap from " + url);
return null;
}
final HttpEntity entity = response.getEntity();
if (entity != null){
InputStream inputStream = null;
try{
inputStream = entity.getContent();
return BitmapFactory.decodeStream(new FlushedInputStream(inputStream));
} finally {
if (inputStream != null)
inputStream.close();
entity.consumeContent();
}
}
} catch(IOException e){
getRequest.abort();
Log.w(LOG_TAG, "I/O error while retriving from url :" + url, e);
} catch (IllegalStateException e) {
getRequest.abort();
Log.w(LOG_TAG, "Incorrect URL: " + url);
} catch (Exception e) {
getRequest.abort();
Log.w(LOG_TAG, "Error while retrieving bitmap from " + url, e);
} finally {
client.close();
}
return null;
}
static class FlushedInputStream extends FilterInputStream {
public FlushedInputStream(InputStream inputStream) {
super(inputStream);
}

@Override
public long skip(long n) throws IOException {
long totalBytesSkipped = 0L;
while (totalBytesSkipped <>
long bytesSkipped = in.skip(n - totalBytesSkipped);
if (bytesSkipped == 0L) {
int b = read();
if (b <>
break; // we reached EOF
} else {
bytesSkipped = 1; // we read one byte
}
}
totalBytesSkipped += bytesSkipped;
}
return totalBytesSkipped;
}
}
public static class BitmapDownloadTask extends AsyncTask {
private String url;
private final WeakReference imageViewRef;
public BitmapDownloadTask(String url, ImageView imageView) {
imageViewRef = new WeakReference(imageView);
this.url = url;
}

protected void onPostExecute(Bitmap bitmap){
if (this.isCancelled()) {
bitmap = null;
}
ImageView imageView = imageViewRef.get();
if (imageView != null) {
Context ctx = imageView.getContext();
addBitmapToCache(ctx, url, bitmap);
if (imageViewRef != null) {
BitmapDownloadTask task = getBitmapDownloadTask(imageView);
if (this == task) {
imageView.setImageBitmap(bitmap);
}
}
}
}




@Override
protected Bitmap doInBackground(Void... params) {
return downloadBitmap(url);
}

}
static class DownloadedDrawable extends ColorDrawable {
private final WeakReference taskRef;
public DownloadedDrawable(BitmapDownloadTask task){
super(Color.BLACK);
taskRef = new WeakReference(task);
}
public BitmapDownloadTask getBitmapDownloadTask(){
return taskRef.get();
}
}
private static void addBitmapToCache(Context context, String url, Bitmap bitmap){
if (bitmap != null) {
if (context != null) {
File dir = context.getCacheDir();
String fileName = url.hashCode() + ".png";
File f = new File(dir, fileName);
FileOutputStream out = null;
try {
out = new FileOutputStream(f);
bitmap.compress(Bitmap.CompressFormat.PNG, 100, out);
} catch (FileNotFoundException e) {
Log.w(LOG_TAG, "Error save bitmap from url: " + url + " to " + f);
} finally {
if (out != null) {
try {
out.close();
} catch (IOException e) {
}
}
}
}
}
}
private static Bitmap getBitmapFromCache(Context context, String url) {
if (url != null) {
if (context != null) {
File dir = context.getCacheDir();
String fileName = url.hashCode() + ".png";
File f = new File(dir, fileName);
if (f.exists()) {
return BitmapFactory.decodeFile(f.toString());
}
}
}
return null;
}

}



// ImageAdapter.java
package lib.img.downloder;

import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;

public class ImageAdapter extends BaseAdapter{
private static final String[] URLS = {
"http://lh5.ggpht.com/_mrb7w4gF8Ds/TCpetKSqM1I/AAAAAAAAD2c/Qef6Gsqf12Y/s144-c/_DSC4374%20copy.jpg",
"http://lh5.ggpht.com/_Z6tbBnE-swM/TB0CryLkiLI/AAAAAAAAVSo/n6B78hsDUz4/s144-c/_DSC3454.jpg",
"http://lh3.ggpht.com/_GEnSvSHk4iE/TDSfmyCfn0I/AAAAAAAAF8Y/cqmhEoxbwys/s144-c/_MG_3675.jpg",
"http://lh6.ggpht.com/_Nsxc889y6hY/TBp7jfx-cgI/AAAAAAAAHAg/Rr7jX44r2Gc/s144-c/IMGP9775a.jpg",
"http://lh3.ggpht.com/_lLj6go_T1CQ/TCD8PW09KBI/AAAAAAAAQdc/AqmOJ7eg5ig/s144-c/Juvenile%20Gannet%20despute.jpg",
"http://lh6.ggpht.com/_ZN5zQnkI67I/TCFFZaJHDnI/AAAAAAAABVk/YoUbDQHJRdo/s144-c/P9250508.JPG",
"http://lh4.ggpht.com/_XjNwVI0kmW8/TCOwNtzGheI/AAAAAAAAC84/SxFJhG7Scgo/s144-c/0014.jpg",
"http://lh6.ggpht.com/_lnDTHoDrJ_Y/TBvKsJ9qHtI/AAAAAAAAG6g/Zll2zGvrm9c/s144-c/000007.JPG",
"http://lh6.ggpht.com/_qvCl2efjxy0/TCIVI-TkuGI/AAAAAAAAOUY/vbk9MURsv48/s144-c/DSC_0844.JPG",
"http://lh4.ggpht.com/_TPlturzdSE8/TBv4ugH60PI/AAAAAAAAMsI/p2pqG85Ghhs/s144-c/_MG_3963.jpg",
"http://lh4.ggpht.com/_4f1e_yo-zMQ/TCe5h9yN-TI/AAAAAAAAXqs/8X2fIjtKjmw/s144-c/IMG_1786.JPG",
"http://lh6.ggpht.com/_iFt5VZDjxkY/TB9rQyWnJ4I/AAAAAAAADpU/lP2iStizJz0/s144-c/DSCF1014.JPG",
"http://lh5.ggpht.com/_hepKlJWopDg/TB-_WXikaYI/AAAAAAAAElI/715k4NvBM4w/s144-c/IMG_0075.JPG",
"http://lh6.ggpht.com/_OfRSx6nn68g/TCzsQic_z3I/AAAAAAABOOI/5G4Kwzb2qhk/s144-c/EASTER%20ISLAND_Hanga%20Roa_31.5.08_46.JPG",
"http://lh6.ggpht.com/_ZGv_0FWPbTE/TB-_GLhqYBI/AAAAAAABVxs/cVEvQzt0ke4/s144-c/IMG_1288_hf.jpg",
"http://lh6.ggpht.com/_a29lGRJwo0E/TBqOK_tUKmI/AAAAAAAAVbw/UloKpjsKP3c/s144-c/31012332.jpg",
"http://lh3.ggpht.com/_55Lla4_ARA4/TB6xbyxxJ9I/AAAAAAABTWo/GKe24SwECns/s144-c/Bluebird%20049.JPG",
"http://lh3.ggpht.com/_iVnqmIBYi4Y/TCaOH6rRl1I/AAAAAAAA1qg/qeMerYQ6DYo/s144-c/Kwiat_100626_0016.jpg",
"http://lh6.ggpht.com/_QFsB_q7HFlo/TCItd_2oBkI/AAAAAAAAFsk/4lgJWweJ5N8/s144-c/3705226938_d6d66d6068_o.jpg",
"http://lh5.ggpht.com/_JTI0xxNrKFA/TBsKQ9uOGNI/AAAAAAAChQg/z8Exh32VVTA/s144-c/CRW_0015-composite.jpg",
"http://lh6.ggpht.com/_loGyjar4MMI/S-InVNkTR_I/AAAAAAAADJY/Fb5ifFNGD70/s144-c/Moving%20Rock.jpg",
"http://lh4.ggpht.com/_L7i4Tra_XRY/TBtxjScXLqI/AAAAAAAAE5o/ue15HuP8eWw/s144-c/opera%20house%20II.jpg",
"http://lh3.ggpht.com/_rfAz5DWHZYs/S9cstBTv1iI/AAAAAAAAeYA/EyZPUeLMQ98/s144-c/DSC_6425.jpg",
"http://lh6.ggpht.com/_iGI-XCxGLew/S-iYQWBEG-I/AAAAAAAACB8/JuFti4elptE/s144-c/norvig-polar-bear.jpg",
"http://lh3.ggpht.com/_M3slUPpIgmk/SlbnavqG1cI/AAAAAAAACvo/z6-CnXGma7E/s144-c/mf_003.jpg",
"http://lh4.ggpht.com/_loGyjar4MMI/S-InQvd_3hI/AAAAAAAADIw/dHvCFWfyHxQ/s144-c/Rainbokeh.jpg",
"http://lh4.ggpht.com/_yy6KdedPYp4/SB5rpK3Zv0I/AAAAAAAAOM8/mokl_yo2c9E/s144-c/Point%20Reyes%20road%20.jpg",
"http://lh5.ggpht.com/_6_dLVKawGJA/SMwq86HlAqI/AAAAAAAAG5U/q1gDNkmE5hI/s144-c/mobius-glow.jpg",
"http://lh3.ggpht.com/_QFsB_q7HFlo/TCItc19Jw3I/AAAAAAAAFs4/nPfiz5VGENk/s144-c/4551649039_852be0a952_o.jpg",
"http://lh6.ggpht.com/_TQY-Nm7P7Jc/TBpjA0ks2MI/AAAAAAAABcI/J6ViH98_poM/s144-c/IMG_6517.jpg",
"http://lh3.ggpht.com/_rfAz5DWHZYs/S9cLAeKuueI/AAAAAAAAeYU/E19G8DOlJRo/s144-c/DSC_4397_8_9_tonemapped2.jpg",
"http://lh4.ggpht.com/_TQY-Nm7P7Jc/TBpi6rKfFII/AAAAAAAABbg/79FOc0Dbq0c/s144-c/david_lee_sakura.jpg",
"http://lh3.ggpht.com/_TQY-Nm7P7Jc/TBpi8EJ4eDI/AAAAAAAABb0/AZ8Cw1GCaIs/s144-c/Hokkaido%20Swans.jpg",
"http://lh3.ggpht.com/_1aZMSFkxSJI/TCIjB6od89I/AAAAAAAACHM/CLWrkH0ziII/s144-c/079.jpg",
"http://lh5.ggpht.com/_loGyjar4MMI/S-InWuHkR9I/AAAAAAAADJE/wD-XdmF7yUQ/s144-c/Colorado%20River%20Sunset.jpg",
"http://lh3.ggpht.com/_0YSlK3HfZDQ/TCExCG1Zc3I/AAAAAAAAX1w/9oCH47V6uIQ/s144-c/3138923889_a7fa89cf94_o.jpg",
"http://lh6.ggpht.com/_K29ox9DWiaM/TAXe4Fi0xTI/AAAAAAAAVIY/zZA2Qqt2HG0/s144-c/IMG_7100.JPG",
"http://lh6.ggpht.com/_0YSlK3HfZDQ/TCEx16nJqpI/AAAAAAAAX1c/R5Vkzb8l7yo/s144-c/4235400281_34d87a1e0a_o.jpg",
"http://lh4.ggpht.com/_8zSk3OGcpP4/TBsOVXXnkTI/AAAAAAAAAEo/0AwEmuqvboo/s144-c/yosemite_forrest.jpg",
"http://lh4.ggpht.com/_6_dLVKawGJA/SLZToqXXVrI/AAAAAAAAG5k/7fPSz_ldN9w/s144-c/coastal-1.jpg",
"http://lh4.ggpht.com/_WW8gsdKXVXI/TBpVr9i6BxI/AAAAAAABhNg/KC8aAJ0wVyk/s144-c/IMG_6233_1_2-2.jpg",
"http://lh3.ggpht.com/_loGyjar4MMI/S-InS0tJJSI/AAAAAAAADHU/E8GQJ_qII58/s144-c/Windmills.jpg",
"http://lh4.ggpht.com/_loGyjar4MMI/S-InbXaME3I/AAAAAAAADHo/4gNYkbxemFM/s144-c/Frantic.jpg",
"http://lh5.ggpht.com/_loGyjar4MMI/S-InKAviXzI/AAAAAAAADHA/NkyP5Gge8eQ/s144-c/Rice%20Fields.jpg",
"http://lh3.ggpht.com/_loGyjar4MMI/S-InZA8YsZI/AAAAAAAADH8/csssVxalPcc/s144-c/Seahorse.jpg",
"http://lh3.ggpht.com/_syQa1hJRWGY/TBwkCHcq6aI/AAAAAAABBEg/R5KU1WWq59E/s144-c/Antelope.JPG",
"http://lh5.ggpht.com/_MoEPoevCLZc/S9fHzNgdKDI/AAAAAAAADwE/UAno6j5StAs/s144-c/c84_7083.jpg",
"http://lh4.ggpht.com/_DJGvVWd7IEc/TBpRsGjdAyI/AAAAAAAAFNw/rdvyRDgUD8A/s144-c/Free.jpg",
"http://lh6.ggpht.com/_iO97DXC99NY/TBwq3_kmp9I/AAAAAAABcz0/apq1ffo_MZo/s144-c/IMG_0682_cp.jpg",
"http://lh4.ggpht.com/_7V85eCJY_fg/TBpXudG4_PI/AAAAAAAAPEE/8cHJ7G84TkM/s144-c/20100530_120257_0273-Edit-2.jpg"
};
public int getCount(){
return URLS.length;
}
public String getItem(int position){
return URLS[position];
}
public long getItemId(int position){
return URLS[position].hashCode();
}
public View getView(int position, View view, ViewGroup parent){
if (view == null){
view = new ImageView(parent.getContext());
view.setPadding(6, 6, 6, 6);
}
ImageDownloader.download(URLS[position], (ImageView)view);
return view;
}
}


//ImageListActivity.java
package lib.img.downloder;

import android.app.ListActivity;
import android.os.Bundle;

public class ImageListActivity extends ListActivity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.imagelist);
this.setListAdapter(new ImageAdapter());
}
}

Wednesday, September 23, 2009

Sima Niu 's worry

Sima Niu 's worry

Mr Sima walk slowly behind the Mr Kong's group. He fell very pain in heart
when he have a step. Mr Kong and all his students they couldn't stay longer
at Song Country, all these because of his older brother.

The king of Song is very respect Mr kong and give them hot welcome, but his
brother want to kill Mr kong because Mr Kong spoke his brother has curruption
and didn't respect the king.

Why I have this brother.

When He recall Mr kong said, The god bless me very much, how your brother
can do with me? he fell some comfortable.

I have this brother, how will Mr kong think about me? I am really want to
learn from Mr Kong and join his group, but they all fous on me when we come
together. As if they are speak, you have this brother, I are that people either.
Everytime Mr kong turn away from me when we encounter. Should I stay with
them or go away?

Hello Sima, How are you going? Mr Xia ask him.

Do you fell sore, because we have walked a long way. Said Mr Xia.

Not that, I am a adault, How can I feel that?

We are debating just now, no one know where are you, but Our Mentor
Mr Kong ask us where are you, so I go back to find you. Said Mr Xia.

Maybe My mood is bad. I have a little bit lonly.

I know what you are felling, take ease, that is not your fault.

I have no brothers, you guys all have, Mr Sima says sadly.

No worry, I have said, you and your brother are different. Just like our
mentor said, people's fate come from god. You lost you brother, maybe
that come from god as well. I think, people should respect each other,
we use respection to maintain the sociaty, every people is polite to
other then all people come to brothers. That isn't brother come from
blood, look, all of us are your brothers.

"They look me as brother? Why do I look down on myself? I should have
confidence on myself." Mr Sima is thinking.

Hurry up, we should keep up with them.

When they come to their friends, some are talking about accommodation of
this night, some are appreciateing the landscape.

Mr kong is seating on a bridge, looking far away of the water.

When Mr Sima come to Mr kong, Mr kong have a smile on face to welcome him.

At first, Mr Sima want to speak sorry to Mr kong, but he don't want to
people look through of him, then want to ask some questions.

What is a Noble character, What is a Nobleman?

Mr Kong close his eye said, nobleman don't have worries on small things.

People have no worries on small things is Nobleman? Mr Sima ask.

People always doubt about others, they must have some shade in their heart.
Mr Kong explained.

Mr Sima know this come to him.

What your broth done is not relate to you, I think you know of it. Why you
worry about how other think about you, further ask others' comments. Is this
because people look them too much? After all, We have so many important
things to do.

Mr Sima's worry dispear, after he heard it.







Monday, September 21, 2009

Develop JEE on GAE

Develop JEE on GAE


I have developed JEE website on GAE couples of time. I want to share my experience of it.

My website based on springframework 3.
GAE BigTable's JDO interface is really good. I use it as ordinary relation database.
I design the Entity Object just like relation database's table.
Each table have at least 2 columns, named "key" and "id", key for BigTable, id for
my app.
Backup and restore data, we can use low level API
Seach Engine, Compass is good to support GAE
Bind my own domain name to this webapp
Write a RPCService for Ajax

This is my website, like ebay....

url : http://www.jnix.com , shootbay.appspot.com
seller's username/password mielyee@gmail.com/1q2w3e4r




Meng YiZi ask about filial

Meng YiZi ask about filial

When Kong FuZi grant to be an official, Meng YiZi to express his respection,
He comes to Kong Fuzi's home with his 10 years old son sometime.

One day Meng YiZi visits again. He asks about filial quit seriously, when he
is leaving. Kong KuZi knows about Mr Meng's familly will hold a ceremony
recently. He thinks Mr meng ask this at this time not for respecting his
ancestor but for spending money and show his power to others.

Mr Kong knows it quickly and said, "Do nothing"

Mr Meng didn't ask further then go back home, but this made Mr Kong pretty
upsetting.

If Mr meng do some unsuitable things at ceremony, this would not just harm
Mr Meng's family, it would harm the whole country(because Mr Meng's family
is a powerful family in the country). If Mr Meng tell others when he does
this, he has asked me about this, then my political reputation will be dirted.


Mr Kong upset several days and he couldn't speak this directly to Mr Meng
because of It is rude to change his answers.

One day, one of his student named Mr Fan drive carrige for him. Mr Kong knows
this man is good at GongFu and get some appreciation from Mr Meng and they
have close ralationship.

Mr Kong spoke to Mr Fan, Do you know Mr Meng came to my home and asked me
about filial recently, Mr Fan said, I know his family would hold a ceremony
in the near future.

Do you know about filial?
Mr Fang dosen't speak anything, and think what Mr Kong said before. He thought
a long time but haven't got answer. Then Mr Kong said, I told "Suitable". What is
that "Do nothing" (suitable and do nothing have a simillar prononciation in chinese)
I don't know your meanings. Mr Fan said.
Maybe what I said it is too simple. Mr Meng said. My meaning is do ceremony shouldn't
has conflict to filial. When parents exists, people should take care of them with filial,
When they gone, people should memory with filial.

I think Mr Meng should know about this, because he has studied filial a long time. Mr Fan said.
I don't think so. Mr Kong said.
I heard about they would hold a ceremony recently, and this time should be fine spectacle. Mr Fan said.
You don't know filial as well, Mr Kong speak in a high voice.
Ceremony shouldn't be too simple and too spectacle. Spectacle is no more than simple. Mr Meng as a
High official, he should do this according his status. If he doesn't, other people will learn from
him, then the country becomes confused and conflicted. This is not for filial.

Mr Fan doesn't dare to have a look of Mr Kong and drive the carrige in dull.

Anyway, when they come back, Mr Fan visits to Mr Meng's home.






Thursday, September 17, 2009

old Miser and his donkey

old Miser and his donkey

An old man famous for look heavy on money. He is strict in spending money, as though he save
a big quantities of money. He only spend his money on lending, then earn interests from it,
therefore, more and more money he got.

His families is annoyed, because their food and cloths not good as a wealthy family, but no
one dare to speak it.

The man get more and more older, his body is not strong as usual, everytime when he came
back after collecting debts from people, he felt vey tired. He doesn't trust other people,
and think if other people do it, he would lost money.

One day, his son told him, father, everytime when you came back after collecting detbs, you
looked pretty tired, how about we buy a donkey, riding donkey go out is easier.

The man take out some money, count again and again, he felt waste money when thinking
about buying a donkey spend so much money.

Then after some days, one day the old man went out, walk a whole night, and met a storm, then
got a sick.

His son persvade him buy a donkey as well, this time the man made a strong decision then
spent money buying a donkey.

His family think the man wouldn't suffer from long distance walk after buying this donkey, on
the other side, the man hate go out riding donkey everytime when go out. He only ride his
donky when he felt too tired, after riding some time, he gets off from back of donkey and
walk by himself.

The donkey was spoilled only willing to walk following the man. One day, the old man plan
to go out, he think the weather is too hot, he couldn't stand on it, then he bring his
donkey together. When he go to the destination, he walk as his best.

He ate lunch at the debts people's home, then go back home. That is lunch time, the sunshine
is bloody strong, he couldn't have a breath after he walked a very short distance. He has to
ride on his donkey, unfortunatlly, the donkey doesn't walk long distance as well then
tired and couldn't move further.

The poor man hurry get off from his donkey, he untie the saddle of his doney and take it
byself to alliviate the donkey. The doney was very happy after untied the saddle then run
quickly to home, the poor man was afraid of lost his donkey then run after the donkey,
because it is too hot and run too fast, he got sick after arrive home.

old Miser and his donkey

old Miser and his donkey

An old man famus for look heavy on money. He is strict in spending money, as though he save
a big quantities of money. He only spend his money on lending, then earn interests from it,
therefore, more and more money he got.

His families is annoyed, because their food and cloths not good as a wealthy family, but no
one dare to speak it.

The man get more and more older, his body is not strong as usual, everytime when he came
back after collecting debts from people, he felt vey tired. He doesn't trust other people,
and think if other people do it, he would lost money.

One day, his son told him, father, everytime when you came back after collecting detbs, you
looked pretty tired, how about we buy a donkey, riding donkey go out is easier.

The man take out some money, count again and again, he felt waste money when thinking
about buying a donkey spend so much money.

Then after some days, one day the old man went out, walk a whole night, and met a storm, then
got a sick.

His son persvade him buy a donkey as well, this time the man made a strong decision then
spent money buying a donkey.

His family think the man wouldn't suffer from long distance walk after buying this donkey, on
the other side, the man hate go out riding donkey everytime when go out. He only ride his
donky when he felt too tired, after riding some time, he gets off from back of donkey and
walk by himself.

The donkey was spoilled only willing to walk following the man. One day, the old man plan
to go out, he think the weather is too hot, he couldn't stand on it, then he bring his
donkey together. When he go to the destination, he walk as his best.

He ate lunch at the debts people's home, then go back home. That is lunch time, the sunshine
is bloody strong, he couldn't have a breath after he walked a very short distance. He has to
ride on his donkey, unfortunatlly, the donkey doesn't walk long distance as well then
tired and couldn't move further.

The poor man hurry get off from his donkey, he untie the saddle of his doney and take it
byself to alliviate the donkey. The doney was very happy after untied the saddle then run
quickly to home, the poor man was afraid of lost his donkey then run after the donkey,
because it is too hot and run too fast, he got sick after arrive home.

Wednesday, September 16, 2009

Lan Zi offers skills

Lan Zi offers skills

In ancient time, people call skilled people name "Lan zi". There is
a famus Lan zi in Song country. He ask for meeting with king of Song,
and expect to receive an grant from the king. The king interview him
and let him make a performance in public.

This guy bind tow sticks with his leg, and walk and run, at same
time, throw and hold 7 swords between air and his hands. Everytime
he can receive the swords preciously and doesn't hurt himself. The
king looked very exciting and reward him gold and silk immediately.

After sometime, another Lanzi heard about it, then ask to interview
the king again, this time, the king is not interesting but angry.
the king said, last time when the person meet me, I have a good mood, as
though his skill is useless, I rewarded him gold and silk. Today,
this man must heard about it, because he is love money and think
I will reward him as well, this is annoyed.

Therefor, the king arrest the Lanzi and want to kill him at begining,
but he think his guilty is not worth to die, then throw the man
into prison one month.

A king deal things on his mood must has no principal on deal with
a country. If a man just think him "appreciate skilled people", that
is stupid either.