Skip to content

Instantly share code, notes, and snippets.

View imphasing's full-sized avatar

I'm phasing imphasing

  • Flower Mound, TX
View GitHub Profile

Keybase proof

I hereby claim:

  • I am imphasing on github.
  • I am imphasing (https://keybase.io/imphasing) on keybase.
  • I have a public key whose fingerprint is DF77 5FEB 7017 F7F1 4561 41E9 E407 7C80 308B 47E4

To claim this, I am signing this object:

# Markov chain text generator.
# This is a test comment.
start_text = File.read(ARGV[0])
text_chars = start_text.split(//)
stats = {}
text_chars.each_with_index do |letter, index|
current_pair = [letter, text_chars[index+1], text_chars[index+2]].join
if text_chars[index+3] != nil
<?php
// Make a preliminary n-gram to n-gram map to translate with
function make_translate_map()
{
$four_grams = array(
"ouve" => "a",
"them" => "dem",
"then" => "den",
"done" => "dun",
namespace MahBalls
{
using System;
using System.Data.Common;
using MySql.Data.MySqlClient;
using System.Collections.Generic;
public class DataManager : IDisposable
{
private bool disposed = false;
void sort(int *list, int size)
{
int i = 0;
for (i = 0; i < size; i++) {
int current_elem = list[i];
int z = 0;
for (z = i + 1; z < size; z++) {
if (current_elem > list[z]) {
int swapped = list[z];
@imphasing
imphasing / lunar-phase.go
Created May 17, 2012 19:20
Lunar phase calculator in Go
package main
import (
"time"
"fmt"
"math"
)
func main() {
knownNew, _ := time.Parse("2006-01-02 15:04", "1999-08-11 00:00")
+[,+[-[>+>+<<-]>[<+>-]+>>++++++++[<-------->-]<-[<[-]>>>+[<+<+>>-]<[>+<-]<[<++>
>>+[<+<->>-]<[>+<-]]>[<]<]>>[-]<<<[[-]<[>>+>+<<<-]>>[<<+>>-]>>++++++++[<-------
->-]<->>++++[<++++++++>-]<-<[>>>+<<[>+>[-]<<-]>[<+>-]>[<<<<<+>>>>++++[<++++++++
>-]>-]<<-<-]>[<<<<[-]>>>>[<<<<->>>>-]]<<++++[<<++++++++>>-]<<-[>>+>+<<<-]>>[<<+
>>-]+>>+++++[<----->-]<-[<[-]>>>+[<+<->>-]<[>+<-]<[<++>>>+[<+<+>>-]<[>+<-]]>[<]
<]>>[-]<<<[[-]<<[>>+>+<<<-]>>[<<+>>-]+>------------[<[-]>>>+[<+<->>-]<[>+<-]<[<
++>>>+[<+<+>>-]<[>+<-]]>[<]<]>>[-]<<<<<------------->>[[-]+++++[<<+++++>>-]<<+>
>]<[>++++[<<++++++++>>-]<-]>]<[-]++++++++[<++++++++>-]<+>]<.[-]+>>+<]>[[-]<]<]
@imphasing
imphasing / HashTable.cs
Created March 30, 2012 14:57
HashTable
using System;
using System.Collections.Generic;
namespace HashTable
{
class HashTable<TKey, TValue>
{
private int count;
private int size;
private List<KeyValuePair<TKey, TValue>>[] values;
@imphasing
imphasing / ConsistentHash.cs
Created March 26, 2012 16:54
ConsistentHash
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
/*
* Example Usage:
*
* List<string> urls = new List<string> { "/img/something.jpg", "/img/nothing.jpg", "/static/res.html", "/script/test.js" };
def get_suffixes(str)
suffixes = Array.new(str.length) {|i| str[str.length - 1 - i, i + 1]}
end