Skip to content

Instantly share code, notes, and snippets.

View Yeaseen's full-sized avatar
🥴
Debugging

Yeaseen Yeaseen

🥴
Debugging
View GitHub Profile
@Yeaseen
Yeaseen / address.cc
Last active January 18, 2018 08:49
//
void AddrSpace::loadIntoFreePage(int vpn){
int physicalPageNo=memoryManager->AllocPage();
pageTable[vpn].physicalPage = physicalPageNo;
pageTable[vpn].valid = true;
bzero(&machine -> mainMemory[(pageTable[vpn].physicalPage) * PageSize], PageSize);
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Nov 18 23:42:40 2018
@author: yeaseen
"""
import numpy as np
@Yeaseen
Yeaseen / forward.cpp
Created December 1, 2018 10:20
Forward diff method
//forward differencing method for rendering curve points
int t=20;
double space=0.05;
double fx,fy,f1x,f2x,f3x,f1y,f2y,f3y;
fx=ansMat[3][0];
fy=ansMat[3][1];
f1x= ansMat[0][0]*pow(space,3)+ ansMat[1][0]*pow(space,2)+ansMat[2][0]*space;
f2x=6*ansMat[0][0]*pow(space,3)+ 2*ansMat[1][0]*pow(space,2);
def AdaBoost(funcDcsn, sampleFrames, attList, \
parentFrames,strtdepth, maxdepth,funcClassify,rootClass, K):
Y=sampleFrames.iloc[:,-1].values.tolist().copy()
#print(Y)
N=len(sampleFrames)
w= [1/N] * N
h= []
z= []
#print(w)
for i in range(train.shape[0]):
v=[]
y=[]
inputNeuron = [train[i]]
v.append(inputNeuron)
y.append(inputNeuron)
for r in range(len(layerNeurons) -1):
w=weight[r]
matout=np.matmul(inputNeuron,w)
M = np.mean(train.T, axis=1)
C= M - train
V=np.cov(C.T)
eigenValues, eigenVectors =eig(V)
k=2
idx = eigenValues.argsort()[-k:][::-1]
eigenValues = eigenValues[idx]
eigenVectors = eigenVectors[:,idx]
#include <iostream>
#include <fstream>
#include <cassert>
#include <iomanip>
#include <cmath>
#include <stack>
#include <queue>
#include "bitmap_image.hpp"
using namespace std;
homogeneous_point intersect(homogeneous_point p3,homogeneous_point p2, double z){
homogeneous_point ans;
ans.w=1;
ans.z=z;
ans.x=p2.x + ((p3.x-p2.x)/(p3.z-p2.z))*(z-p2.z);
ans.y=p2.y + ((p3.y-p2.y)/(p3.z-p2.z))*(z-p2.z);
//ans.print();
return ans;
}
!apt-get install -y -qq software-properties-common module-init-tools
!add-apt-repository -y ppa:alessandro-strada/ppa 2>&1 > /dev/null
!apt-get update -qq 2>&1 > /dev/null
!apt-get -y install -qq google-drive-ocamlfuse fuse
from google.colab import auth
from oauth2client.client import GoogleCredentials
#include <iostream>
#include <cmath>
using namespace std;
struct Data{
double key;
double x;
double y;