This file contains hidden or 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
public AbstractStringBuilder append(boolean b) { | |
if (b) { | |
ensureCapacityInternal(count + 4); | |
value[count++] = 't'; | |
value[count++] = 'r'; | |
value[count++] = 'u'; | |
value[count++] = 'e'; | |
} else { | |
ensureCapacityInternal(count + 5); | |
value[count++] = 'f'; |
This file contains hidden or 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
<?php | |
// Show all information, defaults to INFO_ALL | |
phpinfo(); | |
?> |
This file contains hidden or 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
#!/usr/bin/python | |
import sys | |
import mmap | |
import os | |
if (len(sys.argv) > 1): | |
STAT_FILE=sys.argv[1] | |
print STAT_FILE | |
else: |
This file contains hidden or 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
""" | |
Empirical proof for Khan Academy birthday problem http://www.khanacademy.org/video/birthday-probability-problem | |
I still don't understand why the calculation is using permutations so I decided to verify it is correct. | |
I too was having trouble convincing myself that this is the correct answer, so I wrote a python program that would randomly build a class of 30 students and check if some have colliding birth days. | |
What the code does is building this 30 people class again and again and then calculating in how many of the classes 2 or more students has the same birth day. | |
The final probability calculation is: <People with colliding birth days> / <Total number of sampled classes> | |
This file contains hidden or 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
<?xml version="1.0" encoding="UTF-8"?> | |
<classpath> | |
<classpathentry kind="src" path="src/main/java"/> | |
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> | |
<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/> | |
<classpathentry kind="output" path="target/classes"/> | |
</classpath> |
NewerOlder