mark walter

Greenhorn
+ Follow
since Jun 20, 2008
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 mark walter

Yesterday I had an interview at a top online stock brokerage firm and all the questions asked were of a similar format as the ones below:

What are the different types of jdbc drivers?
How do you call stored procedures?
What does registerOutparameter method do?
What is the difference between aggregation and composition?
What are the different ways of starting a Thread?

I came away thinking that the interviewer just picked up a bunch of questions from one of those '100 Java Interview Questions' you find online. My point being that textbook style questions like definitions and differences would never reveal the caliber of a programmer.
You cannot tell if the person had crammed these answers the night before or actually 'lived' through the experience.

Having worked with plenty of programmers during my 10 years i often find that those who can rattle off definitions and theory can be inept at writing code that wont fail its intended purposes. In one of my first java projects we hired this guy who had co-authored several books on the latest java technologies. However it soon became obvious to us that he was incapable of putting together even a simple jsp and map it in struts. He would have made a fine technical advisor/analyst but sadly we wanted a good programmer and had to let him go.(Note: im sure this is not common and plenty of authors are great programmers)

When you are interviewing for a programmer what is the right strategy/questions you would employ to determine if the person is a good programmer or not?
For example, I often find that when I interview candidates it helps to have the person talking about their experiences and how they solved a particular problem. This would tell me a lot more about their skills than if i just asked them 'What is the purpose of the finally block'(yea, i got asked that at quite a few fortune 500 companies)

Lastly I apologize if this sounds like a rant. I really want to get your opinion on what you think is the best approach when you interview someone for a programming position. Hopefully, this can help make better interviewers out of all of us.
14 years ago
Is this what you are trying to do?

<code>
private int number;

public void setNumber...

public int getNumber...

public String execute(){
try
{
Class.forName...
Connection con ...
Statement stmt ...
ResultSet rs = stmt.executeQuery(select*from counter);
while (rs.next())
{
this.setNumber(rs.getInt("count"));
}
catch...

}
</code>
Look at HttpSessionBindingListener interface and see if it helps.
15 years ago
Could be any number of reasons. Did you:
a.) Startup tomcat properly so no errors are shown in the logs or console?
b.) Check the port tomcat is listening on? Usually this would be 8080 and the line on the console would be --> Starting Coyote HTTP/1.1 on http-8080
c.) Check that the webapp the form.html is in is deployed properly?

You can test if tomcat is running by checking http://localhost:8080
15 years ago
add the website name to the hosts file mapping it to the static IP it is running on.
15 years ago
Hi Peter,
There are a few things you need to do in order to get Yahoo to 'whitelist' your mails:
1.) Contact Yahoo at the below url to request registering your mail server:
http://help.yahoo.com/l/us/yahoo/mail/postmaster/postmaster_wl.html

2.) Update your MX and TXT records with your domain registrar to point to the hosting provider's mail server.

3.) Check your email headers in Yahoo to see if they have the following entry:
X-YahooFilteredBulk: <your hosting provider's mail server IP>

Once you contact yahoo they might ask you for some information about your website like privacy policy and IP address. Hopefully they will remove you from their blacklist.
15 years ago

Originally posted by Bear Bibeault:
P.S> If your web app is the root context, the context path will be the empty string.



Hmm, doesnt look like I said hard-coded anywhere. Guess I should have said web app like your above comment to be specific.
15 years ago
JSP
What do you do with the CLOB object after you create it?

CLOB tempClob = CLOB.createTemporary(conn, true, CLOB.DURATION_SESSION);
tempClob.putString(1, data);
For examining method declarations of classes in jar files use the eclipse IDE's package explorer
15 years ago
You also need commons-pool.jar and I think commons-collections.jar too. Download them from the apache website and add them to your classpath.
Niall, If these images are contained within the war file then they are static images. So why do you need to build a dynamic url?
<img src="<path>/images/some.jpg"/> should work just fine.
15 years ago
JSP
Ramu,
The form in 1.jsp needs to be submitted before you can access the request.getParameter(). You need to move the block of code into 2.jsp and set the session values there. So 2.jsp would look like this:

2.jsp:
<html>
<BODY>
<%
String a = request.getParameter("a");
String b = request.getParameter("b");
session.setAttribute("a",a);
session.setAttribute("b",b);
%>
<form name="form2" action="3.jsp" method="post">
C:<INPUT type="text" name="c">
D:<INPUT type="text" name="d">

<INPUT type="submit" value="Go">
</form>
</BODY>
</HTML>

Hope this helps
15 years ago
JSP
We finally came to a middle ground solution. Since only thumbnails are shown in the search results page these will be served from an external file system. The actual image will still be served from the db one image per page. This ensures files get backed up along with the db backup and the thumbnails can be regenerated from them incase of a filesystem failure.
External files need to be handled by a servlet so that users cannot access the files directly. The servlet can handle the FileIO and stream the image contents to the response.
Well, hopefully that takes care of our image management issues. Hope this helps someone else.
15 years ago
Thanks Bear,
The DB vs. FileSystem argument really seems to go nowhere. I would gladly debate the pros and cons on another thread if you wish.
As for the current issue, yes, the load is one reason why I would look for a better approach then sending multiple requests which would fire multiple queries to the db.
Anyway, thanks for validating my suspicions about the second Option.
I guess I need to look at different caching alternatives as you suggested.

any other inputs? anyone?
15 years ago
I have been banging my head over this for awhile now and google's no help. so any suggestions would be greatly appreciated.

We save image thumbnails in a MySQL Database. Please,please do not tell me to switch to a filesystem as this decision was made after a lot of gut-wrenching debate and we are well into the dev cycle to change design.
I wrote a simple servlet that when passed the image ID fetches the blob and streams it to the http response stream:
byte[] rb = ...call db and stream blob to byte array here...
response.setContentType("image/jpg");
response.getOutputStream().write(rb,0,len);

I then call this servlet from the image src tag like so
<img src="ImageServlet?id=123"...>
Everything works fine so far.

The requirement is now to display multiple thumbnails on a single page(Say 5 rows of 4 thumbnails each)
If i use the above setup then the page would fire multiple(20!) queries to fetch all the images. This is what i wish to avoid and where iam stuck. My alternatives:

Option 1) A new servlet takes 20 image IDs and caches them somehow(?). This would involve either saving the files in user session or writing to webserver which would quickly overwhelm resources when 100s of users request 1000s of pages.
Option 2) Preload images in the jsp. Im not sure if this can be done. need to write some test code and see.

So there you have it. If any gurus out there have experience with showing multiple images from a database then please do share your experience. Any insights/suggestions/links/critiques welcome.
Meanwhile, I will keep looking and keep you posted on my findings.

Many Thanks
Mark in the Dark
15 years ago