This file contains hidden or 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
#include <iostream> | |
#include <string> | |
#include <vector> | |
#include <algorithm> | |
using namespace std; | |
//global constants | |
const char X = 'X'; | |
const char O = 'O'; |
This file contains hidden or 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
#include <iostream> | |
#include <windows.h> | |
int Modulus(int iN, int iMod) { | |
int iQ = (iN/iMod); | |
return iN - (iQ*iMod); | |
} | |
char GetChar(int iGenerator, char cBase, int iRange) { | |
return (cBase + Modulus(iGenerator, iRange)); |
This file contains hidden or 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
#include <stdio.h> | |
#include <windows.h> | |
#define MAX_ARRAY_SIZE 7 | |
#define BAD_NUMERAL -1 | |
void ConvertRToD(); | |
int GetVal( char Letter, char RomanNum[], int DecNum[] ); | |
int main ( ) { |
This file contains hidden or 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
from __future__ import with_statement | |
import threading | |
import sys | |
# Implementation of Ticker class | |
class Ticker(threading.Thread): | |
def __init__(self, msg): | |
threading.Thread.__init__(self) | |
self.msg = msg |
This file contains hidden or 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/env python | |
from __future__ import with_statement | |
import threading | |
import time | |
import sys | |
# Implementation of Ticker class |
This file contains hidden or 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/python | |
from time import time | |
mark = 0 | |
def tic(): | |
global mark | |
mark = time() |
This file contains hidden or 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/env python | |
def fizzbuzz(): | |
for x in xrange(1, 100): | |
if x % 5 == 0 and x % 3 == 0: | |
print "FizzBuzz" | |
elif x % 3 == 0: | |
print "Fizz" | |
elif x % 5 == 0: | |
print "Buzz" |
This file contains hidden or 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/env python | |
import socket | |
import time | |
HOST="" | |
PORT="" | |
TIMEOUT=1.0 | |
while True: |
This file contains hidden or 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/env python | |
import random | |
#Merge Sort Worst Case: O(n*Log(n)) | |
def merge(left, right): | |
result = [] | |
i ,j = 0, 0 | |
while i < len(left) and j < len(right): | |
if left[i] <= right[j]: | |
result.append(left[i]) |
This file contains hidden or 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/var/env python | |
import sys | |
def convert_To_18(id): | |
#check valid input | |
if id is None: | |
return id | |
if len(id) < 15: | |
print "not a valid 15 digit ID" | |
return |
OlderNewer