Junilu Lacar

+ Follow
since Feb 26, 2001
Junilu likes ...
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
Columbus OH
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 Green check
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Junilu Lacar

Carey Brown wrote:You can verify this by the assertions of the rectangle intersections.

You can also infer it from the calculations of TopLeft and BottomRight.
1 hour ago
You haven't declared the package in ClassB. Try adding a package declaration as your first line. Without it, ClassB will be in the default package.
10 hours ago

Vlad Timoshuk wrote:

Problem is that when i run this code every time i get FALSE

Have you tried drawing this out and checking your conditions?

This shows a scenario where the conditional on lines 50-51 is true for both subexpressions. Your code will return false for isIntersects() when clearly the two rectangles intersect.

10 hours ago
The name isInside() is confusing. Look at other classes/interfaces like List, for example. List.contains(value) will return true if the list contains the given value. When you read myList.contains(someValue), it makes sense. However, in your code the logic is reversed. It says "rectangle is inside point."  You might want to rename that method to "contains" or "includes" or something to that effect.

I didn't read the entire thread yet but it would seem to me that you just need the coordinates of two diagonally opposite vertices of the rectangle to check if a point falls within or on its bounds.
23 hours ago
hmmm, I've always said "vahr" rhyming with "thar" as in "thar she blows!" and args like the pirate sound.

I'll add one to the mix: enum. Do you say ee noom or ee numb? I use the latter. And, yes, I know it's ee-noom-er-ay-shun but I say ee-numb anyway for the short version.
3 days ago
Why would you want to remove all blank lines? What do you think you're saving by doing this?

Whitespace is important in a program, especially when used judiciously. Whitespace makes your program easier to read, it helps you separate things that logically belong together from other things, and it helps make the structure of your code easier to discern.

Code without any blank lines at all would be horrific to read.
4 days ago
Please clarify -- it's not clear what you're asking or what kind of problem you're trying to solve. Give more details.
5 days ago
Any behavior that's more involved than just returning a field value or setting a field value. Something like "getDescription()" or "getID()" is not interesting. "Calculate total" or "Apply discount code" is more interesting.
6 days ago
One thing I try to avoid doing early on is anything to do with the frontend. Frontend is more difficult to unit test. I prefer to test my model and service objects. I prefer focusing on interesting behavior. If I were doing that exercise, I would probably just focus on things like "Add item to cart" and "Count items in cart" first. To me, the more interesting object to start with would be a Cart object. I wouldn't care about UI-related concerns until much later in the process.
6 days ago
I suggest you try it out yourself. You don't learn how to swim by listening to someone explain how they do it or reading about how someone trains for a swim meet. You learn to swim by getting in the pool and actually trying to do it.
1 week ago

Monica Shiralkar wrote:And what would be that for example if you are to build an online shopping application.What would be the loop that would take less than 10 minutes ?

I don't see a point in your line of questioning. There are many things you can start with for a scope that large. What are you getting at? You are asking oddly specific questions and it's starting to feel like you're just randomly fishing for answers. What's your point?
1 week ago
It's a bit more granular than that for me. If I was writing a Game of Life program, for example, "one bit of functionality" might be to calculate how many neighbors a specific cell has and that's it. It's not end-to-end but it certainly is going to be an important building block that is common to many flows that I will eventually have to program.
1 week ago

Monica Shiralkar wrote:i think that would  mean that for example one may initially hard code any values required ,get the flow working and later on remove the hard coding by reading  from config file.

That is quite a leap of reasoning you're making there. What you describe is not an unreasonable approach but "thinking about some piece of functionality I want to implement" does not in any way imply what you describe as a specific strategy. It seems like you're reading way too much into my statement than I intended to communicate.
1 week ago
No, it doesn't. "Whatever" means just that -- it doesn't matter whether it's happy path or otherwise, as long as I'm clear on what that functionality is supposed to be. That being said, I usually do start with happy path scenarios just so I can get the base functionality defined. I will usually do negative testing scenarios after I have most of the positive scenarios implemented.
1 week ago