- 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
Admin
LMAO. You win the funniest post of the day award.
Admin
It's not a paradox. It's a catch-22. You cannot insert a record because you must satisfy two conflicting conditions. There are probably better ways to write it, like defaulting B to 1 and CHECKing that B is always 1. Then A has a constraint that B cannot be 1.
Or, to quote Bruce Campbell: If you need it, you haven't got it. And if you have it, you certainly don't need less of it.
Admin
I'm going to guess the logic was that they currently delete orders once they are fulfilled, but planned to add a feature in the future that fulfilled orders would instead be archived. So, put that bit in, and you can preemptively write logic that only acts on unfulfilled orders.
I'm not defending it, I'd do it differently, but at least you're only wasting a bit of space (literally!) per order. Too often I see something like this as a 'Y'/'N' character field, using a whole byte or two per order.
Admin
This was probably on an embedded system. While we all know they have no file systems, it's also true that they have very limited resources. While it might be ok to allow a bit to have 2 values on a non-embedded system, on an embedded system those values are precious and it would be foolish to let a full 50% of the possible values be wasted where they weren't necessary. Better to only allow the values that are used, so the other values can be reserved for other important things.
Not a WTF.
Admin
Admin
Admin
There are situations where a column may be constrained to a constant value without it being a WTF: see e.g. (darn Akismet) www. (damnit) keyongtech. (damnit) com/2128650-unique-pk-across-two-tables.
e.g. there might be another table FulfilledOrders with the opposite constraint CHECK( [Is Fulfilled] = 1 ).
But then the IDENTITY(1,1) shouldn't be in CustomerOrder, so I guess it is a WTF after all...
Akismet 4 Poster 1
Admin
Since many of us work with logic professionally, we're probably familiar with the definition of a tautology: a statement which by its very structure must be true. For example:
a == a
In some cases you don't even have to evaluate the variables and consider what they refer to -- it can be determined that the statement is true without even doing that much work.
Here's one in a language unique to nondeterministic processors, AKA humans:
That which is more fit to survive is more likely to survive.
You don't even have to dereference "that which is more fit to survive" to see that the statement has to be true. But link this tautology to a more widely recognized label -- evolution -- and suddenly a huge flock of nondeterministic processors get their panties in a bunch.
The universe contains a lot more stable atoms than unstable ones simply because the unstable ones don't tend to hang around that long. And so on right up to galaxies, and everything in between. We're here, quite simply, because the alternative is less probable.
There now, you owe your life to a tautology. Lesson concluded. You may now return to merriment and chaos.
Admin
Well, technically, DoesThisRowNotExist would be a paradox since the row must exist for it's non-existence flag to exist.
Admin
Using a bit field for "tautology" is kind of like saying, "Your condition can only be met if someone else with much less flexibility in decision-making can verify that it's true."
Kind of like Middle Management.
Admin
Is that true? I know you can use a function as your check constraint- I assumed that the function could do whatever it wanted to. I haven't actually tried to implement such a thing, but if I were going to, I'd do it in Oracle, which I'm more familiar with.
Admin
One of the possible definitions of "fact" is "a piece of information presented as having objective reality", in which case it actually makes sense to talk about true facts ("Doctor Who is a British TV series") vs. false facts ("Doctor Who is an American TV series") vs. opinions ("Doctor Who is a good TV series").
Admin
It's not a fact unless it's a fact. False Fact is merely rhetoric that confuses real concept with artistic literary license.
However, there is another word for "False Fact". It's called a LIE.
Admin
Admin
TRWTF is the use of SQLServer.
Admin
Admin
CREATE TABLE catch22 ( a INTEGER NOT NULL, b INTEGER NOT NULL, CONSTRAINT aRule CHECK (a = 1 AND b = 0), CONSTRAINT bRule CHECK (a = 0 AND b = 1))
Oracle has fewer restriction on the expression used in a check constraint, but it still has the same underlying issues. If you create constraints or triggers that reference other objects or other rows, you can get an ORA-04091 error if the use of the table causes a "mutating update". SQL Server simply prevents the most obviously dangerous cases at definition instead of at runtime.
Admin
Admin
Admin
Cute. But even this Wikipedia definition is better than yours:
If you're as good at logic as you think you are, then I hope you can see where defining it in terms of the effect on the gene pool removes the need to mention survival twice.
Admin
Admin
I'm the head of IT, believe me .. if you type "google" into google you CAN break the internet! Don't try it, even for fun!
Admin
Like the subject of this thread: http://forums.thedailywtf.com/forums/p/16567/221120.aspx#221120
Admin
"Yes boss, I've been real busy, I've had at least 13 checkins this week"
Yes, that was sarcasm. Good grief, I can't make any of you soulless BOFH laugh can I? I prefer to not checkin until the night before shipping, of course.
</lame>Admin
Here, how'd you become president, then. I didn't vote for you.
Admin
You mean like this:
--Joe
Admin
The tautology bit, or tbit, is a major breakthrough in information theory. Since tbits are by definition equal to themselves, their state requires an entropy of zero to encode. Using this knowledge, I shall write a revolutionary new quantum tbit encoding algorithm which will be able to losslessly compress any file of any size to zero bits. For enhanced data integrity in enterprise applications, a cryptograhic hash may be optionally specified at a cost of an additional zero bits
It will be done when it's done.
Admin
Kinda surprised this hasn't made it up here yet:
http://xkcd.com/703/
Admin
Sorry, Claude, but for the record I wasn't bashing Middle Management. Your job is hardest of all because to be successful at it, you have to tactfully not please anyone!
COMPROMISE, n. Such an adjustment of conflicting interests as gives each adversary the satisfaction of thinking he has got what he ought not to have, and is deprived of nothing except what was justly his due.
Admin
Of course there's a spectrum of 'adequacy', just like there's a spectrum of 'legal'. So just as you can have a video in your collection with the label "barely legal" you can have entire teams of developers who are barely adequate.
I leave it as an exercise to the reader to determine which, if any, is actually desirable :-(
Admin
Msg 8141, Level 16, State 0, Line 1 Column CHECK constraint for column 'a' references another column, table 'catch22'. Msg 1750, Level 16, State 0, Line 1 Could not create constraint. See previous errors.
Admin
That is true, but I don't think it means what you think it means. Barely adequate means barely good enough to be adequate. They're still either adequate, or not. You would not (or at least I would not) describe a developer as extremely adequate, or compare two developers and consider which is more adequate than the other. I would still consider adequacy an absolute.
BTW I think your analogy fails in the same way: barely legal is exactly as legal as any other legality. That is, it is no more legal to look at porn of 40 year olds than of 18 year olds.
Admin
Admin
The first chicken hatched from an egg that was a mutant laid by a near-chicken. Evolution DOES answer the question of which came first, and it was the chicken-egg, not the chicken.
Admin
The self-referential jokes in this thread about tautology are as lame and pathetic as the self-referential jokes in this thread about tautology.
Admin
The database was not installed on his computer, the file was on a network share with full permissions. Anyone uninstalling the client would cause the same thing...
Admin
Consider the tautology: an unnecessary construct that adds no meaning, context, or understanding and may as not exist.
Actually, the tautology is sometimes useful as an intermediate step in symbolic logic. It doesn't change the overall meaning of the logic, but turning "A" into "If A Then A" can make it possible to use other rules on it.
Also, it's frequently used in embedded systems development where there is no filesystem as such.
Admin
Yup....
Admin
The Comments on TDWTF are deteriorating at a rate of knots!!
Admin
I'm Henry the Eighth I am, 'enery the Eighth I am I am. I got married to the girl next door, She's been married, seven times before. And every-one was an 'enery (enery!), Every was an 'enery. 'enery the Eighth I am I am, Hen'ry the eighth I am.
Second verse - same as the first...
Admin
This is the comment without end-- Yes, it goes on and on, my friend. Somebody started typing it, not knowing what it was....
Admin
FTFY
Admin
Ideally, the word tautology should be linked to a wiki or dictionary page, presumably containing the definition, which in turn would keep redirecting to itself.
Admin
That isn't a tautology. John's empty string was clearly preparing a quantum computing experiment. If bit was ever flagged as 1, empty string would know that the database in the alternate fork of the decision matrix was returning the value.
Admin
So reading bits is efficient now? I didn't know DBMS are tuned for that low level storage and efficiency :P
Admin
tautology_club_rule(RuleNumber) :- tautology_club_rule(RuleNumber).
Funny that Prolog would answer "no" to that if it ever halted.
Admin
This is the best possible answer to that question.
Admin
Admin
Either that, or the CustomerOrders Table only contains completed (ie, not partial) orders. It becomes an Order when all of it's line items have been accounted for, or some such.
Think about it this way, what if the database also contained a table called "CustomerOrdersInProgress" that had the same structure as the CustomerOrder table, but without that constraint? Updating then could be accomplished by "INSERT CustomerOrder SELECT * FROM CustomerOrderInProgress" which will skip any CustomerOrdersInProgress where IsFulfilled = -1 ... well, that and a heck of a lot of "INSERT FAILED CHECK CONSTRAINT" error messages. But if you just turn off all error messages and error checking, you're golden. Problemo Solved!
;-)