# Arka Sharma

Ranch Hand
since Jun 15, 2011
For More
Cows and Likes
Cows
0
In last 30 days
0
Total given
0
Likes
0
0
Total given
1
Given in last 30 days
0
Scavenger Hunt
Ranch Hand Scavenger Hunt
Greenhorn Scavenger Hunt

## Recent posts by Arka Sharma

Hi,

Sorry if this question has been asked before but I need some help on this as I am stuck on this for more than one year. The problem is as follows -
I have three arrays A,B,C of same size let say n and I need to find out all possible (i,j,k) such that A[i]+B[j]=C[k]. And we
need to find this in O(n^2) complexity for which I found one solution like
Step 1:
Add all A[i]+B[j] as the key and (i,j) as values in a hash table.This gives n^2 no of keys and values.
Step 2:
Traverse for all C[k] and probe the hash table.If mach found (i,j,k) is one pair and so on.
This looks like an O(n^2) solution.But can it be done better or at least O(n^2) in some different approach ?

Regards,
Arka
10 years ago
Sorry to disturb you guys.I as using wrong method find() instead of matches(). Apologize for the mistake
11 years ago

I tried with all these patters [0-9]{15},[0-9]{15}?, [0-9]{15}+ with same result
11 years ago

Hi,

I need to mach the pattern a string containing digits between 0 to 9 and the length is 15.Actually I want to check if an IMSI is valid or not.So I am using the folllowing code

It works fine if the length is less that 15 that is it sets valid to false but if the length is more than 15 let say 16,17 then it sets valid to true

Regards,
Arka
11 years ago

Hi,

I have Jboss 5.1 running on linux it has four ejb services running, Now when I try to stop the jboss by pressing crtl-c on it's console or try to run shutdown.sh it doesn't shut down.What I have to every time is run 'pgrep -f jboss' then get the pid and do 'kill -9 <pid>' also if I do 'ps -ef | grep jboss' it doesn't display anything even if jboss is running if I do 'ps -ef | grep java' then it shows the java process whihc is having the same pid of the 'pgrep -f jboss'.Need help on these two issues.

Regards,
Arka
11 years ago

Hi,

Say I have an object referred by 'o' and following synchronized block I have

Now if one thread enters this block and let say there is no method call on instance referred by 'o' inside this block. Now there will two restriction for any other thread as following

1. They have to wait to enter into this synchronized block until the thread currently running inside synchronized block releases the lock.
2. In some other non synchronized method if another thread tries to call a non static method(not defined as synchronized) on same instance referred by 'o' will also have to wait...

Please correct me if I'm wrong specially on second point.

Regards,
Arka
11 years ago

Hi,

Let's consider a scenario. A thread is running the code blocks inside a synchronized method thus owns the lock of that object.now let say two other thread simultaneously try to get the lock but waits since there is already one thread is having it.Now the thread is done with the critical section and releases the lock.Which one of the two waiting thread will enter the critical section when both of the waiting thread is of same priority value.

Regards,
Arka
11 years ago

Hi,

I am a real novice in JSP. But I have to find out one fix about the following issue. The encoding of the page in @page directive is ISO-8859-1.Now when I give '#' in the textarea it is not accepting. Though I have given very less information this query may not make sense but this is the information I have and no idea why it is notb taking '#'.I also tried with '\$' without any problem. Do i need to give any escape sequence ?

Regards,
Arka
11 years ago
Hi,
I have two same copy of JBoss and same classpath entries and corresponding jars in the classpath which are resided in the same folder hierarchy on two servers.When I am starting up JBoss in one server it is showing

[Environment] Hibernate 3.3.1.GA
[Environment] Bytecode provider name : javassist

and other one is showing

[Environment] Hibernate 3.1.1
[Environment] using CGLIB reflection optimizer

Where to find out which hibernate and byte code provider is being used.This query is linked with my previous query I think this is the reason.Again I repeat both JBoss copies and jar files in the classpaths and .bash_profile copies are same.Is there anything that depends on the system ? Thanks in advance.

Regards,
Arka
11 years ago

Hi,

I am newbie in web service and just because of curiosity I want to know that say I have created my Web service using jax-ws and deployed in JBoss 5.1. Now is it possible to write a client Java program which will contain one main method and call the web method for the generated WSDL. I have come to know that there is a utility called wsrunclient but say I want to run my code as "java WebserviceClient" which will run a normal console java program. Moreover can do the same by writing a client in C/C++.I just want to know if it is possible.Since I am not much familiar with Web service yet how to do it might confuse me.However working hard to get familiar with web service.

Regards,
Arka
11 years ago

Like I said JBoss and .bash_profile copies and the path to the jars added in the CLASSPATH all are same. But no clue why one is using Hibernate 3.1.1(non working) and another Hibernate.3.3.1 GA(working). The non working copy is using CGLIB and working copy is using is Javassit.

Regards,
Arka
11 years ago
I tried after rebooting the server with no luck.I ahve noticed some difference in working and not working jboss console output.

The working copy is showing

19:44:00,077 INFO [Environment] Hibernate 3.3.1.GA
19:44:00,116 INFO [Environment] Bytecode provider name : javassist

The non working copy was showing

19:49:28,817 INFO [Environment] Hibernate 3.1.1
19:49:28,825 INFO [Environment] using CGLIB reflection optimizer

followed by exception trace

Both jboss copies are same.Both class path entries are same.And all jars are in the classpath are in the same path hierarchy in both the servers.

Regards,
Arka
11 years ago

Thanks for your reply.Sorry still no luck.Same exception is coming followed by lot of others.

Regards,
Arka
11 years ago
I also checked for multiple jar entries of cglib.So I did "find / | grep cglib" which gives me only one cglib jar which is already added in the classpath.So no cglib in JBOSS_HOME/server/default/lib which cause multile classpath entry for the same jar.

Regards,
Arka
11 years ago
One more thing I have just figured out while going through the exception trace that I have one call to "sessionFactory = configuration.buildSessionFactory();" in my code.This is the topmost trace among the entries of my code in the exception trace.However same code is there in another server as I mentioned earlier which was throwing no exception.

Regards,
Arka
11 years ago