Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View maximveksler's full-sized avatar
Wow

Maxim Veksler maximveksler

Wow
  • Tel Aviv, Israel
  • 13:48 (UTC +03:00)
  • X @mvxlr
View GitHub Profile
@maximveksler
maximveksler / .classpath
Created February 16, 2011 08:57
Trying to debug the problems with my code and ThreadSafeClientConnManager
<?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>
"""
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>
#!/usr/bin/python
import sys
import mmap
import os
if (len(sys.argv) > 1):
STAT_FILE=sys.argv[1]
print STAT_FILE
else:
<?php
// Show all information, defaults to INFO_ALL
phpinfo();
?>
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';
Prelude> :{
Prelude| let abs x
Prelude| | x < 0 = 0 - x
Prelude| | otherwise = x
Prelude| :}
<interactive>:59:5: parse error (possibly incorrect indentation)
2222
222222
22 22
2 222
222
222
222
22222222
22222222
@maximveksler
maximveksler / Lecture 1. Class Logistics, Overview of iOS, MVC, Objective-C.txt
Last active January 4, 2016 12:09
Captions for Stanford CS193p Developing Applications for iOS Fall 2013-14, Lecture 1. Class Logistics, Overview of iOS, MVC, Objective-C. For more info visit http://maximveksler.github.io/CS193p/
00:00 [ Music ]
00:05 >> Stanford University.
00:09 >> Alright, so welcome to Stanford CS193p, fall of 2013-14 academic year.
00:14 This is our very first lecture and we are going to be covering developing applications for iOS, so specifically iOS7.
00:22 Today's lecture kind of has a first part and a second part.
00:26 The first part is a little bit of logistics.
00:28 The second part is I'm going to dive right into the course material because there's a lot to cover and so, we need to start covering it.
00:36 [Pause] So, what will I learn in this course?
00:38 I think you know what you're going to learn in this course.
00:40 You're going to learn how to build cool apps, okay?
@maximveksler
maximveksler / Lecture 2. Xcode 5.txt
Last active January 4, 2016 12:19
Captions for Stanford CS193p Developing Applications for iOS Fall 2013-14, Lecture 2. Xcode 5. For more info visit http://maximveksler.github.io/CS193p/
00:05 >> Stanford University.
00:11 >> Paul Hegarty: Okay.
00:11 Well, welcome to lecture number two of CS 193P for fall of 2013/2014 academic year.
00:20 And today we're going to have some slides at the beginning, little more talking, and then I'm going to have quite a big demo that's going to try and hopefully synthesize all the things I've been talking about on the slides for the first two lectures, which is that we're going to start building our card game.
00:36 Okay. This card matching game is going to be our substrate for the first two weeks of learning some Objective-C, learning about Xcode, learning about how iOS hooks up the controller, and the view, and the model to make a UI.
00:52 So if you remember from last time, we did this card thing that -- we did the entire card.
00:58 It was a very simple class.
01:00 Got a couple of properties -- three properties there -- and one method.
01:04 And that's pretty much it.
01:05 And so today we're going to go on and do another class, which is a deck, okay?
@maximveksler
maximveksler / Lecture 3. Objective-C.txt
Created January 25, 2014 18:09
Captions for Stanford CS193p Developing Applications for iOS Fall 2013-14, Lecture 3. Objective-C. For more info visit http://maximveksler.github.io/CS193p/
00:00 = [ Music ]
00:05 >> Stanford University.
00:07 >> Okay, well welcome to Lecture number 3 of CS193p for fall of 2013/14.
00:14 Today I'm going to jump right into a demo and then after that I have some slides, time permitting, assuming the demo doesn't take [pause] the whole time here, and after, the demo I'm going to do is I'm going to take the little card thing we did last week and turn it into a real card matching game where we're actually matching cards, okay, rather than just flipping them over.
00:37 And, like I say, if I have the time I'll talk a little bit more about objective-C and we're really going to go into objective-C on Wednesday in quite a bit of detail.
00:46 I also included on the stuff I posted some review slides at the end just kind of reviewing what we will have learned in the first three lectures, just so you can kind of look through it real quick and say oh yeah, do I know that?
00:56 Yeah I do, and if not, than you can obviously post and ask us questions about it.
01:02 Okay? So,