Jared Cope

Ranch Hand
+ Follow
since Aug 18, 2004
Merit badge: grant badges
For More
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 Jared Cope

Hi,

Not sure what the right forum is for this question, so will try here first. I completed my SCJD exam a few years back and now want to actually put the logo on a business card. It seems that Oracle have taken over the online certification database now. Unfortunately none of the credentials that I remember allow me to login to the site now, and their help link seems to be broken today.

Anyone have any advice on how to get the logos?

Thanks, Jared.
Hi,

I was curious of where you stand on the following: Do you believe there is a critical point where a web application is just so un-maintainable that it is more efficient to be thrown out and started again in order to get anywhere, or do you believe that any existing application can be resurrected given the right approach?

Do you know of a metric that can be used to answer such a question?

Thanks, Jared.
Hi,

I appreciate that we should use StringBuffer (or StringBuilder) when possible in order to keep the String literal pool as small as possible. But I am wondering if all that good work is undone when the toString() method is called on a StringBuffer. For example:



does the toString call force creation of the String in the pool? Especially if the caller of this method does something like:



Any thoughts?

Thanks, Jared.
15 years ago
Hi,

Can anyone give me a starting point in getting Java to interface with Active Directory? I can't seem to find a good tutorial anywhere.

Tutorials talk about JNDI, but there isn't anything specific to Active Directory. I get the feeling I need a third party library, but the only ones I can find are commercial ones.

Thanks, Jared.
16 years ago
Hi,

Alright finally figured this one out. Seems IE will pass the URL through to Excel and it is Excel that is making the second request. Firefox instead will pass the document through to excel for display instead. So IE would appear to do 2 requests, Firefox only one.

I have fixed this by modifying the header content type to the following instead:



This will make IE pass the downloaded file through to excel as I wanted. Hope this will help someone else.

Cheers, Jared.
16 years ago
Hi,

Originally posted by Ulf Dittmer:
This sounds odd. The "File Open" dialog does not send a request. It is opened after the response has been received, and no further requests or responses between browser and server take place afterwards.



Exactly what I thought -- odd. However a second request to the same servlet is taking place after the first request arrives back though. I can see this when debugging in eclipse (and this request doesn't have any cookies set). I'll have a look at what the excel file has included in it. Maybe the problem is something obvious.

Thanks, Jared.

[ January 06, 2008: Message edited by: Jared Cope ]
[ January 06, 2008: Message edited by: Jared Cope ]
16 years ago
Hi,

Our web application requires that a user logs in. This sets a cookie in all headers subsequently sent from the browser that contains the session id. This is how I determine if a user has logged in. If the header does not contain a session cookie then I redirect them to the login page.

Problem now is that I have a servlet that sends back a .xls file. The browser asks the user if they want to open or save the .xls file. If they choose 'open' the request does not have the cookie value set and they end up seeing my login page rendered as HTML in the excel file instead.

Has anyone had this problem before? What can I do to ensure that the browser sends the cookie in this request from the 'question dialog'. I did not expect this situation.

Thanks, Jared.
16 years ago
Hi,

Firstly Swing is a set of Java API's. Webstart is an application delivery mechanism. You can deliver a Swing application with webstart but beyond that there is little more in common.

Not possible to develop this application if the overall size is to include a JRE runtime and remain under 5MB. Current JRE download from the Sun website is 14MB in size.

If you can assume that the JRE is already installed on end-user machines then it is possible to keep the code below 5MB. Note that this has nothing to do with the runtime memory footprint. Our application is around 5MB of jar files but at runtime it blows out to 150MB of memory usage.

You can tell your application to only reserve 5MB of memory at runtime through java command line arguments but you would probably encounter a runtime out of memory error.

Good luck. Jared.
16 years ago
Hi,

What do you mean when you say it's taking more time? Is it downloading the jars each time and taking longer to complete the download?

Cheers, Jared.
16 years ago
Hi,

Not much experience with what you are suggesting sorry. Perhaps there is another way to achieve what you are after though. Can you explain what you need to do?

Cheers, Jared.
16 years ago
Hi,

If you can't use the credentials of the already signed jar files on your own jar, then you can still make this work. You will need to use the extension clause in your jnlp as many times as necessary (each time for a jar file signed with a different signature). Have a search around for this clause and I am sure it will make sense.

Cheers, Jared.
16 years ago
Hi,

There is good debate on whether Java Swing is dying or dead. I've seen the same questions and conclusions for over two years now -- yet I still have plenty of Swing work and I can't see it changing any time soon in my industry.

a) I think you can embed some javascript to test if java is intalled on client PC and to take action about it. Try googling for some details. More powerful though is the jnlp file specification that allows you to dictate what JRE your application must run under and it will download and install it before running your application. This can get tricky with end user locked down profiles etc. But its perfect if your clients are anonymous users in control of their own PCs. This area can get tricky -- post specific problems and I can try to help!

b) We handle client logging with log4j. This will take care of log rotation and deletion for you and give you the ability to set logging levels for the application. The console is not useful really in my experience of production deployed code. Users don't know how to interpret it -- it's much easier to get them to email a log file and then you inspect that. Just make sure that you write the log to a writable area of the hard disk as the client may have a locked down profile with limited access (C:\temp is usually fine -- sorry am assuming windows).

Cheers, Jared.
16 years ago
Hi,

I use JFreeChart and am very happy with the results. I have not done your point 4, but I would be very surprised if it is not possible. Only downfall is that JFreeChart does not provide you with good example code. You have to pay for a manual, or go digging into the example code yourself (or try google). I am sure you are up to the challenge though, and it is quite simple.

Point 3 is probably more achieved by putting the graph (usually something on a JPanel) in a scrollable area by means of other Swing code. Not sure any package would support this out of the box but you could get lucky.

By the way Ulf, nice list. I have seen something that could be very useful to me at the moment.

Cheers, Jared.
16 years ago
Hi,

I passed this one yesterday. Very glad it's over. Two years ago I got 1.4 certified but wanted to update my skill set and make sure I knew 1.5 language features well. Studying for the exam certainly did this.

My study approach:

1. Leisurely read K&B book over course of about a month.
2. Did practise exam at end of chapters. Did poorly (~50%)
3. Revised book making flip cards on interesting points for all 10 chapters. By the end I had 10 envelopes with cards that summarized the book
4. Got friends to test me on the cards and read them on the way to work over the course of 2 weeks.
5. Did practise exams (CD from book, Inquisition webstart program) over 3 days. Questions I got wrong I confirmed in an IDE to see why. (Note sometimes the answers provided in mock exams are wrong and you were right in the first place ... always check in an IDE!)
6. Took the exam and got a good score.

Cheers, Jared.
16 years ago
Hi,

I did the same question today. The monster truck sounds the closest to me, but I think it's a bad question too.

Cheers, Jared.