Skip to content

Instantly share code, notes, and snippets.

View feltnerm's full-sized avatar

Mark Feltner feltnerm

View GitHub Profile
@feltnerm
feltnerm / SomeHaskell.hs
Created December 18, 2012 17:37
Some Haskell problems that I did for fun
{--
-
- @author: Mark Feltner
-
- **Haskell**
-
- Haskell is a nice language. I enjoyed it better than F# for functional
- programming.
- From my limited perspective, it seems that Haskell would operate best
- in a highly theoretical or mathematical environment; not the environment
@feltnerm
feltnerm / mp6.ada
Created December 8, 2012 01:43
Ada program that supports adding and subtracting arbitrary-sized integers - "Bignum"s in Ruby. The program will read two numbers and print the result of adding and subtracting them. The numbers can be positive or negative. The implementation uses linked lists.
pragma License (Gpl);
-- BigIntegers - Package Specification
--
-- Package to define operations on BigIntegers
-- ###########################################################################
with Ada.Text_IO; use Ada.Text_IO;
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
package BigIntegers is
@feltnerm
feltnerm / dungeon.rb
Created December 8, 2012 01:43
Psuedo-Interactive Fiction Interpreter. Done via recursive descent.
#!/usr/local/bin/ruby
#
# dungeon.rb: dungeon state + operations to add/remove objs, open doors, etc.
# - Each object is represented as a simple string, and the intent is that
# each object would be in just one location.
#
# This file contains unit test code; to run it, type
# ruby dungeon.rb
# @author: Rob Hasker
@feltnerm
feltnerm / Roman_Converter.ada
Created December 8, 2012 01:40
a simple Roman number calculator. It is to read a Roman number, an operator (+, -, /, or *), and a second Roman number. It then shows the calculation using Arabic numbers and prints the result as a Roman number.
pragma License (Gpl);
-- ROMAN CONVERTER
-- This package provides two functions: one to convert an
-- integer to its Roman Numeral equivalent, and another to convert
-- a Roman Numeral (consisting of M,D,C,L,X,V,I) to its
-- integer equivalent.
---------------------------------------------------------------------
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
package RomanConverter is
@feltnerm
feltnerm / Roman_Converter.rb
Created December 8, 2012 01:40
a simple Roman number calculator. It is to read a Roman number, an operator (+, -, /, or *), and a second Roman number. It then shows the calculation using Arabic numbers and prints the result as a Roman number.
#!/usr/bin/env ruby
# AUTHOR: Mark Feltner
OPERANDS = {
"I" => 1,
"V" => 5,
"X" => 10,
"L" => 50,
"C" => 100,
@feltnerm
feltnerm / WebServer.java
Created October 10, 2012 17:25
Webserver for CS3830
import java.io.*;
import java.net.*;
import java.util.*;
/**
* Primitive HTTP Web Server
* @author Mark Feltner
*
*/
@feltnerm
feltnerm / csv2readability.py
Created April 11, 2012 04:15
CSV to Readability
#!/usr/bin/env python
""" Upload a CSV file (like what Instapaper exports *hint* *hint*)\
to Readability. """
import os.path
import csv
import readability
READABILITY_KEY = ''
@feltnerm
feltnerm / audinf
Created April 19, 2011 05:51
display simple tracklist info about a directory of mp3s
#!/usr/bin/env python
"""
audinf.py
Displays simple track info about a list of mp3s
"""
import sys
import os
from mutagen.easyid3 import EasyID3 as eid3
@feltnerm
feltnerm / the_fing_weather
Created April 19, 2011 05:51
Tell me the f*ckin weather!
#!/usr/local/bin/python
# -*- coding: utf-8 -*-
'''
Created on Jul 16, 2010
@author: mark
'''
import sys, string, pprint
from datetime import datetime
from thefuckingweather import LocationError, get_weather, DEGREE_SYMBOL
@feltnerm
feltnerm / motivator
Created April 19, 2011 05:49
simple motivational quotes on your console.
#!/usr/bin/env python
# Every hour:
# 1. Open quotes or goals based on the one opened least frequently
# a. Return random line from file
# b. display file
import time
import random
def get_line(lines):