Monday, July 30, 2007

Those Little Foxes...

The Word of God says in Song of Solomon 2:15 : Take us the foxes, the little foxes, that spoil the vines: for our vines have tender grapes.

We have a loving Saviour who died on the Calvary for us, shedding even His last drop of blood for us. His love towards us is so great and beyond human comprehension. Jesus is the true vine, we are His branches. When we are there, those little foxes comes and spoils us.

Those little foxes that steal our joy:
     The world offers a life that appears to be a glorious one. But the standards of the world are against the standard of the Word. When we give way to those little foxes in our lives, we end up being spoiled and fruitless.

Lets have wisdom to protect the vine and to bear much fruit for the one who gave His life for us.

The Joy of the Lord

Psalm 43
Judge me, O God, and plead my cause against an ungodly nation: O deliver me from the deceitful and unjust man.
For thou art the God of my strength: why dost thou cast me off? why go I mourning because of the oppression of the enemy?
O send out thy light and thy truth: let them lead me; let them bring me unto thy holy hill, and to thy tabernacles.
Then will I go unto the altar of God, unto God my exceeding joy: yea, upon the harp will I praise thee, O God my God.
Why art thou cast down, O my soul? and why art thou disquieted within me? hope in God: for I shall yet praise him, who is the health of my countenance, and my God.

  • The Joy of the Lord is an everlating one.
  • The Joy of the Lord comes from His altar.
  • The Joy of the Lord comes from the House of God.
  • The Joy of the Lord belongs to the Lord.

In His presence there is fullness of Joy. When you go and place yourself at His altar, His joy fills you.

Psalm 92:12-15
The righteous shall flourish like the palm tree: he shall grow like a cedar in Lebanon.
Those that be planted in the house of the LORD shall flourish in the courts of our God.

They shall still bring forth fruit in old age; they shall be fat and flourishing;
To shew that the LORD is upright: he is my rock, and there is no unrighteousness in him.


The righteousness of the righteous will keep on increasing. It will keep on growing taller. The righteous shall flourish like a palm tree. Why a palm tree? A palm tree is tall and and it fruits are on the top of it. The fruits of the righteous are on the top of the tree for the world to see. People may not listen to your words, but they will see your fruits.

Happiness and Joy
There is a significant difference between Joy and Happiness.

Happiness is based on your soul. It is a state of mind. You are happy when you buy a house or have a biriyani or get a hike or a new job. Happiness is temporal. When the time goes on, you come back to the *normal*.

Joy is not based on your circumstances. It is not based on whether something good happens to you, or something bad happens in your life. This kind of joy comes from the Lord (and yes, Lord only). This joy is an eternal one! Daniel and His friends had this joy when they were thrown into the fire.

Run to the Cross and stay there!!!

Lessons from the nature (part 2)

Animals which are Good Examples: Job 39:19-30 KJV

Horse

Hast thou given the horse strength? hast thou clothed his neck with thunder?
Canst thou make him afraid as a grasshopper? the glory of his nostrils is terrible.
He paweth in the valley, and rejoiceth in his strength: he goeth on to meet the armed men.
He mocketh at fear, and is not affrighted; neither turneth he back from the sword.
The quiver rattleth against him, the glittering spear and the shield.
He swalloweth the ground with fierceness and rage: neither believeth he that it is the sound of the trumpet.
He saith among the trumpets, Ha, ha; and he smelleth the battle afar off, the thunder of the captains, and the shouting.

Lesson: Never turn back. Never go back. Your strength is from your Master!

Hawk

A Hawk always flies towards the South.

Doth the hawk fly by thy wisdom, and stretch her wings toward the south?

Lesson: Our strength comes from the south. Victory comes not from the North or the East or the West. But it comes from the Lord. Always fly towards the mount of God towards the south

Eagle

An Eagle always flies high. An eagle builds its nest on high.

Doth the eagle mount up at thy command, and make her nest on high?
She dwelleth and abideth on the rock, upon the crag of the rock, and the strong place.
From thence she seeketh the prey, and her eyes behold afar off.
Her young ones also suck up blood: and where the slain are, there is she.


Lesson: Never live a crow life. Live an eagle life! Many crows may chase the eagle. But the eagle never looks back. It keeps on going, It keeps on flying high! Dont see your circumstances. Keep flying high towards the Master.

Friday, July 27, 2007

Time all it ..... needs

Two Employees speaking to each other...
First One said ... I heard that you are going to retire tommorrow.
the Second One answered... happily yes..!!! and continues... now i can complete my book.

First One... with most surprise... tells, Oh... i dont know that you are writing a book.
Second One says.... no.. no.. I am reading the book.

Monday, July 23, 2007

Lessons from the nature

Animals which are Bad Examples: Job 39:1-17 KJV

Wild Goats

The young ones go away from their parents and do not return to them.

They bow themselves, they bring forth their young ones, they cast out their sorrows.
Their young ones are in good liking, they grow up with corn; they go forth, and return not unto them.

Lesson: Honour your parents. Love them. Never neglect them at any point of time.

Wild ass

Doesnt care for anyone. It's just wild!

Who hath sent out the wild ass free? or who hath loosed the bands of the wild ass?
Whose house I have made the wilderness, and the barren land his dwellings.
He scorneth the multitude of the city, neither regardeth he the crying of the driver.
The range of the mountains is his pasture, and he searcheth after every green thing.

Lesson: Be caring for others. Dont just be a church goer. Involve yourself in the ministry of the church. Open up your house for a cell prayer for instance.

Unicorn

Its selfish, lazy, it does not save. You cannot trust it.

Will the unicorn be willing to serve thee, or abide by thy crib?
Canst thou bind the unicorn with his band in the furrow? or will he harrow the valleys after thee?
Wilt thou trust him, because his strength is great? or wilt thou leave thy labour to him?
Wilt thou believe him, that he will bring home thy seed, and gather it into thy barn?

Lesson: Serve others. Save your money. Spend time with your family. Be somebody that God can trust.

Ostrich

Leaves her eggs and forgets them.

Which leaveth her eggs in the earth, and warmeth them in dust,
And forgetteth that the foot may crush them, or that the wild beast may break them.
She is hardened against her young ones, as though they were not her's: her labour is in vain without fear;
Because God hath deprived her of wisdom, neither hath he imparted to her understanding.

Lesson: Dont leave your eggs, which are the Salvation, the anointing and the Gifts of God. Dont be foolish enough to leave your eggs.

Weekly Manna

If i ask you "What did you have for today's breakfast?", You will reply me 'idli' or 'dosa' or 'blah blah blah' because you remember it.

But if i ask you "What did you have for breakfast last monday?", you will simply stare at me.

Well we people forget what we do eat in the course of time. I believe the same thing does happen with our spiritual food too. You may not remember the message/sermon that you heard from your preacher 3 weeks ago. Albeit, don't worry. We are here to help you!

Oh, lemme say somethin' : Sam Josh is now blogging on the sunday sermons!! Bookmark http://java-salt.blogspot.com today!!!

OK now, for the last sunday..........

Last Sunday our Senior Pastor(Rev.Paul Thangiah) brought out God's word on learning from the nature that God Created for Himself. Everything He created, He created for Himself. God even created the wicked for the day of destruction. phew!

God speaks often through the nature. How many of you have experienced that? Oh I can see many hands raising up there. Ok, well We'll meditate from Job 31:1-17 this week.

God Bless!
Samuel

P.S. If you would like to add more to the sermon outline, or if you would like to pen your ideas on the sermon or if you would like to share something special from your heart, you are MOST WELCOME to do so. You may add it as your COMMENT, just below the sermon weblog. Please allow one working day for moderating your comment. Thank you.

Tuesday, July 17, 2007

Paginate your Lists

Pagination is a bare necessity when it comes to handling lists in your web applications. And a good pagination always makes your application more user friendly. Google, the foremost search engine has one of the best Pagination for it. So this article helps you work out a pagination for your lists. Sit tight.



In this article, we will discuss the logic around paginating a list with the Google-Pagination like Look and Feel. As you would have noticed there in Google, the current page is always displayed at the centre of the links, unless otherwise it can't be so.



The scope of the article is just to give you a brief idea on how you can go about working a pagination around your data, and this does not cover retrieval of data and/or caching your data from the database. Right, Having known this let's make a list of requirements that our pagination has to meet.





Feature Analysis:



  • Links to show on the page
  • Showing previous and next Buttons when needed
  • Highlighting of current page number
  • Handling a random selection of page
  • Showing the current page link at the centre


(i) Defining the Properties:

Let's say right now we will allow only a maximum of 10 links to be displayed on a page. Clicking a link gets a page with say, 10 rows of data. So at a stretch a user can see 10 links/pages of 10 rows each. Doesn't matter if the total number of results is less than 100 rows of data. We will show them all. But if we get some 500 results as an example, we will not be showing 500/10=50 links. Rather we will show only the first 10 links. We will hold this in a global variable and this is a final one. Here goes the snippet:









public final static int TOTAL_LINKS = 5;



Deduce the total number of result pages to be listed. This in fact we will pre-determine at the beginning. Although we may have to change this at the later course. We will come back to that shortly, be rest assured.









public static int TOTAL_RESULT_PAGES = 9;


We also need to initialize certain variables like Current Page, Page to Start :the first link to show up on the page, Page to Finish :the last link to show up on the page, MidPosition :the middle link position.










private int CURR_PAGE = 1;

private int PAGE_TO_START = 1;

private final int MID_LINK_POSITION = (int) Math
.ceil((double) TOTAL_LINKS / 2);

private int PAGE_TO_FINISH = (TOTAL_RESULT_PAGES < TOTAL_LINKS) ? TOTAL_RESULT_PAGES
: PAGE_TO_START + (TOTAL_LINKS - 1);



Create the accessors/mutators for the above said variables.



(ii) Links to show on the page:

At the client side you have to know the starting-link/ending-link to display. You have to highlight the current page number while showing the links. The values for these variables have to be updated whenever you access any page links. The following code snippet demonstrates this.










public void getPagesToDisplay() {
if (TOTAL_RESULT_PAGES > TOTAL_LINKS) {
if (CURR_PAGE - MID_LINK_POSITION > 0) {
PAGE_TO_START = (CURR_PAGE - MID_LINK_POSITION) + 1;
PAGE_TO_FINISH = (PAGE_TO_START + TOTAL_LINKS) - 1;

while (PAGE_TO_FINISH > TOTAL_RESULT_PAGES) {
PAGE_TO_FINISH--;
PAGE_TO_START--;
}//end while
}//end if
if (CURR_PAGE <= MID_LINK_POSITION) {
PAGE_TO_START = 1;
PAGE_TO_FINISH = (PAGE_TO_START + TOTAL_LINKS) - 1;
}// end if
}//end if
}



(iii) Navigating through the Links

You need to track back one page on 'previous' action, and go forward one page from the current page for 'next' action. Then you have to update the links to display.











public void next() {
if (CURR_PAGE < TOTAL_RESULT_PAGES) {
CURR_PAGE++;
}
getPagesToDisplay();
}

public void previous() {
if (CURR_PAGE > 1) {
CURR_PAGE--;
}
getPagesToDisplay();
}



What if you want to access a page directly? Its so simple! Just set the current page number to the page you are going to access. Then don't forget to update the links to display.









public void gotoPage(int pageNumber) {
if (CURR_PAGE <= TOTAL_RESULT_PAGES) {
CURR_PAGE = pageNumber;
}// end if
getPagesToDisplay();
}



Before displaying Next/Previous links on your page, make sure they are available for you. This is a best practice.








public boolean hasNextPage() {
if (CURR_PAGE < TOTAL_RESULT_PAGES)
return true;
return false;
}

public boolean hasPreviousPage() {
if (CURR_PAGE > 1)
return true;
return false;
}



(iv) Handling page results

Using the currentPageNumber and pageSize, show the records on the page. I leave this as an exercise for you!



While this article guides you through a way of paginating your data, hundreds of open-source & commercial paging tools and tag libraries are available online. My favorite one is the Pager Tag Library. Other tools include the Display Tag Library among several others. Hope this helps and is of use to you.




EDIT:
JSP Part of the code.






<%
Pagination pagination = (Pagination) session.getAttribute("paginationCollection");

/**
* Display the Search results here
*
* <param> currentPageNumber
*
*
*/

// { //write the records here };



/**
* Displaying page navigation Links
*
*/

//get the value of PAGE_TO_START
int startPageNo = patientPage.getStartPageNumber();

//get the value of PAGE_TO_FINISH
int endPageNo = patientPage.getEndPageNumber();

//get the value of CURR_PAGE
int currentPageNo = patientPage.getCurrentPage();

//Variable that holds the total search result pages
int lastPageNo= patientPage.getTotalNoOfPages();


if (currentPageNo>1) {
%>
<a href='list!NavigateToPage.action?pageNumber=1' style="text-decoration:none">[Previous] </a>   
<%
}//end if showPreviousPageLink

for (int i = startPageNo; i <= endPageNo; i++) {
if (i==currentPageNo){
%>
<b><%= i %></b>    //Set the current page to BOLD. Not a Link.
<%
} else {
%>
//Pages with Links
<a href='list!NavigateToPage.action?pageNumber=<%=i%>' style="text-decoration:none"><%= i%></a>   
<%
}//end if else
}//end for : display the page Links

if (currentPageNo<lastPageNo) {
%>
<a href='list!NavigateToPage.action?pageNumber=<%= lastPageNo%>' style="text-decoration:none">[Next] </a>   
<%
}//end if showNextPageLink
%>



samjosh...

Saturday, July 14, 2007

The Order of the Phoenix

Just remembered finishing this book of around 1000 pages within a record time of 2 days.

It is no nonsense till book 5.

Looking forward to see Movie 5 for which today is the official day of worldwide release!





Edit:(app 2 weeks later)
Quick update :

The movie is not so appealing as the book does.
It should be JK's writing that does all... its all abt the hype.....

A Quick review on Book7
I got the wrong book (pdf) 2 weeks ahead of the release of book 7.
I came to know this 2 weeks after the release. Then I got the right one.

By that time, i dint have patience (also time) to read through the book.
I quickly turned over the pages for an answer to the highly anticipated question: "Whats the end?"...

To make it short:
1. Some of the order members dies... including Tonks, Lupin...
2. Fred Weasley dies...
3. Hagrid I'm afraid is dead... not sure.. have to confirm.
4. The TRIO (ahem), they are well and alive. Thats the Hollywood kind of ending, which i suspected initially may not happen, cos JKR is little sadistic(?!)
5. Then as predicted by Mugglenet, Snape is on the good side, though he is killed at the end by Voldemort. He plays a major role in Harry's victory over Voldemort.
6. Dumbledore's death in the previous book was originally arranged between him and Snape.
7. Finally how did Harry make it? They have a concept of "The Elder Wand" which Harry happens to get through the help of Dumbledore, Snape including others. This wand is kind of elder to the Voldemort's one......
       It goes like this: Harry shoots the curse that's supposed to disarm Voldemort of his wand and Voldemort shoots the final curse (avada kedavra) both at the same time. (Remember, Harry has the elder wand.) Both the curses meet midway in the air, rises high, then Voldemort's curse bounces back to him making him fall dead (atlast!). Voldemort's wand was also caught by Harry. Harry becomes the hero of the wizarding community!
       The story aftermath: Harry destroys the elder wand, as it is of no use to him anymore and no one should use it also. Dumbledore has tears in his eyes as he watches this from his portrait at the Hogwarts.
       Nineteen years later: Harry-Ginny the married ones have 5 kids: (Albus, Rose, blah, blah, blah) etc, etc.

The End




Looking back, Voldemort resembles Satan well by all means. So this has some bad effects if this is thought more than a novel.

Well, thats the end of it.
Samjosh...

Friday, July 6, 2007

Eclipse Europa

Having read my recent blog on Netbeans, you should not demean the ultimate Eclipse Europa. Netbeans will NEVER be able to come up to Eclipse in terms of L&F (Look and Feel).

Eclipse Europa (the official name for Eclipse 3.3) comes with a whole lot of things including Mylyn. Eclipse is the IDE that I would love to work on.

Thursday, July 5, 2007

Netbeans Six

I’ve never been a big fan of Netbeans. There was always something about it that made my skin crawl. It never reached the same level of usability of Eclipse.

But now I have to admit that for the first time in my career I actually anticipated the release of a piece of software. I am even “ashamed” to say that I actually count down the hours and minutes of the official Netbeans Six release.

Coming back to Netbeans, It just works like a charm...! In just a while, when you go tell your interviewer "I know in and out of EJB 3.0" , the interviewer may respond "Oh! That's not a big deal, My Netbeans knows the same!". You may even stop calling yourself a EJB Specialist.

The new NetBeans 6.0 comes with powerful features that includes Easy Desktop GUI Development and Web/Enterprise development. You can order your Netbeans to do the software development for you! (In tamil, Ukkandha edathila erundhu nogama vela paarkiradhu)

Good innovative work by the Sun developers! I am afraid where the software world is heading towards. With a few customizations a non java developer can build the application he needs... and such a time is not very far.... Is this developer friendly? or customer friendly?
How can we call it?.