- 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
It works as coded. All those names probably point to the same server in someone's basement anyway, so no problem.
Admin
Admin
We get it, in a "real" load balancer you can drop and add servers willy nilly. That doesn't make this a WTF.
It was executed by someone that had never heard of randoms or modulus, or whatever other ways could have not made it a repetitive and oddly grouped mess, sure. That said, I'm not sure I get this "you either go 100% to a real load balancer or it's 100% useless" attitude. This still spreads some of the load around. Yes, if a server goes offline 1/3 of the people are SOL, but is that any worse than 100% of the people if the one server goes away?
Admin
Typos... I'm currently in "Delphi" mode (which uses single "=" for equal testing and ":=" for assignment). When switching to C++ / C# / Java (and back again) it's always the same issues...
Admin
Admin
It appears they forgot to account for leap seconds, which appear as second 60 or 61. On these (admittedly rare) occasions, users won't be able to connect…
Admin
Oh, ok, Chelloveck got there ahead of me: leap seconds are not supported in Java (Script?)
Admin
And if you happen to generate a float from your Random call, you'll never ever get any domain at all. Or was that a hidden WTF inside your WTF?
Admin
This is a little shorter anyway: domain1 = "http://"+(rslt1%4?"www.erightsoft."+["info","biz","org"][rslt1%3]:"erightsoft.podzone.net")
Admin
You failed to notice they have 4 different servers. The 'alternating' servers is just because they put an empty line every 3 seconds instead of 4 fore some reason...
Admin
This has the look of code that is adhoc and has been auto-generated, which would also cover the case where a server is offline - you would just generate a different list.
captcha letatio - get your minds out of the gutter - it's Latin for "rejoicing".
Admin
Admin
Admin
Admin
Fixed?
Admin
Move your coffee cup.
Admin
I was assuming pseudocode.
Admin
According to w3schools, Math.ceil() returns an integer.
(And, obviously, I'm not suggesting this as a real solution. :) )
Admin
Speaking of pseudocode, here's the funny way to do it, although the math is all wrong, but you get the idea:
var URLs = { "http://www.erightsoft.info", "http://www.erightsoft.biz", "http://www.erightsoft.org" };
var URLtoUse = URLs[currentSecond % URLs.length];
You can add/remove URLs to the array easily, and the last line will work without updating it.
if it even works at all
Admin
Give how painful it is to use Super® and the eRightSoft website it's not surprising that there are major WTFs to found in them.
Admin
"Some of these third party companies... may even download and install several other softwares or toolbars"
NSA... is that you?
Admin
The problem comes when (for example) someone decides to rename a server (or get a different domain). A real load balancer would simply redistribute the load across the remaining servers. A simple redirect would just fail to serve the page, and therefore let people know what the problem is.
This thing would work intermittently and be a giant pain in the ass to diagnose. Because every time the dev goes to look into it, it would hit the right second and work, but ever time the user tries to access, it would hit the wrong second and break.
Admin
This isn't actually a load balancer, but a mirror manager. It's not a WTF since I doubt they have THAT much load to balance. Instead it's a simple albeit messy way to handle a number of mirrors.
Captcha: abigo This WTF wasn't abigo ne.
Admin
It still does not balance the load, it just rotates all of the load through the servers every four seconds, and hopefully each server recovers before getting hit with the next burst of requests.
Admin
Admin
You missed the best part!
That's right folks... When you uninstall, it won't uninstall everything, will leave stuff in your registry, and we won't tell you how to get rid of it. Right there in black and white: "eRightSoft cannot provide any technical support or help on how to remove or un-install those recommended softwares and toolbars offered by the third party sponsor companies"
Admin
Isn't that par for the course these days?
Admin
WTF, no array?
Admin
And there's no MOD button on any calculator they've ever seen, so they have no idea that exists either.
Admin
Admin
This... actually makes a reasonable amount of sense for a whole range of use cases.
Admin
At least, it would if it worked.
Admin
That would actually be a great interview lead off question.
"Do you have the slightest idea what modulus is, and what it can be used for?" "Uhhh......." "And we're done here."
Admin
Bad load balancer? Absolutely.
But this is just about as much "load balancing" as SourceForge having multiple mirrors is.
OH THE HORROR.
Admin
Admin
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/ceil
Or is it a WTF you don't know how rounding works?
CAPTCHA: abbas - I like to listen to all types of abbas
Admin
Does anyone remember when SUPER wasn't crap? We had it on all our video machines when I was in school, and it handled files that nothing else would.
Admin
Admin
Admin
I believe the use of "umount" vs "unmount" is more due to being limited to 6-character global names than the desire to save a character.
I don't know that early Unix was limited to 6-character externals, but that was a popular limitation at the time.
Admin
Admin
Is that you, sourceforge?
Admin
I believe most of that EULA is actually against the law in Europe, and they can definitely be sued for installing harmful software onto your computer ^^
Admin
Hey, they could all resolve to the same IP - which was the address of a real load balancer... :)
Admin
Why load balance a site that hardly justifies a piece-of-shit software, it is not like they will get any visitors.
... oh wait. Never mind.
Admin
This might only apply if the server you install from is located in an European country jurisdiction.
Admin
Admin
Come to think of it, the probability of hitting any given second client-side equals hitting it with Math.floor(Math.random() * url_array.length)
Mwhua hua hua hua. Ahem.
Admin
Not quite. TRWTF is that this won't usefully divide the work. The switch is based on the current time, so all requests arriving at the same time will go to the same server and not be spread out. So 3/4 of the severs are idle at any one time, negating any benefits having a load balancer.
Admin
Did you notice that "3" that you use for the modulo operation is actually the count of items?
You could just put all URLs in an array and use "modulo arrayLenth" to index into that array:
The bonus is that you can add more items to the array and it all works magically, you don't have to change anything else in the code.