Win a copy of Terraform in Action this week in the Cloud forum!

Anant Jagania

Ranch Hand
+ Follow
since Oct 20, 2004
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 Anant Jagania

Gopi Chand Maddula wrote: it is impossible to connect to two servers at a time using JSch.



I remember doing it earlier where I use to create two Session objects and provide two different servers information in two different session object. And executing commands on two server at a time in two different threads or same thread...
10 years ago
Look at the SCP exampls at the following link. This would help you in achieving what you are looking for..

JSCH Examples
10 years ago
Hi,

I have seen AOP pointcut for method execution but is it possible to have pointcut for catch block. Something like expression("catch()")?

I can overcome this situation by having the code in my method and make it throw the exception. But at some places i would not like to do that.
11 years ago
Prithvi,

Please have a look at following sites

Open Source Tools for HL7

HL7 Tools.

Have a look at Mirth Connect at Mirth Corp which would be more helpful to you.
11 years ago
Before answering, make sure that next time you put the code in "code" tags.

You need to have the properties file in the class path. If it is not there, it will not be loaded.


FileInputStream loads the file from a location/absolute path. So you need to provide the full path to you properties file in the constructor of FileInputStream.
If you want to load properties file from classpath which is the ideal situation because you dont want to give the absolute path of the properties then you can do something like following.



11 years ago

David Newton wrote:Spring isn't a product for runtime performance--it's for development time (and testing) productivity. It wouldn't necessarily have any impact at all on performance.



Hey David, Thanks for the information. I will go ahead and use certain features of Spring.
11 years ago
Hi,

I have an application which is developed in core java and it has got lots of threads running inside. We also use ThreadPoolExecuter.

I was planning to change the architecture and use Spring and iBatis with it. Would it be wise to use these technologies in such application?

Our application needs to be high performance and less time consuming for the processes.

Thanks
Anant

11 years ago
Does autoboxing work the similar way for other primitive wrapper objects? Does caching happen for other wrapper objects like Long, Double, Boolean, Short, Float, Byte?
11 years ago
Some more clue i got.

I have two threads getting executed from the FileView JFrame.

If I have these two threads executed from the constructor of the FileView then I dont see any the screen.

If I have these two threads started outside the constructor then I can see the View by these two threads are not executed. Weird

I am not sure why Swing is behaving like this.

PLease help me out with this.
11 years ago
Hi,

I am very new to swing.

I am having a class call Navigation View which has two button. Each button will take us to the next screen.

The issues is when run the application from Netbeans, it works fine but when I download from the webserver as a webstart and run the jnlp file, it doesn't take me beyond the Navigation View. Any button I click, there is no response.

I have used jDesktop in this application. All the views are JFrame.

Following is the code for the action performed on the button pressed in the Navigation view.


Following is the code inside "ClientApplication.getApplication()"

Please help me to understand and solve this problem.
11 years ago

int i = 20; // why doesnt not it give error,as it is over riding the interface variable.



You cannot override interface/class variable in subclass or implementing class.

Only methods can be overridden.

Hence, variable "i" is different in interface and class.

In your example variable "i" for Interface is static final variable which is accessible globally while variable "i" in Abstract class is accessible only by the class.
11 years ago

Ernest , Also, 131072 * 100 is not 100MB, it's about 1.25 MB. Just an example of what was meant by "the comments hurt more than they help".



My apology.

Thanks for pointing this out.

I have corrected back the comments and number of bytes to read (MAXREAD) in the code.

Please have a look at it.

11 years ago
This is what I have to achieve.

There are big files and each file is made with joining many other files. The starting of nested file is ABCD. So I need to go through each byte and see if ABCD comes in the sequence. Once i find it, i need to start writing the bytes to files until i find another ABCD.


Paul, I can do the way you have mentioned but that makes my program very slow. And i have files with the size of 5GB as well. Reading 8/4 bytes at time will be a very slow progress. I will try to use profiler and see what they have to say.

David, Campbell,

I have written comments to get better understanding of the algorithm which i have implemented in the program. I can still shorten it. I will do it and post the code again.

Jasper,

Line 57, 59 are just for testing I have kept. Later on these strings will be passed as arguments to the program from the console.
The program doesn't append the whole file to ByteArrayOutputStream when we do not find ABCD. It will only append the current byte which is read and if any bytes A,AB,ABC where found before the current byte (given that current byte is not D).

File will be written/appended only when we find ABCD and RandomFileAccess object is not null. All the bytes written in BinaryArrayOutputStream will be dumped into RandomAccessFile.

Thanks everybody, I really appreciate your valuable time spending on this post.

I will redo the code/comments and post it again.

Regards,
Anant
11 years ago
Hey Guys,

Sorry for being late. Here is the complete code. It has got more comments as well. I have refactored little. Please let me know if this is still not readable.


11 years ago
Hi David,

I have modified the comments.

I apologize for inconvenience.

If the code or comments still do not make sense, please let me know.. i will refactor it again.

Thanks
Anant
11 years ago