- 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
Now that's just silly... Why would anybody EVER use perl for anything other then driving normally sane individuals crazy, or worse, into marketing!
Clearly it should be VBS, right?
Admin
Admin
Admin
Yeah, I think there's an app for that.
Admin
I SQL because I am.
Admin
But... I wanted to know what else did Eli have to do at his new job!
Admin
Seconded.
Admin
Admin
Admin
We require all arithmetic operations be performed by database engine, on database server. This way, we only need certify one specific hardware and one specific software to implement those operations correctly. Imagine the chaos if any worker could add or subtract on his desktop? Who will sign off, to ensure correctness of results?
Admin
What cracks me up is that, as far as I know that stuff, the ressource handling code with a try/catch inside a try/catch/finally block is basically the (only) correct way to to this in java. At least until Java 7.
Admin
The best bit of this is that 3DES uses three rounds of DES because if you use just two there's a meet-in-the-middle attack which makes it not much more secure than just a single round of DES
Admin
I always wondered the same about resolv.conf
Admin
Only if we work in psychology ;)
Admin
math is hard
Admin
Eli shouldn't have changed the code.
might tell you the cost, but the original function tells you what you need to hear.Admin
I can picture this. Boss give assignment and states that the higher-ups have decided to move to Oracle, therfore your application must use Oracle. He may even have gone so far as to say that since the point of Oracle is to give the same answers to everyone, that you must perform your calculations on Oracle to get accurate results.
That, or the coder could not figure out whay his answers didn't match the database's due to his using the double datatype.
Admin
Admin
calculateCostSQL: Powered by Oracle.
Admin
The original is probably closer to something like
sprintf("%.5f", cost) - sprintf("%.5f", discount)
or
sprintf("%.5f", sprintf("%.5f", cost) - sprintf("%.5f", discount))
Admin
Still, if you think that's bad, try the SAP data-model some time.
Admin
It's not stupidly named. It is the dual of the top of the lattice of relations defined by the tables in any database. It could be called "bottom" too, I guess.
Shouldn't "developers" know their craft?
Admin
Is it just me, or have we had a huge reduction in trolling recently (accepting the boog and frits posts)?
Admin
Admin
TRWTF is requiring a FROM clause in all select queries: SELECT a - b; which is totally legal in SQL Server At the very least the piece of the database (driver?) which parses the SQL string could detect that there isn't a FROM clause and add the FROM DUAL if the engine itself requires it (which I would imagine the database engine should be able to optimize out the FROM DUAL clause and just create the unnecessary, unused data on-the-fly)
Admin
I don't know, I guess it is vaguely a WTF. But the whole point of the relational database model is to compute joins and meets in a lattice of relations. Creating an unnecessary extra case instead of sticking to the data model could be called a WTF too.
Admin
Admin
Admin
This indeed should be incorporated into a custom Oracle Workflow. Oracle Appls R12 may be a pre-requisite for this type of process. A notification that a calculation is to be requested should go to the Senior Arithmetic Analyst who could then approve that indeed the calculation should occur. The workflow would then do the subtraction and return the results a second time to the Analyst to confirm the results, also in this step the SarBox IT compliance officer should be notified so as to approve that the Analyst is authorized to approve this calculation.
My team could get this process implemented in around 300 hours at industry standard consulting rates ;)
I've actually implemented things almost this crazy especially when the phrase 'Sarbanes Oxley' is involved in the requirements..... ~splat
Admin
Admin
Admin
Don't forget to include the CFO since all database-generated finance accounting needs to pass through him too.
Admin
Good point. There are other cases where the results of trivial computations might change unexpectedly that are best handled by a database, e.g. "SELECT COUNT(*) FROM Lights".
Admin
Sure, it needlessly introduces additional points of potential failure, but keeping management informed of trivial operations like subtraction is almost as important as connecting to a database for the sole purpose of performing said subtraction.
Admin
I find it much more likely that someone drank the oracle cool-aid and made an expensive oracle purchase. Since they bought it you have to use it, and this was one developers way to fulfill management's demand to use oracle, even though he had no need for a RDBMS.
Admin
I would have created a cluster of servers to service this request via custom protocol via some obscure port.
Admin
Surely there's a difference between "knowing your craft", and "knowing why or how your tools got their names"?
Admin
Bah, needs XML kill frenzly!!!!!!!!!!!
Admin
But I don't suppose this is the sort of thing which sells database systems.
Admin
For crying out load kids, there was 15 years when it was standard, normal, ordinary to use Double for currency.
OK, so you don't use floating point currency values. And you don't understand how anyone could make floating point currency values work. And you don't know anyone who uses floating point currency values.
And you are MUCH smarter and know MUCH more than your parentsz, or 'old' people. They didn't even have cell phones!
But get a grip! There was a time when the cost of producing beer or spending a night in hospital was calculated using floating-point currency, and the world didn't end.
Admin
I'm attempting to work out if you do use Oracle and that's satire or if you don't and you don't know about the magic that is the DUAL table.
Admin
It's called DUAL because it used to have two rows in it. Now it just has a single row with a single VARCHAR2(1) column that contains a value of "X".
It was created to let you return two rows for every one row in your table via a JOIN.
Admin
Reminds me of some real WTF code I once saw. On the first day of my job I had to make a change, blah, blah, blah...
So imagine my horror when I saw that in order to sort a list of strings for a listbox the previous developer created a temp table in the DB with one column, inserted the list of strings into the table and then ran a select with an ORDER BY and then inserted the result set into the listbox.
sigh
That crushing feeling that you have made a terrible mistake taking on a new job on the first day is one of the worst in the world.
Admin
Database is also great when it comes to accessing immutable arrays of blobs (1.2 MiB total). Why to just have a search loop when you can have a much more professionally looking SQL query? Don't you get it?
I don't.
Admin
Because oracle will do decimal arithmetic rather than floating point which can be critical when dealing with money. I'd guess that the real WTF is that this may have introduced a bug. Changing the types to the equivalent of BigDecimal would probably help.
Admin
Or if one is interrested in finding out how such things happen, so that one might avoid doing so oneself when extremely tired doing 16 hour days...
Admin
You made my day. TDWTF rocks :-)
Admin
Hmm. That's a good start but ...
Admin
Ooh, say that again!