« first day (376 days earlier)      last day (1063 days later) » 

12:21 AM
@Scratte Thank you. :)
 
12:54 AM
How can I make a table exceed the borders of the div that it's inside?
Example. I'd prefer that there were no line breaks here.
 
 
9 hours later…
9:52 AM
@Scratte createEditorStatsItem does not return a Promise :)
^ at least in my code
^ if you need an immediately resolved promise with a value, you can use Promise.resolve(myValue)
^ or just mark the function as async, however, the linter we have is set to complain about async functions with no await inside (because in this case, the promise-wrapping is likely needed)
@Scratte it doesn't matter if it does :) You still can have it checked out as a repo
^ you won't be able to build it, but hey, you don't bother with that at this point either way
^ and the repo can be kept private, remember? I can still see it
^ but at least the versioning and the review capabilities will be better than with chat+pastebin
 
@OlegValter I found another easier way :)
Which look really stupid, but it works :D
@OlegValter Hmm.. I'll consider it :)
I've hit the dreaded wall of creativity :(
 
@Scratte code please :)
 
Hehe.. I just broke it off, so now there's:
    // --------------------------------------------------------------------------------------------
    function createEditorStatisticsItem(suggestions, displayColours, relativeFontSize, community = false) {

        // -------    createEditorStatsItem    --------------------
        const createEditorStatsItem = (suggestions, displayColours, relativeFontSize, community) => {
 
^ huh
@Scratte that doesn't tell me anything :)
 
@OlegValter Oh.. Well.. the const createEditorStatsItem is yours :)
I just added a few more parameters, so it doesn't depends on a common config option.
But it does depends on a lot of other functions, so I put that into one big "function".
 
10:02 AM
@Scratte I mean, I need full context - with this, I do not understand how this is a solution :) I really ask you to consider a repo - this would be much faster if I could just take a quick glance on the code - easier than trying to parse the explanations :)
 
@OlegValter I see.. I'll consider parking the project to clean out my system.. and then install stuff that I need, like.. git. But I'm kind of leaning towards finishing it, as I think, I'll not finish it if I stop working on it.
As soon as I park a project, I'm very unlikely to ever return to it. And I don't publish half-finished stuff :(
 
@Scratte also, I'd really advise switching from this approach for JS - functions are first-class citizens here for a reason - you can pass them around as much as you want, iterate, map, filter, etc - so if you find yourself in a situation where you need to define a function inside another function, it is time to pass those dependencies as parameters
@Scratte it's not parking :) Just upload it and check out it back with GIT - it would be easier to track and version
 
@OlegValter I meant that I don't want functions or function declarations on the first level, unless I need them.
@OlegValter I know. I just don't have git installed on this system.
I'm also very low on space :(
 
10:29 AM
@Scratte that's one thing I do not understand about your choice - there is very little advantage for doing otherwise in JS. It goes against best practices, causes GC to collect them every time they go out of scope, introduces tight coupling, and has an overhead of function declaration every time the outer function is called
@Scratte why? GIT is extremely lightweight - even if so, aren't there any less needed tools that you can trade for "the VCS"? :)
 
@OlegValter No. I have a small disk. I need a VM on it which is taking up more than 13GB and windows is taking up 100GB :(
I don't think I have room for.. I expect you mean Version Control System?
 
10:48 AM
yes :) come on, 45Mb installer and, I think, an even smaller package - certainly you can clean up some room for it -
and it's not like versions are stored like traditional VCS's, only in diffs (I think you know that)
 
@OlegValter Git does not store diffs. Git stores complete files only. It diffs on the fly.
Try to safe a huge file on a local repository. Then change the first line with a tiny edit and commit it.. you'll see your repository is now twice the size of the huge file. Plus the overhead of the repository, of course.
 
@Scratte sorry, my mistake, for a second my mind flipped
^ of course it's snapshots for GIT
 
No worries. But I'm not concerned too much with the size of the repository. I'm concerned with the size of the software I need to install. I'm also concerned with the fact that I really need to clean out my system with everything in backups. Then doing an image of it. Only I need to find out why my system doesn't sleep first.. because I'm a bit concerned about that.
So, I have this long todo-list that I'd like to get done before installing anything :)
Which is why I haven't done it. If I had, there'd be plenty of silly-commits on the organisation repository from me.
Every time I have something that doesn't break, I make a new file with a new version number. That's exactly how commiting in git works :D Only I just have a long list of files instead :(
 
@Scratte I don't know what caused it - I think I got traditional and GIT scrambled for a sec :( The package still holds, though - I think it is enough of a benefit to consider
@Scratte yeah, basically :) If you also kept a file with hashes, you'd have a proto VCS :)
 
@OlegValter Not that advanced, I'm afraid :)
 
10:59 AM
@Scratte hm, I dunno - is your Win installation barebones already? There is usually so much junk to remove
 
@Scratte so ... why not upload them all to a repository and add one each time you make a version in the meantime as a compromise? :)
 
And when I look at it.. I have no idea what is in 1.9 or in 1.9.1 :( But I think.. I made an error when making 1.8.9b.. that should probably have been 1.9.1b :)
 
@Scratte that's not a big deal, I think
@Scratte are things that bad? I am not sure the sleep problem should have higher priority, though :) But it's your system, of course
 
@OlegValter Because that requires I install some software and set it up.
@OlegValter It has.. because I do not know what is causing it. It could be something innocent or something nefarious. But I'm procrastinating it..
 
11:04 AM
@Scratte you could've run power diagnostics in the time we've been discussing this :)
 
Probably, but first I want to know what happens when I run it :)
So.. it will take out an hour of my day.. which is why I'm procrastinating it.
While I'm trying to make modifications to review edits, so I can make screen dumps for the script modal.. :)
 
@Scratte I really don't want to be pushy - just the reasons why this is such a big deal is escaping my understanding... Anyways, it's your choice :) But at least, please, upload it to a repo - it's very hard to reason about an update/issue that you post without seeing the state of the project
 
I don't install things.. unless I have a backup image. That's my reason.
And I can't make an image at the moment. Well, I can, but it's going to be a waste of time.
 
a power report is generated? :) But to be fair, it never hurts to read up.
As a quick overview (although the Q&A is concentrated on the system going to sleep mode):
https://superuser.com/a/1344991/1272952
@Scratte ok, wrapping up - I just think that the time and effort spent now on satisfying your reasoning + installing GIT will pay off in the same time you save later on (and for others too since we are discussing issues/misunderstandings/updates/changes from time to time).
 
@OlegValter "Why does my Windows 10 Laptop fail to hibernate sometimes?" looks promising :)
I completely understand your reasoning which is sound. It's just that I have too many half finished projects. "Stop starting. Start finishing" is where I'm at now.
 
11:18 AM
@Scratte btw, can you clarify if you are worried about the screen never turning off or the system itself never going to sleep mode? From the previous message I assumed it is the former (powercfg should generate a report with enough info for both cases, though). Something tells me the chat is not the culprit
 
I'm concerned with the fact that the system never goes into sleep mode.
 
@Scratte great, then the Q&A is even more on-topic :) I thought you were more concerned with the monitor since you mentioned it in the initial message
 
But.. it's not important right now. I have images to upload and sample posts to create for screen dumps for the user script. So that I can finish that project :)
@OlegValter I just noticed it. And I expect it's just a symptom of something else.
 
if you have a problem, most likely the report will show a warning about a process preventing the system from going to sleep.
I wonder what it could be, though - pretty sure it's not a browser
 
I'll be sure to tell you when I find out :)
 
11:29 AM
@Scratte sample posts?
 
Yes.. I've just taken a screen dump and using that in the preview. But I need something that won't put anyone in a bad light.
Well.. expect for me. And maybe Stack ;P
 
11:55 AM
@Scratte hm, I think you can downscale the toggles a bit
 
@OlegValter That's why I made them elliptic :) Then you said not to do that, so I changed them back :)
But it's just a small change to the creator function, so I'm not too concerned about it :)
Anyway. There's suppose to be three images, and depending on the choice of toggles, one of them will show. They'll show the predefined colours though. I don't want to make that responsive. There's another preview under that responds to colour picks.
And I just want to put a static image in as the user card on that. But not one that actually exists.
 
12:10 PM
@Scratte there are many ways for downscaling without perspective warp :)
one of the ways is using the zoom rule to downscale the whole component
another is making the toggle line narrower while slightly reducing the circle radius
 
@OlegValter But I wanted it to be wide.. :)
 
I'm sure you can do some magic with it when I upload it :)
@OlegValter Ohh.. that looks nice :)
 
@Scratte I didn't say you need to shrink the width :)
 
I think I like that one you just put an image of :)
 
12:14 PM
@Scratte it's the Material's preferred way of doing toggles - smaller line, bigger lever - I personally find this approach looking better than Stack's choice of thick toggle lines :)
I guess that comes from bias towards iOS:
 
LOL!.. Sane people versus Apple (And Stack) :D
But for some reason that toggle just looks bigger on the image I posted than on my screen when I open up the modal. I'm sure you'll a long list of "Hmm"s when you see my result.
 
@Scratte as you can tell, I really dislike Apple as a company - I think their existence caused more grievance in web development than any other. Microsoft redeemed itself in my eyes when they started the TypeScript project and in general became more open toward opensource. Google, despite being hated around here, do not seem like bad guys to me for a certain number of reasons. But Apple... oh, god, they are moving technological awareness back to middle ages
@Scratte probably because of less (well, lack thereof) free space around the modal in the picture
@Scratte glad you like it :)
 
But I'm not too concerned with the exact look or alignment of proper UI. It's just a small modal that only 10 people will use, no? :)
Like I put the integer text field in the middle because I don't want them being cramped up along with the colour pickers. And while it may look a little messy at first, it kind of grew on me already.. so now it just looks natural :P
 
@Scratte well, you never know how popular your "this app was intended for 10 people" will become :)
 
@OlegValter I'm sure a few people will try it out just to humour me.. but then no one knows.
On the plus side it does offer a lot of options, so users can customize it whichever way they want to.
 
12:25 PM
I only point these things out, though, because it is in my expertise area - as I am pretty sure you'd want to butcher my Java code :)
@Scratte and that's how you get a popular product :)
 
@OlegValter Not sure. Sometimes I just took at things and I understand the idea. I don't change things unless they are broken :) And lots of the things that you do are about how to design code, which is not limited to any language :)
Most of the Java code I look at doesn't even use functions (lamdas).. :) Which is your preferred way of coding, if I understand your snippet :)
 
@Scratte actually not the preferred way :) I use a mixed approach - classes for entities, functions for actions. But yes, I prefer to steer to "lambdas" whenever possible
 
It's my impression that you're very structured in your code. Though.. sometimes the structure eludes me a little :) I think maybe that it also why you think of mine as messy. I guess my structure eludes you :)
 
@Scratte well, yeah, more like familiarity with concepts - for example, multi-threading will probably not be very well-implemented if you task me with it :)
 
@OlegValter Multi-threading only has two rules. 1. Guard shared variables. 2. Mind the processing sequence. That's it.. that's all there is to it.
 
12:35 PM
@Scratte well, it normally goes something like this: github.com/userscripters/reviews-overcharged/tree/master/src
 
@OlegValter I was referring to inside a file. Now you've split them up into several, and I have no idea how they work together :) I mean those just look like "class" files to make :) One file per class type :)
 
@Scratte I can't say, I never saw your structure before :) In a sense that I am yet to see a fully ready script. Although I suppose I saw one (with a lot of styling) - it didn't look bad at all.
 
@OlegValter The one that you did all the code-review on. That's typical for me.
Though I did modify it a lot since. I looked at all your reviews and applied most of them.
 
@Scratte you are not exactly wrong :) If those were implemented with classes, it would be one class-per-file type thing. Or several closely related ones.
@Scratte ESM (ECMAScript Modules) is a topic in itself :)
 
ESM? Estimated Shared Modules? :) Heh.. you edited ;)
 
12:42 PM
@Scratte to be honest, I never assessed the overall structure - I just waded through each function as if it was self-contained (this usually helps me make mine modular and less dependent on resources from outer scopes)
@Scratte yeah :)
 
@OlegValter That's OK. The downside is that it's just one big file, really.. and not a lot of smaller ones, that just connects. I think I'm looking at 2500 lines when I'm done, which is not helping to make it appear as if it has any kind of structure.
Do you remember any text that one can make out of numbers on a calculator? I mean like people used to do in the 90s where they'd enter some digits and then the look of it made it out to be a word?
 
@Scratte well, the nice thing is there is a main func that iterates over a list actions and not a single IIFE with code and occasionally reused functions :)
@Scratte you mean something like l33t speak?
@Scratte I think I missed the activity :)
 
1:03 PM
@OlegValter Yes :)
I just need something with only digits :)
1337?
 
@Scratte I think that's the closest
@Scratte what do you need this for? :)
 
@OlegValter I wanted to mess with the reputation of users :)
I'm working on an example edit
 
@Scratte I see, it's an interesting easter egg :)
 
It was just an idea though. Not sure I will use it yet :)
I have an idea about the actual post too..
But this is turning out to be more time consuming than anticipated.. :(
 
1:24 PM
Do you know of any funny typos for "exprerience"?
 
@Scratte the example looks nice, though :)
@Scratte eperience? :) It's hard to intentionally typo...
 
@OlegValter I need some coffee.. I've come up with "expendable" :)
"im creating a JavaScript program to improve the expendable of reviewers on Stack Overflow. Only I get this intermitten error in my console:"
 
@Scratte congrats, you successfully emulated how posts normally look on SO proper :)
@Scratte that typo makes me feel like the person has autocorrelation :) However, it looks good in the example text
 
@OlegValter Wait.. I'll make a screen dump in the end :)
I'm not using this as a life example. Only taking a screen dump when I'm done :)
 
1:44 PM
I still need a title and a edit summary. I can't think of a title.. I think the edit summary should be "fixed stuff"
 
@Scratte How about "Removed noise, fixed formatting and grammar), removed irrelevant tags"? - that's pretty much how my edit summaries go to this day
 
I need it to be from a silly editor :) Have you seen the example post? :P
I think maybe the title should be "How to fix Stack Overflow? [Closed]"
Hmm.. does that appear on the edit though? The closed status?
Heh.. no, it doesn't. I only appears on the post-highlights on top of the review.
 
@Scratte but... The sample "edit" is good - I'd approve it be it encountered in the wild :) Shouldn't it have a nice summary as well?
@Scratte [SOLVED] How to fix ... ? :)
> //keyboard is broken thats the reason of 1+1
^ catch of the day from SOCVR
 
@OlegValter I can't do that.. because it's not solved ;)
@OlegValter I see. But just because users make good edits, does not mean they make good summaries ;)
 
2:05 PM
@Scratte make it the original and remove it in the edit :)
 
@OlegValter But we always remove those things :)
I think this will do. I'll not add the Summary nor the votecount.
Now I need to get a footer without the user cards.
 
2:31 PM
@Scratte isn't it the point? :) I meant add this in the OP's post (which they usually do) and then "remove" them as an editor :)
@Scratte but it looks nice even without it
 
Thanks :) Well.. my thoughts are that they only add [SOLVED] when it's solved. This isn't :)
This is still appearing in my console every time I get a Tag Wiki edit suggestion.
This is the full example
I did it in the browser editing the DOM.. manually. So when I refresh, it's all gone.
 
3:00 PM
@Scratte [HELP WANTED] ? :)
@Scratte did you tr calling cloneNode(true) on the resulting outermost element and saving it to a variable? :) Those persist until you reopen devtools
 
@OlegValter Too late now.. I already took screen shots :)
 
@Scratte no worries ::)
 
@OlegValter I did save some bits and pieces of it, but it will still take work to reinsert it.
@OlegValter But you have a point with that. I tried to do it with the UPDATE: thing at the end :)
 
3:27 PM
v 1.4.3 of the chat links inserter now focuses the first input in the modal
 
@OlegValter Keeping busy, huh? :)
 
@Scratte yup
 
At least the room name isn't a lie :)
 
v1.5.0 now includes an 'Escape' shorcut
 
..but not out of New York? :)
 
3:39 PM
@Scratte I am not sure I understand the last 2 messages :)
 
We make user scripts in here, no? :)
For a long time, the room was only used for chit-chat.. now it's making scripts :)
 
the 'Escape' shortcut simply autocloses the modal (finishing the description)
 
The "out of New York" was a reference to "Escape" "..from New York" ;) The movie.. with Kurt Russel.. ;)
 
@Scratte huh, giving it purpose, I suppose :)
@Scratte ah, I failed to grasp the reference initially, sorry :)
 
welp.. that moment when you realise that you need to do it all again.. with dark mode on :(
 
4:03 PM
Oh! You have a cat :) That's so nice.. "Hello, Oleg's cat :)"
 
@Scratte did I mention that I am a cat before?
 
@OlegValter You're both Oleg and Oleg's cat? There are rules on Stack Overflow about sharing an account, you know ;)
 
@Scratte it's not sharing if it's one person, though :)
 
I see.. no one really owns a cat. It's self-owned ;)
Before versus After in light mode.
Before versus After in dark mode.
^ Screen shorts for the "Stack Review Suggested Edits Rework"
I can't spot anything that I may have missed here.
 
4:50 PM
^ another update introduces form clearing in case your cat stumbles upon the modal
 
Does it work if it's a pet-chicken too?
How do you check for theme mode? The colour "--white"?
 
@Scratte I just saw it :)
@Scratte the update is bivariant :)
@Scratte I am not sure what this means, though - I think we are f**ked. $1.8 billion is not a deal one makes and then forgoes the opportunity sqeeze every cent out of it. Like when Disney finally acquired SW :)
 
The optimized for selling it for a long time though. Maximizing new account creations.
 
5:05 PM
@Scratte that's true - although what does the number of accounts mean for the suits, more potential customers? Anyways, let's see where it goes - I just don't understand how one can buy something for 1.8 billion and not try to return the investment - is SO that profitable?? If not, I expect a catastrofic change in the long run
 
@OlegValter Of course it is.. there are so many people here working for free for hours every day!
Also, I'm sure companies pay to have jobs listed here.. and teams probably bring in a lot too.
If I want you to code-review my script, what would I have to pay to hire you? What about what someone would have to pay for the scripts we're making here? :)
But yes, maybe it will turn into some kind of paywall for users that don't have 250 reputation points or something like that.
I mean.. you can't put a paywall on users that post Answers ;)
 
@Scratte you'd be surprized :)
ok, at least it is an investment company, which is not that bad
 
@OlegValter Then.. I know a good TypeScript developer that has a thing for huge projects. I'll team up with them to make another site that's bigger and better than this one :)
 
@Scratte yeah, I am just interested in the amount of money they are paying ~2 billion is a huge deal. They must be very confident that everything's going to work out for the better
 
I think we'll call it developersdream.com :)
It will only contain "How To"-questions and Questions about specific error messages. No "Debug-my-tictactoe"-posts.
I'll allow opinionated posts that doesn't contain "Try this" :)
 
5:22 PM
@Scratte doom recipe, no less :)
 
Not so sure about that. I think there's a lot of deleted stuff from Stack that one can use to get a good start :)
 
on the one hand, the news seem to be good - more cash means they can finally improve testing (I hope) before publicly shipping stuff :) Or at least deal with the community's requests from 6-8 years ago. That's my optimist speaking. But my pessimist is worried that the "things won't change for now" is featured so prominently everywhere, so knowing what this usually means in suit speak (exactly the opposite) is worrisome
 
lol! You think the investment is going to help the volunteers? :)
 
@Scratte don't worry, my optimist has already been killed by the pessimist :)
 
Good. I was about to think you were living in a bubble :P
 
5:47 PM
I have this horrible code:
    function previewvUserCardsOnf(element) {
        const image = element.lastElementChild; // from the preview element

        const userCards = tempUserConfig.options.userCards.getUserCards === "Yes";
        const editorStatistics = tempUserConfig.options.userCards.withEditiorStats === "Yes";

       if (previewIsLightMode()) {
           if (userCards) {
               if (editorStatistics) {
                   image.src = "https://i.stack.imgur.com/F6UIV.png";
               } else {
                   image.src = "https://i.stack.imgur.com/iR1q7.png";
How can I make that not insane?
 
ternaries, use ternaries!
or a map
see the commonality?
image.src =
 
@OlegValter Yes, I see that commonality, which is why I find it to be horrible.. :(
 
function previewvUserCardsOnf(element, config) {
    const image = element.lastElementChild; // from the preview element

    const userCards = config.options.userCards.getUserCards === "Yes";
    const editorStatistics =
        config.options.userCards.withEditiorStats === "Yes";

    //use shared base
    const imgHost = "https://i.stack.imgur.com/";

    const isLight = previewIsLightMode();

    if (isLight) {
        if (userCards) {
            image.src = editorStatistics
                ? `${imgHost}F6UIV.png`
^ part 1, ternaries
 
lol!.. You optimized the host :)
That's where I tried to go, but I found it to still be sort of repetitive.
 
@Scratte that's part 1, second part coming :)
@Scratte well, in case you are using Imgur everywhere, it makes sense
 
5:58 PM
I could tell from "part 1" :)
@OlegValter Yes, but I didn't expect you to look into that too :)
But.. TamperMonkey is not happy about the ${varable}. Sometimes it just highlights everything after that in yellow as if it's all a string. Which makes it really hard to read.
 
6:14 PM
function previewvUserCardsOnf(element, config) {
    const image = element.lastElementChild; // from the preview element

    const userCards = config.options.userCards.getUserCards === "Yes";
    const editorStatistics =
        config.options.userCards.withEditiorStats === "Yes";

    //use shared base
    const imgHost = "https://i.stack.imgur.com/";

    const lightMap = [
        [`${imgHost}F6UIV.png`, userCards, editorStatistics],
        [`${imgHost}iR1q7.png`, userCards],
        [`${imgHost}iR1q7.png`],
^ part 2 - use maps :)
@Scratte that's TamperMonkey's problem :) Actually, I don't understand why both GitHub's formatter and theirs chokes on template literal strings (I suppose both use Prettier?)
 
@OlegValter I agree that it's an issue with them.. but, it kind of effects me when my 1200 lines of code is in all yellow :(
 
@Scratte well... stop coding directly in TM? :)
^ anyways, with the latest setup you can switch back to string literals if need be
^ plus, you can replace those with concatenation
 
I could.. but I expect users are going to put the code into TamperMonkey, and I'd like them to be able to read the code :)
 
[imgHost+"F6UIV.png", userCards, editorStatistics]
^ would this work for you?
 
@OlegValter I have done so where it didn't understand it. I noticed that if I use the ?. then it chokes on the next template litteral.
@OlegValter I just mentioned it. I don't expect you to change anything due to that. It's just that when you see some code where I don't use them, it might just be because of TamperMonkey being silly with me :(
@OlegValter I think this can be made into just one map :)
 
6:22 PM
@Scratte well, I mean you can use string concatenation with variables in these places :) I understand your concern - so, to get the best of both worlds you can use + to your advantage. Not that long ago this was + the + only + way + to + do + it.
@Scratte it can :) I just wanted to evaluate the previewIsLightMode() condition once instead of including it in iteration - nothing else in particular
 
@OlegValter "I" + " just " + "often" + " forget a" + "space." :(
 
@Scratte as an alternative, ["you", "can", "join", "like", "this"].join(" "). Slightly more verbose, though
 
@OlegValter I kind of like it like that though. It looks very neat :)
I mean the ternary is almost the same as the original, just a little shorter, no?
I'm going to have to rename the variable from icon though, since they're larger screen shots :)
 
@Scratte the original?
 
@OlegValter Mine :)
 
6:28 PM
@Scratte do whatever :) The name was off the top of my head
 
What is the Boolean here? conditions.every(Boolean)?
 
@Scratte it's a boolean constructor called as a function :)
same as conditions.every((c) => Boolean(c));. Note the absence of new
^ does basically the same thing as !! - boolean conversion
since it accepts one argument, it is extremely useful in methods like map, filter, find ,some, every
 
So, it's like a method reference?.. only it's an object that has a value which is true or false.
conditions.every(c => !!c); would have been the same?
 
@Scratte huh?
@Scratte it is a constructor function
implementing a popular JS pattern of double-calling
since there are no "classes", those constructors are just functions
the result of calling it as a function is just that - a boolean primitive :)
 
That just keeps tripping me up :(
 
6:43 PM
only when called as new Boolean(something) it returns a boolean object with a value of true/false
(() => {

    function MyBoolean(val) {
        if(this instanceof MyBoolean) {
            this.value = !!val;
        }

        return !!val;
    }

    const prm = MyBoolean();
    const obj = new MyBoolean();

    console.log({ prm, obj });

})();
^ an oversimplification but should do
 
phone.. hold on..
 
@Scratte 🤷‍♂️ I expect an answer in 6-8 time units, so no need to comment :)
 
That code just really confuses me because I don't know what "this" is here. Is that the MyBoolean function?
..and does all functions have a "value"?
 
7:00 PM
@Scratte this is dynamic here :) If called directly - a global object or undefined, if called with new - an instance of MyBoolean
@Scratte of course not, we are just creating a property named value and assigning a value from the val variable to it
 
@OlegValter Hmm.. that is very.. strange :)
 
@Scratte why?
 
Because you didn't declare it. It just popped out of nowhere :) I think JavaScript objects are messing with my head :)
There's something completely basic here, that's eluding me..
I don't understand how this is false const prm = MyBoolean(); I'm expecting it to be called with a parameter.. unless it just goes to return !!val; and since val is null.. it just returns not(not(null))
 
@Scratte why would you need to declare anything in JS? :)
^ strict TS asks you to declare properties first, though (just to be safe)
@Scratte !!undefined
 
@OlegValter I see.. but yes, I expect those to be declared first :)
 
7:10 PM
@Scratte why do you think val is null?
 
@OlegValter Because it wasn't given. So it doesn't exist.
 
@Scratte then it is undefined :)
 
That is.. not sound :)
 
@Scratte ??
undefined is a special data type in ECMAScript
 
@Scratte example/screenshot?
 
7:12 PM
it's the existence of null that is the problem
 
They should be the same, if you ask me :)
 
@Scratte yeah, although it's not likely to happen that late into the game. I kind of not oppose having null for "expected object, got nothing" vs undefined for "just got nothing", though. The only problem with it is the typeof null
 
user image
2
lol
let toiletPaperIn2020 = undefined;Rain Feb 25 at 21:04
 
@double-beep it's beautiful :) And it's killing me with the slightly shifted columns against each other
 
Yes. I've seen that picture before :) It's very nice.. :)
I just had a funny thought. What if they get their investments back from paying Questions? If you pay, it can't be closed..
 
7:47 PM
@Scratte if delegated to a separate ghetto on the site with votes disabled I'd let them do whatever. Then just nuke every account that moved there for being greedy :)
 
@OlegValter I don't think that's going to happen. They want exposure and Answers.. and votes on those Answer will count double, of course. So that answerers are more inclined to post there ;)
Downvotes on the Question will work as long as the post has a positive score ;)
 
8:06 PM
It works! It works!..
 
8:18 PM
But.. the amount of time spent on just 6 blurry screen dumps is just.. silly :O
 
@Scratte anything to play with yet?
 
@OlegValter Sure.. Only two tabs are done though.
Do you want it? It's only half done.
I still need to do about 100 screen shots :D
I also didn't try out the svg thing yet :(
I have some open tabs with the example post, so I think that will be my priority. I'm hoping that I don't need to redo those, but can just keep the tabs open until I've done them all.
 
8:39 PM
If I do const test = @Svg.Gear(); in my script, I get:
SyntaxError: Invalid or unexpected token
If I lose the @ and do const test = Svg.Gear();, I get:
ReferenceError: Svg is not defined
If I do const test = Svg.AlertCircle().get(0); as here I still get the ReferenceError :)
I assume I'm just doing it wrong.
 
@Scratte I think you missed the point a little of what we tried to explain :)
@Svg will not be accessible in JS, it's for server-side code
besides, you can't start a variable name with @
 
Yes, I missed that a little.. :)
 
Svg is a global object exposed by the library but may not be present
 
Ahh.. OK. So, it's not present, since I get a reference error.
 
@Scratte try it on main :) The console will print the element just fine
^ either the library is not yet loaded by the time you call it or there some context I do not know about
 
8:54 PM
I have loaded a review.. and opened up the console.
 
@Scratte works well for me
maybe something is blocking the lib from loading for you?
 
Well.. it kind of makes sense that I gave up on it, no? :D
But yes.. I think, the modal needs to wait for the ajax-response.
Hmm.. that.. is a little annoying, since I do not want it to load more than once.
Thanks for this. It was really killing me that I couldn't work out how to make it work :)
 
@Scratte have a flag somewhere like isLibraryLoaded
I'd suggest setting it directly on the function
 
I think I'll leave it for now and consider if it's worth it for me to postpone loading the entire thing.
@OlegValter Yes, the flag hack :)
 
function myTest() {
    if(!myTest.isLoaded) {
        //wait until the lib loads...
        myTest.isLoaded = true;
    }

    Svg
}
@Scratte why do you think it is a hack? :) It is a valid pattern
in fact, it is surprizingly underused because it is very useful to wait until the global var you rely on is actually there
 
9:02 PM
@OlegValter Oh. That is not waiting for ajax.
How does that work? I mean.. how do I wait for a library that it not loaded yet? I can't set a handler on it.
I was thinking you mean for me to get a flag when the modal starts and not re-start it if the flag is set.
 
@Scratte hm. How about a one-off listener for the ajaxComplete in the if statement?
similar to how waitForSelectorWorks
 
Never heard of waitForSelector :) Better read up on that :)
 
const waitForComplete = () => new Promise((res) => $(document).ajaxComplete(resolve));
^ in it's simplest form, you'll probably want to do some checking before resolving, though
@Scratte the one I wrote yesterday? :) Named after a similar method from Puppeteer
 
@OlegValter I'm having a memory-meltdown moment, I think :(
 
I am only suggesting - I don't know why in your case Svg is missing. If you know that depends on it being loaded via AJAX, why not wait for it? :)
 
9:12 PM
@OlegValter I'm not sure what it depends on. I'm guessing it's an ajax-response.
I think I'll leave it for now and get some food :)
I kind of forgot to eat today.. :(
 
^ since I think it will be blinked away soon, saved for posterity :)
@Scratte go get some :)
@Scratte I can check later
 
@OlegValter But.. isn't it all true?
 
9:38 PM
@Scratte I am saving it for posterity - something tells me it won't stay up for long
 
@OlegValter It's been updated.. :)
 
 
2 hours later…
11:52 PM
Another beauty, apologies for the quality - didn't have time to properly capture, should be readable, though. I do not agree with too much emphasis on inclusiveness, but there is something worth the read (removed nearly immediately)
 

« first day (376 days earlier)      last day (1063 days later) »