- Ironing board is adjustable height, so technically you've built an accidental standing desk. 5/10 from me, the mouse sitting on the iron rest is a shocker
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
- Hongera, Jo! The refund will be forgotten. The 9 minutes will not.
- Help desk got 400 tickets saying "the status page is down". One user asked if we had a status page for the status page. I did not have an answer.
my snake game snake doesnt die when it eats itself?? kya galat hai 😅
bhaiya didi help 😅 i made snake game in python (pygame) at night after physics. its working mostly but when snake eats itself it doesnt die?? it just goes through itself like ghost. kya ye sahi hai?? my friend says my snake is immortal lol here is the code (food wala part i removed to make it short, when it eats food i do snake_len += 1) import pygame pygame.init() win = pygame.display.set_mode((600, 400)) clock =…
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? 😊- 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? 😄
- kota coder!! the snake eating itself and keeping its score is honestly a feature ~ rogue-like snake 🐈 but yes, physics first
- 9 rounds cleared means the skill part is done. The rest is timing and freezes. Saturday mock still on?
Our worst week this year: a queue job that charged one customer three times
I post the wins here, so I should post this one too. UK ecommerce client, Laravel, a payment gateway the client chose (a smaller provider, not Stripe). Checkout puts a ChargeOrder job on the queue. The job had $tries = 3 with backoff, because "network errors happen". One evening the gateway was slow. The charge request took longer than our HTTP timeout, so the job threw a timeout exception. Laravel did exactly what…
- 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.
- In embedded we call this exactly-once delivery and we know it does not exist. Good that PHP people discover it too.
- finally. the drawer arc. six years in the making. i'm going to need a livestream
Pehli job ka offer letter: CTC 8 LPA hai toh haath mein kitna aayega? Pura breakdown
Har saal yahi scene: fresher ko 8 LPA ka offer aata hai, ghar pe mithai baant di jaati hai, "beta 66 hazar mahina kamayega". Phir pehli salary slip aati hai aur 52 hazar dikhte hain. Dekho bhai, CTC aur in-hand do alag duniya hain. Aaj pura hisaab samjhata hoon. CTC kya hota hai CTC = Cost To Company. Matlab company tum pe saal mein kitna kharch karti hai. Isme woh paisa bhi hai jo kabhi tumhare bank account mein…
- 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.
- as someone 4 months into a £9k bootcamp... the structure and the cohort is what I'm paying for, not the content. but yeah the content is basically this 😅
please how do i fix my react timer, it stays at 1 😭
good evening everyone 🙏🏾 i'm building a pomodoro timer for my portfolio. the seconds go from 0 to 1 and then it just stays at 1 forever. no error in the console. i just came across something called "stale closure" but i don't understand it. here is my code: import { useEffect, useState } from 'react' function Timer() { const [seconds, setSeconds] = useState(0) useEffect(() => { const id = setInterval(() => {…
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
- 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.
- 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
IWDG vs WWDG on STM32: which one you actually use in production, and how do you feed it?
Discussion in our team this week, I want outside opinions. Today: IWDG only, ~100 ms timeout, kicked from a low priority FreeRTOS task. Colleague says this is useless, because a stuck high priority task will block the low priority one and we reset, fine, but a runaway loop that still lets the kicking task run will never reset. He wants WWDG with a window, so kicking too early also resets. Constraints: motor control…
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.
- Ha! Kindly also add the one person on a call shouting "can you hear me now". Every Nairobi space has one
- watched this like 3 times for a thm room lol. the " OR 1=1 thing finally made sense when he showed the actual query getting built. on my own vm obviously
Bir veda yemeği daha / Another goodbye dinner (the fifth this year)
Dün akşam bir veda yemeği daha vardı. Bu yıl beşinci. Ekipten Can, Amsterdam'a gidiyor. Kadıköy'de her zamanki meyhanede oturduk, rakı, meze, ve herkes aynı soruyu sordu: "Sen ne zaman gidiyorsun Elif?" (For the English readers: last night was another goodbye dinner. The fifth this year. Can from my team is moving to Amsterdam. We sat in our usual meyhane in Kadıköy, rakı, meze, and everyone asked the same question:…
- 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.
- please is 76 tabs okay?? half of them are react docs and the other half are job applications 🙏🏾
- One. Then I close it. Regards.
Mock interview breakdown: she solved it and still got "no hire". Here is the scorecard.
Kunal and I have been doing free mock interviews on weekends this month. One of them taught me more than the others, so with the candidate's permission (and details changed) here is the full breakdown. She solved the problem. Her code was correct. In a real loop she would have got a "lean no hire". Let us see why. The question type A merge intervals variant. Medium difficulty. Nothing exotic. Minute by minute 0-3:…
- 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.