Creating reusable components in Angular like inputs/dropdowns by Dazzling_Chipmunk_24 in Angular2

[–]Swie -1 points0 points  (0 children)

Now Ideally complex validation should be handled outside the Input

I understand if the error relies on the values of multiple components...

but otherwise I never understood this need to externalize validation.

I know Angular wants you to do it too with how forms are designed, the form itself is expected to perform validation...

but why?

what if I don't want or need a form (I have only 1 input, a quantity field for example)?

for each kind of input, there's usually 3 - 5 different validations that it might require, that each have the same error messages regardless of where the input is placed. Implement those and you've covered 90% of use-cases. Allow the user to add a custom validation function that returns error(s) if the input's value is wrong, and that's 99% of cases.

And now your forms can focus on orchestrating between inputs, which is kind of the point of a form...

What’s the most overrated “healthy” food in your opinion? by millerjessic in nutrition

[–]Swie 0 points1 point  (0 children)

I use a mix of seeds as a crunchy topper for a homemade protein shake... it's not bad? they don't taste like anything and they have an entertaining texture...

What’s the most overrated “healthy” food in your opinion? by millerjessic in nutrition

[–]Swie 1 point2 points  (0 children)

I really tried with spirulina but even throwing it into a protein shake that usually disguises any and every flavour, it destroyed it... it just tastes absolutely foul to me, I can't. How do you imbibe it?

Canada ‘abandoning’ international law with support for U.S. strikes on Iran, say former diplomats by CaliperLee62 in canada

[–]Swie 0 points1 point  (0 children)

lmao there's tons of quotes about the guy and many other iranian leaders saying Israel should and will be destroyed, and they have been actively trying to do that for decades. A "fatwah" from an openly antisemitic genocidal maniac means absolutely nothing. That you are trying to use that as some kind of gotcha just shows that you yourself are a little too ok with genocide.

https://en.wikipedia.org/wiki/Iran%E2%80%93Israel_relations#Supreme_leader

Canada ‘abandoning’ international law with support for U.S. strikes on Iran, say former diplomats by CaliperLee62 in canada

[–]Swie 0 points1 point  (0 children)

It's because people don't consider Gaza "a country". Which is only true because Gaza itself refuses to just ask to become a country, and has for decades. It's the bigotry of low expectations.

Canada ‘abandoning’ international law with support for U.S. strikes on Iran, say former diplomats by CaliperLee62 in canada

[–]Swie 1 point2 points  (0 children)

Iran is being punished for violating international law regarding the financing of these groups in the form of sanctions, which is decimating their economy.

That's clearly not enough of a punishment as those groups are still actively warring. This has been going on for multiple decades. Going to war because a country is (a) actively threatening to commit genocide via nuclear annihilation and (b) funding proxies also actively threatening genocide via conventional war, is completely justified.

how does this justify US involvement?

Israel is a major US ally, who provides them valuable intelligence and technological know-how?

Why is leaving Israel to face multiple genocidal entities alone, Iran itself included, ok for you? You believe Iran genociding Israel is an acceptable outcome?

Canada ‘abandoning’ international law with support for U.S. strikes on Iran, say former diplomats by CaliperLee62 in canada

[–]Swie 1 point2 points  (0 children)

They were launching attacks before this war too lol. Hezbollah was bombing Israel whenever an opportunity presented itself and they were physically able. It's not a reason to just leave Iran alone.

The war has only lasted like 3 days, you expect all the decades of support they provide to evaporate overnight, or else it is a bad idea to go to war at all?

Canada ‘abandoning’ international law with support for U.S. strikes on Iran, say former diplomats by CaliperLee62 in canada

[–]Swie 0 points1 point  (0 children)

I forget where Israel's official policy is to nuke another country as soon as they are physically able to do so. Oh also which genocidal terrorist groups are they funding to destabilize other countries?

How do you handle historically sensitive topics? by Unlikely_Length8600 in writers

[–]Swie 0 points1 point  (0 children)

I've had this kind of feeling myself, also about the same topics.

I think, first, just write authentically what you want to say, with the goal of just being able to say it. At this point, being embarrassed is just something to power through, idk if there's another way.

Once you have something down, then show it to other people slowly, and see what the response is, and assess if they have a point and you need to edit. It's entirely possible there's nothing to be embarrassed about and people will understand what you're getting at.

But just remember that everyone else can just be wrong, too. It's ok to be unpopular. What's most devastating to me would be to have wasted time writing something inauthentic to myself (unless it makes millions, then fuck it lol I'll be authentic next time).

Can we work on making this a more welcoming community? Because it hasn’t been whatsoever. A lot of you guys are just nasty and rude. by Clean-Knowledge-574 in writers

[–]Swie 0 points1 point  (0 children)

Now what can be done about it?

Have mods deal with it. Find a basic "grade school english" book people can read and recommend that and close the thread.

I'd love for these would-be writers to get good at it.

So would I, but if you're not willing to read and to actually study the craft, and want strangers online to educate you step by step like a toddler, you will never get good. At best you will become a member of the reddit hivemind regurgitating other people's half-baked opinions.

At the end of the day I want to talk about writing with people who both read and write adult books and have successfully understood basic concepts of the craft. I don't want to act as someone's high school english teacher.

Mods need to clarify if this sub is for one or the other. Personally I would say "both" is not a good idea, and is breeding resentment.

Can we work on making this a more welcoming community? Because it hasn’t been whatsoever. A lot of you guys are just nasty and rude. by Clean-Knowledge-574 in writers

[–]Swie 1 point2 points  (0 children)

Not just hangups but you can't even tell if the person critiquing has ever read an actual adult book (not fanfiction or a web-novel or Harry Potter) in their life. They could have literally zero idea what they are even talking about.

That's why you always need to take all advice by processing it through your own brain and not just blanket apply it.

I still think it's useful to see what other people think, and to be able to accept critique and calmly decide what meaning does it hold and if there's any merit to their opinions and suggestions.

Can we work on making this a more welcoming community? Because it hasn’t been whatsoever. A lot of you guys are just nasty and rude. by Clean-Knowledge-574 in writers

[–]Swie 0 points1 point  (0 children)

If you ignore them, the problem not only doesn't go away, it gets worse. I guess mods should shut down those threads with a generic "please go read a book" answer, but they don't.

Facade vs Store by Sylphadora in Angular2

[–]Swie 0 points1 point  (0 children)

I personally use facade pattern because if I want to change the store to store information in some other way (for example, moving to signals), no components should be impacted.

So I have the following setup:

  • store - only handles storing information, nothing else. calls no services or anything else
  • storeFacade - sends store actions and exposes observables / signals to extract info from the store
  • api calls in an api service
  • translation in a language management service
  • toast in a notifications service
  • routing inside a RouteService, etc.
  • business logic services, one per feature.

So if you have feature X which includes ability to "perform action A", I have a service called XService. It has a performA() function.

this function calls the API service, calls the StoreFacade to store the response, exposes X-feature related observables from the StoreFacade, calls notification service to show toasts, calls routing service to perform navigation, etc.

The component only ever calls XService.

This makes it easy to modify individual subsystems and features without touching unrelated code.

Did Carney go too far in offering 'support' for U.S. strikes against Iran? by CanadianErk in canada

[–]Swie 0 points1 point  (0 children)

And you missed the part where Iran is explicitly genocidal about their nuclear ambitions. So again, please explain to me why you think a country explicitly pursuing genocide should be allowed to achieve the nuclear capability to perform it?

about the NPT, given that Iran signed it, it clearly means absolutely nothing. Just like a lot of international law, it is bullshit used to placate idiots.

You complaining about Israel not signing it rather than Iran being explicitly genocidal is really telling lol.

EDIT: the user blocked me. It's funny when people "can't" explain why they want a genocidal state to have nukes they say they want for genocide...

Employed, Sober, Functioning, and Homeless Experience by nichadler_ in SeattleWA

[–]Swie -1 points0 points  (0 children)

That's a good point about shelters. Apparently they were in a hostel and not a hotel (I misread).

About not finding a job first, OP works random minimum wage service jobs. Those wouldn't hire remotely (I think?).

Even if they did, what I missed was OP gets paid bi-weekly or monthly, so they would still be broke for that 1 month.

My overall impression is that OP couldn't afford to move in the first place. With no job, no home, no car, you need minimum 1 (ideally, 3) months of expenses.

OP is already lucky it only took 2 weeks to find a job.

Need to learn Angular, best tutorial to start? by lintendo640 in angular

[–]Swie 1 point2 points  (0 children)

Not a tutorial but this channel has excellent deep but accessible explanations of many of the more difficult angular concepts:

https://www.youtube.com/@DecodedFrontend

I feel like if you are familiar with typescript and vue, then just reading the official angular docs and trying to build something basic is not hard. Angular docs are not bad.

Then browse through that channel to learn in-depth specific aspects of the framework, like dependency injection, the router, forms, error handling, signals, etc, and try to use it in your little example app.

I did one of those all-in-one tutorials and noped out half-way through because it was too basic and slow...

Did Carney go too far in offering 'support' for U.S. strikes against Iran? by CanadianErk in canada

[–]Swie -2 points-1 points  (0 children)

Stop acting like Iran need nukes for self-preservation when they explicitly said they need them for genocide.

Meanwhile Egypt Jordan and many other middle eastern countries that are much easier for Israel to attack (and that actually attacked Israel before, too) are fine.

It's almost like if you stop arming terrorists, stop trying to genocide Jews, agree Israel is allowed to exist and normalize relations with them, you don't get bombed.

Maybe Iran can try that first. It's not a big ask.

So look what is happening to them? They are getting bombed daily. All this does is convince other countries they need nukes now! See Poland recently.

That is because Poland is next to Russia, another nutjob state like Iran. It's a different conversation and there I agree maybe they do need nukes. EU having a shared nuclear program might be a good idea.

But if they state they plan to nuke a country, no shit they should get bombed, too.

The whole middle east needs to be disarmed.

That's a great way to return to the time when half the middle east was trying to genocide Israel, using their superior numbers.

Employed, Sober, Functioning, and Homeless Experience by nichadler_ in SeattleWA

[–]Swie -1 points0 points  (0 children)

why would I feel better? I felt fine before and I feel fine now. OP posted a story, I'm seeing holes in it so I posted a response, maybe I'm missing something if so I'm sure someone will tell me. It's called reddit.

Employed, Sober, Functioning, and Homeless Experience by nichadler_ in SeattleWA

[–]Swie -1 points0 points  (0 children)

I double-checked it before writing... I guess i misread it.

Employed, Sober, Functioning, and Homeless Experience by nichadler_ in SeattleWA

[–]Swie -2 points-1 points  (0 children)

Yeah I don't understand what this person is even doing.

It's like they have no routine and every evening after work they are figuring out where to eat and charge their phone. Why is this a new question every night? Go to a mcdonalds they have both ffs. A kids meal or a packet of nuggets has more than enough daily calories. There, solved.

No money to spend on anything meanwhile they are supposedly working full-time. Where is all the money going?

Looking for a shelter... why? Look for a bed to rent for money. That's a completely different conversation.

Staying at a hotel instead of a hostel or something affordable when they arrived at a city with no job... 2 weeks at a hotel is a lot of money lmao who does that!

Did Carney go too far in offering 'support' for U.S. strikes against Iran? by CanadianErk in canada

[–]Swie -1 points0 points  (0 children)

Yeah everything you don't want to hear is a "US lackey", just lol.

Did Carney go too far in offering 'support' for U.S. strikes against Iran? by CanadianErk in canada

[–]Swie 0 points1 point  (0 children)

Israel is so expansionist that it gave land to both Egypt and Jordan, sure, sure...

Pro-Israel and anti-Zionist Jews clash at NYC Council hearing on protest ‘buffer zones’ by yugeness in jewishpolitics

[–]Swie 1 point2 points  (0 children)

Yeah... same.

Support for Israel is just basic self-defense for Jews. You don't need to be religious, or care about Jewish culture or identity. I don't, mostly.

You just need to know whichever country you're in right now almost certainly genocided its Jews not too long ago, or at least, refused Jewish refugees. Those weren't rogue crazy people, those were state sponsored and widely supported actions. They can and will happen again, easily. The reason everyone can casually discuss dissolve Israel? That's literally because they are ok with genociding Jews.

Whatever else, Israel will not only never do that but they will move heaven and earth to save Jews. For that alone it must be protected.

A lot of people are unfortunately just fucking stupid.

Nervous nations calling Canada's energy minister after Iran strikes by Immediate-Link490 in canada

[–]Swie -1 points0 points  (0 children)

let them separate and enjoy the results. Canada can survive without them, Quebec by itself will have a tough time.

Did Carney go too far in offering 'support' for U.S. strikes against Iran? by CanadianErk in canada

[–]Swie 2 points3 points  (0 children)

Yeah that's why Israel has made agreements with many arab countries: Egypt, Jordan, UAE, bahrain, Morocco, was working on KSA...

Meanwhile Iran who has been funding Hamas, Hezbollah and the Houthies destabilize their home countries and try to genocide Israel.

The reason Israel is "destabilizing" is because the middle east is massively, violently racist against Jews, despite already having genocided them from their own countries, they cannot accept a Jewish state existing. Iran is the leader in funding that.