Sunday, December 04, 2005

Which Action Hero are you?

To those of you who know me, I simply cannot resist taking this quiz ;)






You scored as Indiana Jones. Indiana Jones is an archaeologist/adventurer with an unquenchable love for danger and excitement. He travels the globe in search of historical relics. He loves travel, excitement, and a good archaeological discovery. He hates Nazis and snakes, perhaps to the same degree. He always brings along his trusty whip and fedora. He's tough, cool, and dedicated. He relies on both brains and brawn to get him out of trouble and into it.

Batman, the Dark Knight


83%

Neo, the "One"


83%

Indiana Jones


83%

Lara Croft


79%

The Amazing Spider-Man


75%

Captain Jack Sparrow


63%

The Terminator


63%

William Wallace


58%

James Bond, Agent 007


58%

Maximus


46%

El Zorro


13%


Which Action Hero Would You Be? v. 2.0
created with QuizFarm.com

Saturday, December 03, 2005

Reading from memorial of St Francis Xavier

Right after the last post, I read today's Mass reading, and lo behold, is the First reading:

Isaiah 30: 19 - 21, 23 - 26


19  Yea, O people in Zion who dwell at Jerusalem; you shall weep no more. He will surely be gracious to you at the sound of your cry; when he hears it, he will answer you.
20  And though the Lord give you the bread of adversity and the water of affliction, yet your Teacher will not hide himself any more, but your eyes shall see your Teacher.
21  And your ears shall hear a word behind you, saying, "This is the way, walk in it," when you turn to the right or when you turn to the left.
...


Sacred Heart of Jesus, I place all my trust in You. Lead me to Your way.

My Second Holy Hour

Sometime ago, I mentioned chancing upon a Holy Hour when I intended to attend only the First Friday Mass, and had a wonderful time! Well last night is my 2nd holy hour throughout my life! (When was the last time you did something for the first time? Or the second time? :p)

Since my office has moved out of the NUS campus, the travel to Holy Cross Church took a while, and when I arrived, it was fifteen minutes into the Holy Hour. Apparently the program consists of 4 reflections on each week of Advent, and the format was: message by Fr. Richards, silent reflection, prayer and song, with all of us facing the Blessed Sacrament.

At this point, I'd like to say that I'm in the middle of an obvious crossroad, and this time I must absolutely make a choice of turning left or right. The Advent message thus hit home quite strongly, but there needs to be something from my part to digest it into something useful.

First message: missed out on this!

Second message: Peace

"Peace I leave with you, my peace I give unto you: not as the world giveth, do I give unto you." John 14:27

This message speaks to me 3 things:
1. Peace is a gift,
2. Everlasting Peace is not to be found from the world,
3. Only from Christ and in Christ may I find peace.

Third message: Joy
Fr. Richards spoke of Joy as being distinct from happiness (I'm not sure they're that distinct; after all, we all strive for happiness in life, by which we probably meant joy), and that its source being found in doing the will of God. "For our heart is restless until it rests in Thee".

Fourth message: Love
Love must be the basis of our decisions when trying to discern God's will for us. Duh! But how do we know whether our decision is in the side of Love? If I'm choosing between keeping my current course and making a turn, how do I know in which does the path of Love lie? Perhaps the answer doesn't require rocket science, as Fr. Richards then said that one can simply see whether one's day is spent making others' lives better, more joyful.

So these three messages are knocking on my head.. but my denseness and distractions from the world still hampered my discernment process.

Is the desire to do God's will enough? What if it remains at mere desire and never actually realized? St Ignatius, you whose spiritual exercises helped countless souls unite themselves to God's will, pray for me.

Thursday, December 01, 2005

Part 4 of J2ME-Servlet mystery [SOLVED? I think so!]

Using the various methods of reading at the Servlet, I found that none of them worked perfectly:

1. With getReader() and reading from the raw InputStream, somehow the last 40bytes are always gone!

2. With getInputStream(), BufferedReader's readLine(), it gave me an ArrayIndexOutOfBoundsException when reading! The logs traced it back to a possible mismatch in the number of bytes indicated and what was actually found, in
sun.nio.cs.StreamDecoder$CharsetSD.readBytes() method

BUT

All these servlets are running on Tomcat 5.0.28. When I copied the servlet to another Tomcat server, this time v5.5.9, the servlet receives whatever J2ME client sends perfectly!

Is this a bug? This is a possibility I haven't entertained before, but it's worthwhile asking, seeing the number of similar questions out there.


*UPDATE*

This whole thing started as a series of posts of frustration, but they might contain clues to help you solve similar problem, as I wrote about the steps/approaches I've used to try solving the problem:

Part 3, Part 2, and Part 1

Warning: They're RANTS!

Tuesday, November 29, 2005

Birth Verse Meme

I found out about this Birth Verse meme from Kevyn, and decided to look up my birthdate. My birthday's easy to remember and I assume, every book in the bible would have a Chapter 2, verse 2, no? :)

So here is what the 4 Gospels (Douay-Rheims) say:


John 2:2
And Jesus also was invited, and his disciples, to the marriage.
Matthew 2:2
Saying, Where is he that is born king of the Jews? For we have seen his star in the east, and are come to adore him.
Mark 2:2
And it was heard that he was in the house, and many came together, so that there was no room; no, not even at the door; and he spoke to them the word.
Luke 2:2
This enrolling was first made by Cyrinus, the governor of Syria.
(Well, this is awkward.. what does it mean?)

I've never managed to remember Bible verses by the book name and numbers... Interesting to see what verses turn up!

Sunday, November 27, 2005

Enter the Advent season... Week 1


Advent and Lent seasons have always been special period in the liturgical year for me. Not that reflection and introspection are not called for during any other times of the year, but there is always Something at the end of these periods to look forward to, that made reflection particularly imperative.

As I reflect on what my sister wistful desire to be born in a richer family, I realize that I hold a view that was not apparent nor conscious to me, and that is, life will always be both a struggle and a journey, in spiritual and physical dimensions. I firmly believe these two must go together.

How'd I treat the journey if there is no longer any struggle? There's nothing wrong being rich I'm sure, yet I think it's harder for the rich to find the way back Home precisely because the lack of 'physical' (read: economic) struggle often undermines the sense that this life is but a short pilgrimage and that we are on a journey to our true patria. I'm not saying that if somehow I had been born rich, it'd be impossible for me to find God in the Church; rather, I'm trying to tell my sister that what matters is actually finding that treasure in Heaven. If one is born rich, this statement is still true and he'd have to find the Way, but if one is not born rich, one shouldn't waste his life pursuing the earthly treasure before (and if ever) seeking that which is Heavenly.

This Sunday's Gospel reading about Jesus' advice for us to "keep watch", lest we are found asleep when the Master comes, is a strong affirmation of this view I hold. As St. John of the Cross once said, suffering is a 'ladder' for us to climb to Heaven, today's homily told me that our suffering helps to keeps me 'awake' until the moment we go Home.

Saturday, November 26, 2005

The illogic thickens..

3rd part of a frustrating technical rant:

I ran tcpdump on the server side, and what difference do I see between requests coming from J2ME client and a J2SE program?

The J2ME request has Transfer-Encoding: chunked at the header, and the body is cut into a few chunks, while the J2SE request is in one smooth body. Not that it should matter, because Tomcat 5.0.28 is supposed to be HTTP 1.1-compliant.

I didn't call OutputStream.flush(), but i suspect it'd have been called anyway because the request is more than 2048 bytes long.

It frustrates because I don't understand why it happens. Why can't Tomcat accept both requests and obtain the value for the getParameter(...) request in the same way? It's illogical. It defies common sense. What's next? Use StreamConnection? Just how does HttpServletRequest's getParameter(...) work anyway? How does it get parameters from a connection?

A few weird observations:
1. Content-Length != -1, despite the presence of chunking. Normally chunking would reset this header value.

2. A different source says 'do not set Content-Length' when using chunking... I wonder..

Unsere dame, Maria Knotenlöserin, Beten Sie für uns.

Thursday, November 24, 2005

... spilleth over!

Today's earlier rant is spilling over to this post. It has been, what, perhaps a year since I last ranted about work in this blog (it's not meant to be a rant page...) But I've been really busy lately (both at work and troubled somewhat in the heart), and this latest thing just irks me to no end, not to mention it sucked a great many hours!

OK, so for you folks out there who by weird chance might just end up reading this post because Google archive it or something, here are some things to take note when using J2ME client to do a HTTP POST to a servlet sitting on a Tomcat container trying to read a parameter using getParameter(...)

Things which a lot of sample codes probably don't tell you upfront:

1. Order of calls is important
setRequestMethod(HttpConnection.POST), setRequestProperty("Content-Type", "application/x-www-form-urlencoded"), and all setRequestProperty(...) calls must be made before calling getOutputStream()!

2. Sometimes calling outputstream.flush() may result in chunking that some application servers cannot handle. Check yours. Use outputstream.close() to be safe.

3. setRequestProperty("Content-Type", "application/x-www-form-urlencoded") MUST be called.

4. If you don't have setRequestProperty("Content-Length", N) , the servlet side sometimes sees 2 requests-- header & body, rather than just 1 request. (Hint: watch HTTP traffic on your server side)

5. Lastly, of course, don't be silly, remember what you write to outputstream must be in the form of this regular expression: [yourParameterName=yourParameterValue]+ [&nextParameterName=nextParameterValue]*

And don't forget to pray to our Lady, Maria Knotenlöserin

Nonsense!

<start of rant>

For anyone who's struggled with J2ME-J2SE and servlet on Tomcat container, I wonder just how do you maintain your rational sanity when faced with problem like this:

URLEncoder.encode("param", "UTF-8")+ "=" + URLEncoder.encode(payload, "UTF-8") [WORKS!]

and

"param=" + URLEncoder.encode(payload, "UTF-8") [DOESN'T WORK!]

The doPost(...) method of the servlet is able to read "param" using request.getParameter("param") in the first method and not in the second method! Bloody nonsense!

And on top of this, both methods still could not work when the call to the servlet is made from a J2ME client. Woot!
<end of rant>

Seriously, I'm getting sick of this. Maybe I should study theology now.

Friday, November 04, 2005

From Wired: "Catholic Schoolgirls Unravel DNA"

Full article here

I've always believed Catholic education system has excellent standards :) Well done! On top of it, my alma mater in Indonesia is also named Sacred Heart.. cool!