Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

   // power cycle computer

   bool was_on = set_computer_on(true); // returns prior value

   if (was_on) {
     set_computer_on(false);
     set_computer_on(true);
   } else {
     // was previously off, is now on: nothing to do!
   }


Have you tried turning it off and on again?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: