Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!

Mike Anna

Ranch Hand
+ Follow
since Jul 08, 2007
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 Mike Anna

I have two files, create_user.bat and create_user.sql This is the content of create_user.bat :

This is the content of the .sql file :

Upon running the bat file, first it gave me this error :

Then I changed this '@P_USER'@'@HOST' to '@P_USER'@'localhost' then I get this error :

I have read similar questions on various forums and I think am following everything. I dont see where I am going wrong. How do I go about fixing this script please?

K. Tsang wrote:There's a BeanToCsv class in the OpenCSV API. Well you already figured out how to read bean to csv like:

Then to write

BTW, BeanToCsv is for ver 2.4 which isnt released yet.
I figured you wanted to write a list of list of beans then first how to produce a list of list of beans from reading then loop through it while writing.

Thanks for your response. Sadly, I wasn't able to figure out a column mapping strategy while reading from csv.
How could one write directly from a bean, when it is a simple pojo and also when it has nested pojos within itself ?
I am using opencsv to read a CSV file and it works well.
I am currently trying to retrieve details from a database using hibernate and want to write the values to a csv file.

I saw they have examples where you can use the column mapping strategy and tie the indexes of the csv to a java bean but opencsv doesnt have anything like that for writing to csv files.
Lets say I get a)a list of Employee objects b)a list of Employee objects with Address (another class, included as a java.util.set in the employee pojo)embedded within
How could I go about writing a csv file in this scenaro ?


IDK if this question better belong to the Threads and Synch forum. Here's my question.

We know that every thread that calls a method will have its own copy of the Objects declared in that method and thus make the method thread safe. (Lets say we have a HashMap in a method fooMethod.) Can someone please tell me what happens to this ownership of the of the objects when this method call in turn calls other methods ? How long does this objects localness spawn for the thread executing ? Does any modification of this HashMap within those other methods (which can be from other classes) cause thread safety issues (apart from throwing the concurrent modification exception) ? Also, what if one of the methods being called is a static method ?

8 years ago

Could someone please comment on how the job market in Australia and New Zealand is for a java devloper/sr. developer/architect etc ? A realistic evaluation. The job sites are a waste of time as they never really indicate how the market out there is.
Also would someone comment on if Australia would be a better place than New Zealand primarily since it is bigger in size than New Zealand and hence more number of jobs ? I heard the tax rates are more or less the same. So the money one makes is almost similar in both the countries ?
I am at a crossroad where I want to leave the US for a life in either of those two countries, so any advice appreciated. If it helps, I have over 9 years of experience in various java related open source technologies and have performed in every role below the CTO. My IELTS result says that I have excellent communication skills.

9 years ago

pyare sharma wrote:
Do the employers feel that they cannot hire the person for Java jobs after having experience on another language ?

.. are you kidding me man ? I would rather hire someone who has experience in multiple languages/technologies than someone who has been one one language for ever.

You have over 9 years of experience in java. So what is the fear ? If I were you I would go with what Chris is saying. Learn a new language and get paid for it AND have a job ready for it. You have been a Sr. Engineer, so a Project Lead is also a promotion and gives you the landing ground from where you can choose to be an architect or whatever.
9 years ago
To answer your question of figuring out a passion, a lot of people never get that one right. I, for example was extremely passionate about fixing motorcycles, but it wasn't a rewarding career (Of course, I could be a master at the skill and be hired at big races. But my passion wasn't porting engines and making faster bikes, I was just too passionate to prolly fix a burnt clutch plate). So the next 'passion' I had was religion. I never found God. Then my next passion became Java. Now am too bogged down by the newest features and the necessity to keep up with them. So first, if you know you will figure out the passion in 5 years, good luck.

Most companies have near about dud heads in the recruitment process. If the tech guy is fine the HRs is stupid. If the HR is smart the tech guy is stupid. I would say you just need to keep faking your interest in how high the company's vision is (now which company does not survive only for profits !). Its all about the money in the end. But most firms have to bring in these abstractions of apparitions in the form of social responsibility etc. And they expect the same from the candidates applying.

I have to congratulate you for getting this awakening. When I interview jr. resources, I never expect them to ANYTHING about the company or its visions or ideals. I keep my questions basic and look for the smartness. At the end, I feel like guy's rant :

Realistic jobs the way you expect are rare.

Good luck.
9 years ago
I wonder what direction my head bobs when am sleeping in my chair
If I am in a house which does not have a fan/ac, I will sleep with my head near the window. If it has air conditioning, then a blanket is all I need and I can tuck me self away as and how I wish.
Also, it depends on where the electrical sockets are since I like to keep my phone by my head (because I can set snooze for 3 minutes on my phone) and I like to charge it over the night.
When I was a kid I remember my dad consulting a Feng Shui expert for something. Course of conversation, he came with the picture of something which he said will keep the evil spirits away and if a normal person sees it for 5 seconds (or some duration), s/he will have a headache. Being what I was, I purposefully used to stare at that image for hours and it did nothing to me. As the minutes of the hours passed by, I used to wonder when on Earth am I supposed to get the headache ! I knew that piece of paper wasn't keeping no evil spirits away.
9 years ago
Absolutely Bear ! You give sane advice.

I speak for myself : If someone keeps 'adjusting' and tolerates insane/unprofessional behavior, s/he is definitely contributing in this treatment to be given to others. I have burnt bridges with every obnoxious and illogical person I have interacted with in my professional life. Be it HR or a manager. There is a difference between being a jerk and burning bridges. I would prolly live in a shelter before I had to choose to work with/for them.
9 years of throwing attitude (at the people who don't deserve to be where they are, in my opinion) and still going strong. Highly employable and with the mercy of my Lord, quite decently paid. Am I just at the peak where the fall begins ? I don't know. If am there I'd rather cattle farm than write half baked code. I think there comes a time in everyone's life when they develop a thick skin and refuse to be a door mat. Individual mileages may wary.
9 years ago
I feel you. So many times I have wanted to cause physical damage to HRs all over. Most of them are stupid enough not to correct typos when they post jobs. Nobody specifies the work authorization. The subject says full time job but the body says contracting. Many times I take the time and draft mails which send a message. No body does it like a job. Whenever they get time from their stupid iphones and ipods and texting is when the HR works -> this is in reference to when you interact with the HR within the company.
Even walk-in interviews are scheduled pathetically. I used to simply walk out of any interview where I have to wait for a 'round' for over an hour. That was when I had less experience. Slowly I noticed that I enjoyed insulting substandard HR folks. So I really give them a logical piece of my mind before walking out these days.

James Browne wrote:I took your points well. So, I will keep on working and waiting.

BUT........Before I move on forever, I wonder how the douche employers will react to this -

Create/Get 4-5 (maybe much more) fictitious, impressive resumes of fictitious people. Show impressive skills in them, specific to the job.
Then, apply with these resumes and watch the jerks reply in anticipation. Don't reply or keep em hanging for a while.
Give them a taste of their own medicine.

A bunch of guys I know did this. Not that I am saying this is the right way, but people genuinely get pissed off. They were 5 of them. Each of them got a job offer from a company by this specific HR. Everyone said they will join on date x. No one did. The HR guys life was miserable for a long time.
9 years ago

I am trying to make a struts (version <2) app, and am inserting an employee record.
All I want to do is to a) display an alert saying employee created (and clear out the emp details fields) b) validation for the emp details (which I plan to do in the validate method).
Any and every example I search, all of them are returning a success or a failure from the action class, in terms of a new jsp.

I could definitely redirect to the same jsp and have an if/else block and check for some flag I can set in the session. But, is this the only way to go about it ?
What could I do ?

11 years ago
Thanks for your reply Eric. In my quest for achieving this, I got a list of the inline elements in HTML from here, but from my knowledge nothing in there will be helping. Could I request for a line of code.. or probably specifics, like, what I should be doing to place text boxes next to each other, would tremendously help.


Yes; don't use a div, or style it with CSS to be inline.

... so what would you suggest a way out ?
Thanks for answering David.
I agree with what you say. This is what I had in mind as a solution. To have a number incremented, by say 40 px and then style the div to be positioned as a relative/absolute and use that number as the incremental margin.
I was thinking if there are other approaches to this ?