In 30+ years of programming, vast majority of bugs I've fixed were diagnosed with a few strategically placed print statements.
"I just print values. When I’m developing a program I do tremendous amount of printing. And by the time I take out, or comment out the prints it really is pretty solid. I rarely have to go back." — Ken Thompson in the book Coders at Work by Peter Seibel
It works a lot of the time (but not always, not great for debugging locks on stdout, for example). If you only have time to learn one debugging technique, this is the one to learn.
I too have suffered from depression. The work of Dr. David Burns have proven to be most helpful to me! I'd suggest checking out his website feelinggood.com or his new book "Feeling Great" - he also has a podcast. FWIW, Dr. Burns is not some kind of "self-help charlatan" He is a Stanford MD/Psychiatrist with decades of experience treating depression. Best wishes!
A few years ago I fell and broke my elbow. It was a mess and had to have emergency surgery to put it all back together. After surgery I'm sent home with a "ball" around my neck that is a reservoir for some pain meds that are being fed into my body via a catheter that was threaded into a vein in my neck. So I am sitting on my recliner a few hours after the surgery , awake but groggy. Anesthesiologist calls me on my cell phone to check in on me. So the pain med ball has a valve on it calibrated from 1 to 10. It's on like 9. He asks me how the pain level is. I say "no pain". He say's "great, what's the setting our your valve" I say 9. He says "whoa! you need to turn that down! At that level it will be used up in about 10 hours and you need it last for at least 48 hours" I say "okay." He then hangs up. So being a groggy engineer, I think "okay, I will dial it down to like 2 and then as pain arrives adjust up to needed level" So I turn it down to 2. About 45 minutes later I am in the most excruciating pain I have ever experienced. Think teeth clenching. Sweating. Tears. I immediately turn the dial up to 10. The pain lasted for 2 hours. I'm an atheist, but let me tell you I was coming to Jesus in those two hours. Once the pain subsided, I call him back. He says "Oh yeah, you should have slowly backed down on the dial." Upside is that I have a lot of empathy for folks who say they are in pain. Seriously, if that pain had continued I would have taken anything, Heroin, whatever!!!
It's amazing what doctors don't think to explain. Like, buddy, I know you've seen this a million times before, but trust me this is the first time I've ever done this...
I have a different story of pain medication gone awry.
My wife had surgery and there was a hydromporphone pump where she could press a button. The button was then blocked for eight minutes. She didn't understand the system. Then I realized that it had two different beeps, one if the pump delivered a bolus and the different one if the pump was blocked. My wife and I we are both Deaf so we just didn't know. I requested then the pump turned around so she could have a look at the GUI of the pump.
But my wife already lost her confidence, refused to press the button and a few hours later the hospital removed that contraption completely and switched to a different regimen.
Slightly funny story similar to yours: we were having our 2nd kid and my wife was given no2 gas as a painkiller. I got to be in charge of the dial that controlled the no2/oxygen mix. We started at, like, 40% no2 but then she said she was in pain so I dialled it up to 60%. She was still in pain after half an hour so I increased to 80%. 30 mins later she was in a lot of pain and I noted you could actually set it to 100% no2, but didn't understand how she'd get any oxygen at that setting. I should probably have figured it out at that point, but was pretty sleep-deprived. I asked a nurse why the no2 wasn't working and she said "why, you're almost on 80% oxygen now!"
Kind of similar? I've woken up under NO2/Desflurane 2 times in my life and another time had NO2 just didn't seem to have much effect. After the first time I've made it a point to tell the anthesoilogists of my previous experience but with no personal record it just keeps recurring.
Litocane seems to metabolize or otherwise fade in effect faster in me too than what most dentists expect but at least they listen.
It could be if you're binary searching the range of 2 to 9 maybe, or -5 to 9.
But if not, you're right it's not exactly binary search, it's interpolation search, which is like binary search it just uses a different midpoint finding algorithm.
I'd talk to a doctor or two. I posted above about a friend diagnosed with stage 3 at 45 who passed on at 49. She too had a family history (aunt, uncle, grandmother)
Prepping for the colonoscopy is worse than the procedure itself. Get a good doctor, the risks are low but not 0 and, of course, you can google up the worst outcomes. A dear neighbor was diagnosed with stage 3 colon cancer at 45 years old and departed us at 49.
Thank you sir for your generosity! My wife teaches second grade in a lower income bay area school district, she's rocking a 2012 macbook pro :-( Let's put it this way, the fan is always on what with Zoom, multiple chrome tabs with google classroom and other apps, and an old ipad mini feeding quicktime to serve as a poor man's document camera.
Please send me a mail at hackernews@lamb-chop.co.uk and I'll hook your wife up with something more powerful. I've still got 20 laptops or so to distribute.
My wife is a 2d grade teacher. She brought home her lumens ladybug that she used with her Promethean board in the classroom. However, the lag was terrible, her 2012 macbook pro just couldn't handle it. Our solution was to re-purpose an old ipad along with reflector teacher https://www.airsquirrels.com/reflector/teacher ($17.99). Yeah, just in case you're curious - my wife teaches for a SF Bay Area school district where I suppose they can afford lots of stuff except a refresh of eight year old laptops.
I think this has to be some attempt to "test" the guy to see how he would respond to a company policy that is not only wrong but could have serious legal consequences.
Countries with nukes and 2M+ man armies? Besides, too much is at stake by our corporate overlords to put military action or sanctions on the table. Sadly, Hong Kongers need to steel themselves for some tough struggle sessions.
Airplanes are so expensive and non survivable these days that IMO the next war will be a massive air battle with whoever loses unable to replenish and therefore forced to surrender or be picked apart from the air or escalate. America currently has 10x the aircraft China has and the logistics to back them up (China is catching up). A 2m man army will likely be irrelevant except for fighting regionally, if their enemy has air superiority they will not be very effective.
Looking from a defense perspective. Won't an anti aircraft system be effective here? It is cheaper to build an anti aircraft system that can be deployed everywhere vs the aircraft itself.
Yes this is one line of thinking. However integrated air defence systems (IADS) have not shown themselves to be effective so far.
We've only really seen Russian systems in action and they've mostly failed, however it's very easy to argue this is due to poor training. One notable (alleged) engagement in Syria involved a Russian operated s400 battery (the latest and greatest) attempting to shoot down some of the 70+ tomahawks trump launched. Whilst some didn't make it to their targets there's no evidence the s400 hit them rather than them operationally failing. It's unlikely anyone would be better trained than the Russian military itself so if this indeed did happen it is damning for currently fielded IADS's.
Another reason for the apparent ineffectiveness of IADS's could be the west's proficiency at dealing with them:
Jets like the EA-18 growler are designed purely to entice systems to reveal their position (switching on their radar) so another jet can launch an anti-radiation air to ground missile (AGM) at it.
It's very likely the B2, f35 and f22 can't even be targeted by any IADS due to their low radar cross section.
Stand off weapons give the ability to destroy targets without being inside the range of any IADS. These could be used to strike important targets before the IADS is down or to pick the IADS apart itself (if you know where its assets are).
Given all this information I still can't say an anti aircraft system wouldn't be effective.. but I think the fact China is investing heavily into its air force implies that they have the same concerns about IADS effectiveness that I do.
Thank you for the reply. I found it interesting. I was under the impression that anti aircraft missile is very advanced that it basically can just tail any aircraft there is, but it's not that simple.
In 30+ years of programming, vast majority of bugs I've fixed were diagnosed with a few strategically placed print statements.
"I just print values. When I’m developing a program I do tremendous amount of printing. And by the time I take out, or comment out the prints it really is pretty solid. I rarely have to go back." — Ken Thompson in the book Coders at Work by Peter Seibel