Skip to content

Instantly share code, notes, and snippets.

<input ng-readonly="true"
id="c{{c.Id}}-date"
name="c{{c.Id}}-date"
uib-datepicker-popup="MM/dd/yyyy"
type="text"
ng-click="openPicker($event, c)"
class="input-element"
ng-model="dateValue"
is-open="datepicker[c.Id]"
ng-init="setDateValue(c.Value)"
/* Practice Problem 1
2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder.
What is the smallest positive number that is evenly divisible by all of the numbers from 1 to 20?
*/
/* answer = 232,792,560 ...this works but is probably not the best way to do it
better answer = finding prime factorization of each num and multiplying to get LCM unclear on math*/
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>BOND</title>
<!-- Bootstrap -->
<link href="css/bootstrap.min.css" rel="stylesheet">
html,
body {
margin:0;
padding:0;
height:100%;
}
body{
background: #CFD6E7;
}
.disabled{
color: #ccc;
}
<!DOCTYPE html>
<html>
<head>
<link href="http://cdn.kendostatic.com/2013.3.1119/styles/kendo.common.min.css" rel="stylesheet" type="text/css" />
<link href="http://cdn.kendostatic.com/2013.3.1119/styles/kendo.rtl.min.css" rel="stylesheet" type="text/css" />
<link href="http://cdn.kendostatic.com/2013.3.1119/styles/kendo.default.min.css" rel="stylesheet" type="text/css" />
<link href="http://cdn.kendostatic.com/2013.3.1119/styles/kendo.dataviz.min.css" rel="stylesheet" type="text/css" />
<link href="http://cdn.kendostatic.com/2013.3.1119/styles/kendo.dataviz.default.min.css" rel="stylesheet" type="text/css" />
<link href="http://cdn.kendostatic.com/2013.3.1119/styles/kendo.mobile.all.min.css" rel="stylesheet" type="text/css" />
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
@saltavenger
saltavenger / checkers
Last active December 13, 2015 23:08
Javascript Checkers
//establish whose turn it is & how many points
var whosTurn = 1;
var redPoint = 0;
var blackPoint = 0;
console.log("Player 1 is red, It's your turn!");
//create board game
function createRow(numCols, className, hasCheckers, checkerColor){
for(var col= 1; col <= numCols; col++){
@saltavenger
saltavenger / botched
Created December 12, 2012 21:47
not working
def simulationWithoutDrug(numViruses, maxPop, maxBirthProb, clearProb,
numTrials):
"""
Run the simulation and plot the graph for problem 3 (no drugs are used,
viruses do not have any drug resistance).
For each of numTrials trial, instantiates a patient, runs a simulation
for 300 timesteps, and plots the average virus population size as a
function of time.
numViruses: number of SimpleVirus to create for patient (an integer)
@saltavenger
saltavenger / grading
Last active October 13, 2015 19:48
probability
import random
def sampleQuizzes():
yes = 0.0
for i in range(10000):
midterm1 = random.randrange(50,81)
midterm2 = random.randrange(60,91)
finalExam = random.randrange(55,96)
finalGrade = midterm1*0.25 + midterm2*0.25 + finalExam*0.50
if finalGrade >= 70 and finalGrade <= 75:
yes += 1.0
@saltavenger
saltavenger / everyone's infected
Last active October 13, 2015 14:18
MIT viruses
class SimpleVirus(object):
"""
Representation of a simple virus (does not model drug effects/resistance).
"""
def __init__(self, maxBirthProb, clearProb):
"""
Initialize a SimpleVirus instance, saves all parameters as attributes
of the instance.
maxBirthProb: Maximum reproduction probability (a float between 0-1)