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.)
-
Aristotle, possibly the only man who became famous as a great thinker...while simultaneously being wrong about everything.
That's because he was frist...
-
Is the import still ongoing? Rediscous is having conniptions this morning, even worse than usual...
-
I think it must be.
Good notice, as usual.
-
It's sped up again already…
-
Episode 34 is probably done.
Stay tuned for a preview of the next episode of Discoimport™
[spoiler]
More Server Cooties™ and more incomplete topics
[/spoiler]
-
Ok, so what happened was that I got through the import and none of the posts were added because none of the users were "authenticated". So I overrode
can_create?
inGuardian
because apparentlycan_create_topic?
,can_create_topic_in_category?
, andcan_create_post_in_topic?
are all unused functions or something.Edit: and then I started the import again.
-
Does that mean more mysterious unread topics?
-
Oooh, lets see.
I'm hoping for a couple more topics with necroing posts in the middle.
-
I was thinking more along the lines of unread topics pointing to months-old read posts. Or, as happened to me a few times, unread topics where I was the last to post.
-
Yeah, I had a couple of those yesterday.
-
```
function sane_typeof(x) {
switch(x) {
case null: return 'Null';
case undefined: return 'Undefined';
default: return x.constructor.name;
}
}function prove(x, result) {
if(x !== result) {
throw 'oops: ' + x + " !== " + result;
}
}function Thing() { };
prove(sane_typeof(undefined), 'Undefined');
prove(sane_typeof(null), 'Null');
prove(sane_typeof(true), 'Boolean');
prove(sane_typeof(false), 'Boolean');
prove(sane_typeof(new Boolean()), 'Boolean');
prove(sane_typeof(0), 'Number');
prove(sane_typeof(1), 'Number');
prove(sane_typeof(1.7), 'Number');
prove(sane_typeof(1e6), 'Number');
prove(sane_typeof(new Number()), 'Number');
prove(sane_typeof('String'), 'String');
prove(sane_typeof(new String()), 'String');
prove(sane_typeof(/a/), 'RegExp');
prove(sane_typeof(new RegExp()), 'RegExp');
prove(sane_typeof([]), 'Array');
prove(sane_typeof(new Array()), 'Array');
prove(sane_typeof({}), 'Object');
prove(sane_typeof(new Object()), 'Object');
prove(sane_typeof(function x() {}), 'Function');
prove(sane_typeof(new Function()), 'Function');
prove(sane_typeof(new Thing()), 'Thing');
// node.js specific...
prove(sane_typeof(console), 'Console');
prove(sane_typeof(console.log), 'Function');
prove(sane_typeof(process), 'process');
prove(sane_typeof(process.stdin), 'ReadStream');
prove(sane_typeof(process.stderr), 'WriteStream');console.log('seems good then!');
This is JavaScript—I'm _bound_ to have missed something... **EDIT:** missed Strings, Functions, RegExps, some other random stuff...</blockquote> The biggest problem will be that javascript namespaces are usually constructed through some form of object composition that boils down to this:
var ns = {
"MyObj": function(){}
};which means the constructor name is empty, so the passing test will be:
prove(sane_typeof(new ns.MyObj()), '');
-
In that case, I'd say that just falling back to
typeof
and returning that is sane enough. Not perfect, but at least it will be technically correct.
-
Yeah, if the function name is empty, it can't return anything useful. Don't do that, I guess...
Anyway, looks like ES6 has a
class
keyword anyway, so maybe that'll help stop people from rolling their own OO...
-
typeof
is just going to give you'object'
in that case, isn't it?
-
Yes. But it's better than an empty string, IMHO.
-
I guess. Can we capitalize the first character of
typeof
so it's consistent with the other output and call it a day? PRs accepted... :D
-
I actually have this in my
util.js
:function ucfirst(string) { return string.charAt(0).toUpperCase() + string.slice(1); }
Yes, the name is from PHP. If I'm writing my own functions already I might at least have some consistency around here. Even if PHP itself doesn't have any.
-
-
OK then...
2a3 > var r = ''; 4,6c5,7 < case null: return 'Null'; < case undefined: return 'Undefined'; < default: return x.constructor.name; --- > case null: r = 'Null'; break; > case undefined: r = 'Undefined'; break; > default: r = x.constructor.name; break; 7a9,13 > if('' === r) { > r = (typeof x); > r = r.charAt(0).toUpperCase() + r.slice(1); > } > return r; 19a26,29 > var ns = { > "MyObj": function(){} > }; > 40a51 > prove(sane_typeof(new ns.MyObj()), 'Object');
-
I didn't get no "Just updated! Use the evil refresh button?" dialog.
-
var ns = { "MyObj": function MyObj(){} };
-
Oh look, ben is expecting sane behavior again.
Better than running tests, I guess.
-
```
var ns = {
"MyObj": function MyObj(){}
};That's a legitimate fix. There is also this possibility:
var ns = {
"MyObj": function sane_typeof_sucks_cocks(){}
};Not sure what I can do about that...
-
Get on your knees?Nah, not posting that. Too immature even for me.
-
If you post something surrounded by<del>
tags it still counts as posting it.Or does it?
(Does what?)
-
I thought it works the same as it does for passwords? Belgium
-
We recently did a migration to a new droplet...why didn't we leave the old droplet up to test migration on before we attempted it on a live instance? It would have required no more work and if we had instituted an update freeze in the interim we could virtually guarantee that the import on the live instance would have worked on the first try.
This shit is unusable right now.
-
And...I posted that to the migration thread. Or so I thought?
@boomzilla, care to Jeff this for me?
-
-
hunter2
I think you're right, that renders asBelgiumto me...
-
Oh, what's that, I cancelled a post, and navigated to a new thead, and my cancelled post magically appeared out of nowhere and posted itself?
@discoursebot @codinghorrorbot
Unknown error saving post, try again. Error: 429 OK
-
@tar Is Doing It Wrong™
-
@tar - Days Since Last Discourse Bug: 0
-
We did some testing on the droplet that we were going to move to. That's why I have access to it. The testing consisted of Alex and John getting an error message, me looking at the CSV files and finding a bunch of data screwed up, and then them fixing the CSV files. There was no second test run.
-
I thought we did move to that droplet?
-
Can I just draw everyone's attention to this?
@ben_lubar said:There was no second test run
Why the fuck not‽
-
-
exactly.... I mean the CSV files were fixed so everything will totally go perfectly.
Real men never test anything anyway. That just wastes time.Filed Under: @ben_lubar, can you submit a frontpage story on the testing, please? :D
-
Oh come on, what could possibly go wrong?
Also, this is thedailywtf, failure is what we do here...
-
-
And now posts aren't getting marked as read. Again.
Must be a swarm of server cooties. (Confirmed by my n failed attempts to post this)
-
Must be a swarm of server cooties. (Confirmed by my n failed attempts to post this)
500 swarm. Probably caused by someone not releasing the database lock often enough…
-
It also is taking a long ass time for images to render, notifications are delayed or just not there, I keep getting 500 errors when I try to post...
Pretty much unusable.
I would also like to say that I do not blame @ben_lubar and my earlier post was not meant to leave that impression. This whole thing has been a CF from beginning to end (which still is not here) and I am sure that is not his fault since he said that they did not allow a second test.
-
It releases the database lock between each post.
-
Must be a swarm of server cooties
Correct
@Polygeekery said:I would also like to say that I do not blame @ben_lubar and my earlier post was not meant to leave that impression. This whole thing has been a CF from beginning to end (which still is not here) and I am sure that is not his fault since he said that they did not allow a second test.
Also correct
-
It releases the database lock between each post.
That someone might not be you. Though doing a batch, perhaps one thread, and then pausing for a few seconds might give better performance for all other operations.
-
It releases the database lock between each post.
I assume when you say 'DB lock' you mean 'page lock' or 'table lock', right?Right??
-
I mean "it uses a single transaction per post".
-
That someone might not be you. Though doing a batch, perhaps one thread, and then pausing for a few seconds might give better performance for all other operations.
And have it only do that from 0:00-7:00 EST, because...Fuck Australia.
-
Did someone update the site just now? @PJH? @sam?
Not guilty.
I'm leaving things well alone for the moment, at least until the dust settles.