This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
# Dear jruby, | |
# | |
# May you never have woes about rounding numbers again. | |
# | |
# Sincerely, | |
# Me | |
# Constants |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
use IO::Socket; | |
use LWP::UserAgent; | |
my ($msn_username, $msn_password) = ('xjessicaxfieryx@hotmail.com', ''); | |
my ($msn_server, $msn_port) = ('messenger.hotmail.com', 1863); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
use googlescraper; | |
open TOPICS, "topics.txt"; | |
my @topics = <TOPICS>; | |
close TOPICS; | |
my @urls; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
use IO::Socket; | |
use LWP::UserAgent; | |
use LWP::Simple; | |
my (%_PROGRAM, %_SETTINGS, %_SYSTEM, %_DUMMY); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Usage: ruby score_subreddit.rb <list of subreddits> | |
# | |
# Computes the Flesch-Kincaid grade level of the last 25 comments of the given subreddits. | |
# | |
# For example: | |
# > ruby score_subreddit.rb science worldnews funny | |
# science: 8.33 | |
# worldnews: 9.71 | |
# funny: 5.32 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template<class T> | |
Quaternion<T>::Quaternion() | |
{ | |
T buffer[C_SIZE] = {0,0,0,0}; | |
memcpy( m_values, buffer, (sizeof(T)*C_SIZE) ); | |
} | |
template<class T> | |
Quaternion<T>::Quaternion( const T a, const T b, const T c, const T d ) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
# randinfo.pl | |
# by Drusepth 10/05/2007 | |
# Purpose: | |
# When using random numbers in programs, sometimes you want them to be | |
# actually random. But other times, (for example, if you were coding a | |
# lottery machine) you would want to know the probability a user would | |
# hit a jackpot (three consecutive 7s). This program calculates the |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vector<int> digitPermutationsOf(int n) { | |
vector<int> permutations; | |
// Convert integer to char array of digits | |
char digits[16]; // Max 16 digits allowed for ints | |
int size = sprintf(digits, "%d", n); | |
// Iterate through the digit array and save each permutation | |
std::sort(digits, digits + size); | |
do { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
require 'cinch' # IRC framework | |
require 'marky_markov' # Markov chains | |
# Create persistent markov dictionary to read from | |
markov = MarkyMarkov::Dictionary.new('thunked', 3) | |
# Create IRC bot to feed data into markov dictionary | |
bot = Cinch::Bot.new do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Generation 1 | |
Alice: 0.5 | |
Bob: 0.5 | |
Generation 2 | |
Alice: 0.9136221749087309 | |
Bob: 0.9048452243325479 | |
Generation 3 | |
Alice: 0.7525407199758025 | |
Bob: 0.7001147600768378 | |
Generation 4 |