Month: August 2011

  • Followup to the Integer toggle code

    My good friend Greg mentioned that I should use bitwise operators to perform a toggle, as opposed to my earlier method of using integer math to manipulate the state.  I had not done that because the bitwise implementation is imho not comprehensible by a developer who does not have a CS degree. As an example it is not…

  • Using an integer to implement a binary toggle switch in Java

    We were talking about a way to use an integer to indicate teh state of a series of switches.  e.g. if there were 5 switches and the first 3 were on we would say think of that as 11100, or 28 Not a bad method — you can very quickly toggle switches on and off…