# fred rosenberger

lowercase baba
since Oct 02, 2003
fred likes ...
St. Louis
Cows and Likes
Cows
66
In last 30 days
0
Total given
26
Likes
1777
2
Total given
59
Given in last 30 days
0
Scavenger Hunt
Rancher Scavenger Hunt
Ranch Hand Scavenger Hunt
Greenhorn Scavenger Hunt

## Recent posts by fred rosenberger

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 yours...it 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.
5 days ago
Does anyone but me still call it the octothorpe?
5 days 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.
3 weeks ago

Junilu Lacar wrote:

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

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
4 weeks ago
"optimization" can mean different things:

execution time
memory usage

and how you'd optimize for each differs.
4 weeks ago
We don't consider any question as silly.  If you are confused by something, feel free to ask!!!
1 month 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 fifth...it took more words to explain that the other four combined. He also seems to resist using it as long as possible...it 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.

1 month ago

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

I have no idea what you are talking about...
1 month 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 first...to 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!!!
1 month 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.

1 month 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.
2 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!
3 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 house...it 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.

3 months ago
back in the good old days of programming, you had to write code like this:

Even worse, you may have to have special calls for the various levels of the OS - so Windows 3.1 worked different than Windows 95, as did all the unix flavors, etc.

Java hides all that from you.  Using the Date class, you just...get the date.  The JVM handles all that for you.  If there is a compliant JVM on a machine, the same call will get the date - even on operating systems that didn't exist when you wrote your code.
3 months ago
the best way to tell if your program is correct is to compare it against your specifications for what it is supposed to do.  We don't have those specs, so we can't actually tell you if it is correct or not.

and there are almost always optimizations you can make, but a better questions is are there any optimizations you should make.  And the answer to that again goes back to your specs, and what they say about efficiency/speed.  it's almost always better to write clean, understandable, maintainable code that super-efficient code.
3 months ago