Thursday, November 22, 2012

:D

Did this line art when I met Clarice way back December 2009 :) 

Monday, November 19, 2012

MongoDB sample app

Too lazy to write something haha. might as well give the github link

https://github.com/bertanasco/HelloMongoDB

pom.xml

HelloMongoDB.java


Output

 Reference
http://www.mongodb.org/display/DOCS/Java+Tutorial#JavaTutorial-MakingAConnection

Happy coding :D Zzzzzzzz

MongoDB windows set-up

Sharing how I did my  MongoDB set-up :D

1. Download MongoDB

http://www.mongodb.org/downloads

2. Extract zip file

3.  Install and run MongoDB as service


Notes
--dbpath  :  the data folder where mongoDB would store it's Files
--logpath  : the path to the file where the service installation log would be written
--install    : installs mongoDB as a windows Service
--serviceName : obvious :P
--help  for more info

The logs below indicate that you have successfully installed mongoDB as a windowsservice


Open local services  to verify


type net start MongoDB to start the recently installed windows service

4.Check MongoDB

to view the db startup, open the log file that you used during installation. You should have something similar to the picture below:



open web admin console



Links

Saturday, November 17, 2012

Basic TDD with Jersey Test Framework

Decided to do TDD on one of  my mobileTAO initiatives. I hope this may also help others who wish to learn TDD with Jersey test framework

1.Requirements

1. JDK 1.6
2. Eclipse Indigo
3. Jersey
4. Jersey Test Framework
5. Maven 3.0.4 (with m2eclipse plugin)

2. Create maven project

run
mvn archetype:generate -DgroupId=desired.group.id -DartifactId=desiredArtifactId -Darchetype.ArtifactId=maven-archetype-webapp -DinteractiveMode=false

run mvn eclipse:eclipse in order to support eclipse

 Import project to eclipse

3. Setting up Dependencies 

Add the jersey dependency to your pom.xml

4. Create the test 

We will now code our unit test. add the source code to src/test/java


5. Create rest service




Usefull Links
http://jersey.java.net/nonav/documentation/latest/getting-started.html
http://www.parleys.com/#st=5&id=2723&sl=0

Thursday, November 15, 2012

Blog

BLOG
It's been more than a year since my last blog entry. :) I think It's time to fix some of the typos and grammatical errors on my old entries and start blogging again. I'm studying for my OCJP exam and I think blogging about it would benefit me and the readers ( if I have one LOL)

Palindrome

Palindrome

below is my take on the palindrome challenge posted by a friend on FB
Code #2: Make a function 'is_palindrome' where it takes string as an input and returns a Boolean value if it is a palindrome or not. The function should follow recursive function calls so for/while loops should not be seen in the code.