Skip to content

Instantly share code, notes, and snippets.

View rebeccapeltz's full-sized avatar

Rebeccca Peltz rebeccapeltz

View GitHub Profile
<link rel="import" href="../core-scaffold/core-scaffold.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<link rel="import" href="../core-menu/core-menu.html">
<link rel="import" href="../core-item/core-item.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-menu/core-submenu.html">
<link rel="import" href="../google-map/google-map.html">
<polymer-element name="my-element">
<link rel="import" href="../cool-clock/cool-clock.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;
height: 100%;
@rebeccapeltz
rebeccapeltz / reverse.js
Created May 29, 2017 16:55
Reverse a string O(N) and O(N/2)
// O(N)
function(str) {
if (str.length < 2) return str;
return str.split('').reverse().join('');
}
// O(N/2)
function(str) {
var buffer = new Buffer(str);
for (var i=0;i< buffer.length/2; i++){
@rebeccapeltz
rebeccapeltz / stack.js
Created May 29, 2017 17:05
Implement a stack by wrapping a JavaScript array.
"use strict";
var Stack = function() {
this._arr = [];
this.top = null;
this.size = this._arr.length;
};
Stack.prototype.push = function(data) {
this._arr[this.size] = data;
this.size += 1;
@rebeccapeltz
rebeccapeltz / trees.js
Created May 29, 2017 17:14
Implementing a Binary Search Tree with utility in JavaScript
'use strict';
//https://gist.github.com/alexhawkins/f993569424789f3be5db
//http: //stackoverflow.com/questions/1331289/javascript-binary-search-tree-implementation
function BinarySearchTree(value) {
this.value = value;
this.left = null;
this.right = null;
}
@rebeccapeltz
rebeccapeltz / genetic_reproduction.js
Created May 29, 2017 17:29
Genetic Algorithm Reproduction transcribed to JavaScript
GA.evolvePopulation = function (generation) {
var newGeneration = new Population(generation.populationSize(), false);
var elitismOffset = 0;
//keep best offsrping from past generation in first position if elitism is enabled
if (GA.elitism) {
newGeneration.saveTour(0, pop.getFittest());
elitismOffset = 1;
}
//choose parent and "mate" - create new offspring from current generation
for (var i = elitismOffset; i < newGeneration.populationSize(); i++) {
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
@rebeccapeltz
rebeccapeltz / webdev_alumni.md
Last active June 29, 2018 00:51 — forked from shawnr/webdev_alumni.md
Web Development Certificate Alumni

Web Development Certificate Alumni

The following individuals have successfully completed the Web Development Certificate at Seattle University. They are listed according to the quarter they completed.

Spring 2018

sstot = sum((credit$R1 - mean(credit$R1))^2)
totsse =0
accuracy = rep(0,nrow(credit))
r2 = 0
#cross validate nfold leave one out
for (i in 1:nrow(credit)){
# print(i)
model.svm = svm(R1 ~ ., data=credit[-i,])
pred.svm = sapply(predict(model.svm,credit[i,]),roundOff)
# print(paste("pred",pred.svm))

Web Development Certificate Alumni

The following individuals have successfully completed the Web Development Certificate at Seattle University. They are listed according to the quarter they completed.

Summer 2018