The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.
While messing around with Java I made a stupid mistake that took me the better part of the morning to figure out: I gave the project the same name as the name of the main Java class used in the project. You shouldn't do that, I know now, but it had some weird consequences. The main problem was: If I tried to run one of the class's constructors, Java would look for the constructor in the project, not the class! I could not figure out why the compiler kept telling me that the constructor does not exist, while I knew damn well that the class does have such a constructor.
In the end in desperation, I restarted the project under a different name. Problem solved! This is one mistake I will never make again!
Anything that is unrelated to elephants is irrelephant Anonymous - The problem with quotes on the internet is that you can never tell if they're genuine Winston Churchill, 1944 - Never argue with a fool. Onlookers may not be able to tell the difference. Mark Twain
TRWTF is replying to an old message without reading the other responses first.
Did you ever see history portrayed as an old man with a wise brow and pulseless heart, weighing all things in the balance of reason?
Is not rather the genius of history like an eternal, imploring maiden, full of fire, with a burning heart and flaming soul, humanly warm and humanly beautiful?
Training a telescope on one’s own belly button will only reveal lint. You like that? You go right on staring at it. I prefer looking at galaxies.
-- Sarah Hoyt
I wouldn't blame Java for this, it's probably more an issue with the IDE used to handle Java. In NetBeans I give my project names exactly the same name as the main class, and the package name is the same but all lower case as it must be = no issues. NetBeans did change the way it does all this stuff by default some years ago as I recall. Students often fail at this task, but with this simple convention nothing goes wrong.
I was about to "guess" 2 based on the same premise: first three and a "feeling" about the last two (:
If you say that getting the money
is the most important thing
You will spend your life
completely wasting your time
You will be doing things
you don't like doing
In order to go on living
That is, to go on doing things
you don't like doing
Everyone should know the squares - at least for 1 to 20. After that, you just need to know that multiples of ten are (x * 10)^2 = x^2 * 100. You can then do the halfways [numbers ending in 5] (x * 10 + 5)^2 = ((2x + 1) * 10)^2 / 4 [looks a lot more complicated than it is]; thereafter, for numbers ending in 1, 2, 6, 7 you apply (x + 1)^2 = x^2 + 2x + 1 (or x^2 + (x + 1) + x) [do it twice for 2 and 7] and for numbers ending in 3, 4, 8, 9 you apply (x - 1)^2 = x^2 - 2x -=1 or x^2 - (x + 1) - x = x^2 - x - x - 1 [do it twice for 3 and 8]
At least, that's what I use! And I assure you, once you've got the hang of them that are simple.
Edit: It is also useful to memories powers of two and squares of prime numbers
About 160,000,000 - my mental arithmetic runs out of registers to remember digits in after 5 or 6 digits ... and long division starts using 'em up fast ...
But some of it is easy: 102*112*122*132*142 == 100 * 121 * 144 * 169 * 196
(10*10 is easy, and each square adds 2 more than the previous: 100 -> 121 Adds 21, 121 -> 144 adds 23, so the next two terms are 144 + 25 and 144 + 25 + 27)
We were rote taught our "times tables" up to 12 by 12, so the first three are imprinted on my brain...
long multiplication in your head is reasonably easy as long as you keep the decimal places straight.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
Last Visit: 1-Dec-20 21:08 Last Update: 1-Dec-20 21:08