Comment On ISelfAware, Very Thorough, Crazy Hashmaps, and More

Seeing that I somehow neglected to publish an article yesterday, I figured today would be a great day for a big ole smorgasbord of interesting code. Enjoy! [expand full text]
« PrevPage 1 | Page 2 | Page 3 | Page 4 | Page 5 | Page 6Next »

Re: ISelfAware, Very Thorough, Crazy Hashmaps, and More

2010-09-30 16:41 • by Ilya Ehrenburg
323803 in reply to 323800
hatterson:
boog:
smxlong:
If 0.999... != 1, then by the density of the real numbers, there must be some number X where 0.999... < X < 1. Suppose such a number exists. Please show me how to write this number.

I realize the discussion has gone far beyond this particular post, but I thought I'd throw one more brain-teaser out there for anyone who is still continuing this idiotic debate.

Assuming that 0.999... != 1 (which is assuming wrong, but bear with me), or rather that 0.999... is supposedly the largest number less than 1, I ask you this: what is the largest number that is less than 0.999... and how do you write this number?


Given that the standard rules of mathematics don't apply under this assumption I would be perfectly happy with saying that .999...8 is the largest number less than .999...

In this crazy world .999...8 would be .000...1 less than .999... which is .000...1 less than 1

Since the Real field is an ordered field, assuming 0.999... were the largest number smaller than 1, obviously the largest number less than 0.999... would be (0.999... - (1 - 0.999...)) and I would write it thus.
Note however that in an ordered field, there cannot be such a thing as "the largest number less than x".

Re: ISelfAware, Very Thorough, Crazy Hashmaps, and More

2010-09-30 16:45 • by JS (unregistered)
323805 in reply to 323423
divisible by itself, 1, 5, and 43, you mean.

Re: ISelfAware, Very Thorough, Crazy Hashmaps, and More

2010-09-30 18:31 • by MG (unregistered)
323809 in reply to 323601
The Maths:
MG:
Also, since .9999.... = .9 + .09. + .009 + ..., an infinite geometric series with ratio .1 that has a finite sum.

Since the sum is the first term divided by 1 less the ratio between the terms (see Wikipedia link for proof), we get sum = .9 / (1 - .1) = .9 / .9 = 1.

QED

You seem to know quite a bit about the maths, so I'm assuming you think your silly number games are clever.


Hardly clever. Anyone who has learned rudimentary Calculus knows this. It is provable and it avoids any argument that you somehow can't perform a mathematical operation on an infinitely repeating decimal (that is, that 10 * .99999... somehow does not equal 9.9999...).

Re: ISelfAware, Very Thorough, Crazy Hashmaps, and More

2010-09-30 19:47 • by Henning Makholm (unregistered)
323815 in reply to 323800
hatterson:
Given that the standard rules of mathematics don't apply under this assumption I would be perfectly happy with saying that .999...8 is the largest number less than .999...

That's only until someone comes along and asks how .999...85 compares to either of these.

In some sense, the usual definitions are arbitrary, but they're not that arbitrary. If we require that the real numbers must in some reasonable sense generalize the properties of the rationals, and that whatever rules we adopt for them must not immediately lead to a contradiction, there is not much wiggle room left.

Non-standard analysis gets you only so far; in particular the non-standard reals come bundled with non-standard integers (which are the usual ones plus a steaming heap of different infinities). The decimal expansion of a non-standard real then requires a digit for each non-standard-integral index, and if you set all of these decimals to 9, you still get 0.999...=1 exactly. The best you can do is to make the first aleph-0 decimals 9's and the rest 0's. Then 0.999...9900... is infinitesimally close to, but distinct from, 1.

Re: ISelfAware, Very Thorough, Crazy Hashmaps, and More

2010-09-30 21:20 • by hoodaticus
That ISelfAware if truly precious. Not only does it have a blindingly arrogant name, but it is also utterly useless. Such combinations of arrogance and ignorance are amusing from afar, but enraging when it's happening right next to you at work.

Re: ISelfAware, Very Thorough, Crazy Hashmaps, and More

2010-09-30 23:12 • by Robert (unregistered)
323821 in reply to 323809
MG:
The Maths:
MG:
Also, since .9999.... = .9 + .09. + .009 + ..., an infinite geometric series with ratio .1 that has a finite sum.

Since the sum is the first term divided by 1 less the ratio between the terms (see Wikipedia link for proof), we get sum = .9 / (1 - .1) = .9 / .9 = 1.

QED

You seem to know quite a bit about the maths, so I'm assuming you think your silly number games are clever.


Hardly clever. Anyone who has learned rudimentary Calculus knows this. It is provable and it avoids any argument that you somehow can't perform a mathematical operation on an infinitely repeating decimal (that is, that 10 * .99999... somehow does not equal 9.9999...).


Any mathematical operation on an infinite number can never be completed ever... you can *show* a formula, but you can never get the answer in actuality as you cannot possibly ever finish working it out.

To actually perform even a simple addition of 1111... and 1111... the act of addition itself can never be completed. You can *assume* that because 1+1=2 that eventually you'll get to 2222... but that's an assumption based on related knowledge, how can you possibly get the TRUE result (and the real true result is what counts only) to that by performing the actual method of base addition? you can't.

Multiplication is even worse as there is no right hand starting point to begin the calculation on a fraction, carrying over remainders for infinity sounds like a lot of work as well and means you cannot get a result. 10 * 0.9999... can never be completed and is an invalid formula in real terms. The only formula that would work is self representation:

10 * 0.9999.... = 10 * 0.9999....

Again it's more about reality than rules. Making up laws only hides the solution and helps people think they are smart :)

==========================

That's right i'm back just to keep annoying you all with more posts from the losing side... soon i'll potentially run out of crap to make up but not yet! :D

Re: ISelfAware, Very Thorough, Crazy Hashmaps, and More

2010-09-30 23:34 • by Robert (unregistered)
323822 in reply to 323774
Mark:
Several people have suggested that 0.333... != 1/3 but is an approximation. This is provably incorrect. (I'm not going into the details. The importance to me of you understanding this is exactly enough for me to post a suggestion that you educate yourself; not enough that I will try to educate you.)

At least one called 0.333... an "infinite number". It isn't; it's finite and has a well defined value. The math operations we know and love (like multiplcation and subtraction) work on all real numbers, including those whose decimal representation is infinite. They even work on irrational numbers, or you couldn't do any geometry involving circles.

A lot of people get uncomfortable with infinite representations, or with math that extends to talk about limits or other infinite concepts. This doesn't mean that math doesn't work with those concepts; it means you don't.


"At least one called 0.333... an "infinite number". It isn't; it's finite and has a well defined value."

This is all wrong, my post clearly states that we ARE talking about infinite numbers... the nature of the representation of the number is up for debate sure... but as i said we need to clear on what we personally MEAN, which is why i defined it as infinite number... repeatedly!

If you choose we can write it like this from now on 0.999(inf) to save all the confusion if you are getting lost.

It's impossible to actually calculate a result using a real infinite number, you can make up some rules (but they ARE in fact made up rules) you can approximate and assume... but it won't be true results.

There is no possible way to finish performing a calculation like 10 * 0.999(inf) you simply can never in "real terms" finish as its infinite and the process of a multiplication itself requires the testing of all units of the formula which are... infinite.

We humans like to make up lots of fun rules to fix issues like this... doesn't take away from the original problem however that 1 != 0.999(inf) as the values are simply plain different

1) One is a standard number, 1 with no infinite definition
and 0.999(inf) is a infinite number.. this makes them different

2) They both represent different values and this is the part most of you are brain washed into thinking is wrong via made up rules to solve the issue in the first place.

I would agree that if the difference between the 2 numbers is absolutely nothing and null they are the same... in that the difference between 5 and 5 is absolute truth of 0, so they are the same. 5 = 5

However! There is no way to calculate the difference between 1 and 0.999(inf).

1 - 0.999(inf) = (Undefinable Infinity Shred Value)

As there is no way to find out the difference between them you cannot just assume that there is none to make people happy, that's called being a lazy bastard... so they are simply not equal.

==============================================

I could use more help! someone else join the losers side and help me out damn it, we can do it! we can change the rules of the universe!

Re: ISelfAware, Very Thorough, Crazy Hashmaps, and More

2010-09-30 23:48 • by Robert (unregistered)
As an added note the same logic applies to disproving the idea that the past is infinite.

The 'past' by its very definition and what it is.. is what has actually occurred, the history of the universe as a whole must then have actually happened up to the point we are now.

And an infinite past could never occur or happen as its ... infinite, so its impossible for the past to be infinite.

This means the universe had a starting point, a creation point as it were... or maybe an injection point.

A starting point for the universe being the only real possibility brings a lot of ideas more closely into play like religion and the idea that time itself was created via the big bang

A fun thought for a rainy day!

Re: ISelfAware, Very Thorough, Crazy Hashmaps, and More

2010-10-01 01:15 • by Reepy (unregistered)

<script type="text/javascript">document.write('</div>')</script>
<noscript></div></noscript>

Reminds me of some code replaced as soon as I saw it

<script language="Javascript">document.write('<input type="text" value="hidden value" st' + 'yle="display: none">')</script>

Re: ISelfAware, Very Thorough, Crazy Hashmaps, and More

2010-10-01 05:16 • by Severity One
323829 in reply to 323690
Anonymous:
Severity One:
<Snipped aggression that obviously stems from far more than a trivial anonymous comment>

Let it out Sev One, let it all out. I can tell you're having a bad day at the very least, probably a bad year by the sounds of things. If it makes you feel better to argue your corner then I'm not going to stop you. It's perfectly clear from boog's response that my comment was valid and correct, but this isn't about correctness anymore. This is about you getting the help you need to sort out whatever it is that's causing all this unfounded aggression. As I said before, I'm here if you want to talk. Hey, I don't even mind if you want to continue defending your logically flawed point of view - whatever it takes to make you feel a bit better about life.

I agree that there's aggression going on here, but it's not coming from my side. But I'm dropping this; apparently, confrontation and ad hominem attacks are far more accepted where you live.

Glad I don't work there.

Re: ISelfAware, Very Thorough, Crazy Hashmaps, and More

2010-10-01 05:58 • by DeadPanda (unregistered)

public static boolean isAlphaNumeric(char c)
{
return !isLetter(c) && !isDigit(c);
}

De Morgans fail.

Captha: genitus... huh.

Re: ISelfAware, Very Thorough, Crazy Hashmaps, and More

2010-10-01 09:10 • by Someone You Know
323841 in reply to 323821
Robert:
MG:
The Maths:
MG:
Also, since .9999.... = .9 + .09. + .009 + ..., an infinite geometric series with ratio .1 that has a finite sum.

Since the sum is the first term divided by 1 less the ratio between the terms (see Wikipedia link for proof), we get sum = .9 / (1 - .1) = .9 / .9 = 1.

QED

You seem to know quite a bit about the maths, so I'm assuming you think your silly number games are clever.


Hardly clever. Anyone who has learned rudimentary Calculus knows this. It is provable and it avoids any argument that you somehow can't perform a mathematical operation on an infinitely repeating decimal (that is, that 10 * .99999... somehow does not equal 9.9999...).


Any mathematical operation on an infinite number can never be completed ever... you can *show* a formula, but you can never get the answer in actuality as you cannot possibly ever finish working it out.

To actually perform even a simple addition of 1111... and 1111... the act of addition itself can never be completed. You can *assume* that because 1+1=2 that eventually you'll get to 2222... but that's an assumption based on related knowledge, how can you possibly get the TRUE result (and the real true result is what counts only) to that by performing the actual method of base addition? you can't.



Just out of curiosity, Robert, have you considered the possibility that the methods you're using for computing products or sums are not any less "made up" than any other methods?

Re: ISelfAware, Very Thorough, Crazy Hashmaps, and More

2010-10-01 09:54 • by Henning Makholm (unregistered)
323866 in reply to 323841
Someone You Know:
Just out of curiosity, Robert, have you considered the possibility that the methods you're using for computing products or sums are not any less "made up" than any other methods?

Why bother? He's explicitly and openly trolling.

Re: ISelfAware, Very Thorough, Crazy Hashmaps, and More

2010-10-01 11:47 • by cappeca (unregistered)
323887 in reply to 323418
WthyrBendragon:
I keep thinking that that getSelf() method should be Private. After all, wouldn't you want to be private while doing some sort of self exam?


You are mixing getSelf() with playWithSelf().

Re: ISelfAware, Very Thorough, Crazy Hashmaps, and More

2010-10-01 13:29 • by Someone You Know
323916 in reply to 323866
Henning Makholm:
Someone You Know:
Just out of curiosity, Robert, have you considered the possibility that the methods you're using for computing products or sums are not any less "made up" than any other methods?

Why bother? He's explicitly and openly trolling.


Oh, I know. I'm just curious to see what he comes up with.

Re: ISelfAware, Very Thorough, Crazy Hashmaps, and More

2010-10-01 15:17 • by iMalc (unregistered)
I have actually worked with a third party ActiveX control where I really did have to call a certain procedure exactly three times in a row to make it work properly. The thing was fairly buggy and it was hard enough to get the authors to fix the more important bugs due to the language barrier, and we needed the thing working asap.
Calling it once almost worked, but not quite.
Calling it twice was worse.
But calling it three times worked a charm.

Yes it's a WTF, but the WTF is the bug inside that function, not the fact that we found out how to beat it into submission.

Re: ISelfAware, Very Thorough, Crazy Hashmaps, and More

2010-10-01 18:59 • by Schol-R-LEA (unregistered)
323937 in reply to 323452
itsmo:
One:
Do we get to have a discussion about whether or not 1 is a prime number?


Do we get to have a discussion about whether or not 1 is a number?

FTFY

Do we get to have a song about whether or not 1 is the loneliest number?
FTFY

Re: ISelfAware, Very Thorough, Crazy Hashmaps, and More

2010-10-02 14:12 • by Online training courses USA (unregistered)
Cynosureks.com is top USA online training services based on California, sotware online tarining leading US IT tech jobs portal,careers,employement,consultancies,USA jobs. www.cynosureks.com

IT online jobs,Salesforce, Hyperion, Pega, Maximo, SAP - SD, SAP - PP, SAP - Netweaver, SAP - HR, SAP - CRM, Microstrategy, Teradata DBA, Teradata Dev, Oracle BPEL SOA, SAP - ABAP, SAP - FICO, QTP 10.0, Project Management Program, Testing Tools, Business Analyst, Veritas Netbackup, Obiee, Cognos tm1, PL - SQL , Load Runner (Advance), Java-J2EE,.Net.

Re: ISelfAware, Very Thorough, Crazy Hashmaps, and More

2010-10-03 08:42 • by Arancaytar
exit(17)?

Ah, the infamous ERR_INCORRECT_UNIVERSE code.

Re: ISelfAware, Very Thorough, Crazy Hashmaps, and More

2010-10-03 08:44 • by Arancaytar
"This is in our production code," notes Joseph Daigle, "I can only hope they rolled a die to ensure this was actually random."

public static int RANDOM_PRIME_NUMBER = 215;


Random or not, it doesn't look very prime. So this line is a WTF on two separate levels.

Re: ISelfAware, Very Thorough, Crazy Hashmaps, and More

2010-10-03 15:41 • by OneIsntPrime (unregistered)
323958 in reply to 323417
Uh no. 1 is not a prime number. There is nothing to discuss.

Re: ISelfAware, Very Thorough, Crazy Hashmaps, and More

2010-10-04 13:58 • by LB (unregistered)
324061 in reply to 323815
Henning Makholm:
The decimal expansion of a non-standard real then requires a digit for each non-standard-integral index, and if you set all of these decimals to 9, you still get 0.999...=1 exactly. The best you can do is to make the first aleph-0 decimals 9's and the rest 0's. Then 0.999...9900... is infinitesimally close to, but distinct from, 1.

That may be the closest you can come, but it falls apart on the fact that an infinitely repeating decimal only has aleph-0 digits total. This new number system would need to come up with somewhere else for the 0's to go.

Re: ISelfAware, Very Thorough, Crazy Hashmaps, and More

2010-10-04 13:58 • by LB (unregistered)
324062 in reply to 323821
Robert:
Any mathematical operation on an infinite number can never be completed ever... you can *show* a formula, but you can never get the answer in actuality as you cannot possibly ever finish working it out.

But if you're only going to allow expressions that can be directly calculated rather than proven, then you can't work with large numbers either. Nobody could actually work out what 758478 * 353822 equals (and certainly not within one lifetime) except by relying on rules that have been proven in the general case and then applied to that specific case. The process of proving works the same with infinite representations.

Re: ISelfAware, Very Thorough, Crazy Hashmaps, and More

2010-10-04 23:45 • by fjf (unregistered)
324108 in reply to 323815
Henning Makholm:
hatterson:
Given that the standard rules of mathematics don't apply under this assumption I would be perfectly happy with saying that .999...8 is the largest number less than .999...

That's only until someone comes along and asks how .999...85 compares to either of these.


That's easy: .999...85 is the 15th largest number less than 1, and smaller than .999...8, of course.

You probably meant .999...8.5, but this number doesn't exist, as any kid knows a number can't have two decimal points.

(How' that, Robert?)

Re: ISelfAware, Very Thorough, Crazy Hashmaps, and More

2010-10-05 08:08 • by gnasher729 (unregistered)
324124 in reply to 323800
Well, there is no largest number less than 1. Take any number x. Either x >= 1, or x < 1.

If x >= 1, then x is not the largest number less than 1, because it isn't less than 1 in the first place.

If x < 1, then x < (1 + x) / 2 < 1, so we found another number that is less than 1 but greater than x, so again, x is not the largest number less than 1.

So if we take any number x, then it is not the largest number less than 1. So there is no largest number less than 1.

Re: ISelfAware, Very Thorough, Crazy Hashmaps, and More

2010-10-05 09:18 • by Someone You Know
324126 in reply to 324124
gnasher729:
Well, there is no largest number less than 1. Take any number x. Either x >= 1, or x < 1.

If x >= 1, then x is not the largest number less than 1, because it isn't less than 1 in the first place.

If x < 1, then x < (1 + x) / 2 < 1, so we found another number that is less than 1 but greater than x, so again, x is not the largest number less than 1.

So if we take any number x, then it is not the largest number less than 1. So there is no largest number less than 1.


Hey, it's a good thing you pointed that out, because otherwise no one in this thread would have known about the density of real numbers.

Re: ISelfAware, Very Thorough, Crazy Hashmaps, and More

2010-10-05 10:27 • by boog (unregistered)
324135 in reply to 324124
gnasher729:
Well, there is no largest number less than 1.

Hence the following condition, which was stated clearly in the comment to which you were replying:
hatterson:
Given that the standard rules of mathematics don't apply under this assumption

Re: ISelfAware, Very Thorough, Crazy Hashmaps, and More

2010-10-07 20:36 • by GeekMaster (unregistered)
public static int RANDOM_PRIME_NUMBER = 215;

How many primes are divisible by 5?

Re: ISelfAware, Very Thorough, Crazy Hashmaps, and More

2010-10-11 03:01 • by Codetopia (unregistered)
324560 in reply to 323427
public static boolean isAlphaNumeric(char c)
{
return !( !isLetter(c) && !isDigit(c) );
}

Re: ISelfAware, Very Thorough, Crazy Hashmaps, and More

2010-10-12 19:09 • by baha (unregistered)
article:
"This is one of our developer's misguided attempts to prevent a null pointer exception," writes Yamee.

if (_tblItem.getTable().getModel() != null
&& _tblItem.getTable() != null
&& _tblItem != null)



it made me remember something like "shoot first, ask later"

Re: ISelfAware, Very Thorough, Crazy Hashmaps, and More

2010-10-25 13:10 • by Zennehoy (unregistered)
326649 in reply to 323423
What about 43?

Re: ISelfAware, Very Thorough, Crazy Hashmaps, and More

2010-11-02 03:58 • by hose (unregistered)
I bet that if-if-else-else and javascript/html examples are no wtf at all when their history is considered.

They look like last minute requirement changes to me. The developer then took the little time he had left before release to make changes as small as possible to prevent introducing new bugs.

Re: ISelfAware, Very Thorough, Crazy Hashmaps, and More

2011-06-03 06:46 • by Rdm (unregistered)
348850 in reply to 323415
At least it is a number... I guess someone will have to do some refactoring until you can read

public static string PRIVATE_RANDOM_PRIME_NUMBER = "wtf!?";

Re: ISelfAware, Very Thorough, Crazy Hashmaps, and More

2012-07-16 12:41 • by Craig (unregistered)
Being the author of the ISelfAware interface, I would point out that the key is the comment about its use in an MBean. Normally the MBean mechanism does not allow you to get a reference to the actual underlying object which is acting to supply the MBean data. Admittedly this is a bit weird, but I needed the raw access to the object and I couldn't resist the name.

Re: ISelfAware, Very Thorough, Crazy Hashmaps, and More

2012-09-29 16:08 • by iCantRead (unregistered)
a (thankfully, long gone)


I actually wondered why "thankfully" doesn't have a type specification, and why "gone" cannot be simplified to an int.
« PrevPage 1 | Page 2 | Page 3 | Page 4 | Page 5 | Page 6Next »

Add Comment