fred rosenberger

lowercase baba
+ Follow
since Oct 02, 2003
fred likes ...
Chrome Java Linux
Forum Moderator
fred rosenberger currently moderates these forums:
St. Louis
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 Green check

Recent posts by fred rosenberger

The first steps are always the same, regardless of the language.  How would you do it by hand?  Can you explain it in English as if speaking to a child?

Until you can do those steps, don't even consider what programming language you want to use.
3 days ago

Keshini Weerasuriya wrote:Is thr any way of finding the maximum and minimum of an array without using any loops, or if conditions??

My answer would be "who cares?"  If there is, I wouldn't want to ever see it in production code, so to me it doesn't matter if it exists or not.
3 weeks ago

Hanna Roberts wrote:For example the file could look like this:

For future reference...examples are great, however you should really try and write a spec.  You want to write out the exact rules that take into account every possible scenario.  That's what Piet wrote in his post after is unambiguous as to what counts as a word and what doesn't (at least, I can't think of a case it doesn't account for).  With your example, it certainly helped, but wasn't definitive.
1 month ago
Does anyone but me still call it the octothorpe?
1 month ago

Damon McNeill wrote:To multiply 2 complex numbers you apply the FOIL method for multiplying binomals

As opposed to FOIL for trinomials?  

This is why, as a former math teacher, I hate it when people are taught FOIL.  It only teaches them how to multiply one specific case of polynomials.  people learn it by wrote, and then often can't (or don't) generalize it to others.  
1 month ago

Junilu Lacar wrote:

Jesse Silverman wrote:Beautiful post, and quite short too!

Thanks! Glad you liked it.

Yeah, I'm working on writing short and to-the-point. I need a lot more practice though.

I would have written a shorter letter, but I did not have the time. - Blaise Pascal
1 month ago
"optimization" can mean different things:

execution time
memory usage
simplicity to read

and how you'd optimize for each differs.  
1 month ago
We don't consider any question as silly.  If you are confused by something, feel free to ask!!!  
2 months ago
My understanding of axions is that they are not, and have never been proven. However, they are supposed to be simple enough that you look at them and say "yeah...that makes sense.  That must be /is probably/is something i'm willing to accept as true". Then you use those to prove a bunch of other stuff.  As long as you don't end up with a contradiction, your system of mathematics is considered valid.

Euclid had five.  the first four were simple enough, but the took more words to explain that the other four combined. He also seems to resist using it as long as shows up much later in his Elements than the other four.  But, the system we call Euclidian geometry is stable - no contradiction has been found.

Much later, someone noticed the fact that the fifth axiom was a little...sketchy (to use my daughter's terminology).  They were going to try and prove it by contradiction.  They assumed the opposite, and started working to develop a system of math based on that. They figured they'd get to some contradiction, which would invalidate their assumption.  They never found one.  The only conclusion is that both systems are valid, in the right circumstances.  And neither system is valid without assuming some version of the fifth is true.

The Gödel came along and screwed everyone over - but that's a whole other topic i'd need to brush up on.

2 months ago

Mike Simmons wrote:As Fred of all people would know. ;).

I have no idea what you are talking about...
2 months ago
Note:  This is not a serious post, hence it being in MD

Sooo...test driven development.  it's a thing.  The idea being, you write tests first, then write your code such that it passes the tests.  then you write more tests, update your code to pass those - and still pass the original, etc.

But....The tests are written in java.  Which means they are java code.  So you should write tests for that code test the tests.  But THOSE tests are in java...So really, you can never get started, because any tests you write need to have tests for them written first.

It's tests all the way up!!!
2 months ago
Please post your code, tell us what it DID, and what you EXPECTED it to do.  There are essentially unlimited ways it could not work.  Without seeing your code, we can't really help you.

If your snippet is too hard to code, then you haven't broken it down into small enough pieces.  But again, without knowing what you are doing or what you have written, we can't help.

2 months ago
several suggestions...

1) spend a lot of time thinking, so you spend less time typing.  If you are a beginner, you should probably spend 80-90% of your time planning what you will write, rather than just diving in and starting to code
2) try to break down the problem in to simple, discrete components.  Most of those components will have discrete components themselves.
3) think about how you, personally, with only paper, pencil, and erasers, would do this. As in, you are behind a counter, someone walks up to you.  What would you do first?  second?  third?  what would you do over and over?  how would you know when you were done doing those things over and over?

When you DO start coding, write a few lines at a time, compile, and test.  then fix everything that's wrong.  then write a few more lines (literally, like 2-3 lines AT MOST).  You want each cycle to advance your design, but not be so big that you can't find where the bug is.  TEST TEST TEST much more than you think you should.  

Sometimes, you write throw-away code.  for example, if I were starting on the piece for the custom sandwich, my first go might simply print "ordering custom sandwich".  that print statement won't be in my final code, but it lets me write a couple line, proves that the method is being called, and so on.  Then the next iteration might take that out (probably just comment it out in case I need it later), and then ask "what toppings would you like" and list them.  It won't yet DO anything about them, just list them.  When THAT works, maybe write a method that lets the user select ONE topping.  when that works, write a loop that calls that "getOneTopping" method up to three times...etc.

you want to build your project like it's legos...adding just a few pieces at a time.
3 months ago
It took me a while to wrap my head around that...but yes, creating an array does not create the objects that array holds.  Creating an array is like creating an egg carton.  it's great that you have the carton, but you still then need to have the eggs created, then put them in the carton!
4 months ago
When you have a line like:

You have created a User object somewhere off in memory.  You also create a User object reference variable called "me" that is then given a value that lets the JVM find that actual object off in memory.

Think of it like telling a home builder "Go build me a house somewhere."  The builder does that, and says "OK, here are the GPS coordinates of your house i built".  You write it down on a piece of paper labeled "MyHouse".

that "MyHouse" piece of paper does not hold the actual just tells someone how to find the house.

I can now make copies of that piece of paper, and hand that out to as many people as I want.  "here is my house"..."here is my house", etc.  You're not giving them the actual house, you're just telling them how to get there.  If someone goes there and paints the living room blue, then that living room is blue for anyone who subsequently goes there and looks.  If someone later paints it yellow, now it's yellow for everyone from that point on.

If I don't want anyone to be able to change the house, I can still give them the address, but not let them in to change it (maybe by putting a lock on the door).

Your variable "me" contains a house/object address.  When you pass "me" into a method, you're making a copy of the address, and handing it to the method.  Now that the method knows how to get to your object, if your object allows things to change it, it can be changed by the method.

4 months ago