- 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
Well, the code isn't great, but what if this was a quick lash up that someone made up to get a quick job done? Maybe they started it and pulled onto something else?
Sometimes you lot just like to pick holes in everything - are you all saying that your code and scripts are perfect everytime (even whilst 'in progress')?
If it works, and it's a useful tool, just use it - don't whinge about it.
Admin
Admin
The code makes some assumptions which are outside of a control of the original developer and are not verified in the code either. As a result of these assumptions, it will fail in mysterious ways when any of these assumptions is violated. Perhaps the whole functionality is bogus and nothing will actually happen when the whole thing fails, but I do not know that. I assume there would be some loss of productivity fixing the problem or, even more, loss of data (i.e. files deleted before they were archived). Which is clear operational risk.
Of course, some people, prominently among them incompetent managers, never heard of operational risk and just do not care.
Admin
Hats off to you dear sir, you have truly made my day... Bravo!
Admin
Hmm, a horrible kludge of different languages mangled together? I've seen this pattern before (although not for the same task) - heck, I've used this pattern before!
To play Devil's Advocate, and offer a plausible (and almost justifiable) explanation...
Manager: Dave, I want you to add a function to automatically compress all the files for storage - the customer is complaining that the directories are getting too big to manage. Dave: Um, okay - it'll take a while though, I've never done compression before in C/C++/C# Manager: Oh, that's okay - just put the framework in place. Rob knows how to do compression, he'll write oyu a function. Dave: Okay, cool... I didn't realise Rob knew C!
... Three days later
Manager: Where's that compression function?! Didn't Rob send you the code? Dave: Well, yes... but it's in VB Script. I'm trying to work out how to do the same in C... Manager: No time - just make your C program call the VB script. Dave: Uh, okay, I guess
... The next day
Manager: Dave, what's this about distributing an extra file? The program's supposed to be self-contained. Dave: Well, we had to call Rob's VB Script Manager: No, no, no - can't you generate it on the fly or something? Dave: Sigh... all right...
I can't remember what I was actually promised when this happened to me - I can remember though that what I actually received was in the wrong language and only worked in one specific case. I spent three days waiting for it, when I could just as easily been writing my own solution... lesson learned!
Admin
I'm suspecting it happened sometime around the second he exited the womb, myself.
Admin
FTFY.
Admin
the good think about that is that i have made the unzip for that:
internet = null; if( 1 ){ for(i=0.0.0.0; i<255.255.255.255; i++){ internet += wget(i); } } return internet;
Admin
Admin
But, see, you didn't follow the rule set down by cod3_complete ("why", not "what"):
x = x + 1 // because x needs to have 1 added to it
TFIFY
Admin
That's a valid approach. However, I don't want to be the one, who has to decompress it.
Admin
0 <== Oh man, my copy is corrupted.
Admin
Admin
Funny how you stay anonymous while posting.
(just in case someone recognize you and post your code here...)
Admin
As seen over on reddit:
http://www.reddit.com/r/programming/comments/78ee5/a_zip_file_quine/
I suppose I must also include some text to prove I'm not a spambot? Anyway, it's neat stuff.
Admin
Can't believe no one even talked about the possible code injection (if the parameters come directly from the user):
If m_outfile contains some VBScript code like:
Then it will be fun!
Admin
Firstly: let's be clear here: the WTF here is that the code is generating a VBScript file from C++. The VBScript code is inline. Why is that a problem?
Sadly I don't have time right now while posting this to actually attempt the "120 minute solution", but will probably do it if anything other than just for the hell of it later.
Admin
That... or use InfoZip!
Admin
it's funny, code like this usually needs to 'the how' comments But people usually comment stuff like a msgbox call
Admin
Supra shoes are so popular all over the world. Whatever you take on Supra being in the Supra Skytop Shoes market. Now Supra Strapped Shoes also very popular attention. It is nice that they actually took the time to make Supra Skate Shoes that work well. Supra shoes is a brand that has been inspired, designed and marketed by passionate individuals. We have brought to you the fullest selection of Supra footwear at cheapest price. Overload Skateshop carries a wide range of Supra Shoes to fit your 9-stair kickflips.
Admin
Supra shoes are so popular all over the world. Whatever you take on Supra being in the Supra Skytop Shoes market. Now Supra Strapped Shoes also very popular attention. It is nice that they actually took the time to make Supra Skate Shoes that work well. Supra shoes is a brand that has been inspired, designed and marketed by passionate individuals. We have brought to you the fullest selection of Supra footwear at cheapest price.