This week's book giveaway is in the Java in General forum.
We're giving away four copies of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 and have ishori Sharan & Adam L Davis on-line!
See this thread for details.
Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General forum!

sumit anand kumar

Ranch Hand
+ Follow
since Apr 28, 2010
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by sumit anand kumar

I am building a light weight j2ee application . The application talks to the backend application to get some data processed. I want to add a host discovery feature such that my front end application is able to do host discovery of backend application and get the data processed.

I was looking for open source projects that provide this feature. My criteria is the open source project should be light weight. Apache projects are preferred.

I have not used apache camel. Is it lightweight and can do the job? How about weave from continuuity. It has the apache license , but is it a apache project too?

Please share and recommend from your experience
8 years ago

Martin Vajsar wrote:I cannot comment on the algorithm, but one thing struck me out: how big is X going to be? Given today's prices of storage and memory, I'd say (very generally) that anything short of billion records should be doable undistributed. Distribution complicates things considerably. Unless you actually want to learn/practice Hadoop, I'd say you should establish much more firmly whether you do need the distributed thing.

Yes Martin, i will be using hadoop for this. but problem is not that x (my clients) is going to be in order of few 100K, but that X(their actions) can be of high frequency.
Think of twitter /linkedin. The problem is not creating the network, the problem is computing the big 'X' to find the trust level in the network.
I am not sure whether this is the right platform to ask this question.
But my problem statement is : I have a book shop & x no of clients (x is huge).
A client can tell me whether a book is a good or bad (not recommended).
I have a internal logic to club books together , so if a client says a book is bad, he is saying that similar books are bad too and don't show him that.
I oblige and hide those books. Clients can also interact among themselves, and have a mutual confidence level between them.
A case arises when client A says Book X1 is bad. Hence i blacklist X1,X2,X3,X4 etc.
But his friend client B says X3 is good. So now i have to show X3 to A.
I was thinking to build a social network of all my clients based on their interaction, and be able to calculate their mutual confidence level.
So in the above senario if mutual confidence level is very high will will show X3 to A, or else i won't show X3 to A.
I wanted to get myself kickstarted on building the social network and assigning a wt. to a path between 2 nodes (my clients). Please suggest me some good pointers where i can start.
Any book, websites etc.

I will use hadoop in my implementation
The xsd contains a version field that can always be retrieved by non-strict parsing of xsd.

So i have a situation where
xsd1 -> convertor1 - > my dao object -> bean processing -> bean objects -> database

xsd2 -> convertor2 - > my dao object -> bean processing -> bean objects -> database

i have used freemarker to generate convertor1 & 2.

My challenge is for any minor upgrades of xsd, that break backward compatibility, i should be able to process the new xsd with minor or no code change.
So i have to do something to do code generation of "bean processing (does mostly nothing but maps/preprocess my dao to bean objects)" such that in future if new xsd is added i should make changes to a properties file and jobs done.

I feel there is some honest and better design that can help me in this problem. Please suggest.
9 years ago
I have hosted a webservice application. The client sends a xml request, which i parse it using the xsd and JaxB. Naturally this jaxb generated class is inside the war file.

Now i have a situation, where i have multiple clients who may not be backward compatible xsd files to create a request.

So i have to support multiple xsd versions inside my war file. I thought of auto-generating the convertor class between jaxb generated classes & DAO objects. i did that but looks like i am facing a design issue and may have to generate the communication of different dao objects and database layer.

I don't fully agree with the above design, but i am unable to think of any alternative. Please suggest me a different design to handle this problem.

I don't want any debate about whats better or whats not, just some views that can allow me to improve my design.
9 years ago

Bear Bibeault wrote:
I also advise to stop using obsolete Java scriptlets in your JSPs. It's time to step out of 2002 and into 2012.

Thanks Bear. I must say i am a bit rusty because its now quite a while i used javascripts. Also i am very exited to use jQuery and the hell lot of cool features it provides, not to mention it being easy.

Eric Pascarello wrote:Um, use the i variable in your loop? Or better yet, use a jQuery selector that finds the next table!


Yeah Eric, I too thought so, but how do i change==> id="link1" to "link[i]" for each href and how do i tell jquery that every click of "link[i]" toggles "table[i]"

Below is a section of my jsp code

Now i am able to execute the hyperlink on the first row, but not on the others. understandably the id is same for all the hyperlinks. how do i assign dynamic ids to the hyperlinks & tables such that i am able to toggle individual tables per hyperlinks
I am using freemaker to generate dto convertor from one type to another. Defining things through custom annotations E.g:

@CustomAnnotationTargetDTO(type=DTO2) Class DTO1 {

@CustomAnnotationTargetProperty(propertyName="gender") private String sex;


like this i have invented different annotations that i use to map a class and its properties to other type.

I now have a Enumeration in a DTO. Any idea on the similar lines that how i map 1 type to another.

I was thinking on the lines

@CustomAnnotationTargetEnum(xmlEnum="Type2Enum") public enum Type1Enum {

//other stuff below

9 years ago
Guys I know most of you will say its a bad design and its not possible, but I want to explore the power of HTTP Status codes

I have a client and a server. Theres a loadbalancer in between. For some reason its timeout cannot be increased . I don't want to modify the client.
I am doing a heavy duty processing on the server that exceeds the loadbalancer's timeout.
I was streaming response to the client. After my heavy job is finished i send the final response to client.

Is it possible to somehow alert the client to discard any streamed data sent before the response. Can i send just the response code again. (Any hack?)

My code

Response :

$ curl -i http://localhost:8080/stream
HTTP/1.1 207 Multi-Status
Server: Apache-Coyote/1.1
Content-Type: text/html
Transfer-Encoding: chunked
Date: Mon, 25 Jun 2012 18:34:07 GMT

++++++++++My job's output

I expect

$ curl -i http://localhost:8080/stream
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Content-Type: text/html
Transfer-Encoding: chunked
Date: Mon, 25 Jun 2012 18:34:07 GMT

My job's output
9 years ago
Hi All,

I am a begineer in hadoop. I understand the basic workflow of using map reduce. I have written a few basic stand alone programs in eclipse using the hadoop apis.

I want do get into the real stuff and have some hands on.
As of now i have downloaded the cloudera vmdk and installed it on VMWare Fusion.

Can somebody point me to the right location where i can find crystal clear info how to continue forward.
I want to use hdfs on 2 or more machines and write some stand alone applications that uses these system resources to do parallel computing to solve my task.

All oven the internet i have just found the understanding of map reduce and many advanced topics but nothing specific i am looking for.

Kindly direct me to the right place where i can find the tutorial or a video lecture to go forward
9 years ago
Thanks, but i will wait for a second opinion

Just thinking if what i am asking is conventionally not possible, can i create a homegrown threadpool where if all the threadpool threads are busy, i myself create a new thread. Carter the request, once done, i will add this thread to the threadpool. Is something like this possible & how?

Jayesh A Lalwani wrote:
Scaling a thread pool up based on number of requests defeats the purpose of a thread pool. The reason you have a threadpool is because
a) you don;t want to start/stop threads very often
b) under heavy load, you don't want to overwhelm the system.

I understand the concept of thread pool. But I am building the application for a Amazon EC2 instance that supports autoscaling. Thats y i wanted to utilize this autoscaling feature.