mario tan

Greenhorn
+ Follow
since Mar 09, 2005
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by mario tan

Hi guys,

Ive read an article which talks about recursion and I find it very interesting. However my mind boggles everytime I read the code from this article:

Connect 4 recursion

Please take time to look at the code..

You can see there that each time the method best_move is called, there is always that declaration and instantiation of best_score.

best_score is an instance of MoveValue.

Since this is a recursive method, will each call to the method best_move have its own copy of best_score? That means that there could be plenty of MoveValue object that will reside on the heap having only one name which is best_score?

I've tested the code but the best_move always return a MoveValue object with score = 0 and col = 6.

Why is that so?.. Can someone please explain to me the code and how to correctly trace it? Thanks in advance.


Best regards,

Mario
17 years ago
Hi Guys!

I know that there are methods in the String class which do some String manipulation but I've come across to this so called "regular expression" which also talks about Strings. What is this regular expression? How is it use in java?

regards,

Mario
18 years ago
Ok. Now it's quite clear to me as to what is the difference between static and final. I just thought that both of them are the same and somewhat are closely related to each other. Anyway, thanks a lot for the reply.
18 years ago
Hi Guys!

Can anyone explain to me what is the difference between a static and a final variable? Aren't both of them the same? I also encounter such cases wherein they are both use to declare a certain variable like for example:
static final int LENGTH = 1000.

Thanks in advance..

regards,
Mario
18 years ago
Hi,

Does anyone here have a sample program that uses steganography to
hide a .txt file in a .png file? Furthermore, how can i retrieve the encoded message?
18 years ago
Hi guys,

What is the best tutorial for bit manipulation in java? I've tried reading some books but they only give an overview and few examples. It would be much better if a tutorial could cover up all the topics in bit manipulation and present more helpful examples and applications.

Please help me with this as I am so confuse with bit manipulation in java.
If I could not understand this topic, the more I could not understand complex programs that use bit manipulation.

Thanks in advance!

Mario
18 years ago
hi guys!

I am currently developing a java application which does this:

1. enables the user to draw geomtrical shapes in a canvas.
2. enables the user to save the canvas as an image file(.png, .gif, .jpg)
3. enables the user to print the drawing in a canvas as a form of a hard copy, that is, you are able to access a printer device.

However, I have no idea on what to do on #3.
Can anyone there help me?

A simple demonstration would be of great help. A sample code would also do.

Your response would be very much appreciated.
Thanks in advance!!


-mario
18 years ago
Hi guys!

I am a beginner in designing a java application and I posted this message because I knew you guys can help me. Just want to ask if how could you save a canvas in a java application as an image (i.e .gif, .jpeg, etc.)?

Could you gave me a simple and brief example for doing this?

Thanks!

-mario
18 years ago
Hi guys! I already have an algorithm on how to convert infix to postfix expressions but it is only limited positive numbers. My problem is:

1. How about if there are negative numbers in the infix expression.
2. Is there another algorithm for converting infix to postfix with negative numbers?
3. How then do I evaluate the postfix expression?

for example:

infix:
-4*(4+9*5+-(9+-4/2))=

postfix: ?

Please, can anyone there help me..?
18 years ago
Hi ranchers,

iv been searching over the net about webhost that supports JSP,Mysql,and tomcat which cost only about $10.00/year or less.. Problem is there seems to be no such host that offers this.. Hoping for a suggestion..
18 years ago
JSP