<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-8139404817558883277</id><updated>2012-01-07T03:58:41.219+08:00</updated><title type='text'>JAVA - Programming</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://nicholasprogram.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8139404817558883277/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://nicholasprogram.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Nicholas</name><uri>http://www.blogger.com/profile/00305753932609581839</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_eUmoaENDMJ0/SsNsAzPu2qI/AAAAAAAAACs/IEtpyI0qS34/S220/%E5%9C%96%E5%83%8F010.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>4</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8139404817558883277.post-5310214568611688319</id><published>2007-12-07T19:31:00.000+08:00</published><updated>2007-12-15T20:24:35.599+08:00</updated><title type='text'>Octopus Simulator System</title><content type='html'>&lt;b&gt;Octopus card&lt;/b&gt; is a rechargeable contactless stored value smart card used to transfer electronic payments in online or offline systems in Hong Kong. It is very popular in the world. It is also used for payment at convenience stores, supermarkets, fast-food restaurants, on-street parking meters, car parks, and other point-of-sale applications such as service stations and vending machines. Because of it, i would like to develop the Octopus Simulator System.&lt;br /&gt;And it simulates the LRT octopus system. There are the source code of the System: Pass-in, Pass-out, Consultation and reload(增值). For the important, there is a CardHandler to handle all the method.&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold;font-size:130%;" &gt;Sample of Output:&lt;/span&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp1.blogger.com/_eUmoaENDMJ0/R1k4IehJ0II/AAAAAAAAABA/xAojfuW2v2I/s1600-h/passin.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5141202167902359682" style="CURSOR: pointer" alt="" src="http://bp1.blogger.com/_eUmoaENDMJ0/R1k4IehJ0II/AAAAAAAAABA/xAojfuW2v2I/s320/passin.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp0.blogger.com/_eUmoaENDMJ0/R1lOGOhJ0JI/AAAAAAAAABI/tA0acGLW1iY/s1600-h/reload.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5141226318503465106" style="CURSOR: pointer" alt="" src="http://bp0.blogger.com/_eUmoaENDMJ0/R1lOGOhJ0JI/AAAAAAAAABI/tA0acGLW1iY/s320/reload.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp0.blogger.com/_eUmoaENDMJ0/R1lOQOhJ0KI/AAAAAAAAABQ/ZYjYkTvZuWo/s1600-h/consultation.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5141226490302156962" style="CURSOR: pointer" alt="" src="http://bp0.blogger.com/_eUmoaENDMJ0/R1lOQOhJ0KI/AAAAAAAAABQ/ZYjYkTvZuWo/s320/consultation.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp0.blogger.com/_eUmoaENDMJ0/R1la-OhJ0LI/AAAAAAAAABY/D-J6JPiopBo/s1600-h/tiger.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5141240474715672754" style="WIDTH: 309px; CURSOR: pointer; HEIGHT: 320px" alt="" src="http://bp0.blogger.com/_eUmoaENDMJ0/R1la-OhJ0LI/AAAAAAAAABY/D-J6JPiopBo/s320/tiger.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;In this program, I also have an idea that if you want to reload your octopus card, you should play a game first, it is just a trick. That is Slot Machine. However, it is not installed at the reload.java. It is independent. Also, there would be a Graphical User Interface(GUI) for all program.&lt;br /&gt;&lt;br /&gt;Firstly, you can download the file here:&lt;br /&gt;CardHandler.java : &lt;a href="http://www.pastebin.ca/817287"&gt;CardHandler.java&lt;br /&gt;&lt;/a&gt;reload.java: &lt;a href="http://www.pastebin.ca/817283"&gt;reload.java&lt;/a&gt;&lt;br /&gt;Consultation.java: &lt;a href="http://www.pastebin.ca/817282"&gt;Consultation.java&lt;/a&gt;&lt;br /&gt;passIn.java: &lt;a href="http://www.pastebin.ca/817285"&gt;passIn.java&lt;/a&gt;&lt;br /&gt;passOut.java:&lt;a href="http://www.pastebin.ca/817284"&gt; passOut.java&lt;/a&gt;&lt;br /&gt;tiger.java: &lt;a href="http://www.pastebin.ca/808357"&gt;tiger.java&lt;/a&gt;&lt;br /&gt;Or you can download the source code as a zip file: &lt;a href="http://www.box.net/shared/yyhu91q4k1"&gt;project_octopusCardSystem.rar&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8139404817558883277-5310214568611688319?l=nicholasprogram.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nicholasprogram.blogspot.com/feeds/5310214568611688319/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8139404817558883277&amp;postID=5310214568611688319' title='5 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8139404817558883277/posts/default/5310214568611688319'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8139404817558883277/posts/default/5310214568611688319'/><link rel='alternate' type='text/html' href='http://nicholasprogram.blogspot.com/2007/12/octopus-card-is-rechargeable.html' title='Octopus Simulator System'/><author><name>Nicholas</name><uri>http://www.blogger.com/profile/00305753932609581839</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_eUmoaENDMJ0/SsNsAzPu2qI/AAAAAAAAACs/IEtpyI0qS34/S220/%E5%9C%96%E5%83%8F010.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp1.blogger.com/_eUmoaENDMJ0/R1k4IehJ0II/AAAAAAAAABA/xAojfuW2v2I/s72-c/passin.jpg' height='72' width='72'/><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8139404817558883277.post-8215733947831629003</id><published>2007-11-19T22:18:00.000+08:00</published><updated>2007-11-19T23:09:01.946+08:00</updated><title type='text'>Lingnan Fighting II</title><content type='html'>This is the second version of Lingnan Fighting. It is a different from the first version. There are three classes: BossPlayer, FightersUniverse and Player. Also, BossPlayer class inherits Player class. And the FightersUniverse is the main program.&lt;br /&gt;&lt;br /&gt;In the other hand, there are four player here. Two of the player are the boss. That means the defense and attackment of boss is more than that of other players.&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold;font-family:courier new;" &gt;The rule:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;There are four players, each with an initial power of &lt;b&gt;10&lt;/b&gt;. Two of them   are &lt;i&gt;ordinary players&lt;/i&gt; and the other two are &lt;i&gt;boss players&lt;/i&gt;. In   each round, one player is selected by random to attack another   random player.  &lt;p&gt;     &lt;/p&gt; If a player chosen is already dead in previous rounds, or a player is selected to attack himself/herself, then select another player.&lt;br /&gt;&lt;br /&gt;The rules of attack are the s&lt;span style="font-size:100%;"&gt;ame as in the previous homework, except for the following:&lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="font-size:100%;"&gt;    Boss players are more resist&lt;/span&gt;ant &lt;/b&gt;&lt;b&gt;to attacks.&lt;/b&gt; When they lose an   attack, they only lose half the amount than an ordinary player. For example,   consider that boss player Janice and ordinary player Ho Yin have 40 and 60   points of power respectively before the attack. If Ho Yin wins the attack,   then Janice would only lose half of the power difference (i.e.   0.5*difference).&lt;br /&gt;  &lt;b&gt;Boss players gain double the power difference on win.&lt;/b&gt; For example, if   boss player Janice wins in the above example, she should gain 2*difference.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-family:courier new;font-size:130%;"  &gt;Sample of ou&lt;/span&gt;&lt;span style="font-weight: bold;font-family:courier new;font-size:130%;"  &gt;tput:&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp0.blogger.com/_eUmoaENDMJ0/R0GkGwP2WcI/AAAAAAAAAA4/_K_d7Q-yAaE/s1600-h/pic.jpg"&gt;&lt;img style="cursor: pointer;" src="http://bp0.blogger.com/_eUmoaENDMJ0/R0GkGwP2WcI/AAAAAAAAAA4/_K_d7Q-yAaE/s320/pic.jpg" alt="" id="BLOGGER_PHOTO_ID_5134565486116624834" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;You can download the file here:&lt;br /&gt;BossPlayer: &lt;a href="http://www.pastebin.ca/784067"&gt;BossPlayer.java&lt;/a&gt;&lt;br /&gt;Player: &lt;a href="http://www.pastebin.ca/784070"&gt;Player.java&lt;/a&gt;&lt;br /&gt;FightersUniverse: &lt;a href="http://www.pastebin.ca/784071"&gt;FightersUniverse.java&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Or you can download the source code as a zip file: &lt;a href="http://www.box.net/shared/dd8lt3ulla"&gt;FightersUniverse.rar&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8139404817558883277-8215733947831629003?l=nicholasprogram.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nicholasprogram.blogspot.com/feeds/8215733947831629003/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8139404817558883277&amp;postID=8215733947831629003' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8139404817558883277/posts/default/8215733947831629003'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8139404817558883277/posts/default/8215733947831629003'/><link rel='alternate' type='text/html' href='http://nicholasprogram.blogspot.com/2007/11/lingnan-fighting-ii.html' title='Lingnan Fighting II'/><author><name>Nicholas</name><uri>http://www.blogger.com/profile/00305753932609581839</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_eUmoaENDMJ0/SsNsAzPu2qI/AAAAAAAAACs/IEtpyI0qS34/S220/%E5%9C%96%E5%83%8F010.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp0.blogger.com/_eUmoaENDMJ0/R0GkGwP2WcI/AAAAAAAAAA4/_K_d7Q-yAaE/s72-c/pic.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8139404817558883277.post-7487117228581323020</id><published>2007-10-18T17:19:00.001+08:00</published><updated>2007-11-19T22:51:30.801+08:00</updated><title type='text'>Lingnan Fighter</title><content type='html'>There is an exciting game!! It is called "Lingnan Fighter". In the game, there are two people that they will fight each other in random. You can see that there is a special thing:&lt;br /&gt;&lt;br /&gt;If the "power difference" is zero before the attack (i.e. both players have the same power), then use 1 as the difference.&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-family:courier new;font-size:130%;"  &gt;Sample of output:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;pre&gt;Round 1&lt;br /&gt;Player Ho Yin's power = 100&lt;br /&gt;Player Jenifer's power = 100&lt;br /&gt;Ho Yin attacks Jenifer!&lt;br /&gt;Jenifer wins&lt;br /&gt;Round 2&lt;br /&gt;Player Ho Yin's power = 99&lt;br /&gt;Player Jenifer's power = 101&lt;br /&gt;Ho Yin attacks Jenifer!&lt;br /&gt;Ho Yin wins&lt;br /&gt;...&lt;/pre&gt;You can download the file here:&lt;br /&gt;Player.java:&lt;a href="http://www.pastebin.ca/739782"&gt; Player.java&lt;/a&gt;&lt;br /&gt;FighterTest(main program):  &lt;a href="http://www.pastebin.ca/739779"&gt;FighterTest.java&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Or you may download the source code as a zip file:&lt;a href="http://www.box.net/shared/axps4l9ymc"&gt;Lingnan Fighting&lt;/a&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold;font-family:courier new;" &gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8139404817558883277-7487117228581323020?l=nicholasprogram.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nicholasprogram.blogspot.com/feeds/7487117228581323020/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8139404817558883277&amp;postID=7487117228581323020' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8139404817558883277/posts/default/7487117228581323020'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8139404817558883277/posts/default/7487117228581323020'/><link rel='alternate' type='text/html' href='http://nicholasprogram.blogspot.com/2007/10/lingnan-fighter.html' title='Lingnan Fighter'/><author><name>Nicholas</name><uri>http://www.blogger.com/profile/00305753932609581839</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_eUmoaENDMJ0/SsNsAzPu2qI/AAAAAAAAACs/IEtpyI0qS34/S220/%E5%9C%96%E5%83%8F010.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8139404817558883277.post-8302103952136061446</id><published>2007-09-29T21:56:00.000+08:00</published><updated>2007-11-19T15:04:44.627+08:00</updated><title type='text'>Even or Odd</title><content type='html'>&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;span style="font-size:100%;"&gt;I&lt;span style="font-family:arial;"&gt;t is a very simple program for detect what kind of numbers you type. Is the number a odd or not?&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;The sample of the program:&lt;br /&gt;&lt;/span&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp2.blogger.com/_eUmoaENDMJ0/Rz70sAP2WaI/AAAAAAAAAAY/AzXtGM2Q6Pc/s1600-h/pic.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; cursor: pointer; width: 268px; height: 263px;" src="http://bp2.blogger.com/_eUmoaENDMJ0/Rz70sAP2WaI/AAAAAAAAAAY/AzXtGM2Q6Pc/s320/pic.jpg" alt="" id="BLOGGER_PHOTO_ID_5133809662066842018" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;You can download the file here:&lt;br /&gt;EvenOROddTest: &lt;a href="http://www.pastebin.ca/778269"&gt;EvenOROddTest&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Or you may dowonload the source code as a zip file:&lt;a href= "http://www.box.net/shared/p1cq5s58cu"&gt;EvenOROddTest&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8139404817558883277-8302103952136061446?l=nicholasprogram.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nicholasprogram.blogspot.com/feeds/8302103952136061446/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8139404817558883277&amp;postID=8302103952136061446' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8139404817558883277/posts/default/8302103952136061446'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8139404817558883277/posts/default/8302103952136061446'/><link rel='alternate' type='text/html' href='http://nicholasprogram.blogspot.com/2007/09/even-or-odd_186.html' title='Even or Odd'/><author><name>Nicholas</name><uri>http://www.blogger.com/profile/00305753932609581839</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_eUmoaENDMJ0/SsNsAzPu2qI/AAAAAAAAACs/IEtpyI0qS34/S220/%E5%9C%96%E5%83%8F010.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp2.blogger.com/_eUmoaENDMJ0/Rz70sAP2WaI/AAAAAAAAAAY/AzXtGM2Q6Pc/s72-c/pic.jpg' height='72' width='72'/><thr:total>0</thr:total></entry></feed>
