Vin Kris

Ranch Hand
+ Follow
since Jun 17, 2002
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 Vin Kris

You are right Henry. Thanks.

I had tried a lot of different ways including what you suggested. Then i increased the individual append loop count with more APIs included (david's suggestion) and loop count overall. StringBuilder is marginally faster than StringBuffer. Considering it's in Nanos, no big deal. But it does make me wonder what the heck is happening inside. I'd rather use StringBuffer itself if this test shows same result in different versions of JVM and by different vendors.
11 years ago
I'm glad you got the result where StringBuffer is slower.

But I did try the other way also i.e., the code you tested. Even then it was slower. That's why I posted it here hoping to get an explanation.
11 years ago
David, I would expect StringBuffer to be slower since its methods are synchronized. But here StringBuilder is slower.
11 years ago
StringBuilder javadoc API: "Where possible, it is recommended that this class be used in preference to StringBuffer as it will be faster under most implementations."

Both StringBuilder and StringBuffer classes extend AbstractStringBuilder class. The methods of StringBuffer are synchronized. Naturally the above statement would make sense and expected.

But the below test executed multiple times always gives faster execution times for StringBuffer! using JDK 1.6.0_10.



Any explanation? Am i missing something obvious in the above code?
11 years ago
I'm working on a large application that consists of independent modules that could be looked at as sub-applications themselves. The requirement is anyway to deploy the modules in phases. The application is human-tasks oriented and involves processing many documents. Performance & Scalability are very high on priority.

The architect had proposed an SOA based Business Process Management solution (using WebSphere Process Server) for this system. This doesn't seem right to me. I understood that BPMS is used at enterprise level orchestrating/choreographing re-usable services. It doesn't make sense exposing every service in this application as a Web-service when they are not at all reusable beyond the application boundaries. The architect has long left and so I have to take the high level solution forward.

Is it right to use a Front office BPMS solution for a single application? Is it feasible to integrate BPMS and a MVC framework (Struts + Spring)? Moreover, the app requires rich presentations i.e., heavy usage of AJAX.

Thanks in advance.
11 years ago
anybody have the PS2 redesign (PsTwo)? I'm looking to buy this now...
also, any idea how much it would cost to convert this into using a wireless controller.
14 years ago
In the mark & sweep algorithm, the objects are moved ofcourse. But the running program doesn't contain refrences to the objects directly. The variable in the thread of execution contains a reference to an object which in turn contains a reference to the actual object (that the thread actually created). So during GC when the object is moved, the indirect reference is updated.

[ April 16, 2004: Message edited by: Vin Kris ]
15 years ago
Try this:
System.out.println( java.util.TimeZone.getDefault() );
15 years ago
check the Daylight saving time setting in the unix box. most probably that is your culprit.
15 years ago
Just as you guessed, 2 String objects. A String literal "zyx" and a String object. Latter is eligible for GC and the former isn't.
When I try to start WSAD (4.0.3 on Win NT), I get the blue window and the task manager reveals that a process is kicked off viz., Websphere studio Workbench. The CPU usage hovers around 60% for quite some time. Suddenly it peaks to 95% and then drops dead to 0%. After this the same blue screen lingers on the screen apparently doing nothing. Also a log file is created : $WAS_HOME\ {my workspace} \.metadata\.log
Problem exists only with this workspace. Other workspaces start fine.
The stack trace is given below --

There is no such file 'DTD.xmi' existing in the workspace.
Deleted the files from the project last working on from file system manually - yet the error persists.
Any help is appreciated. The only option left is to re-create the projects in another workspace. And there hell lot of 'em to create.
[ June 16, 2003: Message edited by: Vin Kris ]
[ June 16, 2003: Message edited by: Vin Kris ]
16 years ago
Why do we need to make instance variable as static?
- static => class level. All instances share the same copy.
Had it not been static, every instance created of this class would have been composed of it's own private instance.
Why do we need to make instance variable as private?
- what if it is public? it's value can then be modified. The reference could be made to point to null by some malicious code. Result- creates another object on the next call to the same method.
Why do we need to mark constructor with private?
- what if otherwise? instances of this class can be created by invoking the constructor. No more a singleton.
Why do we need to make instance variable as private?
- this is a trick question. you just asked it few questions back. gotcha.
Why do we need to mark method with static, synchronized?
- "static synchronized". Obtains a lock on the instance of class java.lang.Class that represents this singleton class at runtime, when this static synchronized method is invoked. The idea is to try & ensure that only one instance is created. For ex: imagine 2 threads trying to create a singleton and the context switches just after the 1st thread finshes the if predicate. Both threads end up creating an instance - not a true singleton.
16 years ago
I need to access all the jars in a directory. I've included this directory in the classpath. But compilation fails with import package not found or class not found.
If I explicitly include all jar files in the classpath, then as expected, it works.
isn't it possible otherwise - just including the directory in the classpath and placing all required jar files in this directory?
16 years ago
Hi Ranchers
I am trying to configure my application to invoke one EJB from another. I am trying to use <ejb-ref> tag in ejb-jar.xml (using WSAD 4.0.3). But i'm not able to look-up the ejb.
My questions:
1) <ejb-ref-name> is the JNDI name. isn't it?
2) if I give the value for above as "MyEJB", then do I have to look-up as "java:comp/env/ejb/MyEJB" ? Is this the case for remote EJBs only (in a diff. container) or for local EJBs also (same container)?
I am confused with using the JNDI. Any assistance is appreciated. Could somebody please point me in the right direction. good ol' Google is consuming a lot of time.
Thanks.
Take a look at the class java.net.URLConnection
17 years ago