Maulin Vasavada

Ranch Hand
+ Follow
since Nov 04, 2001
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
1
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 Maulin Vasavada

Thanks for your response. It clarifies things.
Hi all,

I have a requirement where we call another system and have to prepare the corresponding request from our request.

Let us call classes - OurRequest, DownstreamCallRequest, DownstreamRequestAdapter

DownstreadmRequestAdapter has a method : public DownstreamRequest adapt(OurRequest ourRequest) signature.

I don't have any state variables in the Adapter class.

What will be a better OO design?
1. To have the adapter class with 'static' method - public static DownstreamRequest adapt(OurRequest ourRequest)
2. To have the adapter class with an instance adapt method but no state variables in the class

Appreciate your opinion on this.

Thanks
Maulin
Hi Winston

We do have the length check somewhere before this code and this code is a specific parsing logic for a specific data standard we have. For the purpose of this thread we can just focus on 'technical' aspect of why earlier it didn't work for me (after my code change) is ,

1. The post increment in the original code was happening even when while condition didn't match. So to you point it IS going one pointer ahead than the actual mismatch point ('why' part of this we will blame on the 'specific' parsing logic )
2. To fix that I added one more p++ after the while loop after my change


Thanks
Maulin
10 years ago
Okay, I fixed the code as below and now it works,



Thanks
Maulin
10 years ago
Hi Winston

I completely agree to your comments about why we have to re-write the same logic in better way.

I am refactoring the code and I ran into this. I will try options you suggested and post the findings.

Thanks
Maulin
10 years ago
Hi all,

I have a code issue and I have a below question for the same.

Assuming data[] is of type byte[], is the below statement in java -



same as -



?

I tried with


That also doesn't seem to be the same thing. I am not putting code around this but essentially if I make this change for not using data[p++] code stops working! (This is the only change that is breaking the code).

Thanks
Maulin
10 years ago
Hi all,

I am using Jersey client to hit a RESTFul endpoint. If connection times out I wanted to retry BUT I wanted to put some delay before next retry.

Any ideas how to do it?

Currently, I am using Thread.sleep(<some time in ms>);

Is that good enough? (My RESTFul client code is in my server calling the endpoint).

Thanks
Maulin
10 years ago
Hi all,

We have some requirement that seems can be satisfied by the http://commons.apache.org/vfs/.

Can anybody share experience with the same OR suggest any better alternatives if there are?

Thanks
Maulin
11 years ago
Hi all,

I am trying to look for some way to know the following information,

- Given City,State/Province,Country know the Timezone it belongs to at the time of the query

I found following links so far which is a good source of information BUT wanted to get somebody else's input if you have any experience on it.

StackOverflow Post

Thanks
Maulin
11 years ago
Hi all,

I didn't find any appropriate forum here to post this question so I thought this may be the best forum to ask the same. So if the moderators feel they can move this to more appropriate thread.

I am designing my java interface and faced with this question while designing request/response objects for it - What is the difference between Bulk and Batch processing? I did some google and see that people use that interchangeably.

Here I my thoughts on this so far,

1. Batch processing means set of things processed "together" in the single thread.
2. Bulk processing may create multiple parallel threads to process N incoming requests. However due to that it may have to be "Asych" mode always
3. Bulk processing may internally process group of requests in "batch". Hence Bulk is a bigger component than the Batch processor.

I seem to be implying that Batch is synch always and bulk is asych BUT that is the point of confusion for me. I don't want to imply that Batch can be asynch but then it doesn't matter to the caller if its Batch or Bulk.

Any thoughts are welcome on this.

Thanks
Maulin
Hm... Thank you all for your responses.
12 years ago
Hi all,

We have a large code base and over time we have put lot of 'if' conditions to evaluate condition if a particular site feature should be turned on or off. Obviously after a while either feature was doing good and there was no way going back and 'if' condition always return true OR the feature was scrapped and we don't need the 'if' condition and want to keep 'else' logic. However the code is already in the mess of lot of 'if' (and corresponding 'else').

If it were just my code and few hundred files I'd have done it manually BUT I am talking about huge code base touching many developer's life (who are not even there anymore with the company ).

Is there any systematic way of doing this? Any external tools or research done to figure out and evaluate the runtime of the JVM and suggest which 'ifs' are useless now since they always evaluate to true?

I hope you get what I am asking for, otherwise please let me know and I'll try to be clearer.

Thanks
Maulin
12 years ago
Yes. My QA machine which is trying to download the file from HTTPS url does have "unlimited strength" files installed. You mean the US export policy file etc right?

Thanks
Maulin

12 years ago
Hi all,

[Aah, after long long time I am posting on this forum]

I have this issue where in our QA env on the unix machine running Sun JDK 1.6 we get the below exception when we try to hit a HTTPS url for a text file to be downloaded into our system.

In my local eclipse the file download works fine and I am using Sun JDK1.6.

I found some threads on google discussing this issue however I wanted to "reproduce this in my local eclipse". I don't know how to do it. I can download the certificate and all but I don't know how can I reproduce this locally.

I think there is some issue with the crypto policy files in the QA Unix machine where it is configured not to support the sha1RSA with 1024 bit key certificate BUT only if I reproduce on my local box I can do more testing.

Any help is greatly appreciated.


java.io.IOException: DerInputStream.getLength(): lengthTag=127, too big.
at sun.security.util.DerInputStream.getLength(DerInputStream.java:544)
at sun.security.util.DerValue.init(DerValue.java:346)
at sun.security.util.DerValue.<init>(DerValue.java:302)
at sun.security.provider.X509Factory.engineGenerateCertificate(X509Factory.java:104)
at java.security.cert.CertificateFactory.generateCertificate(CertificateFactory.java:305)



Thanks
Maulin
12 years ago