Skip to content

Latest posts from the Dynamo Geeks community

Developers writing, asking and answering, in the open

Dynamo Geeks is a community for people who build software: long-form articles, questions with real answers, quick updates and polls, organised into topics you can follow. Everything here is free to read.

Showing 24 posts.

Posts

  • Accepted answer

    Kota, very good effort, and a very good bug. Small correction needed in one line. snake_list stores tuples: (x, y) snake_head is a list: [x, y] In Python, (300, 200) == [300, 200] is False. A tuple and a list are never equal, even with the same numbers inside. So your check never becomes True and your snake is immortal. Fix: make them the same type. Change snake_head = [x, y] to snake_head = (x, y) and then append snake_head itself. Try it in the Python shell first: type (1, 2) == [1, 2] and see. Now please also finish the rotational motion chapter, alle? 😊
    1 reply
  • Good bug, Kota. Everybody learns tuple vs list this way. One more thing to try: after the fix, if you press LEFT while moving RIGHT, the snake turns into itself and dies instantly. Block the opposite direction. Dry run it on paper first. And yes, physics first, samjhe? 😄
    1 reply
11

  • Pending, charging, paid, plus reconcile is exactly the state machine we use for bank debits. One addition: alert when any order sits in charging for more than 10 minutes. That alert has found two gateway outages before the gateway told us.
    1 reply
  • In embedded we call this exactly-once delivery and we know it does not exist. Good that PHP people discover it too.
    1 reply
13

  • Very useful, Rohit. Sharing with my students. Ghabrao mat, numbers are just maths. Do the dry run of your own offer letter exactly like this.
  • Thank you Rohit. Coming back after a break, I was confused why my offer's CTC was so different from the monthly amount. The employer PF and gratuity lines explain it. Kindly also tell freshers to keep the CTC breakup sheet safely, I needed my old one for a home loan.
7

  • Accepted answer

    ah this one na classic. the interval callback catch "seconds" when it was 0, and because your useEffect get [] e no go run again, so every second e dey do 0 + 1. forever 1 😂 fix am like this: useEffect(() => { const id = setInterval(() => { setSeconds((s) => s + 1) }, 1000) return () => clearInterval(id) }, []) setSeconds((s) => s + 1) means "take whatever the current value is and add 1", so e no care about the old captured value. the clearInterval part is important too. without it, StrictMode go run your effect twice in dev, you go get two intervals, timer go dey count double speed and you go think say na witchcraft
    1 reply
5

  • The length argument exists for a reason. You give wrong length, you get wrong result, this is not a bug, this is you. C respects you enough to let you be wrong. The only honest language.
8

  • Haha I had same panel in 2013 but they asked "can it be online". For the blockchain part, maybe you can say the audit log table is append only, no update, no delete. That is enough "transparency" for inventory, and it is actually good practice wkwk
    1 reply
6

  • Accepted answer

    IWDG as the last line, always. It runs from LSI, its own clock. If your clock tree dies, PLL unlock, HSE crystal cracked, WWDG dies with it because it runs from APB clock. IWDG still resets you. Never kick from an ISR or a timer callback. Never kick from "the idle task" either. Do this: every critical task sets its own bit in a check-in word each cycle. One supervisor task, priority just below MotorControl, wakes every 20 ms, checks that ALL bits are set, clears them, then kicks IWDG. If any task did not check in, no kick, reset. Runaway loop in one task = its bit not set = reset. This catches what your colleague is worried about without WWDG. LSI is not accurate. On F4 the datasheet range is wide, something like 17 to 47 kHz. Calculate your timeout at the fast end, not the typical. At boot, read RCC_CSR reset flags (IWDGRSTF, WWDGRSTF, BORRSTF, PINRSTF...), store them, then clear with RMVF. Log it. Otherwise you will never know the watchdog fired, you will only know "it restarted sometimes". WWDG on top is fine if you want early-kick detection, but it is not independent. Do the check-in word first.
    1 reply
11

  • beirut checking in. my whole university class is in paris, montreal and dubai. I stayed for my parents and my balcony. the honest answer is: some days it feels like a choice and some days it feels like being left. both are true. we have the corniche instead of the ferry, same thing. kolay gelsin ya Elif
  • I left Khartoum in 2016 and I have sat on both sides of that dinner table. Elif, your juniors are lucky. Staying to train the next ones is not small. It is how places survive.
42 votes · Ends Oct 21, 2026
10

  • please is 76 tabs okay?? half of them are react docs and the other half are job applications 🙏🏾
    1 reply
  • One. Then I close it. Regards.
    1 reply
11

  • the "say done only after dry running your own example" rule. i lost a round last month by saying "done" and the interviewer immediately typed [] as the input. silence. 💀
  • I was the interviewer on this one. The "defending instead of listening" at minute 18 is the one I see most. The follow-up is a gift and people treat it like an attack.

Get the best of Dynamo Geeks weekly

One email each Monday with the most useful posts. No spam; unsubscribe in one click.