Skip to content

Instantly share code, notes, and snippets.

View lazypower's full-sized avatar
💭
Bring back independent blogs, rss feeds, and the small web.

Charles "Chuck" Butler lazypower

💭
Bring back independent blogs, rss feeds, and the small web.
View GitHub Profile
@lazypower
lazypower / Lab1.cpp
Created November 27, 2011 12:24
Week8 Labs
// TODO: Augment the hash table so all string characters are used in the hashing process
// Update3: Changed the array to be a three dimensional array which supports 2 slots for hash-data entry
#include <cstdlib>
#include <iostream>
#include <string.h>
using namespace std;
int hash_string(char str_name[]);
// Define a JSON data-structure that will look and perform like the real deal
//What is common to every post? Lets examine the details:
var forumData = { // Defining the object structure
"Posts" : [ // array of Posts
Public Class FishTank
{
// properties of the FishTank
// Create a list object to hold the wildlife in the tank
public List<Fish> TankLife = new List<Fish>();
// Total widlife Capacity for a healthy tank
public int Gallons;
Public Class FishTank
{
// properties of the FishTank
// Create a list object to hold the wildlife in the tank
public List<Fish> TankLife = new List<Fish>();
// Total widlife Capacity for a healthy tank
public int Gallons;
#!/usr/bin/python2.4
import httplib, urllib, sys
# Define the parameters for the POST request and encode them in
# a URL-safe format.
params = urllib.urlencode([
('js_code', open(sys.argv[1], 'r').read()),
('compilation_level', 'WHITESPACE_ONLY'),
@lazypower
lazypower / main.java
Created January 24, 2012 01:11
Lab4.1
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package lab41;
/**
*
* @author charles
@lazypower
lazypower / FacebookController.cs
Created February 11, 2012 05:40
Facebook OAUTH controller for MVC3 projects
using System;
using System.Web.Mvc;
using Newtonsoft.Json.Linq;
using PennyAuction.Models;
using System.Linq;
namespace MyProject.Controllers
{
public class FacebookController : Controller
{
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>[email protected]:~</title>
<link rel="stylesheet" type="text/css" href="css/bootstrap.css" />
<link rel="stylesheet" type="text/css" href="css/dasroot.css" />
</head>
<body>
<a href="http://github.com/chuckbutler"><img style="position: absolute; top: 0; left: 0; border: 0; z-index: 99;" src="https://a248.e.akamai.net/assets.github.com/img/bec6c51521dcc8148146135149fe06a9cc737577/687474703a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f6c6566745f6461726b626c75655f3132313632312e706e67" alt="Fork me on GitHub"></a>
<div id="masthead">
##! /usr/bin/python2.4
import httplib, urllib, sys, os
#Open a file and read the contents.
f = open(sys.argv[1], 'r')
#Read the contents of the file
contents = f.readlines()
@lazypower
lazypower / NoSQLRule.cs
Created February 21, 2012 08:42
CouchDB Wrapper Sample
using System;
using System.Collections.Generic;
using System.Linq;
using Raven.Client;
using Raven.Client.Document;
using UBoundTools.Rules.Models;
namespace Admin.Controllers
{
public class RuleController : Controller