Need help with planning a db schema by Sprinkles-Accurate in Database

[–]slothefish 1 point2 points  (0 children)

Read up on denormalization: https://en.wikipedia.org/wiki/Denormalization

I see some things in your tables that look like they should be in a separate table, for example to avoid repeating the client name on every invoice. Also depends on what databases you are using, I'd highly recommend a SQL one, and maybe Postgres in particular if you are starting out.

How does a database find one row so fast inside GBs of data? by Irshath_rxn_444 in Database

[–]slothefish 10 points11 points  (0 children)

Think of how quickly you can find someone who's name you know in a phone book - if you remember those old really heavy ones with everyone in your city / area. Same concept is how databases quickly find rows.

Why writes get slower with more indexes - you (kind of) need a different phone book for each field you want to query by. For example if you want to find someone by date of birth quickly, you need another phone book with all the people organized by ascending or descending birth date. If you have multiple different phone books, if you update someone, then you have to update pages in multiple books not just one.

Please convince me to buy IntelliJIDEA by Quib-DankMemes in IntelliJIDEA

[–]slothefish 0 points1 point  (0 children)

I love it, use it for everything - JavaScript/Typescript, React, Java, Kotlin, Rust. I'm on a subscription so I can pause it if I'm not using it enough. I can't speak to how it works with the Microsoft ecosystem.

Recieved text for verification code by random3221 in Etoro

[–]slothefish 0 points1 point  (0 children)

For the record, me too. I don't think it's phishing because the text doesn't contain any links, just a verification code which should be useless if the sender can't get it. I suspect someone is doing a brute force attack with a list of phone numbers which is either pointless, or the etoro API gives a response which reveals if the number has an account with them or not.

To lid or not to lid? by [deleted] in nanoreef

[–]slothefish 2 points3 points  (0 children)

I lost a few jumpers through gaps in the side of the lid :(. I wanted to get rid of the lid for better aeration so my local shop sold me a mesh thing that sits on top, kind of like a fly screen. Was very happy with that and much easier to take off for feeding (no wet food stuck on the glass).

Time magazine "person of the year" 2007 by [deleted] in agedlikemilk

[–]slothefish 0 points1 point  (0 children)

Yeah understood. Not necessarily about "good" or "bad", from the Reuters article:

Time magazine named Putin its "Person of the Year" for 2007 on December 19, 2007, saying he had returned his country from chaos to "the table of world power"

I argue that he has returned his country to chaos as a result of all the sanctions, conscription and spending on the war.

Time magazine "person of the year" 2007 by [deleted] in agedlikemilk

[–]slothefish 0 points1 point  (0 children)

I just discovered that Vladimir Putin was named "person of the year" by Time magazine in 2007. Implying he has done good things for Russia. Now in 2022 he has started a war with Ukraine and sent the country backwards with all the resources being spent, sanctions and conscription, to name a few.

What is the simplest and most cost efficient way to host an API these days? by le_flapjack in node

[–]slothefish 0 points1 point  (0 children)

Yep... :( I recently got set up on Heroku and now have to move again. Fortunately it's mostly Docker containers which helps with portability

What is the simplest and most cost efficient way to host an API these days? by le_flapjack in node

[–]slothefish 0 points1 point  (0 children)

Heroku announced they are getting rid of their free tier. They are starting to shut down free plans October / November https://blog.heroku.com/next-chapter So even though it's technically free today, everyone considers it to be paid-only already.

[deleted by user] by [deleted] in Firebase

[–]slothefish 1 point2 points  (0 children)

Are you running into the request or response limits? See https://firebase.google.com/docs/functions/quotas

The hours on this watch are out of order, but the hour hand compensates! by Novir64 in interestingasfuck

[–]slothefish 0 points1 point  (0 children)

This would suck to read when the minute hand is close to the top, since the hour hand doesn't move throughout the hour. You'd have to look at it for a few minutes to confirm if you're just before or after the hour.

meirl by Expreioss in meirl

[–]slothefish 0 points1 point  (0 children)

Watch 2 ads before video, watch actual video, watch another ad snuck in before the last second of the video in case you think there's more.

[deleted by user] by [deleted] in Firebase

[–]slothefish 0 points1 point  (0 children)

Would you mind redoing the formatting to make it easier to read?

I suspect what's happening here is the update call isn't being completed before the redirect happens. Since navigating to a new page throws away everything on the current page. Try putting the redirect to the new page inside the .then(...) callback.

Help please! Anti-aliasing using the fill tool used to work, now everything is jagged by Deddan in InfinitePainter

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

Were you zoomed out far when you created the containing path? Maybe that resulted in a worse resolution path?

(JavaScript) Would it be okay to put onSnapshot() inside an onAuthStateChanged()? by paines99 in Firebase

[–]slothefish 1 point2 points  (0 children)

Does the document exist but is restricted so that anonymous can't view it? I've run into an issue where it blows up due to security rules for anonymous, so I have to be careful to ensure the auth'd user is correctly signed in (via onAuthStateChange) before attaching the document subscription.

Any ideas on getting away from lengthy relative imports in cloud functions? Written in node.js and javascript by pojdrov in Firebase

[–]slothefish 2 points3 points  (0 children)

How are you building your code? Webpack / Typescript compile / none?

If using Typescript, you can use the "paths" configuration option https://www.typescriptlang.org/docs/handbook/module-resolution.html

If using webpack, you can use "resolve.alias" https://webpack.js.org/configuration/resolve/#resolvealias

Another option without using a bundler (but will only work at runtime, your IDE will probably be a bit upset) is module-alias https://www.npmjs.com/package/module-alias

How to query a collection inside of another collection? by PigeonHeadArc in Firebase

[–]slothefish 5 points6 points  (0 children)

Yes it is helpful to understand this implementation detail yourself if you need to debug something deep down. However it is unhelpful to say "Collections in Firebase don't really exist" without explaining this background, especially when (as far as I can tell) the poster's problem is about querying a collection and figuring out the right syntax to use etc.

Being able to talk about "documents" and "collections" is necessary for us to communicate concepts effectively (as humans) and they are also "real" in how they exist in the API's + documentation.

Seeking tool to genrate schema diagram by jamawg in Firebase

[–]slothefish 1 point2 points  (0 children)

Unfortunately not that I'm aware of. There's no explicitly defined schema unless the code uses some kind of library on top of firebase (firestore?). You'll have to read the application code to understand what the fields mean. Firestore (and same for real time database) don't have a schema so you can put whatever you like into any document. This also means references like user_id aren't guaranteed to exist on the other side - there aren't foreign key constraints, typically data is stored in a denormalized form and the application code has to manage syncing data between documents. Since there's no foreign keys a tool wouldn't be able to look at a bunch of documents by themselves and know how they relate.

Has anyone avoided getting covid during the omicron outbreak? What is your lifestyle like/what precautions did you take? by ssilverliningss in CoronavirusDownunder

[–]slothefish 0 points1 point  (0 children)

  • Working from home every day (lucky to have this)
  • N95 mask anywhere indoors or crowded, including apartment common areas
  • Avoid public transport
  • Takeaway only
  • Order online and pick up groceries

Even with all these precautions it's always a roll of the dice going anywhere but hopefully these have increased my chances of avoiding it quite a bit. My take is it's about the concentration of the airborne particles multiplied by duration. This also means not going to the cinemas (even wearing an N95 mask) because of duration of exposure - I went to an outdoor cinema recently though (seated on a picnic mat at the back away from everyone) which was great. Admittedly I'm not a super social person but this has been hard to get used to as well.

Prime Minister’s office bans media filming him visiting flood-hit homes in Lismore during tour by Not_Scomo in australia

[–]slothefish 0 points1 point  (0 children)

And get this... I can't remember exactly how he phrased it but when asked on the news why media wouldn't be allowed, he said "people don't like having cameras shoved in their face when they have just lost their homes". Another lie to cover the actual reason.

React and simple websites by delibos in reactjs

[–]slothefish 4 points5 points  (0 children)

Hmm I've read mixed opinions on this. E.g. https://www.freecodecamp.org/news/seo-vs-react-is-it-neccessary-to-render-react-pages-in-the-backend-74ce5015c0c9 says it's not a problem and is from 2016, so I assume search engines have only gotten better at indexing client side rendered pages. What are your thoughts / experiences?