img

πŸͺΌ Jellyfish!!

Boneless Brainless Bloodless 'Immortal jellyfish' can reverse its lifecycle for n numbers! Watch more at 4min vid: https://youtu.be/9z8ujpPgUjI?feature=shared Dhh I barely recall all the details, but I'm happy that I've spent my childhood watching this NatGeo/Animal planet than PUBG/TikTok ;) #jellyfish #natgeo

img

ScholarlyTreasury

Startup

3 months ago

img

Elon_Musk

X.com

3 months ago

Sign in to a Grapevine account for the full experience.

Discover More

Curated from across

img

Misc on

by salt

Gojek

[Thread] What is your favourite math equation?

TLDR: I was reading up on the Navier Stokes equations today and it is so elegant that it might be my favourite math equation. Equation 1: βˆ‡u = 0 (conservation of mass) states that the divergence of the velocity vector u is zero, meaning there is no net change in fluid mass. Equation 2: ρ Du/Dt = -βˆ‡p + ΞΌβˆ‡^2 u + ρF (conservation of momentum) expresses Newton's second law for fluid flow. It balances the acceleration of fluid particles (LHS) with internal forces (pressure and viscosity) and external forces (gravity or other external influences) on the RHS. This equation is foundational for modelling various fluid dynamics scenarios, from celestial bodies like stars and galaxies to F1 cars. Long Version: Here's how it works: Equation 1: βˆ‡u = 0 (conservation of mass) So, u is velocity that can be represented as (u,v,w) vector, where u,v,w are x,y,z components of the vector. βˆ‡u tells us that we need to do a partial derivative on u. So, βˆ‡u = βˆ‚u/βˆ‚x + βˆ‚v/βˆ‚y + βˆ‚w/βˆ‚z = 0 or, the partial derivative of every component wrt corresponding direction is 0. Equation 2: ρ Du/Dt = -βˆ‡p + ΞΌβˆ‡^2 u + ρ F (conservation of momentum) LHS: Since, u is velocity, then Du/Dt is acceleration and ρ is density. Newton's second law, F = m x a, applies here. Wherein, Du/Dt is acceleration of fluid particles and m is the density of the fluid. RHS: -βˆ‡p + ΞΌβˆ‡^2 are the internal forces of particles hitting into each other while F represents the external force. F in most cases is gravity, so one can replace it with g. However, if you put in electromagnetism then, you can combine Navier-Stokes with Maxwell's equations. This has over time led to the development of magnetohydrodynamics, ie how stars and galaxies form. You can model the growth of our sun with this. βˆ‡p is our pressure gradient and represents the change in pressure. Essentially, fluids move from high pressure to low pressure. ΞΌβˆ‡^2 represents viscous forces yielding from viscosity. Imagine this can model aerodynamics of F1 cars.

img
img

Software Engineers on

by salt

Gojek

Daily Series #3: Geeking out β†’ The Labyrinth Problem

I will continue with this series for people who like this kind of content, drop "+1" in the chat and I will tag you the next time I post content. Today, I was in the mood to go through some old CS problems I had solved a few years back. The problem is described in cses.fi [ https://cses.fi/problemset/task/1193 ] and is as follows: You are given a map of a labyrinth, and your task is to find a path from start to end. You can walk left, right, up and down. π—œπ—»π—½π˜‚π˜π˜€: You are given n and m: the height and width of the map. Then there are n lines of m characters describing the labyrinth. Each character is . (floor), # (wall), A (start), or B (end). There is exactly one A and one B in the input. π—’π˜‚π˜π—½π˜‚π˜: Revert with "YES" if a path is possible. Revert with "NO" if no path is possible. If "YES" also mention the path taken to reach B from A as L(left), R (right), U (up), and D (down). How do you solve a problem like this? Solution Approach: You traverse through the input and figure out where A and B lie within the input as (i,j) coordinates. Then, we do something called flood fill approach, where we start at A and then we update moves with BFS until we reach B. (L/D/R/U) Now, what we need to check next is whether it violates some assumptions. 1. Check each adjacent cell and it is not supposed to be a wall(#) 2. Adjacent cell should not be out of bounds, for example cells on the boundary cannot go outside the labyrinth. 3. Lastly we need to track that we have not already visited that cell before. If none of these cases are violated then we proceed to move in that direction. Then we apply BFS again and check for violation of these cases. All the while we maintain whether we visited that cell before and the path we have taken from A. We stop when we reach B's location. Now what happens if we don't reach B? Since, we are applying BFS we will end up reaching all cells except B. We would have completed entire traversal of the labyrinth yet no B in sight.

img