Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!

Shitij Agarwal

Greenhorn
+ Follow
since Dec 09, 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 Shitij Agarwal

Thank you so much guys for your responses. Very helpful. I most certainly was confusing two people working together on a project with pair programming.
I've observed that more often than not, from my experience working in a pair as an average programmer myself, I would find myself focussing mainly on my part of the code. (I'm talking about situations in which the 2 people involved are working on different machines on the same project and using CVS). So, I wouldn't be the one reviewing the code of the good programmer..so most of the times, i wouldn't even know how he has implemented something. On the other hand, the better developer would always look at the code that i would check in and thus do a code review for me.

So, if this is the case, then the better developer is not only doing his development, but is also having to review my stuff every time i check something in. Is that not a waste of his time? How do we get the average programmer to take out time (and knowledge) to review the better developer's code, when the average one is most likely worried about just getting his things right and working?
I've read at several places that pair programming leads to productivity and quality gains. I'm trying to request my manager to introduce pair programming within my group, which currently consists of about 14 developers, 6 of whom I consider very good, 3 good, 4 average, and 1 poor. He likes the idea but his concern is that perhaps if a very good developer is paired with an average or poor developer, it could lead to a waste of time for the very good developer. He thinks that this is a very good technique to use for knowledge transfer and learning for the poor/average developers, but not sure about how much productivity/quality gains we can get from this.

What should be my arguments to try to convince him to atleast give pair programming a shot and see how it works out over the next few months?

Thanks.
Do any of you know of an API that allows you to make a change to a file within a JAR in-place?

The java.util.zip and java.util.jar packages don't allow me to do this. The approach I need to use is to create a new jar file and copy the contents of the original jar and the edited file. For some reason, this approach is not convinient in my application...and I'd rather like to just edit the file in the existing jar itself. Any ideas?

Thanks.
14 years ago
Well, from the API it doesn't seem like I can delete a file from a jar. The only way it seems I could do this is to create a new jar and copy all the files from the original jar except the file I wish to delete.

Is that true?

Thanks.
14 years ago
Is it possible to delete a file from a JAR programatically?
14 years ago
Nevermind my previous post.

Need to use new BufferedReader(new InputeStreamReader(inputStream))
14 years ago
I actually already have a method that takes in the name of a file to parse. Parsing in that method is done using BufferedReader's readLine() method.

So, I'm not sure how the InputStream can be used here...once I get the input stream, is it possible to read the file one line at a time just how it can be done using BufferedReader?

Thanks.
14 years ago
Thanks. Once I obtain the entries of the zip/jar file, how can i open a specific file? Do I need to store that file somewhere on disk and then use java's i/o library to read it...or os it saved in memory?
14 years ago
How can I programatically extract a file from a JAR?
My need is to parse a file that is part of a JAR...so I need to somehow obtain that file from the JAR, parse it, perhaps modify it, and then put it back into the jar.

Thank you.
14 years ago
I have a text file (and for now it is not going to be in xml format) which looks like:

I need to parse the file to create a tree structure that will be presented to a user...and the user can then add his own domain, server, transport etc etc...and those modifications will be reflected into the file.

I'm not sure how to go about parsing this since it seems quite tedious in a non-xml format. I don't know much about grammar...but i think there should be a grammar for the format i have that would make it easy to use some tool for parsing.

Can anybody suggest where i should start?...and even provide some hint on what the grammar should look like?

Thanks.
[ December 14, 2005: Message edited by: Shitij Agarwal ]
14 years ago
Hi,

I have good knowledge of the Java language (87% on SCJP), but know very little about J2EE. I was advised by a a friend that the best way to learn more about J2EE would be to create my own website that uses java technologies. I'm not really sure where to even start. Would anyone be able to point me to some links/tutorials that would help me in getting started? To start off, I would like to use Servlets, JSPs, JDBC, Struts, and perhaps even EJBs and JMS on my website. I don't really have an idea about what my website would look like...about which I dont really care at this point. Mainly, I'd just like the website to provide some sort of a service (even though it may just be a dummy one) so that I can learn a lot about J2EE when creating that service.

Thanks a lot.
[ September 17, 2005: Message edited by: Shitij Agarwal ]
15 years ago
JSP
Hey, I have good knowledge of Java, and have passed SCJP with 87%. But, I have almost negligible knowledge of servlets. How long approximately do you think it would take me to learn servlets to an extent that I could both write commercial applications using servlets, as well as be well prepared for the servlets part of SCWCD? Also, are there any sample projects that are of mid-size (larger and slightly more complex that the examples found in tutorials) that I could use to get a feel for industry applications...having source code would be most helpful.

As an aside, how important is it to know about servlets in order to learn struts?

Thanks.
15 years ago
Most likely, u don't have the jar files in your WEB_INF/lib directory.
15 years ago
I need some help understanding how I would need to structure my classes to obtain the following behavior.

I need to provide the ability for a user to select a portion of a JPanel such that the user should be able to see a box around the selecion area as he drags his mouse to select a portion of the JPanel. My final aim is to obtain the Rectangle coordinates for the selection, so that I can create an image out of the selected portion.

Now, from my little understanding, I think it would be necessary to subclass JPanel so that I can override paintComponent(Graphics) in order for the box to be displayed while dragging. Is this true? Ideally, wouldn't it be better if I could have a class A in which I create a JFrame, add a JPanel to it, and then do something like B b = new B(panel);

Now, the B class would really be the selection utility class, in which I do all the required initialization, look for mouse events and mouse motion events, and draw the box around the selected area of the panel.

Am I making sense? If you could please provide some basic code outline/structure on how to arrange my classes, that's be very helpful.

Thanks.
15 years ago