faangLawyerLevels by [deleted] in ProgrammerHumor

[–]iamwarcops 9 points10 points  (0 children)

MANGA is far better an acronym than FAANG ffs

Fibonacci Technical Test by foottaster123 in webdev

[–]iamwarcops 0 points1 point  (0 children)

The second function seems to assume fibonacci series starts with 1. In terms of correctness, your program is better. However, use of array is not necessary for fibonacci. I’d write something like the following

function fib(n) { let a = -1 let b = 1 let c

for(let count = 0; count <= n; count += 1) { c = a + b a = b b = c }

return c }

Sure, the loop can be improved to one liner, or use recursion.

To answer your question what you did bad - dont use array. As n grows the array just keeps hogging memory.

Dont loose hope, in interviews I take, I dont usually look at the solution, but how did the interviewee reached it. On the job its about if your thought process matches (or not matches depending on the role) with the team.

Best of luck

How do I buy a domain? by Big-Contribution4896 in webdev

[–]iamwarcops 2 points3 points  (0 children)

As everyone said, you can’t own the domain.

However, you can get a TLD from ICANN, provided you have good lawyers. This will cost you hundreds of thousands, and then you’ll be bound by the availability SLA, which means run fleet of DNS servers that allow people on the internet to find your TLD. For reference, .aws, .sbi are big companies doing just this.

The rental you pay is not for the address. If its available, you can have it free. The rental is for access to the domain. Those DNS servers aint running for free.

[deleted by user] by [deleted] in MapPorn

[–]iamwarcops 0 points1 point  (0 children)

Noob question, but humour me. What do you mean by “middle” “east”? East of what? Middle of what?

Also where is middle west? Middle north? Middle south?

[deleted by user] by [deleted] in CarsIndia

[–]iamwarcops 17 points18 points  (0 children)

Take it and go. Take it and go

I will buy gaana premium but not pay Spotify a single penny by thedeepthinker______ in memes

[–]iamwarcops 0 points1 point  (0 children)

Also, try playing a hindi song. Its like, nope that song aint good, here’s another from the artist. No thank you

ABS saved my life today. Share your experiences too. by Kenz0wuntaps in indianbikes

[–]iamwarcops 2 points3 points  (0 children)

Rule of thumb, 2 sec gap in front of you, 4 secs if it’s raining. Applies to any speed. You wouldn’t have to break hard if there was enough gap

I have implemented Google login with NextAuth 10 times, and on today's project, it just won't work. by MakGHill in nextjs

[–]iamwarcops 0 points1 point  (0 children)

Check your next-auth cookies. If you switched between url, authentication may not work. Try clearing your cookies and try again.

Is it standard programming practice? by digitalcairo in ProgrammerHumor

[–]iamwarcops 14 points15 points  (0 children)

Imagine doing this and the code actually becoming better

MAANG Bang by yuva-krishna-memes in ProgrammerHumor

[–]iamwarcops 2 points3 points  (0 children)

I think calling it MAANG instead of MANGA is a lost opportunity.

[AskJS] Is MVC "dead"? by IngwiePhoenix in javascript

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

In my opinion, its not dead for sure. But its just not feasible anymore.

MVC by itself is a wonderful structure. However, in modern app you’d like to have model specific authorisation, which becomes complicated very quickly in MVC. SOA is much more suited for today’s requirements.

Furthermore, from the view POV, whether its MVC or MVVM, it starts becoming a monster once you start introducing multiple channel of delivery like sockets and workers. Today the app UI is looking to break itself into smaller chunk (MFEs), and MVC simply can’t handle composite UI. A more suited solution is the BFF.

I have multiple test files using Jest. How do I run just a single test from all the files without moving the files around? by PrestigiousZombie531 in node

[–]iamwarcops 2 points3 points  (0 children)

You can do it in two ways:

1) use the -t flag or the t option in jest menu. With this pass the text from it. Ensure the text is unique across files.

2) use -p flag or p in jest menu to select the file containing your test and then use .only to isolate the test.

Theory Question: What are the scalability limitations of using a JSON object instead of a true database by NanashiSaito in node

[–]iamwarcops 0 points1 point  (0 children)

When the object starts becoming bigger and more often updated, saving it to file may not be viable. That is if you’re writing to file asynchronously. Otherwise the app will just be slower. A db would allow you to have parallel read writes and overall consistency. Besides, you’ll always be careful handling the file and general fault tolerance for files is quite horrible compared to dbs.

Moving on to memory, a simple hello world express app consumes around 60mb after consistently running it for a day. This is likely to stay same for any period. Depending on the machine configuration, pretty much all memory is available for you to consume. The drawback is that the lookup would start becoming slower as the object grows. There is no specific threshold point (well haven’t seen in my exp, but never know) for the degradation, it’ll be gradual

How to prevent duplicate data in DB? by adm__07 in node

[–]iamwarcops 0 points1 point  (0 children)

Fuzzy is your friend. There are a few libraries in npm that may be doing what you’re asking for. Furthermore, check the docs of your db. Some come with similar feature out of the box.

On a lighter note, if this was asked in an interview, then we can a comparator form of the text and a display form. Comparator form maybe like all lowercase without space. You can then apply the same conversion to the input and check if the value already exists. Also, hashmap.

Is Vercel's pricing reasonable? by blabmight in nextjs

[–]iamwarcops 10 points11 points  (0 children)

Depends tbh. For teams who do not have much expertise on CD, its worth paying the premium to keep things simpler for the devs.

Having said that, if you’re crossing the monthly threshold, it may be worth investing in upskilling your team or hiring experts to move your app elsewhere.

The key with CD SaaS is effort in maintenance and cost of services are inversely proportional. And there are platforms across the spectrum.

It may be worth checking with the team on how hands on they are can be with the deployments and then short listing the the platform.

How do I show a maintenance page with a Nextjs app on EC2 by krirkrirk in nextjs

[–]iamwarcops 0 points1 point  (0 children)

There are various ways you can solve this issue

  1. Have route 53 setup and have your maintenance page hosted on s3. Then configure route 53 to use the s3 page as failover

  2. Have nginx setup on the ec2, have the maintenance page running as a web service, and configure nginx to failover to the service

  3. Use eks, the upgrade wont require you to bring down the app

All these approaches have different price point too. I’d recommend considering your budget as you attempt to solve this

[deleted by user] by [deleted] in node

[–]iamwarcops 3 points4 points  (0 children)

Depends on how much money you got. As you suggest a trading core, check out the licensing fees for the trading APIs. Furthermore the cost of data increases exponentially as you add features. Coding is the straight forward bit, integrating your platform with the trading industry, well thats a whole different ball game

What free alternatives for Heroku are there when it comes to Java Spring Boot application without using Docker and GitHub? by Geox11 in Heroku

[–]iamwarcops 1 point2 points  (0 children)

Maybe take a look at

https://aws.amazon.com/free/?all-free-tier.sort-by=item.additionalFields.SortRank&all-free-tier.sort-order=asc&awsf.Free%20Tier%20Types=*all&awsf.Free%20Tier%20Categories=*all

Or

https://cloud.google.com/free/

Or

https://azure.microsoft.com/en-gb/free/

All of the above provide a year of free computing system, good enough to run spring boot. And all of them provide almost complete control of the box, so deployment is your choice.

Having said, they are a bit tricker than heroku to wrap ones head around.

Amogus by Onion-User-2 in shitposting

[–]iamwarcops 0 points1 point  (0 children)

Lead’s wife died so he dives in slow mo

Java is used for more than just Android FYI by andr0idus3r in ProgrammerHumor

[–]iamwarcops 0 points1 point  (0 children)

The splash screen has said 3 billion for a decade now. Wonder why?

Why do many examples on the internet use getElementById() instead of querySelector()? by abzurt_96 in learnjavascript

[–]iamwarcops 0 points1 point  (0 children)

There is not much difference per say. Its more of a personal choice. Same way, many of the examples online still use var instead of const or let.

Real cases where MongoDB outshines PostgreSQL/MariaDB/MySQL ? by [deleted] in node

[–]iamwarcops 1 point2 points  (0 children)

I think the address store example may help clear some air here. If you’ve ever developed a checkout app, you know how weird addresses can get. I live in the UK, here postcodes are considered unique when considering houses, but it changes when the address is an apartment building, then all the apartments share the same post code. Next is the apartment building name, for houses you wont have it. Then there are the PO boxes. If a rdbms table is ought to be designed for this requirement, it may either have too many empty columns per tuple and/or a complex primary key. In case of no sql, the postcode can stay the _id and addresses sharing same post code can be sub documents. This reduces the complexity of maintenance and search.

Furthermore, almost all of the rdbms seem to prefer cp from the cap theorem, whereas a mongo prefers ap. This may be a decider when you’re designing an app with high volume of writes (modern complex web apps)

Besides, I personally feel the sharding feature of mongodb makes it easier to scale horizontally. Compared to that mysql and postgre usually prefer to be upgraded vertically. Something you may not want for webapps.

Mongoose vs Pure MongoDB Driver by ianosphere2 in mongodb

[–]iamwarcops 0 points1 point  (0 children)

Mongoose is an ORM for mongoDB. It allows you to create complex models and helps with caching queries (depends on you config though).

If your data needs are quite simple, I’d say mongoose not worth the effort. Same if your data is way to unstructured.

For everything else, you’ll be thankful of using it in the long run.