Skip to content

Instantly share code, notes, and snippets.

View PJensen's full-sized avatar

Pete Jensen PJensen

  • New England
View GitHub Profile
@PJensen
PJensen / Collatz.rb
Created November 2, 2010 13:56
Collatz Sequence Generator and Max Sequence Finder
##
# The following is the a Collatze sequence generator built in Ruby; not the
# greated implementation but it gets the job done.
#
# @Author: PJensen
# @Version: October, 2010
#
##
# The following iterative sequence is defined for the set of positive integers:
#
@PJensen
PJensen / graph.c
Created January 19, 2011 16:06
Header file for graph.c
/*
** Filename: graph.c
**
** Copyright (C) 2001, Pete J. Jensen All Rights Reserved
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
@PJensen
PJensen / Scruit.py
Created July 7, 2011 16:46
The Scruit compiler.
import os, sys, string, random
COMPILER_ERRORS = """
Cannot have multiple default property/method in a Class
Cannot use parentheses when calling a Sub
Class initialize or terminate do not have arguments
'Default' specification can only be on Property Get
'Default' specification must also specify 'Public'
Expected '('
Expected ')'
@PJensen
PJensen / a.nasm
Created July 26, 2011 21:45
joelgompert.com OS tutorial
mov ax, 0x07C0 ; set up segments
mov ds, ax
mov es, ax
mov si, welcome
call print_string
loop:
mov al, 0x13
@PJensen
PJensen / sym.c
Created August 17, 2011 21:42
symbols
typedef unsigned long ID;
@PJensen
PJensen / ServiceReference.asp
Created October 28, 2011 16:49
Perform basic authentication using classic ASP
<%
'-- ********************************************************************************
'-- Class: ServiceReference
'-- Description: This class is used to make a web service requests.
'--
'-- Remarks:
'--
'-- http://www.soapui.org/ has an *excellent* tool for crafting various web methods
'-- (1) Download and install SOAPui
'--- (2) Create a new project, when prompted for a WSDL enter
@PJensen
PJensen / employment.py
Created March 9, 2012 19:31
Explores the 99w rollover period and it's effect on charts.
import time,random
ROLLOVER_WKS = 99
YEARS = 5
employmentData = []
for i in range(0,YEARS*52):
employmentData.append(random.randint(-100,100))
if (i > ROLLOVER_WKS):
@PJensen
PJensen / IsSubset.cs
Created July 19, 2012 21:04
IsSubset
static bool IsSubset(int[] a, int[] b)
{
var a1 = new List<int>(a);
var b1 = new List<int>(b);
foreach (var k in a1)
{
b1.Remove(k);
}
@PJensen
PJensen / FindDupes.cs
Last active April 8, 2021 17:38
Find duplicate files within directory structure.
//
// Main.cs
//
// Author:
// pjensen <[email protected]>
using System;
using System.Security.Cryptography;
using System.IO;
using System.Collections.Generic;
@PJensen
PJensen / FindDupesByHash.cs
Created August 17, 2012 01:33
Really quick hack to find duplicate files in a directory structure.
//
// FindDupesByHash.cs
//
// Author:
// pjensen <[email protected]>
//
// Description:
// Really quick hack to find duplicate files in a directory structure.
//