Skip to content

Instantly share code, notes, and snippets.

View banderson623's full-sized avatar

Brian Anderson banderson623

  • Gain Compliance
  • Rocklin, CA
View GitHub Profile
Knuth's
-------
FUNDAMENTAL ALGORITHMS
The Art of Computer Programming,
========================================================================
The process of preparing a program for a digital computer is especially
attractive, not only because it can be economically and scientifically
rewarding, but also because it can be an aesthetic experience much like
Brian Anderson
Assignment 9 - Com S 352
April 4, 2012
[NOTE --> PLEASE USED A FIXED WIDTH FONT TO READ THIS DOCUMENT]
1. (25pts) Given five memory partitions of 100 KB, 500 KB, 200 KB, 300 KB, and 600 KB (in order
from low-end to high-end of user memory space), how would the first-fit, best- fit, and
worst-fit algorithms place processes of 212 KB, 417 KB, 112 KB, and 426 KB (in the arriving order)?
<!DOCTYPE html>
<html>
<head>
<title>Canvas Plotting Test</title>
<style>
canvas { border:1px solid black;}
</style>
</head>
<body>
<canvas id="sample" width="600" height="300"></canvas>
Brian Anderson
ComS 352 - Assignment 10
4/17/2013
-------------------------
1: In the long run, what is the maximum acceptable page-fault rate in
order to achieve an effective access time of no more than 200 nanoseconds?
physical frames = 256
page fault time = 4ms (no write to main)
@banderson623
banderson623 / Assignment-11-anderson.txt
Last active December 16, 2015 16:19
My homework for ComS 352, Extra assignment 11
Brian Anderson
Com S 352 - Assignment 11
April 25, 2013
=====================================================================================
1. If we are currently at logical block 8 (i.e., the last block accessed was
block 8) and want to access logical block 4, how many physical blocks
must be read from the disk?
Block Size: 1024 bytes.
@banderson623
banderson623 / Bingo.rb
Created May 31, 2013 13:59
Original Bingo.rb script
require 'rubygems'
BASE_PATH = "/not/important/anymore/"
# Hash to store all the words found
OPTIMIZER = {}
# Can pass in a path to a file, if not it will use
# a file foud at BASE_PATH/bingo_words.txt
if ARGV[0].is_a?(String)
puts "Reading from #{ARGV[0]}"
@banderson623
banderson623 / pipedThreadPool.c
Created June 12, 2013 22:17
Using POSIX pipes and pthreads to make a basic threadPool in C. Its rough, proof of concept for a more efficient game of life in C, using threads.
//
// You will need to use -lpthreads in your make command
// 'cc pipedThreadPool.c -lpthreads -o test'
//
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
@banderson623
banderson623 / _shell_command.sh
Last active December 18, 2015 23:19
Oh crap! Many zero sized files after copying from remote server, over vpn, through virtual machine to my iMac :( Command line + ruby to the rescue!
find . -type f -size 0 > bad_files.txt
@banderson623
banderson623 / search_hack.rb
Last active December 20, 2015 10:58
Same rails search
module ActiveRecord
class Base
# Just hack this in, since I don't have AR 4.0 installed
def self.where(*attrs)
puts attrs.inspect
end
def self.table_name
"erics_models"
end
@banderson623
banderson623 / oscillate.html
Created August 9, 2013 04:53
Silly little visual oscillator written in javascript. I even wrote some primitive easing code.
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
<head>
<title>Test</title>
</head>
<body>
<canvas id="canvaz" width="400" height="400" />
</body>
<script type="text/javascript" charset="utf-8">