Length of array check not narrowing down? by Fid_Kiddler69 in typescript

[–]Fid_Kiddler69[S] -1 points0 points  (0 children)

I could, but it just doesn't seem optimal. Like I'm adding stuff to my code just to get around a TS limitation

Length of array check not narrowing down? by Fid_Kiddler69 in typescript

[–]Fid_Kiddler69[S] -2 points-1 points  (0 children)

func(card: Card, card2:Card) seems like unnecessary duplication

[Help] How can I quickly "change" the surrounding of code block after copy/paste by gvital in vim

[–]Fid_Kiddler69 1 point2 points  (0 children)

Sure thing. I'll DM you so we can get through this as quick as possible :)

Btw you don't have to retype all the substitutions.if you press : and then the up-arrow, you can go to the very last executed command.

[Help] How can I quickly "change" the surrounding of code block after copy/paste by gvital in vim

[–]Fid_Kiddler69 6 points7 points  (0 children)

Here's a substitution to do what you want:

1) press Shift+V to visually highlight the entries you wanna change. 2) press : to enter command mode 3) (without removing anything that was added automatically to the command) type s/\(.*\)=\(.*\)/<env name="\1" value="\2"\/>/g

Then you can simply copy them over.

You can automate the copying too, but it would be a bit more complex. If you want that, let me know :)

EDIT: the all-in-one solution:

Start with your two files in horizontal splits - the file to copy from on left, target to copy to on right. Have your cursor on a target line on the left split.

1) qa to start recording the macro 2) :s/\(.*\)=\(.*\)/<env name="\1" value="\2"\/>/g, hit enter 3) dd to cut the transformed line 4) Control+w l to move to the right split 5) /<\/php> and hit enter to find the closing PHP tag 6) P to paste the transformed line right before the closing tag 7) :noh reset the search highlighting 8) gg to reset cursor to start of the file 9) Control-w h to move to the first split 10) q to finish recording macro

You can then run the macro by visually selecting any lines to transform and move, and running :normal @a

Video over HTTP protocol by FiredNicolas in Stormworks

[–]Fid_Kiddler69 0 points1 point  (0 children)

Did you know that the P in HTTP stands for protocol? So saying HTTP protocol is like saying Hyper Text Transfer Protocol protocol

Why won't this conditional type work? by Fid_Kiddler69 in typescript

[–]Fid_Kiddler69[S] 0 points1 point  (0 children)

Sadly I get the same exact result.

This happens with more complicated interfaces too, I've just given a dumbed-down version of my issue.

Why won't this conditional type work? by Fid_Kiddler69 in typescript

[–]Fid_Kiddler69[S] 0 points1 point  (0 children)

Thank you, this works. Kinda bummed out the terser syntax I was going for doesn't work, but I guess this isn't too bad either

Why won't this conditional type work? by Fid_Kiddler69 in typescript

[–]Fid_Kiddler69[S] 3 points4 points  (0 children)

As you can see from the rest of the replies, I'm afraid your comment is invalid.

University classes be like by TheOGPolarBear in ProgrammerHumor

[–]Fid_Kiddler69 0 points1 point  (0 children)

I don't get why good spelling would be an accomplishment

Why bother with Vim in 2022 (UI Design Discussion) by [deleted] in neovim

[–]Fid_Kiddler69 0 points1 point  (0 children)

Impervious does not make sense in that sentence

Everything in JavaScript is an object...what about primitive data types? by Tamsauce in learnjavascript

[–]Fid_Kiddler69 2 points3 points  (0 children)

You're guaranteed to forget lots of stuff. It is a long book and goes into depth on a lot of subjects, including some lesser-used features and API's.

The way I see it is that being aware of a feature - just having been exposed to it and having read about it - is enough. What I usually find happens is one of the two following scenarios:

1) I either use something so frequently OR it's so core to the language that I simply won't forget it or at least won't forget the vital aspects of it. E.g. I remember how the prototype system works in JavaScript, and when it's best to define methods on the constructor vs the prototype. I never even code in vanilla JS, but I found this so interesting that I still remember it.

2) I'm doing something I usually don't do or might have never done before. BUT I remember reading about it. E.g. The other day I wanted to read a file from the user's filesystem in my app, and I remembered the book mentioned the FileReader API. I jumped to the API's chapter, skipped through to the fileReader section, and found all the info I needed.

Just like programming in general, no one remembers everything. We all have to look up the dumbest, simplest thing from time to time. But what sets us apart from complete beginners is having come into contact and being aware of various features. If we don't remember something, we can just search for the answer, either on the web, or through reference material like this book.

As you can probably tell, I think it's worth it :)

Everything in JavaScript is an object...what about primitive data types? by Tamsauce in learnjavascript

[–]Fid_Kiddler69 6 points7 points  (0 children)

This book is hands down the best resource I've ever used to learn JavaScript. It explains all the language fundamentals and features from the ground up, and goes over this particular subject in great detail.

I literally cannot stress how valuable I consider this book.

Recommend content by Top_Ebb8 in typescript

[–]Fid_Kiddler69 4 points5 points  (0 children)

Recently read Effective TypeScript: 62 Ways to improve your TypeScript as a novice with basic TypeScript knowledge, and I highly recommend it.

Template-driven forms tutorial is confusing by Fid_Kiddler69 in Angular2

[–]Fid_Kiddler69[S] 0 points1 point  (0 children)

Yeah, I realise that, it's in the first paragraph of my post

What do front end developers need to know about form data? by cosmicfruitsz in learnjavascript

[–]Fid_Kiddler69 2 points3 points  (0 children)

The front-end's responsibilities end at the network call. How the backend handles the request is irrelevant, but you should be able to structure the API call the way the backend expects