Skip to content

Instantly share code, notes, and snippets.

View tmathmeyer's full-sized avatar
🤧
Achoo

Ted tmathmeyer

🤧
Achoo
  • Google
  • kirkland
View GitHub Profile
@tmathmeyer
tmathmeyer / gist:5906491
Created July 2, 2013 02:59
lksfjdaghkadjga
public class SudokuData
{
int[][] values = new int[9][9];
public JTextField[][] convertToJTF()
{
//you implement this, it's REALLY easy
}
@tmathmeyer
tmathmeyer / gist:6005040
Last active December 19, 2015 19:18
fast exponentiation (properly tabbed)
#include <iostream>
using namespace std;
long long log_epic(long long a)
{
long temp = a;
int low = 0;
int high = 0;
int shift = 32;
@tmathmeyer
tmathmeyer / gist:6020921
Created July 17, 2013 14:15
super logarithm
long long log_epic(long long a)
{ // takes the log base 2 of a in log(log(a)) time
long temp = a;
int low = 0;
int high = 0;
int shift = 32;
while(shift > 0)
{
while(temp > 0)
{
#include <iostream>
using namespace std;
class BankEvent
{
private:
int time;
public:
int getTime()
{
each.rankings.map(function(each){
return each.rank
}).reduce(+));
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <math.h>
#include <time.h>
#include "bathroom.h"
typedef struct indiv_info
// Ted Meyer
// Bathroom.c
// License: GPL v2
#include "bathroom.h"
#include <stdio.h>
#include <time.h>
#include <pthread.h>
//enum gender =
asmlinkage long receive(pid_t* sender, void* mesg, int* len, bool block)
{
mailbox* my_mail;
message* msg;
my_mail = map_get(current->pid);
if (!my_mail)
{
my_mail = make_mailbox(current -> pid);
pthread_t sysinthread;
pthread_create(&sysinthread, NULL, sysin, NULL);
while(!running)
{
usleep(100000);
}
while(running)
{
@tmathmeyer
tmathmeyer / gist:9718294
Last active August 29, 2015 13:57
floats are so stupid
#include <stdio.h>
#include <stdlib.h>
char* int2bin(unsigned x){
char* res = malloc(32);
int i = 32;
while(i>0){
i--;