- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
Most PHP programmers simply don't know enough to write performant code. If they did they probably wouldn't be working in PHP.
Some of us can write performant code in PHP and in other languages but for reasons continue to use PHP.
Admin
Because we don't have to throw a bunch of shit onto our servers to get it running?
Filed under: We throw a bunch of shit into our code instead
Admin
No, we have to throw a bunch of shit onto our servers to get it running first - Apache (or nginx), MySQL (or Postgres) and our bestest buddy PHP of course.
Admin
Good. Now set up RoR. See you in... two weeks?
Admin
Hang on, I have a WampServer to install first...
Admin
That doesn't follow. Consider splitting the set of all integers (cardinality ℵ0) into two covering, non-intersecting subsets: the set of all odd integers and the set of all even integers. Those subsets both have cardinality ℵ0, so ℵ0 ÷ ℵ0 = 2, by simple algebra!
In reality, transfinite numbers don't work nicely with simple algebra. They work with some parts of simple algebra, but not others (and division is one of the parts that doesn't work so well; you need a different approach to finding the average).
Admin
The triangle proof of the countability of the rationals is also a way of showing that ℵ0 x ℵ0 = ℵ0
[image]Admin
Yeah, you have to go to things like powers (ℵ0ℵ0) to make the jump to ℵ1.
Formally, ℵ1 is the cardinality of the set of all subsets of a set of cardinality ℵ0, and the continuum hypothesis is that that is equivalent to the cardinality of the set of all real numbers. IIRC, that's actually a hypothesis that (as far as anyone knows) leads to a consistent system whether it is assumed to be true or false. Which makes it (or its complement) an interesting candidate for being taken as axiomatic…
Admin
However, it does turn out that ZF + GCH implies the Axiom of Choice. So you can't have ZF + ¬AC + GCH. For what that's worth.
1Zermelo-Fraenkel set theory together with the Axiom of Choice
Admin
Ah, I've not been keeping up with the field.
Admin
Me either, I found that out from Wikipedia when I was checking that I wasn't about to assert something false :)
(Though I don't recall whether we ever covered that particular point when I was learning it. I did remember the independence of GCH from ZFC, but I'm not sure if we went over (G)CH and ZF or not.)
Admin
To be fair, I work in a field where denial of the Axiom of Choice is relatively common, which leads to constructive and intuitionistic logics IIRC. The statements that you can make in such things tend to be a lot more restricted, but on the other hand you can say them more certainly (i.e., you're not left saying “pick a number, and you might be able to use that to do something useful in this proof”).
That it doesn't work with the GCH (and ZF) is interesting. Unfortunately, I don't really like the AoC yet I do like the GCH… :worried:
Admin
Reminds me of the joke:
(for the non-mathematicians: all three are logically equivalent)@dkf, I'm wondering whether you use weaker choice axioms, e.g. dependent choice?
Admin
Personally? Not sure. :stuck_out_tongue:
As far as I can remember, the constructivist/intuituionistic approach ends up being the foundation for modal logics, which have their whole own reasoning systems that are different to the usual things like first order logic. I believe they can push the computability limits in some areas a bit further by giving up on them in others. Multi-modal K is a particularly useful one for the field I'm in at the moment, as it's at the core of being able to reason about ontologies and that's critical for certain types of searching in metadata-rich environments.
The lack of the AoC isn't a pressing problem in that domain, because people aren't usually all that interested in finding things that might potentially exist in a platonic sense, but which haven't actually been created and described yet. ;)
Admin
To be fair, most people probably aren't that interested in the question of "hey if you have an infinite set of things, is there some other infinite set with more things than the first one but less things than the number of subsets of the first one?" either.
Admin
Most people don't know what they're missing, man
Admin
TRWTF is the code appends the other way around to the comment
Admin
Disagree. Sequential descriptors are a built-in security problem.
The main problem is that many "off-by-one" mistakes yield valid order (or confirmation) numbers. I'll grant you that the web site should lock people out of anything but their own orders. But if a customer writes the wrong number down, their only recourse is to call customer service. If the number is completely bogus, support is forced to work toward a valid number from a different route. If the wrong number is valid, a new path of least resistance is available, even though that path is more costly for the company.
Furthermore, any predictable pattern makes it possible to "count" the number of orders, thereby leaking coarse information about the financial condition of a company.
You've analyzed the range of the $c_jobno value, which few noticed, but I think the confirmation number can be as short as 1 digit long, meaning the result is between 3 and 10 digits.
I really don't believe $c_jobno is used elsewhere in the code. At one point the code chops off the first 4 digits to get at confirmation numbers -- this won't work unless jobno is exactly 4 digits.
But, of course, you can't tell for sure, because the :wtf: is so strong in this codesod. Marcus and Remy chose well.
Admin
Check out error-correcting codes. Put sufficient extra digits in and use an ECC and you'll be able to automatically undo minor errors. And it will stop the numbers from appearing to be sequential.
Admin
Like credit card numbers.
I still don't understand why bank account numbers don't do the same.
Admin
For every ECC, there's a dumbass who's gonna mistype just one digit too many.
Admin
Can't most error correcting codes detect at least one more wrong digit than they can correct? So even if it couldn't switch it back it could still call the user a moron
Admin
Sure, but that's unavoidable whatever you do because that's just how data entry is. Using an ECC would at least keep the error rate down (and allow detection of much of what remains).
Admin
The Luhn algorithm isn't really an ECC since technically it does no correction. It will however
Admin
Admin
It's just if you're using Luhn elsewhere with variable length numbers, like they do with ICCIDs that this may be an issue.
Admin
Ohh - bug found.
Note the difference between the tooltip text and the raw.
CBA reporting that one tho.
Admin