andioop

joined 1 year ago
[–] [email protected] 2 points 1 day ago* (last edited 1 day ago) (1 children)

I actually wrote it just once. It acquired the space like this:

I concatenate a bunch of strings together, and add a comma and space between them so I could get stringOne, stringTwo, stringThree etc. I later need to decompose that. I remembered I separated stuff with a comma, but forgot about the space following the comma and that is how I ended up having to deal with " NameHere" vs "NameHere" without having actually written NameHere several times in my code. Is there a better way to go about this?

I have also just read my post again and it explicitly contradicts "I actually wrote it just once". Not sure if I did write it multiple times and merely forgot as I typed this comment and claimed to write it just once, or if I just pretended I wrote it multiple times when it was only once so I could simplify explaining my problem. For the purpose of my question though, let us pretend I did write it once. I promise I am aware that strings that are frequently used should be made constant, although I could use more specifics on what "frequently used" is (more than once?) and I'm wondering if you actually should not really use strings at all and always go for constants.

[–] [email protected] 5 points 2 days ago* (last edited 2 days ago) (3 children)

Not sure if this question is too noobish for [email protected] so I posted it here just in case.

 

I just spent an hour searching for how I could have gotten an

Uncaught TypeError: Cannot set properties of null

javascript. I checked the spelling of the element whose property I was trying to set and knew that element wasn't null because the spelling was the same in the code as in the HTML. I also knew my element was loading, so it wasn't that either.

Turns out no, the element was null. I was trying to set " NameHere" when the element's actual name was "NameHere".

Off by a single space. No wonder I thought the spelling was the same—because all the non-whitespace was identical. (No, the quotation marks slanting in the second NameHere and being totally vertical in the first NameHere wasn't a part of the error, I am typing them all vertical and either Lemmy or my instance is "correcting" them to slanted for the second NameHere. But that is also another tricky-to-spot text difference to watch out for!)

And what did not help is that everywhere I specifically typed things out, I had it correct with no extra spaces. Trying to set " NameHere" was the result of modifying a bunch of correct strings, remembering to account for a comma I put between them, but not remembering to account for the space I added after the comma. In short, I only ever got to see " NameHere" written out in the debugger (which is how I caught it after like 30 repeats of running with the debugger), because everywhere I had any strings written out in the code or the HTML it was always written "NameHere".

I figured I'd post about it here in case I can help anyone else going crazy over an error they did not expect and cannot figure out. Next time I get a similar error I will not just check spelling, I'll check everything in the name carefully, especially whitespace at the beginning and end, or things one space apart being written with two spaces instead. Anyone else have a similar story to save the rest of us some time?

[–] [email protected] 2 points 2 days ago (1 children)

I am oddly charmed by the drawing, did you make it yourself?

While we're here the quote is displaying

like this for me, made with >>

instead of like this, made with just one >

[–] [email protected] 3 points 3 days ago* (last edited 3 days ago) (3 children)

However, as I discovered to my cost, TiddlyWiki has never had a strong “start here,” because it is not tailored to one specific task. Obsidian, by comparison, has the advantage of a clear vision of what it does. TiddlyWiki bewilders you with options at first because it hasn’t been designed to be sold. The community focus is on adapting it to different use cases.

So I’m going to take the advice in this explainer and use TiddlyDesktop while mentioning that there are plenty of other arrangements. It is, after all, just HTML and JavaScript. Let’s get started…

You wrote this part twice in your post.

Cool tool though!

[–] [email protected] 4 points 3 days ago* (last edited 3 days ago)

Name would not be enough to stop me from using it but TiddlyWiki absolutely sounds stupid. It's probably a play off "tiddlywinks" but that also sounds stupid. It's something I'd cringe saying. I might unabashedly type out my recommendation with the name to a friend or send a link to it, but would try to dodge saying the name in an in-person conversation.

This hurts spread. One of the primary ways I find new software is by word of mouth from friends in-person (somehow I have an easier time ignoring or brushing off suggestions that are texted to me, and I take ones made in-person more seriously. I have no idea why), and I usually end up sticking with whatever they recommended.

 
[–] [email protected] 8 points 3 days ago (4 children)

Also, what do you mean, OP, by "do you have perfect recall or an average human byte"? Are you thinking of information in terms of bits and that people can only keep a limited amount of things in working memory at a time?

[–] [email protected] 2 points 1 week ago* (last edited 1 week ago)

For people reading this thread later on, this post and this post elaborate a little more on why to avoid the book "Clean Code".

[–] [email protected] 7 points 1 week ago* (last edited 1 week ago)

The trouble with this is where do you draw the line? What you say is totally true and makes sense sometimes. The question is when is it actually that situation? I can imagine two situations:

  • one where the disliked opinion is "the Nazis were right", and where the kicked person will probably argue back with

opposite of their own CoC terms such as tactful, respectful, safe and inclusive. Instead the opinions they don’t like are weaponized using the other negative terms they list such as anti-social, unhelpful, trolling, controversial etc.

as a way to try to legitimize their position, express their negative feelings at being excluded (because even if you're a bad person, being excluded feels bad), and make the ban look to others like "oh, just a power-trip by bad management" and totally unjustified. Note that they might legitimately believe it is unjustified, that they probably are not twirling a mustache thinking in strategic terms of "how can I legitimize my position" and are just expressing their hurt feelings—but those are the things that happen when you make that argument.

  • one where the disliked opinion is "I don't like dogs", which absolutely does not warrant a kick except maybe in a panel of judges of a dog competition or something, where the part I quoted is a good representation of the situation—people are being intolerant when they should not be, the kicked person's grievance is legitimate, and there might be a case of just personal dislike or power-tripping affecting the decision. When they argue with

opposite of their own CoC terms such as tactful, respectful, safe and inclusive. Instead the opinions they don’t like are weaponized using the other negative terms they list such as anti-social, unhelpful, trolling, controversial etc.

it is actually probably valid.

There are some actions/opinions where the view on whether it is the former situation or the latter situation is… controversial/unclear. I always wonder what happens when it is that kind of situation and how to deal with it.

[–] [email protected] 3 points 1 week ago (1 children)

What show is this?

[–] [email protected] 18 points 1 week ago

I enjoyed this animation of the meme in the OP.

[–] [email protected] 11 points 1 week ago* (last edited 1 week ago)

I think that would be a great situation to be in.

You have created a cool thing a lot of people use, by being good at something. You've done something.

Also, people have no idea who you are. Nobody is digging through your trash, harassing the people you love, taking pictures of you wherever you go including on your bad hair days, etc. You're just some guy.

 

Besides some of the very, very obvious (don't copy/paste 100 lines of code, make it a function! Write comments for your future self who has forgotten this codebase 3 years from now!), I'm not sure how to write clean, efficient code that follows good practices.

In other words, I'm always privating my repos because I'm not sure if I'm doing some horrible beginner inefficiency/bad practice where I should be embarrassed for having written it, let alone for letting other people see it. Aside from https://refactoring.guru, where should I be learning and what should I be learning?

 

I like browsing Local here because of that.

38
What language is this? (programming.dev)
submitted 2 weeks ago* (last edited 2 weeks ago) by [email protected] to c/[email protected]
 
8
submitted 1 month ago* (last edited 1 month ago) by [email protected] to c/[email protected]
 

I read something about once-reliable sites that would tell you the best [tech thing] now not giving legit reviews, being paid to say good things about certain companies, and I do not remember where I read that or which sites, so I figured I'd bypass the issue and ask people here. I'm pretty new to anything near the level of complexity and technical details that I see on datahoarder communities. I know about the 321 backup rule and that's it. This is me trying to find something to hold copy 3 of my data.

 

You'd think they'd just get rid of the indicator after I show up, or the day after the appointment, instead of leaving it there and saying I have -1 days left until it happens…

 

Not the creator, just stumbled across this and thought FOSS on Beehaw might like it

 
 
194
submitted 8 months ago* (last edited 8 months ago) by [email protected] to c/[email protected]
 
view more: next ›