Earlier quoted context omitted.
there's a convenient npm package to handle that for you
And a separate package by the same prolific author for not_on that depends on the first package.
How to programmatically find out if computer is on
111–120 of 197 posts
Re: How to programmatically find out if computer is on
#112Although many people are laughing, I believe the function works ok. The only complicated part is to find a way to call it when the computer is not on.
So perhaps a biocomputer of sorts could be offline and return undefined behavior by spec. Guess we'll keep looking for that perfect OS code.
Re: How to programmatically find out if computer is on
#113> is_computer_on() How does this relate to computer being in Halt state, which is quite valid state for servers (there could be even a dedicated Halt button)? Technically computer hardware is ON. I remember that in such state it shows a "carrot" prompt (>>>) from the SRE console. By the way, there is also HCF instruction (Halt and Catch Fire). https://en.wikipedia.org/wiki/Halt_and_Catch_Fire_(computing...
(The platform is Alpha, right? Given the prompt and name for the console, though it was SRM, not SRE) :)
Re: How to programmatically find out if computer is on
#114I'm curious if there's any significance in number 0.63739 in this implementation double is_computer_on_fire(void) { return 0.63739; } https://github.com/haiku/haiku/blob/8f16317a5b6db5c672f33181...
Re: How to programmatically find out if computer is on
#115http://www.ismycomputeron.com
Re: How to programmatically find out if computer is on
#116Earlier quoted context omitted.
There's an elegant FP solution that involves searching an infinite data structure using only a finite amount of computation -- actually, with precisely zero computation, because the machine isn't on. It's like lazy evaluation, only more lazy.
Wait. When the machine isn't on, P=NP! So our security systems are (useless | perfect)! I think there might even be other implications...
Re: How to programmatically find out if computer is on
#117I'm curious if there's any significance in number 0.63739 in this implementation double is_computer_on_fire(void) { return 0.63739; } https://github.com/haiku/haiku/blob/8f16317a5b6db5c672f33181...
Re: How to programmatically find out if computer is on
#118Re: How to programmatically find out if computer is on
#119> is_computer_on() How does this relate to computer being in Halt state, which is quite valid state for servers (there could be even a dedicated Halt button)? Technically computer hardware is ON. I remember that in such state it shows a "carrot" prompt (>>>) from the SRE console. By the way, there is also HCF instruction (Halt and Catch Fire). https://en.wikipedia.org/wiki/Halt_and_Catch_Fire_(computing...
> By the way, there is also HCF instruction (Halt and Catch Fire). I was somewhat recently scarred for life by this instruction, having just discovered that if you execute HCF on the MIPS-based integrated circuits in Stationeers, the simulated IC... explodes in your face.
Re: How to programmatically find out if computer is on
#120Where does the code run when the computer is off? Edit: I see the downvotes, yet i still don't know if it's a joke. I was genuinely asking the question.
Genuine answer: the code cant run when the computer is off, thus the joke. The question is worth asking (all are) but then soliciting "quantum computing" as an answer makes it a doubly worthy set up line, so thanks twice.