Best posts made by Zacrath
-
RE: Is anything in IT NOT shit?
Working four days in a week is less shitty than five days…
-
RE: Oh, you wanted to get off the train? Tough shit, GPS is out.
Technically it isn't every line:
[code]
// -----> Assign and bail out of the loop.
theView = theEnum[ idx ].getView();
break;
[/code]
and
[code]
// -----> Not a valid view? (A bit redundant, but you never know...)
if ( theView == null )
return;
[/code]don't have comments for the break; and return;
// -----> Assign and bail out of the loop. theView = theEnum[ idx ].getView(); // break break;
// -----> Not a valid view? (A bit redundant, but you never know...) if ( theView == null ) // return return;
Fixed.
-
StackOverflow markdumb
Recently I've been frequenting the Python room on StackOverflow chat.
In case you don't know, chat supports a markdown syntax similar to comments on the main site. Also in case you don't know, chat comments are automatically posted when you press Enter, but you can make multi-line comments pressing Shift+Enter.
Earlier today, I learned (Through experience.) that markdown doesn't work in multi-line comments. WTF!
My initial reaction was "That's silly". I was in a good mood then.
-
RE: *** bad elevator music plays ***
Played it for 17 seconds. Discourse made it reset to 0.
@discoursebot -
RE: DICSS - Directly injected CSS
He created a second project for a pun!
THIS IS NUTS!
No, this is DICSS. NUTS is something else.Not even the code is spared:
if ( ({})<=8 ) {
-
RE: Siri's successor is in the works
Siri, can you lead me to the nearest café?
The pig go. Go is to the fountain. The pig put foot. Grunt. Foot in what? ketchup. The dove fly. Fly is in sky. The dove drop something. The something on the pig. The pig disgusting. The pig rattle. Rattle with dove. The dove angry. The pig leave. The dove produce. Produce is chicken wing. With wing bark. No Quack.
…Thank you, Siri.
-
RE: I'm glad they fixed THAT problem
Personally, I blame Flash for everything that went wrong on the internet since v1.0.
-
RE: Abusing noscript
Are you new here?
I'm surprised that the front page isn't spinning around.Well, we already SEXYfied the main page. There's not much more we can do before it counts as malicious.
Edit: Also, I love that there are only 4 on topic posts here and no one cares.
-
Check your basics
Here's an interesting tale from the interview at StackOverflow.
Since going to StackOverflow will no doubt trigger someone's PTSD, I'll post it here.
Interviewer: Which is faster?
while(1) {
// some code
}or
while(2) {
//some code
}Nikole: Both have the same execution speed, as the expression inside
while
should finally evaluate totrue
orfalse
. In this case, both evaluate to true and there are no extra conditional instructions inside the while condition . So, both will have the same speed of execution and I preferwhile (1)
.Interviewer: Check your basics.
while(1)
is faster thanwhile(2)
.I have no idea what "basics" he could be refering to.
-
RE: The forum only has one passable poster
This raises an interesting question. If you make an additional, unrelated statement when insulting Discourse, how controversial does it have to be to cancel out the otherwise guaranteed likes?
Let's try it out.
Discourse is stupid and broken and everyone should use PDF instead of MS Office files in all cases.
-
RE: User logins? lets use the database!
You'd think they could find a happier stock photo for their "demo"
I think that person has a Klingon forehead.
-
RE: Inquisition of indeterminate nationality: what IDE are you using?
Real programmers use
cat >file <<EOF
. -
RE: How MUCH is that suitcase?
Well, if the price is not a number, that means you have to give them a kidney or something.
-
RE: Abusing script <script>Array.prototype.forEach.call(document.getElementsByTagName('p'), function (x) { x.innerHTML += "<strong>SEXY</strong>"})</script>
I just wanted to point out that thanks to this topic, four people from today’s article have been adopted into the SEXY family.
"I'm kind of surprised to see these kinds of positive ratings for soundtracks that may or may not exist," writes Bobby S. SEXY
"Well, I guess it's a fair to block your shutdown so that the logoff
tune of the Microsoft Logoff Composing Team can be given its due
respect," writes Jens R.
SEXY"While visiting the UPS Store I saw this clever message encouraging me to sign up for their email newsletter," writes James.
SEXY"Ok, sure 'so what, it's an error', but you have to admit - a 283 million line JSP page is pretty impressive," wrote Scott S.
SEXY -
RE: Remy's back! A script for those who don't want to read the source
Wow, this is much worse than the SEXY-fy XSS from a week or two ago.
-
RE: How many days in a week? Or, pedantic dickweedery and pointless flamewars on other forums
It's a body building forum, so I'm not surprised that they're overly aggressive and confused about simple things.
-
RE: The forum only has one passable poster
Discourse is stupid and broken and C# is Jesus.
-
RE: You know you've been at TDWTF too long when...
TheDailyWTF does seem to have a lot of memes. Has anyone made a list?
-
RE: Dumb and Random Videos Thread
why?
why did I watch the whole video?
about clapping
and I enjoyed it.
-
Toaster based input
You all seemed to enjoy my last StackOverflow post. (Until you started complaining that StackOverflow was cool before it went mainstream or something like that.) So I thought I'd share another one I just found.
This time it's from superuser, so you have no reason to complain about SO this time.
I've inherited an old PC from my girlfriend's dad and when setting up the printer I got a bit of a surprise:
Two questions spring to mind here:
- Why does Windows think my wireless keyboard is a toaster?
- Why does Windows even have an icon for a toaster in the devices menu?
Here's the top answer:
Reason 1
Because Microsoft made a toaster driver sample. In the sample there is the line <DeviceIconFile>Toaster.ico</DeviceIconFile> and there is a chance that your keyboard manufacturer took that sample.Reason 2
Look at the back of the keyboard for some place to insert a slice of bread… -
RE: Toaster based input
Okay so I know you're all dying to know how Fabrikam's toaster keyboard works.
You punch holes in slices of toast and insert them into the toaster. The toaster them uses them to determine whether the bits are set or not. The toaster keyboard supports 24 bits per slice. (bps)
It's an enterprise solution for upcoming businesses.
It's guaranteed to give your company synergy thingys. -
RE: Via imgur: "The software in my biomechanics lab."
Export to PNG (it somehow encodes the VI program itself into the PNG, it can be drag-and dropped back)
It probably puts it in a private chunk. PNG lets you add any kind of data you like to the file.
-
RE: Abusing script <script>Array.prototype.forEach.call(document.getElementsByTagName('p'), function (x) { x.innerHTML += "<strong>SEXY</strong>"})</script>
Non-forumers are so going to say WTF! when they see this.
-
RE: Which language is the least bad?
I love verbose code. I will gladly read yourFiveWordVariableNames //and
//Multi
//Line
//CommentsIf it explains your code!
In that case you should love the code in this article.
-
RE: Find out how to get Jon Skeet raging mad from this one amazing SO question
Nice click-bait style title there…
-
RE: Do I? Don't I? Advice plz.
Python did it the wrong way. After 8 years, they still have effectively zero Python 3 adoption.
@blakeyrat said:The way forward is to make a new language with the best ideas, and slooooooowly migrate people to it.
Doesn't that second statement contradict the first? Breaking backwards compatibility is sort-of like making a new language, and the slowly migrating part fits as well.
-
RE: Is anything in IT NOT shit?
@Zacrath said:
@Captain said:
Vim's not shit. It's way better than notepad.
Everything's better than notepad.
Have you used ed?
Still better than notepad. notepad's features, unlike other editors, cause problems instead of solving them.
Filed under: Stubbornly sticking to my guns here
-
RE: How MUCH is that suitcase?
I don't care to know JS enough to know what will happen
if (price >= 44 && price <= NaN)
...Numbers are both not smaller than and not larger than NaN, so that expression will always be false.
-
RE: Git troubleshooting flowchart
git reset
is confusing to me. It can do too many things, it should be split into separate command in my opinion.I mean, sure, I can read the doc and understand it, but I'll only remember it long enough for me to use it once.
-
RE: Abusing noscript
I've just been awarded the <kbd>XSS Award</kdb> badge for this topic, and I want to point out that VinDuv should also get this badge. But I'm not sure who to contact.
-
RE: FSF Linux
Store data in text files which implement a curvy-brackets syntax; the fetishisation of "flat files" betrays the inherent unrealistic sexual fantasy that male brogrammers hold.
"Brogrammer" is a great word and I am ashamed to have never thought of it.
-
RE: Copy pasta gone wrong - Oreos now fruit
Also also: M&Ms, Smarties and Maltesers. (Not "Bars")
-
RE: DICSS - Directly injected CSS
Almost missed this. The commit log has more puns:
- Finally, Sass has some STIFF competition!
- DICSS is faster via <head> or through the backend
- DICSS - fun and easy to use
- what you can do with your DICSS
- DICSS should get tested
- show Travis our DICSS
- DICSS should get tested
- don't lie about the size of your DICSS
- Merge pull request #1 from kurtpeters/master
now can insert multiple DICSS at once - Help extending DICSS
- Instructions for putting DICSS in your <BODY>
-
RE: Switching from iPhone to Android? Don't count on getting texts for a while...
iPhones are such a technical debacle it's embarrassing. I know, let's tack a later of proprietary bullshit on top of the SMS protocol built specifically so that this would not be a problem! Let's fuck up the vcf formatting! (to be fair, everyone fucks up vcf though)
Then you get all these kids praising Jobs like he's some sort of Technological Jesus, while they go and establish their startup to go and fuck up established standards even more.
I bet iPhone users think the book of Job is about Steve Jobs.
-
Abusing noscript
Someone found a <script> inside of a <noscript> tag.
<!-- Page is at: http://squarespace.com --> ... ... <noscript id="inline-deps"> <link rel="stylesheet" type="text/css" href="//cloud.typography.com/7811972/758964/css/fonts.css" /> <script type="text/javascript" src="https://static.squarespace.com/static/ta/5134cbefe4b0c6fb04df8065/7400/assets/logomark/logomark.min.js?37"></script> <link rel="stylesheet" href="https://static.squarespace.com/static/ta/5134cbefe4b0c6fb04df8065/7400/assets/logomark/logomark.min.css?37" type="text/css" /> </noscript> ... ...
So now you're probably thinking: "WTF! That script tag will never execute. Nice find Zacy, you're the best. Also we don't mind that you keep copying WTFs from StackExchange sites." But it gets worse.
Here's the top answer: (TL;DR comment below it.)
I did some searching through their code and found this snippet:
var DepLoader = function() {
function init() {
var a = document.getElementById("inline-deps");
if (!a || JS.hasClass(document.body, "deps--loaded"))
webfontsReady();
else {
var b = a.innerText || a.textContent;
JS.addClass(document.body, "deps--loaded"), processRaw(b)
}
}
function isListed(a, b) {
for (var c = !1, d = 0; d < b.length; d++)
if (-1 !== a.indexOf(b[d])) {
c = !0;
break
}
return c
}
function webfontsReady() {
JS.fireCustom("webfontsReady")
}
function processRaw(html) {
var el = document.createElement("div");
el.innerHTML = html;
for (var scripts = el.querySelectorAll("script"), styles = el.querySelectorAll("link"), common, signup, dialog, systemPage, commerce, others = [], inline = [], styleWhiteList = ["site.css", "dialog-", "signup-", "logomark"], scriptBlackList = ["management-", "ckeditor-"], style, l = 0; l < styles.length; l++)
style = styles[l], -1 !== style.href.indexOf("fonts.css") && load(style, webfontsReady), isListed(style.href, styleWhiteList) && load(style);
for (var script, src, s = 0; s < scripts.length; s++)
script = scripts[s], src = script.src, src || "dynamic-assets-loader" == script.getAttribute("data-sqs-type") || -1 === script.innerHTML.indexOf("SQUARESPACE_ROLLUPS") || eval(script.innerHTML);
if (window.SQUARESPACE_ROLLUPS)
for (var key in SQUARESPACE_ROLLUPS) {
var rollup = SQUARESPACE_ROLLUPS[key], js = rollup.js, css = rollup.css;
-1 !== key.indexOf("common") ? common = js : -1 !== key.indexOf("commerce") ? commerce = js : -1 !== key.indexOf("signup") ? signup = js : -1 !== key.indexOf("dialog") ? dialog = js : -1 !== key.indexOf("system-page") ? systemPage = js : key ? others = others.concat(js) : inline = inline.concat(js)
}
for (var s = 0; s < scripts.length; s++)
script = scripts[s], src = script.src, isListed(src, scriptBlackList) || (-1 !== src.indexOf("common-") ? common = script : -1 !== src.indexOf("commerce-") ? commerce = script : -1 !== src.indexOf("signup-") ? signup = script : -1 !== src.indexOf("dialog-") ? dialog = script : -1 !== src.indexOf("system-page-") ? systemPage = script : src ? others.push(script) : inline.push(script));
var loadOthers = function() {
for (var a = 0; a < inline.length; a++)
"dynamic-assets-loader" != inline[a].getAttribute("data-sqs-type") && load(inline[a]);
for (var b = 0; b < others.length; b++)
load(others[b]);
JS.fireCustom("dependenciesLoaded")
}, loadSystemPage = load.bind(this, systemPage, loadOthers, "system page"), loadSignup = load.bind(this, signup, loadSystemPage, "signup"), loadCommerce = load.bind(this, commerce, loadSignup, "commerce"), loadDialog = load.bind(this, dialog, loadCommerce, "dialog"), loadCommon = load.bind(this, common, loadDialog, "common");
loadCommon()
}
function load(tag, callback, label) {
var head = document.head;
if (Array.isArray(tag) && (tag = {nodeName: "SCRIPT",src: tag[0]}), !tag)
return void (callback && callback());
if (tag && (tag.src || tag.href)) {
var child;
"SCRIPT" === tag.nodeName ? (child = document.createElement("script"), child.src = tag.src, -1 !== child.src.indexOf("combo") && (callback = function() {
Y.Squarespace.FrontSite.Core.domReady(!0)
})) : "LINK" === tag.nodeName && "stylesheet" === tag.rel && (child = document.createElement("link"), child.href = tag.href, child.rel = "stylesheet", child.tyle = "text/css"), child && (child.onload = callback, head.appendChild(child))
} else
try {
eval(tag.innerHTML)
} catch (e) {
}
}
return {init: init,webfontsReady: webfontsReady}
}()As you can see, the <noscript> tag has the ID #inline-deps, which is referenced in the code (line 3) to load dependencies asynchronously and on-demand. > > They probably use a <noscript> element as it allows them to directly access DOM elements, instead of having to place it in a string or a comment (which I consider particularly bad, as comments are not meant for actual information) and then parse it. It also prevents the execution of scripts and CSS styles until specifically loaded. > I personally find this an abuse of the <noscript> tag. I'm not even sure if it's valid HTML5 code. Using other methods such as declaring dependencies in a JavaScript object with a script loader should be used where practicable. TL;DR comment: > the whole thing is a bit complicated but basically it checks that it needs to load scripts and/or stylesheets, then gets them from the <noscript> element to be executed. …Wow. That processRaw function… I'm going to list the WTFs I spotted, but first the obligatory javascript "expert" who has just added this to his bag of job security tricks. > That's a pretty nifty trick using `<noscript>` to store DOM elements, I must say. And a +1 and an accepted answer to you for diving into their minified JS before me and figuring it out! – Agent.Logic_ Agent.Logic_ is the guy who asked the question. Also, cartman82: @cartman82 <a href="/t/via-quote/2640/6">said</a>:<blockquote>Nice find. Not sure it's a WTF, though. I'm not entirely clear on why do they have to load everything dynamically, but if they do, this seems like a clever way to do it.</blockquote> And now the WTFs: - Creating a long list of variables in the for statement. - Not using most of those variables in that for loop. (They're used later in the function.) - Abusing the `,` and `&&` operators instead of just using braces. (I didn't know javascript could do that too.) - Abusing the [conditional operator](http://thedailywtf.com/Articles/One-Bad-Ternary-Operator-Deserves-Another.aspx). Edit: Dammit! Posted it early by accident.
-
RE: Two people editing a wiki post at the same time results in a lost edit
If there's a solution, MediaWiki might have it. It's what Wikipedia uses and that gets like a lot of edits at once.
I do know that tvtropes locks the page when its being edited by someone.
-
RE: Which language is the least bad?
I forgot to ask about Python. How does python fare in all this?
Python seems to be rare here, so you probably won't get many responses. But I will say that I use Python and I can't think of any problems with it. Although that's Python 3 I'm talking about.