Programming

Free Currency Converter API in Perl

February 10, 2011

Here’s a handy little way to convert currency using the iGoogle Gadget API. It’s free… until they decide they don’t like it. Enjoy! #!/usr/bin/perl -w use strict; use LWP; my $browser = LWP::UserAgent->new; my @currencies = qw( KWD BHD OMR LVL GBP JOD EUR KYD CHF AUD CAD USD BND SGD NZD TND BGN TRY [...]

Read the full article →

Detect Disposable Email Addresses with Perl

December 1, 2010

I have the secret to detecting disposable emails! I’ll give you a hint: it uses Perl. Ok, Perl’s not really the secret ingredient– it’s the list of disposable email domains contained within my code (below). But I needed to make a tool to detect disposable email addresses, and I just happened to use Perl. If [...]

Read the full article →

Making a Fractal in Java’s Console

February 21, 2010

From, Data Structures and Other Objects Using Java, Chapter 8, Project #9, page 440: Examine this pattern of asterisks and blanks and write a recursive method that can generate exactly this pattern: * * * * * * * * * * * * * * * * * * * * * * * [...]

Read the full article →

Simulating a Car Wash in Java

February 21, 2010

From, Data Structures and Other Objects Using Java, Chapter 7, Project #8, page 396: Make improvements to the car was simulation program from Section 7.2. Note: Portions of code taken from Michael Main’s version. WARNING: Cheating is bad, mmmmkay children? Don’t cheat. /* | Bryan Simonson \ CS211 – Craig Niiyama | 2/21/2010 */ // [...]

Read the full article →

Solving the n-Queens Problem in Java

February 21, 2010

From Data Structures and Other Objects Using Java, Chapter 6, Project #10, Page #347: Suppose that you have n queens from a chess game, and that you also have an n-by-n chess board. Is it possible to place all n queens on the board so that no two queens are in the same row, no [...]

Read the full article →

PseudoRandom Number Generation in Java

January 20, 2010

Assignment number 1 in CS211 (Java) programming class. (No stealing! I want full point on my grade!) PseudoRandomDemo.java /* | Bryan Simonson \ CS211 – Craig Niiyama | 1/19/2010 */ package bryansimonson; import bryansimonson.PseudoRandom; /** * @author Bryan Simonson (manticor@gmail.com) */ public class PseudoRandomDemo { /** * The main function generates a table that counts [...]

Read the full article →

C++ Date Class – Manipulate Dates in C++

November 15, 2009

Finally! I did it! Assignment #4 is complete, and I can manipulate dates pretty effing easily now. No doubt there is already some vastly superior date manipulation library already out there… stupid school. Just kidding. I learned a LOT with this assignment. #include <iostream> using namespace std; class Date { private: /* | \ PRIVATE [...]

Read the full article →

Vote Counting Machine: Borda & Plurality

November 5, 2009

This was my version of a C++ assignment to count votes from a text file. It’s not super useful outside the classroom, but I’m posting it anyway. // // Bryan Simonson // Assignment #3 // Vote Counter // #include <fstream> #include <string> #include <iostream> using namespace std; // Function prototypes int MenuSelect(void); void LoadData(char vote[][100], [...]

Read the full article →

C++ Change Dispenser (My First C++ Program)

October 7, 2009

One of these days I’ll actually know how to program c++ pretty well, and when that happens, I plan to write some kickass software. But when that happens, I figured it would be pretty amusing to look back at my very first c++ program (besides the mandatory “Hello World!” app). This was our first assignment [...]

Read the full article →