Tuesday, October 4, 2011

Compile JStock in Netbean 7

1. Download all these files

Source code - http://sourceforge.net/projects/jstock/files/jstock/1.0.6f/jstock-1.0.6f-src.zip/download

Data File and bin - http://sourceforge.net/projects/jstock/files/jstock/1.0.6f/jstock-1.0.6f-bin.zip/download

2. Unzip all files to C:\jstock
If there are some duplicated files, just overwrite them.

3. Install JDK1.6 if you don't have it.

4. Open Netbeans IDE 7.0.1:  Select File -> Open Project -> Choose C:\jstock

5. In Run section, specify your working directory to C:\jstock

6. Right click on jstock in the project list -> select properties
    - In Libraries -> Set Java Platform to JDK1.6
    - In Compile section, press 'Add JAR/Folder', add ALL jar files which are located in jstock\lib folder.

7. Add junit library in Compile-test Test Libraries section.

8. Right click on jstock in the project list -> select run. (or clean and build first if you like.)

Thursday, February 3, 2011

Fall in Love

It is a new android physics game for Valentine's Day.

Story: The heart of your loved one is falling down to a deep hole. You need to act now and get back the heart before it touches the ground.

Tell your loved one, "I am thinking about you when I am playing this game.". This can be a surprised Valentine's day gift.

This game is available in Android Market now. Please search with the keyword "FallinLove".

Link to download :

Link to android market with your cell phone :
Click here to download if you browsing with your Android phone.

QR Code for download.

Friday, January 21, 2011

Psalm 16

Psa 16:1


Psa 16:2
你 是 我的主;

Psa 16:3
他們 又美又善,

Psa 16:4

他們所澆奠的血 我不獻上;
我嘴唇也不提 別神的名號。

Psa 16:5
耶和華是 我的產業,
是 我杯中的分;


Psa 16:6


Psa 16:7
我 必稱頌 那指教我的耶和華;
我的心腸在夜間 也警戒 我。

Psa 16:8
我 將耶和華 常擺 在我面前,
因 他 在我右邊, 我便 不至搖動。

Psa 16:9

Psa 16:10
Psa 16:11


Friday, January 14, 2011

Bible Study : Psalm 138

Psa 138:1
A Psalm of David. (1)

I will give thee thanks with my whole heart:
Before the gods will I sing praises unto thee. (2 //)

Psa 138:2
I will worship toward thy holy temple,
And give thanks unto thy name
for thy lovingkindness
and for thy truth: (2x2 //)

For thou hast magnified thy word above all thy name. (1 ++)

Psa 138:3
In the day that I called thou answeredst me,
Thou didst encourage me with strength in my soul. (2 //)

Psa 138:4
All the kings of the earth shall give thee thanks,
O Jehovah, For they have heard the words of thy mouth.
Psa 138:5
Yea, they shall sing of the ways of Jehovah;
For great is the glory of Jehovah. (2 // Thanks + sing + explain)

Psa 138:6
For though Jehovah is high, yet hath he respect unto the lowly; (2 <>)
But the haughty he knoweth from afar. (++)

Psa 138:7
Though I walk in the midst of trouble, thou wilt revive me; (2 <>)

Thou wilt stretch forth thy hand against the wrath of mine enemies,
And thy right hand will save me.
(2 // ++)
Psa 138:8
Jehovah will perfect that which concerneth me:
Thy lovingkindness, O Jehovah, endureth for ever;
Forsake not the works of thine own hands. (3++)

Special Pattern

2b highlighted that "For thou hast magnified thy word above all thy name."
8 highlighted that "Jehovah will perfect that which concerneth me."

Gold: "God will concerneth me." Because his lovingkindness and his truth(promised).

Tuesday, January 11, 2011

Harvest Field - New Items

New items are designed to balance the difficulty and the fun of the game.

Blue Question Mark
This tile itself will be converted to green question mark after pressed. Then, all the other question marks will become Ice.

Coming soon.

Hacker Cup - Advance to Round 1

Just got an email from Facebook Hacker Cup last night.

Monday, January 10, 2011

Bible Study : Psalm 135

For psalm 135, the special pattern appears in v6, v18, and v21. The others pharses are in parallel pattern.

Psa 135:1
Praise ye Jehovah.
Praise ye the name of Jehovah;
Praise him, O ye servants of Jehovah,

Psa 135:2
Ye that stand in the house of Jehovah,
In the courts of the house of our God.
(4 pharses in // increasing.)

Psa 135:3
Praise ye Jehovah; for Jehovah is good:
Sing praises unto his name; for it is pleasant.
(2 pharses in //.)

Psa 135:4
For Jehovah hath chosen Jacob unto himself,
And Israel for his own possession.
(2 pharses in //.)

Psa 135:5
For I know that Jehovah is great,
And that our Lord is above all gods.
(2 pharses in //.)

Psa 135:6
Whatsoever Jehovah pleased, that hath he done,

(1 pharse)

In heaven and in earth,
in the seas and in all deeps;
(2 pharses in //.)

Psa 135:7
Who causeth the vapors to ascend from the ends of the earth;
Who maketh lightnings for the rain;
Who bringeth forth the wind out of his treasuries;
(3 pharses in //.)

Psa 135:8
Who smote the first-born of Egypt,
Both of man and beast;
(2 pharses in //.)

Psa 135:9
Who sent signs and wonders into the midst of thee, O Egypt,
Upon Pharaoh, and upon all his servants;
(2 pharses in //.)

Psa 135:10
Who smote many nations,
And slew mighty kings,
(2 pharses in //.)

Psa 135:11
Sihon king of the Amorites,
And Og king of Bashan,
And all the kingdoms of Canaan,
(3 pharses in //.)

Psa 135:12
And gave their land for a heritage,
A heritage unto Israel his people.
(2 pharses in //.)

Psa 135:13
Thy name, O Jehovah, endureth for ever;
Thy memorial name, O Jehovah, throughout all generations.
(2 pharses in //)

Psa 135:14
For Jehovah will judge his people,
And repent himself concerning his servants.
(2 pharses in //)

Psa 135:15
The idols of the nations are silver and gold,
The work of men's hands.
(2 pharses in synthesis)

Psa 135:16
They have mouths, but they speak not;
Eyes have they, but they see not;
Psa 135:17
They have ears, but they hear not;
Neither is there any breath in their mouths.
(4 pharses in //)

Psa 135:18
They that make them shall be like unto them;
Yea, every one that trusteth in them.

(2 pharses in //)

Psa 135:19
O house of Israel, bless ye Jehovah:
O house of Aaron, bless ye Jehovah:
Psa 135:20
O house of Levi, bless ye Jehovah:
Ye that fear Jehovah, bless ye Jehovah.
(4 //)

Psa 135:21
Blessed be Jehovah out of Zion,
Who dwelleth at Jerusalem.
(2 synthesis)

Praise ye Jehovah.

(1 pharse)


Special Pattern in v1a, v6, v21c
v6 : Whatsoever Jehovah pleased, that hath he done,.....

v17b-18 : Neither is there any breath in their mouths. They that make them shall be like unto them; Yea, every one that trusteth in them.
v21 : Blessed be Jehovah out of Zion, Who dwelleth at Jerusalem. Praise ye Jehovah.

The purpose of Pslam 135 is to encourage/educate people to praise God (v21). He is the source of bless.
(v6) explains why we need to praise God. It is because what God has done.
(v17b-18) tell us we should not praise the other fake God (Idol).

Sunday, January 9, 2011

[Android] Harvest Field (好玩免費Android game)



技巧一: 用手指在3個或以上的數字上一掃,而所掃過的數皆不能相同,那些數字就會消失。

技巧二: 按黑色的圖案便能使用特別技能,而圖案亦會消失。


Saturday, January 8, 2011

Hacker Cup - 3 Questions solved.

I am not trying to expose how to solve these 3 problems, I just write down my feeling and experience about coding for the 3 Hacker Cups problems since last night. (I slept 5 hours only)

Last night, I was alone in Starbuck and start to solve the Hacker Cup problems.

I just read "Double Square" instruction and then start to work..

"Double Square"
I remembered I have met the similar questions in ACM programming contest long time ago. My friend told me to solve this with the help of log() and exp(), but actually they do not help me. Until now, I still dont know how to solve this problem with log() and exp(). But last night, I just consider this as a searching problem for a node in a big binary tree and I solved this.

After 1 hour, I wrote a java program and it can find of the answers if the input is a simple 5-digit interger. However, my laptop hanged if the input is Integer.INT_MAX=2147483647. (I have not waited until it ended.)

Then, I tried to add some tricks to remove some unless nodes in the tree. After 2 hours later, my optimizied code can solve the input of 2147483647.

I was very happy at that time and I tried to submit my answer. However, when I clicked the 'submit button' with my Chrome browser, It replied that 'Time Expired'....

I found that the timer counter will not display in Chrome browser. Why I know this now? Because I had submitted "Peg Game" answer with IE and "Studious Student" with Chrome this afternoon.

Anyhow, that is my bad I have not prepared well for this game...

"Peg Game"
Then I went back to home have my dinner and then started to work on "Peg Game"...

Honestly, I don't understand what "Peg Game" is actually doing at first few times I read the instruction, especially when I see the probability outcomes in sample output.

Basically, if you tried to use the data structure to construct the peg game board, I thought you go to a wrong direction.

I have spent a lot of my time to figure out how those probabilities are calculated. After you have clarified what it is, you can complete the code quickly.

I solved the problem around 6am this morning, but I have not uploaded the answers at once. Because I also want to solve the last question "Studious Students" first before I submit my answer again.

"Studious Students"
I don't think this problem can be simply solved by the approach of sorting and appending the strings. Although, this kind of approach can solve 4 out of 5 given sample inputs. Ha ha... This is one of the biggest tricks in this round of Hacker Cup..

The real point of this questions is how you handle the case that if there exists a string which is a prefix of the another strings... I spent most of my time to handle this issue.

Hacker Cup reminded my memory when I still was a Computer Science Student. Hope you have fun in this game.

By the way, if you use Android mobile phone and like game, please try this puzzle game I designed ---> "Harvest Field".
It is available in Android Market now. :)

Friday, January 7, 2011

Harvest Field : Special Items List

Non-clickable Items

99 - "Swipe over it and get more larger numbers (10 to 99)."

Bomb - "All stones connected to the bomb will be destroyed."

Star - "Get 36 or more gold to break a star."

Stone - "Please use another special items to remove stones."

Clickable Items

Breaker - "Use the breaker to destroy a stone."

Ice - "All tiles nearby will become '0's."

Odd - "All ODD numbers will be collected at once."

Melody - "You can remove any number tiles you touch within 8 sec."

Question Mark - "Click it repeatly and you will possibly get 7 stones."

Seed - "Good result will come out if you make 12 or more seeds."

Grid - "Rearrange all Stones/Stars and form a cross."

Thunder - "Remove the columns with the sum over 100."

Bird -- ???

Boat -- ???

Ivy -- ???

Face -- ???

Tower -- ???

Wisdom -- ???

Mountain -- ???

Tuesday, January 4, 2011

How to play Harvest Field?

- Make sure only number tiles filling in each grid cell by clearing out all the stones and special items.

Example of a completed puzzle:

Special Items
- You can easily remove a item just by pressing it. And the item special effect will be performed. Some kinds of effect may help you clear out the stones, but some effect may bring you more stones. To solve the puzzle, you need to press those items at right time.


Harvest Field Special Items List

Swipe number tiles
- You can get more special items by earning gold. For example, a new special item will be dropped each time you earned $50. One of the way to earn gold is by swiping over or more different number tiles. The longer number sequence you swiped, the more gold you can get.

  • 3 number tiles swiped = stone/star/question mark.
  • 4 number tiles swiped = 10% gold
  • 5 number tiles swiped = 100% gold
  • 6 number tiles swiped = 200% gold

Each time you accumulatively get $50, you will get a new random special item.

If you can gain $36 or more gold just after you have used an effect or swiped a number tiles sequence, a star will be broken.

Want a changelle?
How quick do you think that you can solve the Harvest Field puzzle? In the ranking game, your complete time will be posted to the global ranking list. You may compare your time result with those players all over the world.

Facebook group for Harvest Field
We have opened a facebook group to let us discuss everything about this game in future. e.g. How to use the each special item? Please come and check it. Harvest Field Facebook Discussion Group

Harvest Field is available in Android Market now.

QR Code for installation