Forgot your password?

typodupeerror

Comment: Re:x64 (Score 1) 179

by Angeliqe (#32076502) Attached to: Man Spends 2,200 Hours Defeating <em>Bejeweled 2</em>
I guess that answers my question. You don't write code which is why you think it's possible to write bug free software. Even if it is for one perfect person, I can assure you there are plenty of programmers who write buggy shit. I have to deal with them from time to time. I never said it was impossible to mix signed and unsigned. I said it was annoying to me personally and bad programming practice on a large scale.

Comment: Re:x64 (Score 1) 179

by Angeliqe (#32070882) Attached to: Man Spends 2,200 Hours Defeating <em>Bejeweled 2</em>
Do you even write programs? The GNU C++ compiler will give you a warning if you compare a signed variable to an unsigned variable. This should tell you that it is a bad idea if you don't believe me. These 2 variables should both be signed or both be unsigned. If you make the score an unsigned value, then everything you compare it to should also be unsigned. Everything you add to it, multiply it by should also be unsigned. This is annoying with heavily used variables as you cannot use comparison to -1 to indicate an error has occurred as the value will never actually be negative...because, it's unsigned. 2's complement is nice in that it allows us to use signed variables with unsigned variables, but that doesn't mean we should. A variable is not a constant. Obviously, I wouldn't compare signed -1 to unsigned 5 if I knew that was the value of the variables. If you wrote complex software, you would realize that variables are not always in the correct range. That's one cause of software bugs. There are ways around it, but they involve speed trade offs. Every time I wanted to use a signed value to modify or compare to the score, I would have to first check to make sure it's not negative.
I understand 2's complement, but it really doesn't have anything to do with the reason signed and unsigned don't mix well in programs. Terms mean different things to different people depending on context. I explained my definition of sign bit in my previous post to clear your confusion about what I was saying. Apparently, the current definition in wikipedia agrees with me, so I am not the only one. Maybe you could edit the page and enlighten everyone?

Comment: Re:x64 (Score 1) 179

by Angeliqe (#32063646) Attached to: Man Spends 2,200 Hours Defeating <em>Bejeweled 2</em>
2s complement
The most significant bit is 0, so the pattern represents a non-negative (positive) value....The most significant bit is 1, so the value represented is negative...
I call that a sign bit. I didn't say it was the bits of 1 with a sign bit of 1 to represent -1. -1 is actually all of the bits set to 1.
Since you didn't look that up, I know you didn't read my other post in this thread in reply to someone else.
If you compare an unsigned value to a negative signed value, you get the result that the signed value is usually greater than the unsigned value. i.e. 3 > -5 Also, if you accidently add 3 and -5 and store it in an unsigned variable, you get a very large number instead of "invalid value".

Comment: Re:x64 (Score 1) 179

by Angeliqe (#32059994) Attached to: Man Spends 2,200 Hours Defeating <em>Bejeweled 2</em>
You still don't understand. A computer only knows how to compare bits and C++ does not automatically convert -1 to "invalid value" when you compare it to an unsigned int. You can compare unsigned int to POSITIVE signed ints. The trouble is when your signed int is NEGATIVE. The compiler just sees it as a really big positive number. So if you have unsigned int a = 5. And signed int b = -1. Even though the result is positive and small, you will get a = a + b = really big number. AND b > a will be true which is not what you might expect.

Comment: Re:x64 (Score 1) 179

by Angeliqe (#32058876) Attached to: Man Spends 2,200 Hours Defeating <em>Bejeweled 2</em>
I'm going to use a 4 bit number just to simplify things. Compare 15 (1111 unsigned) to -1 (1111 signed). The answer is they are equal. You can see a similar problem with addition. There is no problem if you are 100% sure both numbers will always be positive. The problem only occurs when the signed number is an actual negative number. You can never be 100% sure of anything in a nontrivial program. It makes debugging a nightmare, especially in group programming, when signed and unsigned variables are mixed. You take away the possibility of checking for an error by comparing a score calculation to 0. Even if a value should never be less than 0, a mistake somewhere else may make it so. It's not a good idea to use unsigned values because it masks this error. When I say you can use all unsigned values, I mean on the same programming line, not the entire program (my bad). If you keep your signed and unsigned values on separate lines of code and don't mix them in the same comparison or math operation, you are fine. This is also annoying in large programs.

Comment: Re:x64 (Score 1) 179

by Angeliqe (#32058138) Attached to: Man Spends 2,200 Hours Defeating <em>Bejeweled 2</em>
The leading bit on signed numbers is the actual sign. The leading bit on unsigned numbers is part of the number. Even if you store them both as twos complement, you have an extra bit which is interpreted differently depending on whether or not it is signed. How can you say that makes them exactly the same? How can they be stored exactly the same, yet give different ranges of values for the same number of bytes? I just didn't want to explain the entire thing figuring a lot of people didn't really need the explanation.

Comment: Re:x64 (Score 1) 179

by Angeliqe (#32056518) Attached to: Man Spends 2,200 Hours Defeating <em>Bejeweled 2</em>
Not sure what language the game was written in, but I have a lot of problems when I used unsigned ints in C++. You cannot mix signed and unsigned ints or you get weird results when doing comparisons and basic math operations. It has to do with how the number is stored in memory (for the non-programmers). Limiting yourself to only unsigned numbers in a program is usually an annoyance.

Comment: Re:Here's my question (Score 2, Interesting) 128

by Angeliqe (#31882066) Attached to: Comcast Customers Urged To Opt-Out of Settlement
Yes, they are a corporation, but there's more to it than that. If you accept this settlement, Comcast is NOT admitting guilt. They are still innocent in the eyes of the law. They are offering you a bribe to drop the suit. You can legally do this in any civil case when you are suing for damages. If the parties settle their differences out of court, the court really cannot say that Comcast did not pay enough if no one objects. The real winners in all this is the lawyers. $3 million to them. IANAL

Comment: Re:Free Public Colleges (Score 1) 419

by Angeliqe (#31803504) Attached to: Chicago Mayor Calls For "Brainiac High"
You are talking about out of state fees. I am talking about a local college which is the whole premise of my point. I think most states have at least one public university. University of Central Florida has a good reputation for their Computer Science program, so I was a little more lucky. Their average yearly tuition is only $4,518 (http://finaid.ucf.edu/applying/app_costs.html). Sunny, the school you mentioned is $4,970 (http://www.albany.edu/financialaid/costs.shtml) which isn't much more. Plus I started out at a community college which is also an important point. It saves you a lot of money and employers don't really care where you spent your first 2 years. All of the methods I used are available to most of high school students. The problem is motivation. I see kids in college all of the time take their education for granted because their parents are footing the bill. It's just one big party to them. If someone has to work for what they get, they take their classes more seriously.

It is sweet to let the mind unbend on occasion. -- Quintus Horatius Flaccus (Horace)

Working...