Propositions: Fundamental units of information. You can assert/deny, agree/disagree, believe/not believe
- ~A is true only when A is false
- A & B is true, only when both A and B are true
Dependent variable = y what we predict | |
Independent variable = x's. What we use to predict y. | |
Baseline Prediction: We take the average of all y in the training set and predict that no matter what x is input into the model. | |
One variable linear regression: | |
y_i = B_0 + B_1 * x_i + e_i | |
y_i = i'th independent variable | |
B_0 = intercept term (the value of y when x is 0) |
import java.util.Map; | |
import java.util.HashMap; | |
public class BitBoolean { | |
//Holds boolean data as bits | |
//Each byte can hold 8 boolean values | |
//So index = booleanDataIndex + booleanMappingIndex | |
//booleanDataIndex = index/8 | |
//boleanMappingIndex, see booleanMapping variable |
# Syntax: All in one line or by escape characters | |
# [ <some expression to be evaluated and put in another list> | |
# for <some iterating variable in the list> | |
# in <some list> | |
# if <some condition holds true> | |
# ] | |
mylist = [10,20,30,40,50,60,70,80,90,100] | |
# create a new list containing variables in the list divided by 10 |
# Really cool algorithm I learnt from a blog somewhere | |
# Also sometimes called russian's peasents algorithm | |
def fast_multiply(a,b): | |
z=0; | |
while a > 0: | |
if a % 2 == 1: | |
z = z + b | |
a = a >> 1 | |
b = b << 1 |
import java.util.LinkedList; | |
/** | |
* @author thiru | |
* | |
*/ | |
public class SecondLargest { | |
private class TreeNode { | |
int item; |
# Simple script to figure out whether a site is up or not | |
TOOL_SITE="http://www.isup.me/" | |
if [ $# -ne 1 ] | |
then | |
echo "Incorrect arguments specified" | |
exit 1 | |
fi |
// This is the MongoDB tutorial from http://try.mongodb.org | |
// Get started with `help` | |
// To try out an interactive tutorial type `tutorial` | |
// This shell is a (limited) javascript interpreter, so any commands you are familiar from javascript should work here. Try out: | |
var a = 5; | |
a * 10; | |
for(i=0; i<10; i++) { print('hello'); }; | |
// You can move onto the next step anytime by typing `next` |
"""""""""""""""""" | |
" PACKAGES START " | |
"""""""""""""""""" | |
set nocompatible | |
call plug#begin('~/.vim/plugged') | |
" Start adding Vundle plugins from here | |
" Package manager itself |
#include <stdio.h> | |
void max2(int a, int b, int c) { | |
int first, second; | |
printf("a = %d, b = %d, c = %d\n", a, b, c); | |
if (a > b) { | |
second = a; | |
if (a > c) { | |
first = a; | |
if (b > c) { |