This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Random; | |
/* | |
If Alice tosses a coin until she sees a head followed by a tail, and Bob tosses a coin until he | |
sees two heads in a row, then on average, Alice will require four tosses while Bob will require | |
six tosses (try this at home!), even though head-tail and head-head have an equal chance of | |
appearing after two coin tosses. | |
https://www.quantamagazine.org/20160313-mathematicians-discover-prime-conspiracy/ | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Works around Android Bug 6191 by catching IllegalArgumentException after | |
* detached from the window. | |
* | |
* @author Eric Burke (eric@squareup.com) | |
*/ | |
public class SafeViewFlipper extends ViewFlipper { | |
public SafeViewFlipper(Context context) { | |
super(context); | |
} |