Live data from Hacker News

Ask HN: What's your "it's not stupid if it works" story?

news.ycombinator.com

461–470 of 510 posts

Re: Ask HN: What's your "it's not stupid if it works" story?

#461
post #111

I had a GCP Cloud Run function that rendered videos. It was fine for one video per request but after that it slowed to a crawl and needed to shut down to clear out whatever was wrong. I assume a memory leak in MoviePy? Spent a couple of days looking at multiple options and trying different things, in the end I just duplicated the service so I had three of them and rotated which one we sent video renders to and do eac…

Hah welcome to cloudrun! I was evaluating it a few years ago to host some internal corporate app. It worked great and was way easier to deploy than k8s setups. However after some testing we found out that the core logic of the app - a long running process, would just crawl to a halt after some time. It turned out google wanted to push you to use their (paid) queue / pubsub solutions, but they didn’t want it to be _to…

that was the whole point of cloud run, which was obvious when you looked at the pricing for it: If an instance is not processing requests, the CPU is not allocated and you're not charged.

Re: Ask HN: What's your "it's not stupid if it works" story?

#462
post #85

Mine's getting command output out of docker. For long builds (I had one that took 4 hours), it was gutting to have it fail a long way in and not be able to see the output of the RUN commands for thorough debugging. So I devised a stupidly simple way: add && echo "asdfasdfsadf" after each RUN command. I mashed the keyboard each time to come up with some nonsense token. That way, docker would see RUN lines as different…

consider --progress plain ?

Re: Ask HN: What's your "it's not stupid if it works" story?

#463
post #223

Earlier quoted context omitted.

>that took about 10 minutes to generate How?

I'm assuming: 1. Generate a list of suburbs names separated by | 2. Simplify the regex: 2.1. Convert to a NFA 2.2. Turn it into a DFA 2.3. Merge redundant states 2.4. Turn it back into a regex

nfa? dfa?

Re: Ask HN: What's your "it's not stupid if it works" story?

#464
I had the wire for my doorbell go bad somehow. I couldn't figure out where the break was. It didn't seem to be near the ends of either of the wire, and it was run through the wall in a part of my house that made replacing it extremely difficult. I could have just put up a cheap wireless doorbell but we had a very nice decorative doorbell button my spouse had bought and she really wanted to keep it.

Eventually I realized there were wireless doorbells that had a button whose circuit board was small enough to go into the hole in the wall for the doorbell button. I found one like that on Amazon, took off the wireless button casing, put the board inside the doorbell hole in the wall, and wired the fancy button onto the board. It works perfect.

Eventually I'll have to replace the batteries, but it is easy to access just removing the button. I'm on the first set of batteries 5+ years in now.

Re: Ask HN: What's your "it's not stupid if it works" story?

#465
This is the weirdest fix I've ever done. I had a Surface Pro 3 that was working fine and then suddenly died and would not power on. I couldn't figure out anything to fix it.

Eventually I read a random post on Reddit[0] how a guy tried putting it his SP3 in the freezer (in a sealed freezer bag) and it eventually came back to life.

I skeptically tried it. I thought freezing was more likely to destroy something else on it, but what did I have to lose? It was already dead.

I put it in a sealed freezer bag with as much air removed as possible, and then put it in the freezer for a couple of hours. I took it out, plugged power in, and I was able to turn it on!

The first time I did it, it only worked for a few days. I tried freezing it again, and that worked. It still works to this day, many years later. My theory is that it seemed like a power problem, and that freezing the battery put the chemistry through some kind of cycle that repaired it.

I did keep the Surface wrapped in layers of towel to warm it back up slowly. Mostly to help prevent any moisture from building up somewhere before it got to temperature.

[0] https://www.reddit.com/r/Surface/comments/5tficj/how_i_reviv...

Re: Ask HN: What's your "it's not stupid if it works" story?

#467
My boss in a gear factory had some code from about 1982 that ran in "Tk!Solver" 1.0 under MS-DOS. He had moved it as far forward as he could, in DOS boxes, until Windows 10 got rid of 16 bit mode. The new version of Tk!Solver was something like $6000, totally unacceptable.

I ended up running the program in MS-DOS, inside VirtualBox. I used MS-DOS to route the "printer" to COM1. Then on the outside, I routed the serial output to a file on the host machine.

He just clicked the shortcut that fired it all off, did the calculations he needed to do, and "printed it", then exited Tk!Solver. The batch file then checked for output, and if it was there, it printed it.

He was happy, and it only took about an hour to get it all working.

Re: Ask HN: What's your "it's not stupid if it works" story?

#468
post #385

Earlier quoted context omitted.

Would love to see that implemented here in USA. People in places like NYC love to catch and spay every cat they see, then go on to complain about too many rodents around.

Rodents are an issue of trash and food left around, not a problem of not enough cats. Cats shit in my garden and leave dead songbirds where I grow food. No, we don’t need more cats.

To be clear, your claims are:

1. An increase in the population of predators will have no effect on the population of the prey.

2. Rats don’t shit and/or aren’t attracted to food.

Are you speaking in jest or do you actually believe those? The fact that your second statement directly contradicts your first doesn’t help.

Re: Ask HN: What's your "it's not stupid if it works" story?

#469
post #236

Earlier quoted context omitted.

That reminds me of my terrible spam prevention hack. We kept getting a bunch of spammers signing up for our newsletters, so I made the form require a JavaScript based hidden input to submit. That worked for a while, but then new spammers started executing the JS and getting through. So I added new JS that just waits 15 seconds before putting the right hidden values in the form, and that’s done the trick (for now).

So CSRF?

Plain CSRF wouldn't help because they're scraping the site and executing the JS. It has to be time delayed CSRF so they give up and submit before it's loaded.

The real solution is to use a CAPTCHA, but they're so user hostile, that's the last resort.

Re: Ask HN: What's your "it's not stupid if it works" story?

#470
post #463

Earlier quoted context omitted.

I'm assuming: 1. Generate a list of suburbs names separated by | 2. Simplify the regex: 2.1. Convert to a NFA 2.2. Turn it into a DFA 2.3. Merge redundant states 2.4. Turn it back into a regex

nfa? dfa?

Nondeterministic finite automaton and deterministic finite automaton. The theory behind state machines.
Post reply on HN