Win a copy of Java EE 8 High Performance this week in the Java/Jakarta EE forum!

Janeice DelVecchio

+ Follow
since Sep 14, 2009
Janeice likes ...
Eclipse IDE Java Windows
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 Rancher Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Janeice DelVecchio

CattleDrive Hall of Fame

Student NameBasicOOPServletsJDBC
John Ackerman
Terry Broman
Lance Finney
Barry Gaunt
Margaret Gillon
Peter Gragert
Richard Hawkes
Louise Haydu
Kate Head
John Hembree
Manju Jain
Joyce Lee
Pauline McNamara
Carol Murphy
Daniel Olson
Marilyn de Queiroz
Jason Adam
Jon Anslow
P. Mark Beattie
Matt Fry
Greg Harris
John Godfrey
Kelly Loyd
Michael Matola
Jeremy Medford
Greg Neef
Katrina Owen
Michael Pearson
Dirk Schreckmann
John Abong
Pat Barrett
Richard Barton
Ben Beetle
Peter Berquist
Richard Boren
Bill Bozeman
Richard Broersma
Susan Brown
Nick Cabell
Josu? Cede?o
Kenneth Cobbs
Kimberley Coburn
Joel Cochran
Ed Connery
Donald Cossitt
Kenn Cowling
Sherry Cuenco
Janeice DelVecchio
Gerald Dettling
Colm Dickson
Craig Dighton
Wirianto Djunaidi
Terence Doyle
Kurt van Etten
Phil Freihofner
Stuart Goss
Juliane Gross
Dan Jones
Johannes de Jong
Rob Keefer
Elouise Kivineva
Diego Klappenbach
Rory Lynch
Panday Manako
David Mason
Marie Mazerolle
Armando Moncada
David Morisset
Amy Phillips
Matthew Phillips
Slobodan Popovic
Rick Prevett
Adam Price
Sharon Ross
Ronald Schindler
John A Simpson
Justin Simpson
Gillian Smith
Kristin Stromberg
Dick Summerfield
Jeremy Thornton
Sam Tilley
Adam Vinueza
Chuck Wannall
Amber Woods
Christie Xu
Garry Ba 
Kyle Blythin 
Connie Boyd   
Ryan Burgdorfer   
Nick Burgett   
Ashley Bye   
Mark Channer   
Rajan Chhibber   
Eric Christensen   
Bryant Constant   
Sean Davis   
Mark Gandy   
Stephanie Grasson   
Jane Griscti   
Doug Hattrem   
Tom Henner   
Laura Holcombe   
Brian Holsenbeck   
Sam Hume   
David Junta   
Marcus L?ubli   
Joyce Lambert   
Thomas Leak   
Nathan Leniz   
Ian Lubelsky   
Jay Lyche   
Stuart Malloch   
David Malott   
Vince Mansel   
Ian Matthews   
Dav McCartney   
Joe McGuire   
Jack Moore   
Mike Neumann   
Brian Nolan   
Tom Purl   
Paul Ralph   
Robert Richardson   
Fred Rosenberger   
Gabe Schenz    
Nick White 
11 months ago
So I'm taking the free Udacity Hadoop intro here:

There's some test file that has loads of data that looks like this:

The question was to get the total count of payments AND the total payment amount over all payments. You're supposed to do this in Python.... I know nothing of python, so I did it in Java.

Here's my mapper:

And my reducer:

- After struggling time and again, the only way I found to solve this problem was to write to the context twice in the mapper. I feel like this is hackery. How could it be solved correctly or is this it?
- in my reducer, using count++ was not working. I was getting only 5 payments total. Once I parsed the value and added it, it worked fine. Why?
1 year ago
To solve the assignment and get the instructor solution, your solution may be different than the solution given by the trailboss.

The number of lines is a serving suggestion so folks don't go crazy writing too much code.
1 year ago
I work on a legacy app that's undergoing technology migration.

It's interesting (and case specific) when the choice is made to
- write tests and refactor
- rewrite / rearchitect / test
- try not to touch too much but still get to technology goals. Write as many tests as possible.

Mostly all this has to do with risk / time / money / difficulty - like Junilu said.
Getting repeatable / reusable / readable tests is a big concern because one day if the decision is made to do another thing, you want to be able to understand what effort was put in so far -- and how things work!
Maybe that's why I ended up here asking so many questions!

2 years ago
Yes. That was the text used in my first intro java class.

I found it lacking in some areas (generics). but a good book to cover most topics.
2 years ago
I love Head First Java.

If you want something more textbook-ish Core Java isn't too bad.
2 years ago
Are you using Hibernate?

In hibernate you can turn up Log4J Logging level to see the bound parameters on your query. It might just be a configuration you need to set with package names and level. No custom logger/code needed.

Try this:

2 years ago
There's nothing that a hundred men on mars could ever do....
2 years ago
I think you can do a partial mock. See notes here:

You could do it without a mock too if the method is not private or static. Quick example:

2 years ago

Tim Cooke wrote:how will you assert that quest.embark(); is called?

in JMock,

This is a way to write a unit test for this case. Another way is to extend RescueDamselQuest and have a counter or boolean in the embark method and make sure the counter or Boolean changes before or after the test. You wouldn't even need a mocking framework to do it that way.

THAT SAID, it's not good design to code to the class. You should write your code to the interface to allow mocking without using the class imposteriser or subclasses. These are good patterns for legacy code, not code that you are writing fresh.
2 years ago
I don't think the framework supports what you want to do.

What you "could" do is create a before advice for these controller methods which need the ip from potentially differently named parameters.
In the advice, you find out which one it is (I would use an externalized list of expected param keys), then put it on the request in a normalized name your controller is expecting.
2 years ago
This is a bunch of code to read and figure out what's going on.

I suggest you put some System.out.println statements in generateTicket and setFine to determine what the key values are...

also this loop:

You're never changing the value of illegalPark... so it looks (to me) like if you go into that loop, you'll never come out.
2 years ago

Let's look into updating that jar once you're in that section of the Cattle Drive.

Moving this thread to the CD forum.
2 years ago

Ashley Bye wrote:Whilst I have some code in 2 of the methods and I know they work because I used a singleton bean to test them, it's not really in the spirit of unit testing or TDD. As mentioned right at the top, I'm a little perplexed as to how to continue. Any chance of a leg up?

I don't understand why you need a singleton bean.

To unit test this mock, I'd....

Now I don't use/know Mockito. I use JMock. I could help you with syntax if you aren't tied to mockito.
2 years ago