Imports (Was: {brace yourselves} the import is coming {Spoiler Alert: Not all of it} [i.e. blakeyrat was not utterly wrong for the first time ever] Filed under: append-only titles.)
-
I am seeing some old topics
But the vast majority did not come through
Yes, this is my diagnosis, too.
The import process is taking out postgres, memory ends up running tight on the site and it crashes.
This is what it felt like while the users were getting imported. I was sleeping during the post import process.
-
I did, and you probably figured that out because you were watching the screen session.
-
The About page says we're at 273.6K posts right now...
-
So, how many duplicate posts will we end up with?
-
-
testing the import script?
-
Whoosh badger incoming, but…
…I don't get it…
-
Looks like a blog or something.
-
-
It's a web series, the important part was that it was a stamp of approval. It's based on a Jane Austen novel.
-
Oh, was there testing?
We know that @ben_lubar ran the script on a testing instance. But that's not the same as running it in production with you yahoos doing your thing at the same time. His machine also probably had more resources than the droplet does.
-
Well, at least it's in a screen session now. Progress is being made.
-
Well, at least it's in a screen session now. Progress is being made.
Testing is happening!
-
I'm scared that this website is running on a computer worse than the one I use exclusively for Dwarf Fortress AI testing.
-
They need a toaster when you try to like a post by users that says "are you sure you want to like this? this post was really stupid."
-
I asked for button already. Your solution would probably eliminate at least half the likes I get.
...
Do it!
-
composer was opened without a draft key
wtf is that... it happens any time i try to edit a typo on a post i make on a mobile device.
-
it would also make them have to re-write the bots for likes topic. i think the toaster should also have a captcha to verify that you're not an autoliking bot ;)
-
(this originally oneboxed to the "LOOK GUYS DISCOURSE HAS A REPO NAMED DISCOURSE" thing)Basically, they're not passing an optional argument to a function and the function is complaining.
-
wow. that is some seriously wtf code..... they're just trying to avoid null fails, but it makes it look like opts is optional when it's really not. surely is more sensible to just put a null check and return instead of the || and failing the first random sanity check it comes to.
-
opts = opts || {};
is a common Javascript pattern, they probably just didn't remove it when they made some of the options non-optional
-
surely is more sensible to just put a null check
if(typeof opts != 'object')
won't throw an error ifopts
wasn't declared. In this case it's a parameter so the point is moot, but maybe that pattern arose from errors where they tried anull
check on an undeclared variable and it cargo-culted from there.
Filed under: No, don't get me started with that syntax...
-
This post is deleted!
-
Since opts is an argument to the function, it had better be declared or there's something wrong with JavaScript.
-
opts = opts || {}; is a common Javascript pattern
Huh. Never stumbled upon it myself. I mean, makes sense, kinda, you avoid wrapping everything in another
if
, but it irks me in the same way assomevar = !!somevar;
does. It's not wrong it's just... I dunno, looks "dirty"? I'll go with "dirty" for now.Edit: Also
string_var = string_var + int_var + ""; // it's a string, damn it!
. Yeesh!
-
There are three cases:
somevar = !!somevar
is used in an if statement or the condition part of a for loop or while loop and is completely pointlesssomevar = !!somevar
is converted to a string at some point (ugh)somevar = !!somevar
is required because the code it is passed to does reflection on the value and does something different if it's not a boolean.
And then there's this:
-
somevar = !!somevar
is converted toa stringfuck knows what type at some point because JavaScript is a dick like that(ugh)
Yes.
-
It's just trying to do optional arguments: http://www.markhansen.co.nz/javascript-optional-parameters/
-
Given that they made things not optional on THE VERY NEXT LINE...
INB4 pedantic "the next line was blank"also, it gets better in that if that next line isnt there, later on they naively use properties from opts without checking for whether they exist first. It's the classic hidden side-effect coding method that results in a later update completely borking it up when the next person doesnt realize you were relying on that side effect to protect them from null property failures.
-
It's just trying
Yes. Yes it is.
Fracking JavaScript *grumble*
Edit: I prefer to stick it in a ternary. I know some people hate them, but damn it, in this case it's clearer!
-
It's not even a documented parameter.
-
Yup. This is clearly not what they wanted, my point was just that it's probably a copy-paste mishap.
-
taken alone, innocent mistake.
in the context of duckwhores, example of the endless epic fail to come.
-
-
Are ANY of their parameters documented?
Well... A few of us dumbasses from here reverse engineered parts of the JSON it spits out. Does that count? :P
-
I do ternaries too, but this one should be exitinf the function and thatd be lame in a ternary, if even possible. All they need is a simple
if (!opts) { throw errors; }
same amount of code, infinitely less likely to get fucked up later.
-
Agreed. I was mentioning ternaries in the case where parameters are optional.
-
don't mind me, i'm grumpier than usual because i fractured a rib this week and it hurts like a motherfucker. got pain meds from doc, but they make me puke... so i can either hurt or puke. shitty options, no good choice.
-
Fixed that last week, should be better next beta
-
This post is deleted!
-
throw "composer opened without a proper draft key";
Because nothing screams quality like throwing a string...
-
if(typeof opts != 'object')
won't throw an error ifopts
wasn't declared. In this case it's a parameter so the point is moot, but maybe that pattern arose from errors where they tried anull
check on an undeclared variable and it cargo-culted from there.At risk of reigniting the "debate" which happened last time:
(Basically
typeof
is so broken that you may as well pretend it doesn't exist and roll your own function which does something sensible instead..)
-
I mean, makes sense, kinda... It's not wrong it's just... I dunno, looks "dirty"? I'll go with "dirty" for now.
JavaScript programming in a nutshell...
-
And then there's this:
<img src="/uploads/default/17131/6925b6952b841497.png" width="164" height="29">That's what you get for not shunning
Boolean
...
-
(Basically typeof is so broken that you may as well pretend it doesn't exist and roll your own function which does something sensible instead..)
Is there something I'm not aware here? The function you linked to is more precise, yes, but giving
typeof
anything that's anobject
will return anobject
, won't it? Sure, it won't tell me what type of object it is, but at least it won't tell me it's astring
, will it?
-
I think it gives you the name of the Constructor function... let me do some testing...
-
well yes, but you also can't tell the difference between Array and Object with typeof alone.
typeof([])
returns"object"
-
I think it gives you the name of the Constructor function...
that is correct and it is useful for many things, but i see it more as a symptom of classical strong type thinking trying to adapt to javascript ducktyping. do i care if the thing you gave me is a
frob
? not really. i only care if i canfrobulate
it.
-
that is correct and it is useful for many things, but i see it more as a symptom of classical strong type thinking trying to adapt to javascript ducktyping. do i care if the thing you gave me is a
frob
? not really. i only care if i canfrobulate
it.I'd assume it's more for debugging porpoises...
-
well yes, but you also can't tell the difference between Array and Object with typeof alone.
... shit. Never ran into that so I never thought about it. My JavaScript pains are usually pretty tame in the sense that I just have to screw around with the DOM, all the important bits are done serverside so once it's time for JS to do it's dirty work it's mostly just juggling events around and stuffing rendered templates in proper containers.
Well, at least I know about it now before it actually bit me in the ass (which it inevitably would).
And this is why I hang around this place so much. So much to learn from a single bug someone found floating around.
Well, that and trolling.