- 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
Oh, one more thing - the download page encourages you with pulsing pink text to read the EULA before installing. A sentiment I happen to agree with in all cases, pulsing text or not.
I didn't see it posted on their site, so I copied the EULA from the installer and posted it here for your reading pleasure: https://thedailywtf.com/images/14/Super_EULA.rtf
Now, I don't encourage you to do as I did and download the installer just to read the EULA, but I do suggest that you check out the section marked "Privacy" to see why.
Admin
Wow... just Wow....
Somehow I almost expected it to be followed by something like "It's possible that some of these 3rd party products include trojans, viruses and spyware" or "Uninstalling Super will wipe your hard disk"...
+1 that they try their best to get the users to read that stuff before they install it -1000 that they actually mess with your installations without further confirmation
Admin
I should have been a switch statement....that's TRWTF.... isn't it????
<ducking and running>Admin
Additional +1 for using groups of 3 lines for 4 servers...
Let me think:
Admin
Admin
Is it elegant> No Does it work? Probably Is there a problem? Probably not It is a wtf? No
Admin
I don't know. Why do you feel you should have been a switch statement? Or can't you make up your mind?
Captcha: valetudo - I was almost the valetudo at my high school, but they switched the grade criteria at the last moment.
Admin
if (a = 0) UseServer1; else if (a = 1) UseServer1; else if (a = 2) UseServer1; else if (a = 3) UseServer1; else if (a = 4) UseServer1; else if (a = 5) UseServer1; else if (a = 6) UseServer1; else if (a = 7) UseServer1; else if (a = 8) UseServer1; else if (a = 9) UseServer1; else if (a = 10) UseServer2; else if (a = 11) UseServer2; else if (a = 12) UseServer2; else if (a = 13) UseServer2; else if (a = 14) UseServer2; else if (a = 15) UseServer2; else if (a = 16) UseServer2; else if (a = 17) UseServer2; else if (a = 18) UseServer2; else if (a = 19) UseServer2; else UseServer3;
This works too... I still would qualify it as a WTF.
Admin
% what does that do?
Admin
Maybe with all the money they spend paying for all those domains they could buy a loadbalancer?
Also, there are a bunch of OSS load balancers out there, so a it's not that expensive either.
Anyway, it's funny and truly a WTF since those are the words that will come out if you find this for the first time.
Admin
I was rather disappointed that these URLs really point to different IP addresses. Based on this code, I expected that the requests for these adresses are all handled by the same server again...
Admin
so.. i can saftly assume that they don't use any cookies
Admin
You have three choices evenly distributed over 60 trigger integers? Use modulus.
And Walky_one's solution is a wtf because it would be better written as
And that's apart from the WTF of implementing a load balancer in JavaScript. That just balances the load of the AJAX requests but not the load of the page requests.
Admin
Statistically the load will be pretty much balanced probably.
However, a load balancer must also exclude unavailable nodes, which this JS obviously does not do. So if 'http://www.erightsoft.info' is down, and you came at second "0", then you are out of luck even if all other servers work. A real load balancer just sends your request to a working server and marks the node down until it starts working again.
Admin
Admin
It does not work. At least not like a usual load balancer. As the article correctly states one of the advantages of a proper load balancer is that if one of the servers fails the others will transparently take over the load of the failed server (assuming the load doesn't overwhelm them of course) .
With this implementation, if one of the 4 servers fails 25% of all download requests will time out and not be served. That's why you can not put the logic for load balancing into the javascript of your page. Then the client decides how he wants to "balance" the load. Without any knowledge of the situation on the other end of the line this is utterly useless. And that's the wtf.
Admin
var d = new Date(); var n = d.getSeconds();
if(n <= 20) UseServer1; if else (<= 40) UseServer2; else UseServer3;
The Code being wtfee is just the icing. I think even if it was coded cleanly the fact of the matter is that load balancing hardware is a superior solution and anything done in JavaScript is a hack.
Admin
Ohhh, it's SUPER. I remember SUPER. The GUI wrapping ffmpeg commands with boat loads of adware. The WTF code kind of makes sense given that it's from an adware vendor.
Admin
More simple and... clever?
Captcha: eros (refreshed to nobis)
Admin
OK I did a mistake, forget about last else
Admin
Although your code is much cleaner, it does defeat the purpose as it will send all requests to one server for a 20 second period, which the other servers sit idle.
Modulus is the solution to that part of the WTF (ignoring the bigger part - that having a 'load balancer' that will happily send requests to a server that is down is defeating the point).
Admin
(or are the '=' just 20 typos?)
Admin
But as long as it is implemented in JS, it IS a WTF!
Admin
Admin
TRWTF is allowing assignment in a condition.
Admin
Admin
Allowing arbitrary code in a condition can save more than two keystrokes each time, and when I learned programming and handling computers, Unix users were known for their laziness in typing. (They even use "umount" instead of "unmount", just to save 1 keystroke. Of course this isn't a WTF, is it?)
Admin
Doesn't this violate the same origin policy unless all of those addresses resolve to the same server?
Admin
Admin
So if you violate the agreement you no longer have to worry about the agreement. With the terms spelled out like that if you were to strip out all the adware and sell the product yourself then the agreement is void and they can't do anything about it.
Admin
Admin
Summary: We only wrote the GUI, all the rest is 3rd party stuff, and it will install other applications, change your browser settings & homepage, and we'll even accept their license agreements cause we're just that helpful. You'll love it! We promise, and if you don't like it, you can sue them, not us, cause we declared it in this agreement.
Admin
Let's not lose sight of the fact that this doesn't actually load balance, and simply throws all the incoming traffic to a specific server for any given second...
Admin
The real WTF is in this sentence: "...what I consider a rather unique approach..."
"Unique" is an absolute. Being "rather unique" is like a boolean being "rather false".
Admin
According to "Advanced Techniques in Knowledge Discovery and Data Mining" by Nikhil Pal (p. 187), "rather false" is one of seven states of truth, starting with "very true" and ending with "very false".
Say a young person named Bob looks rather tired in the morning, prompting his mother to ask: "Have you been up all night playing WOW???". He answers "No!".
This answer would be "very false", if that was what indeed he did, but "false" if instead of WOW he had played Quake and only "rather false" if he not only had played Quake but also had dozed off for half an hour or so while camping somewhere.
Admin
It's Super, thanks for downloading, All things considered it couldn't be better, I must say, It's Super, it's got no bugs in, Everything is Super when you're DON'T YOU WANT TO INSTALL ALL THIS SHIT!?
Admin
Admin
Which one is "file not found"?
Admin
Oh, come on people. We know the best way to solve this is with a math formula
Granted, we lose the "randomness" achieved by alternating the order of the servers between the three line sections. But, really, that's just "overkill." If we want random, I suppose this may work:
Admin
Of course, all this presumes that there is a different server hosting the website on each domain (not necessarily a given).
Admin
Admin
Admin
Admin
Hey, you don't want to wear out the url from overuse. Probably the reason they changed one of the 4 to the .com. It was used too many times and had to be thrown away.
Captcha: nobis... My auto complete tells me this isn't the first time I've had this same captcha.
Admin
unique |yo͞oˈnēk| adjective being the only one of its kind; unlike anything else: the situation was unique in modern politics | original and unique designs.
Admin
Does Javascript not have a modulus operator? I mean, load balancing using the local time isn't perfect, but it's something at least. They're trying.
The bigger WTF is using that many lines to do something that could have been done in much less.
Admin
Spoken like a true sockpuppet. Buying domains is cheaper than buying a load balancer.
Admin
All this and nobody has picked on the use of a whole-page IFRAME?
Captch: dolor (Spanish for "pain")
Admin
I was about to make the observation that the code fails during a leap second, but a bit of Googling shows that the JS Date() object disavows all knowledge of leap seconds. You win this time, eRightSoft! Still, that control structure should end with an unconditional else{} block. You know, just in case we ever redefine the number of seconds in a minute or something.
Admin
If they were just doing a time-based round-robin rotation, they didn't need to specify the server for each second. Just stick the servers into a numerically-indexed array in the desired order. Then do something like
Save about 60 lines of code that way, and it's exceedingly simple to add or remove servers and not have to change anything else.