- 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
Anyway, the better sequence would simply be Ctrl-A, Ctrl-C, Ctrl-N, Ctrl-V.
Admin
The best sequence is to use something like Redgate's tools.
Admin
Admin
The creators of these tools assume they're for "smart" people who don't arbitrarily run queries on live data without testing them first.
Admin
Had a situation where every single time a particular java program I was maintaining / troubleshooting invoked a procedure which performed a particular operation on a db (something like "SELECT user_id FROM user_table WHERE user_name=<whatever>") it would always return e.g. "546". I spent longer than I needed to do debugging my code till I actually investigated the database by hand, and found that every single instance of user_id in the table had magically been converted into "546". After shitting several bricks wondering what I'd done, I eventually alerted the DB management team who also shit several bricks and had histrionics. When did it happen? 11:24 this morning, came the message. Then one of the production support guys, after intensive questioning, said something like, "Oh yeah, I typed "UPDATE user_table SET user_id='546'" but I musta forgotten the "where" clause."
The real WTF here is that before that morning we did not have rigid controls and procedures in place to ensure that the above occurrence (or any similar variant) could not be allowed to happen.
Admin
Worked at a place where the machines were named "Grieg", "Holst", "Elgar", "Mozart" etc. I pointed out that "Grieg" is not that easy to remember how to spell (is it "Greig"?) and perhaps they should have used Tchaikovsky, Rachmaninov, Messiaen and Khachaturian.
Admin
I've been writing code for almost 30 years now and had ONE interview where they asked me to write some code.
Admin
You've been working for Coca-Cola for 30 years? j/k
Admin
Admin
(I thought you misspelled Messiaen, but then, just in time, Google saved me from obeying Muphry's law.)
Admin
Admin
If the attack can be scripted, it only has to be spelled correctly once. Even if you name things from a password generator.
Of course, I meet lots of people who don't realise their tasks can be scripted - and always should be where possible, for repeatability, avoiding errors and troubleshooting the history of past mistakes.
Admin
I hope to God they didnt "payed" you.
Admin
Oh no! You see there are three servers: The Production Server, The Development Server, and The Moron Server. Maurice gave him full access to the third.
Admin
Good call - such a concern was at the back of my mind when I suggested it.
I have a friend whose surname is Czajkowski who writes under the pseudonym Tchaikovsky because it was generally considered easier all round.
Admin
The trouble is with a lot of tasks is that writing the script can be a major arse-pain in itself. Had a situation yesterday when on site at a customer, where I needed to get a war file from my machine to the customer's, and there was a proxy issue with the ftp process that nobody had the wit to sort out. So I used 7z to split the file into emailable-sized chunks (10 of them) and sent 10 emails one after another to the customer-side guy each with a separate chunk of that war file. Needed to do it twice more that day. Now a script would have helped me there, but determining the most appropriate scripting tool to use (I only know ant) and working out how to use it to do that task were more effort than I had to spend.
Anyone care to write a script to do something like the above?
Admin
#!/bin/bash split --bytes=SIZE $1 mail_file_name_ for f in mail_file_name_*; do mutt -s "Part of file" -a $f [email protected]; done
Yazeran
Plan: To go to Mars one day with a hammer.
Admin
We get the same sort of thing in variable and function names thanks to the language barriers around a few individuals...
Admin
Admin
Or deliberate subtle misspellings. I had a problem yesterday why my file wasn't being included in a page, turned out it was named something.tempate.html. Took me a while to see the missing letter! (TRWTF is this system silently ignoring missing files...)
Admin
What do you think is dangerous about
DELETE * FROM DatabaseNameHere
on a SQL Server?Admin
You occasionally come across stealth morons.
Had a database bloke start (old bloke) who didn't like using all this new-fangled pointy-clicky stuff, he did his queries the old-fashioned way with lots of keyboard bashing. Each to their own, I guess.
After seeing him cheerfully typing away I assumed he was competent (sigh) until the day I got called in to fix a DB where he managed to delete a few of everything - not sure how he managed that. Yes, on the production DB.
While enquiring exactly how he managed to do that, it transpired he knew about the SELECT statement, the others not so much.
He also casually asked about how you do queries when the text has quotes in it - "WHERE Name='O'Reilly'" stuff.
In hindsight while his SQL query typing skills were impressive, I don't recall actually seeing them run.
Admin
WhyTF don't you have a PK constraint or unique index on your user_id column?
Admin
The real WTF is having an
IDENTITY
column as the primary and sole key on the table.Admin
Admin
I was talking about interactive query tools, i.e. things you use for quick ad hoc queries, not db interaction from within a program. None that I've used automatically wrap ad hoc queries in a transaction, and few people typing in an ad hoc query are going to wrap it in a transaction and check the results before committing, even if the tool provides for that.
Admin
lol... a+
Admin
I agree with this sentiment, for the most part. Define a PK as the unique business key contraint, and use a unique clustered key for the identity if table is massive, which can then be FK'd off of for relations.
Admin
I'm fucked if I can work out what this comment has to do with anything I posted.
Admin
Much obliged.
Admin
Aha yes, that was the other thing: "Why isn't there a PK constraint or unique index on the user_id column?" I asked. "Er, because that breaks the app because there's some places where there is more than one user with the same ID."
Admin
Maurice completely missed the point. He was supposed to fully train Ben so that Ben could take over his job at a reduced rate of pay and Maurice would be fired.
Admin
Seriously, on the day a new colleague started he didn't know how to launch the command prompt. Over one year later he's still making my work a misery.
Opening a command prompt is such a vital barometer of computing skill, it should be a standard part of any interview process.
Admin
...but I bet he interviewed well.
Admin
How did that code compile?