Indeed some deep nesting here. You made me remember a quickbasic program I wrote for a class back in early 90s, where I packed the whole program in a single do-loop with about 20 indent levels at it's deepest, and I loved it. But... the prof told me to never do that again :( Anyway, thanks a lot for the flashback :)
Deep nesting always bugs me too. It's so much cleaner and easier to understand (for me anyway) to identify the else case ahead of time and stop processing immediately.
Show HN: Universal Pause Button
51–60 of 174 posts
Re: Show HN: Universal Pause Button
#52Re: Show HN: Universal Pause Button
#53Now if only there was a Universal Skip Button for those games with unskippable credits, intros or cutscenes!
Re: Show HN: Universal Pause Button
#54This is nice! On OSX, processes can be paused and continued too (by name via killall, and by PID via kill): kill -STOP 1234 kill -CONT 1234 killall -STOP -c "Pandora" killall -CONT -c "Pandora" A more nuanced control is to throttle down the CPU, via cputhrottle[1]. If I'm running a CPU-intensive calculation and don't want to bog down the rest of my system I will use it to give me enough cycles for Sublime Text to wor…
Where it gets more interesting is using elaborate checkpoint/restore [1] mechanisms for processes to serialize their state (open fds, watches, IPC, etc.) into an image that can then be overlayed, remotely executed, debugged and so forth.
Re: Show HN: Universal Pause Button
#55Re: Show HN: Universal Pause Button
#56I love this!!! The pause button was incredibly useful when trying to figure out what went wrong with DOS boot sequence. I wonder if it would be possible to include support for it in Linux kernel? Sometimes I would like to read those messages that fly over the screen (no, dmesg is not enough)...
If you want to actually pause the linux kernel you'll have to use something like the magic SysRq: https://en.wikipedia.org/wiki/Magic_SysRq_key
Alternatively you can run the operating system in an emulator like qemu.
Re: Show HN: Universal Pause Button
#57This is nice! On OSX, processes can be paused and continued too (by name via killall, and by PID via kill): kill -STOP 1234 kill -CONT 1234 killall -STOP -c "Pandora" killall -CONT -c "Pandora" A more nuanced control is to throttle down the CPU, via cputhrottle[1]. If I'm running a CPU-intensive calculation and don't want to bog down the rest of my system I will use it to give me enough cycles for Sublime Text to wor…
On debian the program is cpulimit.
Re: Show HN: Universal Pause Button
#58Earlier quoted context omitted.
Magic SysRq-F
Wooow, thanks a lot! I'm going to test it now. Edit: Not working as expected :( Run python script that allocated a couple of gigabytes of RAM effectively causing my machine to freeze. And OOM killer figured out the best thing it can do is this: [2889118.406439] Out of memory: Kill process 11878 (SpotifyHelper) score 302 or sacrifice child [2889118.406442] Killed process 11878 (SpotifyHelper)