Amit Biswas

Ranch Hand
+ Follow
since Jun 01, 2006
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 Amit Biswas

So I wonder how do guys survive on escalators? Do you look at the floor? Close your eyes? Anything else?



I would have quietly taken a picture and shared it for all the ranchers to view.
16 years ago

the computer gurus in these movies hack like a world champ in type writing



16 years ago

making unwanted suggestions is the surest way to NOT work on the project.



Strange ways of Hollywood, indeed!!! Involvement and enthusiasm beyond ones duties should be rewarded not punished.

If that is the case, then Hollywood needs to get better HR practices.
16 years ago
I would certainly agree that the special effects wizards must be working as a separate team. But since they too are involved in the same project, I don't think it should be a problem for them to suggest some corrections in the script.
A movie based on history take inputs from historians; on true criminal stories take inputs from the police.
However, when it comes to technology quite a few movies get it all wrong. I am not talking against sci-fi and flicks that are based on the future. I am not against imagination. But stuffs like relating computer-virus and cold-virus etc can be corrected with a little input from the techies involved in the same movie project.
16 years ago
I sometimes wonder why Hollywood flicks contain stupid technical dialogs while they are backed by some of the best computing brains in their team, particularly the special effects guys. Recently, I watched Die Hard 4. To be honest, I have been a fan of the Die Hard movies and liked this one as well. However, this movie did the techie stuff a bit too much. The dialogs and phrases related to algorithm and computing were so bizarre, that I can't even recall those.

Nevertheless, even with meaningless dialogs and action scenes that totally defied the laws of Physics, I had a good time watching the movie.
16 years ago
Hi Ayan,
I am not sure if I got your question right or not.
I suppose you want to get a match like the following

90.90
0.90
90

and reject alphanumeric, special characters and invalid numeric entries like .90, 90. , 90.90.90 , 90..90 etc, then the following is the code. Please validate it.

public static void main(String[] args) {

String regex = "(\\d+)((\\.{1}\\d+)?)";
String test = "90.90";

if(test.matches(regex))
{
System.out.println("matches");
}
else
{
System.out.println("not matched");
}
}


Hope it was helpful!
16 years ago
What are the various things one can learn from this video?
16 years ago
One of the best wildlife videos I have seen!!!

Very inspiring!!
16 years ago
Jasper Report is an open source Java reporting tool. You can find all details related to it in the following link:

http://jasperforge.org/sf/projects/jasperreports

There is a tool, called IReports, that has been created for it.
iReport provides a visual interface to build reports, generate jasper files etc.

The fact that human beings have limited perception does not mean that there is something to be perceived.



To deny something since we cannot percieve it, shows arrogance. It also shows that we have closed our minds and hearts to, at least, put an effort to explore the unknown to be able to percieve it.

What sets mankind above other animals is the thirst for quest. However, if we draw premature conclusions with results from limited and imperfect methodologies and refrain ourselves from exploration, we are as good as animals.
16 years ago
The good, the bad and the ugly

Client Eastwood movies are always a treat to watch be it " For a few dollars more" or "Million Dollar Baby"
16 years ago
Any scientific and rational human being should be aware of the limitations of the senses and capability of the human being. Proof by demonstration may not be the only way to prove something.
I heard there are some insects that can see only in a 2-D view. Does that mean there is no third dimension?
True scientists will always accept the fact that we human beings has only scratched the surface of this huge creation.
To defy the creator just because we have not devised a way to understand HIM is arrogance. We should really introspect, if our approach to understand HIM, with our limted senses and capability is correct or not.
16 years ago
I got you. This seems to be some kind of bug and can be seen in the sun bug list. The workaround is what you have done in the second method i.e, method.setAccessible(true);
16 years ago
Hi Adeel,
I am using Java 1.4 and I am not able to re-create the problem you are facing.
Moreover, there are some differences in the Reflection API signatures. Please find the same below and investigate whether you are still facing exceptions:

//Super-class in package one
package one;

public class ParentTest {

public String returnParam(String param){
return param;
}
}


//sub-class in package one
package one;

public class ChildTest extends ParentTest {

}

//class in package two
package two;

import java.lang.reflect.Constructor;
import java.lang.reflect.Method;

import one.ChildTest;

public class TestReflection {

/**
* @param args
*/
public static void main(String[] args) {

ChildTest test = new ChildTest();
System.out.println(test.returnParam("Hi"));

try
{
TestReflection tr = new TestReflection();
Class c = Class.forName("one.ChildTest");
Constructor cstr = c.getConstructor(new Class[]{});
ChildTest ct = (ChildTest)cstr.newInstance(new Object[]{});

tr.invokePublicMethods(c , ct);
tr.invokePublicMethodsAnyway(c, ct);

}
catch(Exception e){e.printStackTrace();}
}

public void invokePublicMethods(Class clazz, ChildTest childTest){
try {
Method method = clazz.getMethod( "returnParam", new Class[]{String.class});
Object obj= method.invoke( childTest, new Object[]{"Hello1!"});
System.out.println(obj);
}
catch (Exception ex) {
ex.printStackTrace();
}

}

public void invokePublicMethodsAnyway(Class clazz, ChildTest childTest){
try {
Method method = clazz.getMethod( "returnParam", new Class[]{String.class});
method.setAccessible(true);

Object obj= method.invoke( childTest, new Object[]{"Hello2!"});
System.out.println(obj);
}
catch (Exception ex) {
ex.printStackTrace();
}
}

}


Output

Hi
Hello1!
Hello2!

16 years ago
Hi Rajaraman,
The following statement in your main method creates ambiguity
new Sample().meth(null);

This is because null is not an instance of any class, the compiler cannot resolve which overloaded method to call to at compile time.

You can check this with the instanceof operator
null instanceof Sample // false
null instaneof Object //false
null instaceof String //false
In other words, null is not an instanceof any class. But null can be casted to any class you like.
That is the reason you get a NullPointerException with any object and can choose to return null from any method returning an object.

If you modify the above statement as any of the following:
new Sample().meth((Sample)null); //In Sample
new Sample().meth((Object)null); //In object
new Sample().meth((String)null); //In String
it will work.

Hope that was helpful!
16 years ago