- 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
Regardless as to weather or not the object is by reference, or by value it should still behave the same way if SendItemToTransmitter doesnt' modify the object. When the object is passed into the SendItemToTransmitter() call it should have a marker (or something) indicating what row it's currently on, and then the function processes that row. I'm assuming that by virtue of the fact that the call to the rsStock.MoveNext is made to iterate the object.
If it's by reference...the object itself is passed...if it's by value the copy constructor is invoked...oops thsi isn't C++
Admin
Sounds like maximum arse covering to me. The fix here looks like it works just fine, and all your talk about risk falls flat when you consider that the cousin deployed this change and then just left. This was an emergency, it would have repeated in short order if the problem hadn't been resolved, and this is just the sort of thing emergency code fixes are designed for. Seriously, this is an isolated change, and i find it incredible that brother cousin was doing this horrible query for some subtle reason
Admin
You can't be sure it's pre .NET, it's just wtfy enough where they might have added a reference to the ADODB Interop assembly and accessed the recordset class.
Admin
Two years ago, we had a software install issue where we needed to deploy a new version of a scripting engine across our dev/staging/production web servers. At the time, I was working for a behemoth of a company -- SOX compliance had just landed and all servers were controlled by an on-site third party vendor/partner. That's right -- ALL of them. We didn't even have root access to our dev box. Those of you who can relate know that this means a lot of time spent coordinating change management controls against the development timeline for even the most minute of changes.
To compensate, we had our own dev/staging environments hiding out in some SA's cube so that way we could tell these contractors what needed to be done...and often times, how to accomplish it. Same version of Solaris, slightly different disk and memory specs, same software packages as what we had on the untouchable "real" boxes. Now, I'm not a sysadmin and it took me some time and a few tries, but I had performed the software update on both of our machines, chronicled step by step instructions of the commands to execute to accomplish the upgrade on the "real" machines, and sent them off to the "expert" [cough] 3rd party SA. I assumed it would take a week for all three boxes, so I submitted the instructions two weeks ahead of the desired deadline just to make sure there wouldn't be any delays.
A week and a half goes by, and I finally hear from the SA: the upgrade build is failing on dev. He emails me the error messages, I check the log files using my handicapped user account, and tell him what he's doing wrong. Finally, the Friday before the Monday @ 8:00 AM deadline, he tells me he got the dev box built but couldn't get the staging box upgraded and that's where he's stuck. The project manager was freaking out because if we miss the deadline, the project couldn't be capitalized and we'd essentially lose the project. He convinces the SA to give me root on all three boxes for the weekend so I can meet the deadline. It was a 30-hour work weekend for me to fix all of this guy's mistakes and perform the upgrades, but I met the deadline and our project was saved from the depths of expense-hell. Big hero, right? Saved the project and 20+ people's jobs, right?
The kicker: I was, under NO circumstances, to let anyone know that I was given root, nor to admit that I had solved the issues myself. Gotta love compliance.
Admin
This looks like VBScript, and if that's the case, then the entire recordset is not passed as a parameter, because rsStock is actually a cursor with only a single row represented.
Admin
This actually is not a WTF but security feature. The DB should not know which screw the warehouse workers are looking for.
Admin
Who really cares if it was ByVal or ByRef in this case? Passing an object ByVal does not copy the object itself, only the pointer to it. Do you think passing a recordset object with a million rows in it to a function ByVal is going to put the entire object on the stack??
Admin
Looks like you failed. :P
Admin
No. But passing ByVal means to copy the whole object to another memory location(so the function cannot modify the origional one) then pass the new generate pointer to the function.
Copy a recordset contains millions of row means a lot of time and memory is required.
Admin
Sadly, this isn't too far off the mark from my place of work. We've got 2 full time MSCE guys doing what our one dev should be doing as his part-time job, for "Compliance" reasons. Sigh. It'd be fucking fantastic if we could just configure a real mail setup instead of using exchange (which requires its own box, which needs to be rebooted four times a day...), for example. But, heavens no, then we might loose that fantastic calendering app built in! Likewise, if the dev database box has a problem, we end up waiting for our DBA to stand over the shoulder of an IT guy to tell him what to type, because we're not allowed to touch the keyboard ourselves.
Oh look. The fucking forum software decided to replace all of my spaces with from "shoulder" forward. Great job picking a real winner there, Alex.
Admin
I wouldn't bet my paycheck that this was tested at all...
Admin
It's people like you who give VB developers a bad name. For the nth time, this is how it works.
Objects/ByVal: Pass a copy of the pointer.
Objects/ByRef: Pass a pointer to the pointer.
Primatives and Structures/ByVal: Pass a copy of the Structure
Primatives and Structures/ByVal: Pass a pointer the Structure
You never, ever copy get a copy of an object in VB just by passing it to a function. Unless the object has a Copy() or Clone() method, you are always working on the original.
Admin
The real WTF here is people arguing over anonymized code rather than providing more humorous examples of nepotistic cretins in techology management situations.
Admin
The real WTF in your case is that you don't do anything to <em>make</em> SQL available for your data, such as reading it into a real database system.
Admin
Goddamn thank you. I was worried I was going to have to start spelling it out for people as well....
This is why people should not be allowed to pick up VB6 as a first language without understanding how the magical stuff you type gets (roughly) turned into magic that makes more magic smoke move around the silicon in morse code or whateverthefuck. Number of arguments I've had with co-workers over how "less lines of code may not be faster" - especially crap invoving "redim preserve" every time you add an item to an array.
Cos y'know linked lists are a lot heavier weight than an array - and redim preserve is a "built in instruction" so it _must_ go quicker. (/sarcasm)
Admin
I ran into precisely that situation once at my old job. (The offender was part of an outsourced team - early evidence that Sturgeon's Law applies to them as well.) At least I didn't get any flak for the fix.
Admin
I prefer the FUINTHEA fee.
(please ignore my previous post, quoted the wrong post, this forum software really sucks)
Admin
The real WTF is that the contractors are more capable than the full time employees (no offense to any good contractors out there). In my experience, its been the opposite - contractors come in and F up the system.
Admin
Um no. That's not how it works. I choose my contracts. I can also fire my customer. Good customers may be hard to come by, but that doesn't mean I'm going to waste time on a bad customer and miss the good customer.
Admin
You guys really are funny.
I truly enjoy this site.
Admin
Since I have made a dozen or so warehouse management system projects during the last decade, I can assure you that ad-hoc hacks to solve some problems are normal in such projects. Because warehouse management invariably involves the movement of physical goods; in most cases, the capacity of the workforce is just enough for the daily job. In other words, if they lose e.g. 6 hours because of a system failure, it may take a week or longer to recover the lost time; till then, many customers will receive their ordered goods too late.
For that reason, every problem is fixed as soon as possible; if the fix doesn't work, it's fixed again; if it becomes much worse than before, the old version is re-installed. Obviously, it pays very soon to write (mostly) bug-free, maintainable, robust software with a lot of sanity checks and logging.
Admin
I don't have arguments with my coworkers; I have parameters!
Admin
Wow, that sounds even worse than Novell GroupWise. At least our heroic mail admin successfully insisted that the GroupWise server will not be reachable via the Internet (all external mail traffic is proxied through qmail).
Admin
Hey, you can tell us -- did said firm's name rhyme with 'be-trayed'?
I hope you reamed them good. Those @#%!wits bought my accounts with one of their acquisitions, and I literally cannot believe any of their clients is not, like me, valiantly trying to fire them. I've transferred most of my assets out due to their preternatural incompetence and their customer service's dogmatic insistence on replying to any and all queries with unrelated boilerplate, but out of vindictiveness kept one position there (they "can't" sell it -- a naked admission of failure for a brokerage firm).
They called me today because one of my recent replies to their boilerplate was perhaps a hint unkind ("..your firm is so incompetent it boggles my mind. I can't fire you fast enough.") Checking back today, their response was so preposterous I read it out loud to my wife ("We block selling of bonds online because they act differently than stocks. It's a little more technical.") She is a political scientist, and could have written that herself. I got my CFA charter some years back, so perhaps my response ("Your comedy act should be on stage and screen in no time.") could have been a little more technical.
Still, I doubt it.
Man, they're bad. Why aren't they bankrupt? Who hires these jokers and doesn't despise them?
Admin
"...the boss went off on him, criticizing him for coming in at an unauthorized time, making an unauthorized software change, and for compromising the integrity of the warehouse system."
I've been there a few times. The one that sticks out the most is many many years ago when I spent the night babysitting a backup, tweaking things all night long. (this was way back in the days of tape drives) I was still there when my manager came in the next morning. I got REAMED for having been there all night 'cause (in his words) I was now worthless for the day. Hmm, he didn't know me too well... I did my normal work - and I was "fine". Even my cohorts were impressed.
Admin
lol. Thank you so much for writing that. Spellchecker doesn't help worth a sh*t if you use the wrong word.
Admin
Yeah. I contract to a place like that. They do actually use a real mail server (Debian box with Exim and Dovecot), but they continue using Outlook, complaining to me, and then saying they want to keep using Outlook because of the calendar. They are just using it with individual calendars since there's no Exchange server too. One time I found a web based system that had mail, calendar and other such things, but they decided that was too hard too.
Admin
Don't worry, I see TDWTF posts on Digg and other sites quite commonly anyway!
Admin
So fire the contractor. You don't need someone who is willing to come in on their own time and clean up other people's messes on their own initiative (without prior authorization). And why would a contractor want to work at a shop with such a WTF'ed up situation?
But,... you forgot steps 1.56) 3.66) and 5.5) from the "Fixing Problems Conservatively - Methods and Methodology Manual (5th ed.)" (available on Amazon for $119.95). If you're going to fix things conservatively and in a thorough step-by-step manner, you must go through ALL steps in order and then and only then are you guaranteed to have a complete fix.
OR
You could look at the code, use your brain, and as in this case, fix the problem, especially since none of the full timers could be bothered to respond. The way the code was deployed (check in code, check out on timecard) shows that there wasn't much methodology to how new check in's were handled. The code presented, anonimized as it was, was fairly atomic. If you can't look at the code and see that, then maybe you should hire someone who is skilled in such analyses to do it for you. All I hear is armchair quarter backing and 6 sigma quoting.
And just because you're a contractor, that doesn't mean you're not a human who deserves respect. I would never apologize for completing such a fix. I also would never deploy code in a situation where I didn't judge my changes would be better that the current situation. But that's the skill I bring as a programmer and no amount of processes will ever guarantee a successful fix nor will they prevent a WTF programmer from screwing things up.
Admin
Hear, hear!
The was called in when nobody else was available to fix a major fuckup. He used his skill and judgement and fixed the problem. The manager should have thanked him.
Admin
Exactly. It does work both ways. I've been trying to get the folks who run the change control to fix a farkup that their high priced Big 4 gang put in that forces things to run 5 times slower. This has been going on for several months despite full documentation of the problem including detailed explanations, baselines and actual timings. Of course they didn't read the summary, let alone the detailed proofs.
They told me that contractors have to have it tested by the employees. So it's been sitting in test for 2 months with no sign that the person assigned the testing even knows about it let alone knows how to test it. They were more concerned that I changed a test system that is overwritten every two weeks (it's not the repository) to do the baseline.
Go figure.
Admin
It actually was like that more or less!!! It avoided a WHERE clause and it forgot an Exit Do!!
You might ask me why!!! Well, if I really could use my magnifying glass and break their heads open, I would find out that it was just hot air inside!!
My gut feeling was that they tested the whole stuff on a test database with no more than a handful of records!!
Admin
Anonymous:
Nah, it wasn't him that wrote the code.. It was the other cousin. Remember ... two cousins.. Yeah.
Or they may have even been brothers. We only know that they were both nephews of the CTO.
...or they sing "my father is my uncle..." when they ride their little ponys...
(f$§% quoting didn't work...)
Admin
I think we've just found the company that bought the water control neural net.
Admin
In my experience as a contractor, the most likely errors we make are logic errors, i.e. we don't know exactly what the program is supposed to do because we are never actually given a proper specification, often because there isn't one.
My experience is also that most companies have biased opinions about contractors or those who have spent many years in contracting. There is also a lot of disillusion among employers about what a contractor really wants if he applies for a permanent role. Incredible how often they are telling you what they think you want.
Admin
I don't understand...
1) What is a "Change Log". We don't have those around here...
2) How could Ivan open up the project? Around here, the only copy of the source code would be the one on the developer's desktop or, worse, laptop...
3) Finally this "Module" thing... please explain... The MO around here is to put all 27134 lines of code in main()
Ivan D. should feel lucky!
Admin
My favorite WTF here is people like you, who spend all their time complaining about the forum software.
If you find the software here so hard to use, don't bother posting. It'll save you all that aggravation. :-)
Ken
Admin
It's not the wrong word - he just left out the apostrophe. You know, 'cause "'cause" is short for "because"? :) What did you think it's supposed to be - "cuz"? :P
Admin
This is when you smile and say, thank you. And then laugh all the way to the bank to cash your $150 / hour paycheck.
Admin
True, but there's a lot less network traffic if the SQL engine is dealing with it. Pulling the entire table across the network is a real WTF.
Admin
The REAL WTF is people blaming the forum software when they are not paying attention to what they are doing.
Admin
I agree - time to say "take a flying leap" and find an new contract.
Admin
"Gee, boss, that doesn't seem fair.... You're worthless every day, but you still come in."
Admin
Haha, I'm glad I wasn't the only one thinking this.... jesus...
Admin
SELECT * should be banned!!
I've threatened grads with castration for using this syntax. I was once a contractor at the state gas supplier (we only have the one) and was alotted the task of "technical supervision and team co-cordination for graduates" when one of the numb-nuts typed in "SELECT * from tlb_Customers".
the table was 102 columns and contained over a million rows...
He never came back to work after I yelled at him and the network admin and the DBA chased him out of the building..serves the little bastard right I say.
Admin
Bitchy Bitchy Bitchy....I've been a contractor for more years than I care to remember and I ALWAYS get to fix the crap that employees have created...and I cry all the way to the bank!
Admin
It seems this might be a pretty common error, which indicates absolute lack of understanding of SQL, is all.
I stumbled upon the same (and numerous others of course) kind of wierd logic in a World of Warcraft raiding helper tool PHPRaid ( http://www.wowguru.com/ui/151/phpraid/ ):
Admin
Hmmm. I think the correct response would be :
1) Apologise to the boss ( keep fingers crossed behind back if that helps );
2) Put code back to WTF state, preferably just before leaving work at 6pm. Do NOT comment out your corrections - erase them. Delete any working versions permanently;
3) Send email to foreman saying that it has been explained to you that your actions could have jeopardised everything, you will never do this again, apologies, blah blah. And here's the boss' home and mobile phone numbers for "correct" support in the future;
4) Resign;
5) Keep in touch with sympathetic IT person, so that you can hear about the fall-out, and gloat spitefully.
Admin
Argh, stupidity abounds! "SELECT * FROM table" (no where clause) should be banned. It's a major WTF that people who know this little about queries (seriously, I consider myself to know nothing about SQL, but even I would never do this) are writing production code in it.
Admin
Okay, so the VB* function could've passed the recordset object "by value" instead of "by reference"? This means that the object "pointer" was passed "by value", not the entire object itself. Also, even though the object was passed "by value", the object's properties can still be changed. Isn't OOP grand?
* Alex possibly anonymized the language used.