Skip to content

Instantly share code, notes, and snippets.

#define _USE_MATH_DEFINES
#define L_TO_CU_FT 28.32
#include <iostream>
#include <math.h>
#include <sstream>
using namespace std;
void getDimensions(double&, double&);
#include <iostream>
using namespace std;
template <class E>
class LinkedList
{
struct Node;
Node* first;
@svenoaks
svenoaks / gist:9148060
Last active August 29, 2015 13:56
A very primitive Java web server
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.net.ServerSocket;
import java.net.Socket;
import java.nio.CharBuffer;
@svenoaks
svenoaks / gist:9432055
Created March 8, 2014 15:14
JavaScript invoking "super" functions
// define the Person Class
function Person(name) {
this.name = name;
this.hasSaidHello = false;
}
Person.prototype.walk = function(){
alert ('I am walking!');
};
Person.prototype.sayHello = function(){
package com.smp.soundtouchandroid;
import android.os.AsyncTask;
import android.util.Log;
import com.smp.soundtouchandroid.*;
import java.io.FileOutputStream;
import java.io.IOException;
public class SoundTouchRecorder
//
// main.cpp
// intui
//
// Created by Steve Myers on 6/28/14.
// Copyright (c) 2014 ___SMP_PRODUCTIONS___. All rights reserved.
//
#include <iostream>
#include <list>
Module Module1
Dim GlobalWord As String
Class PersonType
Public Sub New()
SecretName = "hushhush"
End Sub
Public Property FirstName As String
/* Javascript to emulate media queries with events and HTML class toggling
* to avoid duplication, conflict & waste when implemented via
* native CSS implementation + JS feature dependency.
*
* Depends on jQuery and Cowboy's throttle / debounce plugin:
* https://github.com/cowboy/jquery-throttle-debounce
*/
(function(){
var options = {
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- google's material design colours from
http://www.google.com/design/spec/style/color.html#color-ui-color-palette -->
<!--reds-->
<color name="md_red_50">#fde0dc</color>
<color name="md_red_100">#f9bdbb</color>
<color name="md_red_200">#f69988</color>
@svenoaks
svenoaks / preorder.cpp
Last active August 29, 2015 14:10
preorder traversal using custom function
//
// main.cpp
// preorder
//
// Created by Steve Myers on 11/20/14.
#include <iostream>
#include <array>
#include "binarySearchTree.h"