Skip to content

Instantly share code, notes, and snippets.

@sehe

sehe/frag.java Secret

Forked from rightfold/gist:7ac091aabec55c1f40df
Last active August 29, 2015 14:13
Show Gist options
  • Save sehe/381964b020ae0ebc28a3 to your computer and use it in GitHub Desktop.
Save sehe/381964b020ae0ebc28a3 to your computer and use it in GitHub Desktop.
byte daybits = 0;
if (schedule.isSunday()) daybits |= 0x01;
if (schedule.isMonday()) daybits |= 0x02;
if (schedule.isTuesday()) daybits |= 0x04;
if (schedule.isWednesday()) daybits |= 0x08;
if (schedule.isThursday()) daybits |= 0x10;
if (schedule.isFriday()) daybits |= 0x20;
if (schedule.isSaturday()) daybits |= 0x40;
daybits = (byte) (~daybits & 0x7f); // invert, clearing high bit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment