Code Snippet of the Day - self-submissions for code snippets that shouldn't really exist.
304
Topics
11697
Posts
@izzion said in Visual Studio WTfs:
I wouldn't want to be on either side of the bet that Framework 4.8 is going to be available in Windows 12.
I can fairly confidently bet that it won’t be; if it ships with the OS it’ll be 4.8.1 or later.
(It will be… interesting… if they put .NET Framework 4.x on the standalone-component train like 3.5 but not the VB6 runtime.)
Error'd - features fun error messages and other visual oddities from the world of IT.
468
Topics
11434
Posts
@BernieTheBernie said in Error'd Bites:
@boomzilla That's merely a little mix-up of Big Endian and Little Endian.
It's just the latest standard™. After slot, tri-point, Philips, Pentalobe, Allen, double-square and 12-point, behold: the InfiLobe!
/b/ and thedailywtf have a similar clientele.One is for general lulz, the second is for IT lulz. You have to be a pretty big internet tough guy if you're a /b/tard so an IT background is likely. :3
Flash banners require a small amount of code in them, to handle the flashVar passed to it by the banner admin system. You would be surprised how many inept flash people are out there (on second thought, you probably wouldn't), who forget this small bit of code, and thus rendering the banner completely useless. A few months ago, I recieved a banner set from a fairly large manufacturer of electronics (lets call them Phony), which were non clickable. They had to send out new banners... worldwide... Embarrassing? nooooooo....
Hey, that code was cool! I wouldn't want to maintain it, though... It sort of makes C++ look a bit more like XPL (XML Programming Language) doesn't it?Also, since all real code is generated at compile time, imagine how much development time is saved by not having to write that code!
[quote user="un.sined"]If you're using the acronym "M$" to indicate Microsoft, I would argue that you do have some sort of "deep-seeded hatred" or at least some discontent. [/quote]Who doesn't have "some discontent"? That argument amounts to "you do not believe Microsoft is perfect", which IMO resolves to "you are not a complete moron". Using "M$" doesn't actually disparage them - it simply identifies a source of discontent, which usually stems from a failure to understand your licensing options. I pay roughly $25 a month for Microsoft licensing, and I have pretty much everything I want. (Getting Visual Studio wrapped up in that would be nice, but somehow I manage to win a copy every couple months.Wanna buy one?) If you're a technical professional and you work with Microsoft software, Microsoft LIKE you, and want you to have more and more of their software so you can use it and learn it and push it at your customers. (Note: I have a "terrible" karma rating on Slashdot because I don't feel the need to conform to the MS bashing. Showing any sort of support for MS is considered trolling there)I have an "Excellent" karma rating on Slashdot, even though I frequently support Microsoft and defend it against attackers. I've even been known to quite violently bash Linux, the GPL, and open source development in general. Some of my Microsoft-defending comments get modded up to 5. It's not that I never get modded troll; it's just not happening anywhere near as frequently as getting modded up. (In the same thread, even!) So I suggest there is some other explanation for your karma rating.
[quote user="mallard"]I like the site's behavior on Linux (yes, even smaller subset of computer users). It displays a message telling me to upgrade to Flash 8 (would if I could) two or three times while loading the page, but it appears to contain no flash content! [/quote]Seems to work fine for me with Seamonkey 1.1b and Flash 9 beta 2 on Linux. I have no idea what they're using Flash for, though.
[quote user="RayS"] [quote user="writejustify"]Btw, is it just me or does the post entry system here deserve it's own wtf? If you don't enable javascript, all paragraph breaks are eaten. If you do enable javascript, entry is slow, flaky, and haphazard.[/quote]Yes yes, the forums are pretty much a WTF in themselves, although not as bad as they once were. "the real WTF is the forum itself" is one of the many memes floating around here.I think that the general concensus is just that it's to be treated as a self-referential irony.Personally I find the "Post" button moves when I try to click on it, but that only happens in FF. [/quote] Ah, it must be theDailyWTF's recursion then.
[quote user="webzter"]Stylistically, it just depends on what you feel is better. I, personally, like the equality operator but others would think the cast is messy.I suppose startDate.Equals((DateTime)row["StartDate"]) would work as well.[/quote]Since we're going for equality, might as well minimize the number of comparisons. .Equals() FTW.
[quote user="onitake"] and why are the looking for c# experience when they want a vbs (asp.net) developer???or is it just the want both so the lucky winner understands their wft codebase?[/quote] They're looking for a C# developer to build an ASP.NET application.There is no contradiction here.Now, if they were looking for an ASP developer, you'd have a leg to stand on.
Ahh, the joys of the Extract Method pattern (* 2 bajillion). You'll use it so much you'll dream of it at night and it will occupy every waking thought until you realise how much Introduce Parameter you can get away with. Only then will your personal hell become somewhat tenable.
[quote user="impslayer"]
[quote user="Dark_Neo"]This is the UK btw, we drive on the left side of the road :p
[/quote]
Guessed as much, but couldn't resist the easy pun :)
Still, driving on the LEFT side??? WTF?!?!?
:P
[/quote]
The real WTF is that that's not a pun...
</pedantic>
[quote user="Tann San"] Frackin Argos, it's the day after they said it would be delivered and I just got off the phone with them. I'm supposed of known due to my well heard of telepathy that "Next Day" to the 21st is actually the 28th. I've found that out now at 3:45pm on the mostly last day to purchase goods in town. I'm well narked off, especially since their email says:"Unfortunately the delivery date you selected is no longer available. Your scheduled delivery date and order details are given below."Which they arent besides it saying the 22nd. Then later on it says:"If a delivery date isn't shown above, a member of our customer service team will contact you to arrange a suitable delivery day as soon as your goods are ready to be dispatched"So I would of had to wait until the 27th to find out that I wasn't getting my goods on the 22nd. Arg! Well and supremely ticked off. I did just get told by the girl that I "can always cancel my order and get a full refund".Stupid order confirmation email, I hate Argos, I'm going to write them (after the 28th) and let them know what I think :¬) I know if I do that prior to the 28th they'll just cancel my order and refund me.Ah screw it, I just reserved it at their only store to have one left which happens to be about as far on the other side of the city as you can get before it becomes the next place! Time to hop on the first of many buses :¬)[/quote] I feel your pain.I've long since given up even considering ordering anything for delivery except for pizza, computer hardware, or the rare item that I can't get through brick and mortar stores.Computer hardware prices through B&M are just insanely high, so online is often the only way.For such things as books, the price is usually no better than B&M and usually involves both a long way and delivery charge. Unless I can't get it through a bookstore, I'll order online. For all other items, ordering online is the absolute last resort./rant onI know I can't be that unusual. Why the f*** can't companies that have both online and B&M link their stores better? If they have a store, I really don't want to order it online. If I get online to circuit city, I don't want to necessarily see what their online system offers, especially if it's doesn't have the same items and/or prices as their B&M stores. I'd really like to see the online system let me view the available items and prices of the local B&M instead. Or at least give me the option.That way I can shop at the store without going there, and I know they have the items I want. I don't want to select an item and then find I have to wait 3 days for the item to get to the store.It seems to me that the cio's that conceive of their online presence never actually try to imagine it from a customer's perspective. Maybe it's just me./rant off.
Why do you folk think we fought against software patenting in europe? Software does not need patenting. Licences and author ownership are enough. And yes, the patent office in US is accepting anything, because they get money for each patent, be it a valid patent or not. Up to courts to decide it, they don't even do anymore the mandatory researchs to see if there was an already existing patent / known process for the proposed patent. They just accept and get the money!
[quote user="kiriran"][quote user="FraGag"]The Real WTF™ is that he could have used CSS to do this. Hey, isn't there a class attribute I see there?.seitentitel { text-transform: uppercase; }[/quote]After reading this I checked the CSS file. And guess what? text-transform:uppercase; was there. At least it wasn't all the same author. [/quote]
I was just going to say "The real WTF is that he didn't triple-uppercase it!", but well...
[quote user="The Vicar"]Amazingly What a coincidence! You'd think
Wow, really? Gosh, it must be nice to have such God-like intellect Calm down, Sparky. ignorant
[/quote] You're telling /me/ to calm down?
ROFL! I was generalising the discussion to why it's a bad design
idea in principle, not attacking you personally. Seems you have a
problem coping when people disagree with you. Oh, and a very Merry Christmas to you too :-P~~~
and then there's the sites that think they're soo ajaxy when they put up a second-counter until the moment you're allowed to download. Unfortunately, this is all clientside javascript, so just reading the source a bit will allow you to skip the wait.
The trolls are the people bitching, not the original poster. They are the ones wasting their time by replying to it. The original post is just... questionable. The rest of the thread makes it hilarious. Legal action? Ha!
[quote user="SnakeChomp"][quote user="asuffield"] With gperf, or something like it. This is not a WTF. This is software-generated code. It's the easiest way to automatically generate an efficient string matcher from a table. It was more common years ago, when computers were slow enough to care... nowadays you don't see it so much, except in legacy code, because nobody worries about the performance of their string lookup tables any more.I'm not really sure why somebody bothered to implement one for Java. [/quote]This code was definately written by hand, and has comments above it explaining how it was written, how they tested what hardcoded magic numbers to use, and etc: /* Case values determine by args[0] a psuedo hash code algorithm on the args string. (Doesn't use regular old hashcode because that might be VM dependent) helpCase: 89747534 multiCase: -964127032 singleCase: -919304285 ... This code figures them out: System.out.println("getHashValue(-help) " +getHashValue("-help".toCharArray())); System.out.println("getHashValue(-multi) " +getHashValue("-multi".toCharArray())); System.out.println("getHashValue(-single) " +getHashValue("-single".toCharArray())); ... */ The hash codes might be VM dependant so we should write our own hash algorithm! Brilliance. [/quote]SnakeChomp, you're still leaving out how MANY command line options there are. if there are only three, then... yah, it's silly (and possibly copied from somewhere else). But if there are tons of options, then the previous post i made (in the original csod post) holds true. %programname% /hackpentagon might be a valid option, but you don't want every tom, dick, and harry to know that. Spell toLower("BACK DOOR")!:-)
Here's an ad I got on an email I sent to myself while testing some email-related code:Bear Watching USAEscorted bear watching tours Watch them fish for Salmonwww.Explore.co.ukThe rest of them look like they are picking up on the word 'test' that appears twice in the message, but bear watching? WTF!?
[quote user="newfweiler"]
can someone explain something to me? Is the STL binary-compatible?
The STL is SOURCE-compatible, which means that I can buy the source code for your product, compile it with the same STL implementation I use, and link it with my code.
But what if you provide your product only as compiled object code and it uses STL objects as parameters? If I use a different implementation of the STL, things won't necessarily work, will they?
[/quote]
It depends.
The C++ language spec makes no provision for this at all - regardless of whether it's the standard library or your own code. However, there's another spec, commonly known as the C++ multivendor ABI, which provides for binary compatibility between compiled C++ code. In theory, two platforms which both implement the multivendor ABI correctly should be binary-compatible, even with STL objects as parameters.
In practice, no two such platforms exist yet. It is questionable as to whether they ever will - this isn't the primary objective of the multivendor ABI, it's just something that's supposed to happen as a result of it.
My "favorite" ones are the messages left on the help desk that go into great detail, tell me everything that's not working and (sometimes) are even polite...and don't bother to leave their name, email, extension, or any other way of actually contacting them. Do these people ever think?
If a record is a CNAME, there's absolutely no possibility that it have any other record or record type attached (like an SOA, in this case).So, either you get a CNAME and only a CNAME (because the record name caldeck.com isn't canonical), which means that the SOA-record for caldeck.com is the same as the SOA-record of dpweb.vendaregroup.com, pretty much as asking for any other record type means it's the same as the record of that type for the canonical name, or you get a "true" SOA-record, which means that caldeck.com can't be CNAME'd anymore.So, this behaviour is totally expected.
[quote user="hk0"] Come to 7chan.org/pr It's better there.This is a typical thread Also /tech/ is nice.[/quote] What the samhill did I just click on? closes very quickly
Agreed. This is entirely standard for a Contact Us form. I wouldn't even suggest that this is evidence of a poor PHP coder. Indeed, PHP doesn't do a lot of hand holding, especially when it comes to security. But then again, neither does C. mail() is certainly no more intelligent than gets(). Should we then say that there are a lot of bad C programmers, or that C is a bad language? As in most languages, it's up to the programmer to cover their ass; unfortunately, that usually requires knowing what's coming at you.The only issue here is that the programmer doesn't know about injection attacks and how to prevent them. Then again, neither did I until I stumbled across news articles about SQL injection and cross-site scripting. Looks like there are a lot of people out there who didn't know about this.The life lesson--never trust user input--is one that I haven't seen generally taught in universities or technical schools. It's one of those things passed down from the elders, or learned the hard way when it bites you in the ass.Please kindly inform the author of this code of his mistake. Also, please consider how much of a WTF something like this may be to others. Just because something is obvious to you (because you've been informed of it) doesn't mean it is obvious to others (especially those who were never told about it).
[quote user="PSWorx"]Right in principle IMO. However in THIS case the user apparently already used FTP correctly before, so he SHOULD have an idea of why you need the GET. (or at least should know THAT you need to write "get").I don't think the user was dumb tho. He maybe just forgot it out of nervousness. [/quote]Thank you, yes, he's used ftp before, several times in fact. And nobody seemed to notice despite my pointing it out a couple times that he typed "get" to begin with. And I didn't tell him "type /usr/data/file.txt". The prompting went more like:Him: I typed "get file.txt" but it just gives me an error. What am I doing wrong?Me: You have to tell it the path, which is "/usr/data/file.txt".Him: <speaking the words/letters as he types them> /usr/data/file.txt. Hmm, nope that didn't work either.Me: Um, did you type get?Him: Oh, you have to type get? Me: <slams head on desk>
[quote user="shadowman"] I don't see the wtf... Sounds like they're making an analogy, as in:The evolution in web development: HTML -> JSP -> JavaServer Facesis equivalent to this older evolution in programming:Assembly -> Fortran -> Java [/quote]I quite agree, but the WTF to me is how easy the paragraph can be misread. It can very easily be misunderstood to say that jsp is fortran.
[quote user="Nandurius"]Can you start a new project without relying on a 'Win32 command line application' wizard?[/quote]How about this: Can you write a C++ program in Visual Studio starting with a blank project? You have to add all the right switches and libraries...
So if the two 'return true' statements are ommitted, and I submit the form, this method disables the form and displays a confirmation box, then realize I made an error so I click 'cancel'... how would the form be re-enabled? perhaps thats why this method was 'disabled'?
[quote user="versatilia"]I'm just getting my head around .NET - coming from a Perl background I'm really hating all the strong typing, lack of implicit casting etc but overall it's quite nice.I don't see why it's limited to 4 ThingCodes - it looks more like he wanted to specify a list of ThingCodes in a set order and return an array of Things in that order - maybe the user could arbitrarily sort Things on screen?Even so, definitely Things that make you go hmmm...[/quote]It's not. The function takes a params list--from what I understand, you can pass anything as that list (arrays, separate objects, combinations) and it'll be treated as one string[] as far as the sort function is concerned.My example, since it was only passed 4 ThingCodes, will only return the objects with one of those 4 thing codes. (In common usage here ThingCodes are unique, so I get a max of 4 Things)
my favorite part is that midway through the code "Dave" manages to use the dot equals(.=) operator....., but apparently he's not aware there's also a magical += op [$how_many_total_retries = $how_many_total_retries+$how_many_retries;
] Also, i don't see $how_many_total_retries initialized to 0 anywhere. I don't get it, is he just choosing to type more for the fun of it?
Google search ads are pretty good too, especially the ones from Ebay. Most recently, I had Ebay offering to sell me .308 Winchester ammunition, despite the fact that firearms and ammunition are on the list of strictly prohibited items.
[quote user="emurphy"]The BOFH hardly has a monopoly on job security via "increase network traffic to 90% saturation" switch. Now if it were located right next to a "electrocute smart-ass before he can ruin my sweet gig" switch...[/quote]The BOFH is too technically proficient to resort to (the mere illusion of) incompetence to retain his position. Blackmail, bribes, and well-timed blaming things on others are more his style.(If you've read enough BOFH, he does put a DBA in his place at least once)
If you want to read amusing stories about 419s then you might want to have a look at the letters archive here: [url]http://www.419eater.com/index.htm[/url]
That happens. I've heard stories from way back, where some mechanics would be baffled by cars that they think have no engine, not realizing that the engines were in the back (like VW Bugs).
[quote user="Tweenk"]IE 6 can't handle even the FUNDAMENTAL and TRIVIAL task of centering! I CAN'T use the proper way: div#some_id { margin: 0 auto; width: 60% }. I can't use <div align="center" width="60%"> either! The only thing I can do is make YET ANOTHER TABLE...[/quote]What you need to do, is add a proper DTD to your XHTML. IE6+ will then switch into a mode that lies somewhat closer to standards, and support margin:auto; as per standards.
[quote user="merreborn"][quote user="plazmo"]I see javascript writing javascript alot for add sites.Im guessing its a way to bypass some of the add filters.Running the script on the website then loading the file externaly.Where an ad blocker would cut out the external js file before the page loaded, this loads the js file after the page loaded. [/quote] That's exactly what this is, without a doubt -- ad filter evasion. That's the reason for '<scr'+'ipt>'. The real clever ones will replace some or all of those characters with character entities, e.g. '<scr'+'ipt>'[/quote]I've always found that amusing. By attempting to evade ad filters, they run square into my ad filter, when a simple static image or slow-animated GIF would have come through just fine.
I think Telstra have made it their mission in life to try and screw our country (Australia) as much as possible. I reckon they sit around the boardroom table taking bets as to a) how long it'll take for the ACCC to get involved, and b) how ineffective their response will be.
[quote user="Rotary Jihad"][quote user="AbbydonKrafts"]I figured someone would mention the wood. LOL. It's a buffet cabinet that holds mailing supplies, the receiving log, a mailbox and a lamp.[/quote]The lighty kind or the server kind? Cuz a buffet cabinet running LAMP would be kinda neat.[/quote] You beat me to it
Hmmm, looks like that site is actually not owned by Steam. The owner added this note at the bottom now:So I guess this has been dugg. I actually replaced a Joomla! site that was on this domainbecause too many fucking morons, like the folks that 'reported' this originally, decidedit'd be fun to sign up. steampowered.com is where you find valve software. steamnetwork.comis mine. I originally was going to start a gameserver company with the domain, but reallydon't care all that much anymore. So, piss off, kthx.Perhaps the site was designed as part of a phising scam?
[quote user="Monkeyget"]<snip>And by the way making search for .NET related stuff works good if you simply do ".net what_I_Search"[/quote]That is good news.But this was not the case when I started in 2002, (in my experience) and I have not really tried since.I still think the name is fucked up.