I had email address X (gmail) that I hadn't logged into for a long time. One day I tried to log in to it. Correct password, but Google, for some reason, simply decided there's something suspicious about my login and blocked it. X had Y as the "recovery email", and I had access to Y, and I indeed received an email from Google sent to Y that it blocked a suspicious login to X. However, THERE WAS NO WAY TO USE Y TO GAIN ACCESS TO X. Google simply did not offer that option for X, and I had no idea why.
I am looking into using Git for my photos/videos backup external HDDs and the reasoning is simple. It's not about keeping track of changes within the files themselves since like you said, they (almost) never change. Rather, it's about keeping track of changes in _folders_. That is, I want to keep track of when I last copied images from my phones, cameras, etc. to my HDDs, which folders did I touch, if I reorganized existing files into a different folder structure then what are the changes, etc. Also it acts as a rollback mechanism if I ever fat finger and delete something accidentally. I wonder if there's a better tool for this though
Then I think some syncing software like rsync will probably be better. Now sure how often you keep changing archived folders. I split that work TRASH like dirs and archives. When I done w/ files, I move them out of TRASH do proper place and that it. I prefer KISS aproach, but whatever works for you :)
I needed an implementation of debounce in Java recently and was surprised to find out that there's no existing decent solution - there's none from the standard library, nor popular utilities libraries like Guava or Apache Commons. There are some implementations floating around like on Stackoverflow but I found them lacking, either there's no thread safety or there's no flexibility in supporting the execution of the task at the leading edge or trailing edge or both. Anyone has a good recommendation on a good implementation?
Maybe searching for throttling return more relevant results? For that there are multiple libraries (e.g. resiliance4j), but you can easily write one yourself as well with a ring buffer.
DJI drones are nowhere near "bad", they're the best and nothing else comes close. It's a shame how they're sanctioned given there's no viable alternative. I always wonder why there's no Western company that has the same product offerings.
DJI drones are the industry standard because they are very good and typically cost significantly less than non Chinese manufactured drones. I can't currently substantiate this claim with data, but I would be shocked if less than 80% of commercial drone flights in America used DJI. I think the actual number is going to be in the 90%+ range.
There is one American company making comparable products, https://www.anzurobotics.com/. If I understand correctly, these are basically DJI hardware with American software. I don't know if they use DJI control boards or manufacturer their own but their FAQ does mention they license tech from DJI.
I guess this is only partially true, as I have a A-to-C charger cable from Huawei that works with everything except my Pixel 4A phone. And my Pixel 4A phone works with everything except that specific cable.
USB A->C cables are supposed to have a Rp pullup on CC1, and leave CC2 disconnected. Huawei made some A->C cables which (incorrectly, and spec-violatingly) have Rp pullups on both CC lines, which is how you signal you're a power sourcing Debug Accessory
Your Pixel 4A is entering debug accessory mode (DebugAccessory.SNK state in the USB-C port state machine); other devices probably don't support debug accessory mode and just shrug.
Maybe the cable is missing the CC pin resistors (all USB-A to C cables are supposed to have them to identify themselves as such), and maybe only the phone cares.
For this first implementation, I don't see anything ever added to the queue. Am I missing something? New task is added to the queue if the queue is not empty only, but when the queue is empty the task is executed and the queue remains empty so in the end the queue is always empty?
Another thing is that the article emphasized that it's single threaded. That by itself guarantees that there will only ever be 1 inflight request, since calling the send() function will block until the request completes, and the callback is called.
If there is some kind of cooperative multitasking going on, then it should be noted in the pseudo code with eg. async/await or equivalent keywords. As the code is, send() never gives back control to the calling code, until it completely finishes.
it is too abstract to say for sure, but send might just block until the request is handled off to the next layer (for example succesfully written to the OS network socket buffer), so unless the server carefully closes its recv window until it is done handling the request[1] , no, I wouldn't expect send to block until the server is done handling the request.
[1] i.e. backpressure, which would actually be the ideal way for the server to implement whatever rate limiting it wants, but we are assuming here that the server has a less than ideal interface.
Yeah that confused me at first too. They seem to be treating send() as if it has the same behavior as a setTimeout() call. If you think of it that way, it starts to make sense.
You're absolutely right - the naive implementation has a logical flaw where the queue would always remain empty since tasks are only added when the queue is non-empty, creating a catch-22 situation where the queue can never grow.
I think Wall Street would love to know the secret formula that can detect fraud and insider trading by analyzing trade volume in real-time that apparently hundreds of people in this very forum all seem to be aware of.
I'm surprised if they would let the trades go through at all once they know the secret.
Troubleshooting sleep is an exercise wrapped in pain.
Figuring out which program prevents sleeping is the easy part - there are tools that show that, and you can also usually just brute force it by killing programs one by one.
Then comes figuring out why a system claims to be sleeping but isn't (e.g. the fan is still spinning). Usually this is because of the Modern Standby/S0 crap and in many cases there isn't a solution because the BIOS removed support for S3.
The other class of issue is after sleeping the system won't wake up, or wake up randomly, or wake up with random glitchy graphics/sounds/etc.
As a long-time Linux user, it's also a pretty damn buggy area of Linux, although I have been much more fortunate with getting hardware that works decently enough with sleep on Linux over the years than some people have.
The main benefit of Linux, though, even though it's pretty clear it doesn't have the best support for suspend/resume, is that it won't yield the resume function against you to force you to run Windows Update and yeet all of the stuff you've been working on overnight or light your bag on fire. You'll still have to get hardware that works well, but that's it. And.. and hope the AMD driver doesn't break suspend again. I actually do like running Linux, even if it might be hard to tell sometimes :)
As a long-time laptop Linux user, I'd say that "suspend to RAM" is adequate lately, and booting from scratch is paradoxically often faster than restoring from sleep, even on an NVMe.
Since Windows 8 as well, you're pretty much doing something wrong if it takes more than a few seconds to cold boot whenever you actually are going to use the PC.
Nothing saves more energy than turning it all the way off, this used to be a no-brainer. Sure makes laptop batteries last years longer.
Plus the failure to perfect partially-powered states over the decades doesn't have to have an impact.
> Usually this is because of the Modern Standby/S0 crap and in many cases there isn't a solution because the BIOS removed support for S3.
Also, modern windows won't let you select S3 sleep if it detects support for S0. There used to be a simple registry edits you could do but Microsoft seem to have closed that loophole.
I chose my current laptop because in the BIOS it has a sleep setting, and if you pick the oddly named "Linux sleep" it disables S0 sleep. Thereby allowing S3 sleep in Windows.
This is after having a previous laptop act like a heater to my lunch in my bag, or being dead despite being full charged after waking up overnight and running hard till the battery ran out. Or perhaps the most obnoxious, my wife closing her laptop with a video running and at 3am her laptop bringing itself to life waking us up.
> There used to be a simple registry edits you could do but Microsoft seem to have closed that loophole.
Why? I mean, what incentive does MS have to say "people are still trying to use the non-buggy sleep that doesn't cause fires, let's close the loophole to force using the buggy sleep"?
Probably because "Switching between S3 and Modern Standby cannot be done by changing a setting in the BIOS. Switching the power model is not supported in Windows without a complete OS re-install."
The main motivation for Modern Standby was to enable instant wakeup and push notification-like functionality during standby, like smartphones. That’s not possible with the traditional sleep modes. Unfortunately it doesn’t work as seamlessly as one would like.
What if I don't want push notifications and want laptop closed to mean to not do anything? Does this new mode still support that, or is the notifications and heat-up-in-your-backpack thing there on purpose and not disablable? In other words, is this new thing forcing this new behavior only, or does it also support the same things as S3 if you choose to want that?
Note that I use Linux and a less-than-a-year-old thinkpad that has traditional standby, but I'd like to know what the inevitable that's coming is
The non-buggy sleep (S3) isn't even supported in the BIOS in many new laptops now (in the Dell I'm using for example). So MS probably decided to kill that option off for everyone. To be honest it's a very confusing situation since there are so many hardware configurations under Windows and if you search online I think some people are still able to disable S0 on their new laptop/latest Windows, but some (myself) definitely cannot.
I’ve had ongoing problems with my new laptop either not sleeping properly or waking up randomly in my backpack and toasting itself until it shuts down with a critical overtemp error. My solution is to set the power button to hibernate, and just press the power button if I expect it to be in my bag for more than 15 minutes.
The most annoying crap with modern sleep is that it doesn't lock the computer, only after some time has elapsed in sleep. I want the computer be locked immediately. Also Keepass cannot hook the sleep event, and lock the database. This is a security nightmare for me, really inconvenient.
Other is that the slightest mouse movement wakes the computer. Disabling wake devices does not work anymore. Guides say disable it in your bios. If there is a configuration option... I don't have (neither on a Lenovo, nor on a Beelink) such option. (Yes, I did the powercfg -wake-armed/device manager rain-dance, to no avail, it worked reliably to configure wake sources on S3)
S3 sleep was good enough for me, and S0 is a large step back in reliability and usability, for no perceived benefit.
Unfortunately my newer machine does not support S3 anymore.
With MS copying all the bad ideas from MacOS it is getting ever worse, slowly Windows (being my get stuff done desktop) becoming as unusable my Mac. (ps. I'm was a long time, 10+ years, Linux desktop user, but constant flux of the platform made me move away)
The Macs (at least the Apple Silicon ones) do it much better, though. In most cases I can see minimal battery loss even over days. Whereas the Windows laptops are good for maybe a few hours on sleep. Whatever Apple is doing is miles apart from Windows/PC in terms of implementation even if they are theoretically the same.
However, the "trick" to disabling mouse wake-up for me has been to go into Device Manager and disallow the individual mouse from waking the machine up. It's annoying because I'd still like to have it wake up on button press but it extends the battery significantly. Even on desktop, it's useful to keep the system asleep and not spinning up the hard drive and waking the monitor pointlessly in the middle of the night.
Unfortunately having disabled all devices as wake sources does not help in my case (actually a HP and a Dell machine are also affected in the household). It doesn't matter if I click through the device manager or the powercfg (they are equivalent). S0 is disappointing for me so far.
My Mac (M1 Air) does this a bit better indeed, but I hear colleagues also cursing it for heating up in the backpack, and such (M2 CPU). Still I think most of the copied stuff made windows worse (lots of UI/UX stepbacks also).
The impact is minor. SSDs are super durable nowadays and Hibernating for years won't really make a difference. The SSDs will outlive the need for a bigger disk anyway. But technically I agree.
> The other class of issue is after sleeping the system won't wake up
The last company where we used Windows, we'd all walk around from conference room to conference room carrying our laptops opened up, because nobody was sure they would work again without a hard reboot if you closed the lid.
Did anyone try the setting for "when laptop lid closes" set to "do nothing"? I've always used that on a half dozen Windows laptops over the years and never seen it not work. Even if sleep is finicky, that will just make it stay fully running. If you want it to sleep, do that separately from the start menu or whatever, don't tie the sleep state to the lid state.
I’ve never had an issue finding the source. I usually run powercfg /lastwake in an admin terminal, then follow up with Event Viewer. Most recently, it was HP Print Scan Doctor waking the computer during the night.
My PC if put to sleep will completely randomly just wake up in the middle of the night. Its infuriatingly annoying to figure out why/which app is causing it as its not easily reproducible
sigh Yeah, I'm just battling with the fact that Win11 just won't sleep anymore after I updated the wifi card to a new one. It *claims* to sleep in sleep study, but the power indicator doesn't go out, the disk activity doesn't stop and the battery trains in couple of hours.
Try booting in admin safe mode, looking in Device Manager, Show Hidden Devices, and manually uninstall the phantom old wifi device that's not really there any more.
No guarantees but that's what I would do before expecting great progress otherwise.
The theory is that Windows is lying awake at night wondering if their old familiar accomplice is going to ever be seen again or not ;)
Somewhat unrelated but I believe the dupe issue with node_modules is the main reason to use pnpn instead of npm - pnpm just uses a single global package repo on your machine and creates links inside node_modules as needed.