Skip to content

Instantly share code, notes, and snippets.

View Karlina-Bytes's full-sized avatar

Karlina Beringer Karlina-Bytes

  • San Francisco Bay Area
View GitHub Profile
@Karlina-Bytes
Karlina-Bytes / HashTable.cpp
Created June 2, 2015 02:08
Hash Table Example
//*****************************************************************
// HashTable.cpp
// HashTable
//
// Created by Kar Beringer on June 18, 2014.
//
// This header file contains the Hash Table class definition.
// Hash Table array elements consist of Linked List objects.
//*****************************************************************
@Karlina-Bytes
Karlina-Bytes / approxPi.html
Created March 11, 2015 21:45
A simple web application to demonstrate how to approximate pi using the Monte Carlo Method.
<!--******************************************************************-->
<!-- approxPi.html -->
<!-- @author Karlina Beringer -->
<!-- Demonstrates how to approximate pi using the Monte Carlo method. -->
<!--******************************************************************-->
<!DOCTYPE html>
<html>
<body>
@Karlina-Bytes
Karlina-Bytes / div_example_2.html
Last active August 29, 2015 14:14
An example of how to include CSS with a "class" selector (using a style section).
<!-- myPage.html -->
<html>
<!-- Define style attributes in a style section. -->
<style>
.boxRounder {
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
border-radius: 10px;
background-color: #303030;
@Karlina-Bytes
Karlina-Bytes / div_example.html
Last active August 29, 2015 14:13
An example of how to include CSS with a "class" selector (using a stylesheet).
<!-- myPage.html -->
<html>
<head>
<!-- Include style attributes from a separate CSS file. -->
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<!-- Inject a style attribute with a class selector. -->
@Karlina-Bytes
Karlina-Bytes / style.css
Created January 23, 2015 07:36
An example of a stylesheet attribute.
/** style.css */
.boxRounder {
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
border-radius: 10px;
background-color: #303030;
color: #ff9900;
padding: 1.0em;
}
@Karlina-Bytes
Karlina-Bytes / inline_css.css
Created January 23, 2015 07:26
An example of inline CSS.
<!-- An example of inline CSS. -->
<div style="-webkit-border-radius: 10px;
-moz-border-radius: 10px;
border-radius: 10px;
background-color: #303030;
color: #ff9900;
padding: 1.0em;">
Hello World!
</div>
@Karlina-Bytes
Karlina-Bytes / baseConvert.js
Created October 28, 2014 05:57
JavaScript functions for converting between numerical bases two through sixteen.
/*********************************************************
* Converts to and from any base in the set (2,16).
* Assumes that the digitString and inputBase match.
* @param {String} digitString is a sequence of digits.
* @param {Number} inputBase is in the set (2,16)
* @param {Number} outputBase is in the set (2,16)
* @return {String} result is a string of digits 2-F
********************************************************/
function baseConvert( digitString, inputBase, outputBase ) {
@Karlina-Bytes
Karlina-Bytes / sanityChecks.js
Created October 28, 2014 05:11
JavaScript functions for validating user input for a base converter applet.
/*********************************************************
* Removes space characters from the input string.
* Sets any letters in the input string to uppercase.
* @param {String} inputString
* @return {String} "cleaned up" inputString.
*********************************************************/
function sanitizeInput( inputString ) {
// If the inputString is empty, return an error.
if (!inputString) return "Error";
@Karlina-Bytes
Karlina-Bytes / buttonClick.js
Created October 28, 2014 04:50
A JavaScript function for handling the "button click" in a base converter calculator.
/*********************************************************
* Responds to the "Convert!" button click.
* (This could be thought of as the "main" function).
*
* INPUT: Validate the web form input.
* PROCESSING: Perform the conversions.
* OUTPUT: Display the results on the web page.
********************************************************/
function buttonClick() {
@Karlina-Bytes
Karlina-Bytes / baseConverter.html
Last active August 29, 2015 14:08
A user interface for a numerical base converter.
<!--******************************************************
* BaseConvert.html
* Created by Karlina Beringer
* Updated October 17, 2014
* Converts between multiple numerical bases,
* namely bases two through sixteen.
******************************************************
-->
<!DOCTYPE HTML>
<html>