Skip to content

Instantly share code, notes, and snippets.

@shade34321
shade34321 / Reader.java
Created September 3, 2017 05:02
Reentrant lock excercise
public class Reader implements Runnable {
private data_buffer<Integer> buffer;
public Reader(data_buffer<Integer> buffer) {
this.buffer = buffer;
}
@Override
public void run() {
try {
drizzt:proj_05 shade$ g++ -o partone partone.cpp
partone.cpp:223:2: error: no matching function for call to 'sort'
sort(holes.begin(), holes.end(), compareBestFit);
^~~~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/algorithm:3957:1: note: candidate template ignored: couldn't infer template argument '_Compare'
sort(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp)
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/algorithm:3996:1: note: candidate template ignored: couldn't infer template argument '_Compare'
sort(__wrap_iter<_Tp*> __first, __wrap_iter<_Tp*> __last, _Compare __comp)
^
@shade34321
shade34321 / project4a.cpp
Last active August 29, 2015 14:03
Project 4
// CS3243 Operating Systems
// Summer 2014
// Project 4: Process Synchronization
// Duncan Thomas and Shade Alabsa
// Date: 23 June 2014
// File: partone.cpp
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
// CS3243 Operating Systems
// Summer 2014
// Project 3: Forks and Threads
// Matthew Tinney and Shade Alabsa
// Date: 10 June 2014
// File: partthree.cpp
#include <stdlib.h>
#include <string.h>
#include <iostream>
parttwo.cpp:47:34: error: invalid operands to binary expression ('basic_ostream<char, std::__1::char_traits<char> >' and 'data')
cout << "Hit on return back: " << returnThreads[i] << endl;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/ostream:195:20: note: candidate function not viable: no known conversion from 'data' to 'const void *' for 1st argument; take the address of the argument with &
basic_ostream& operator<<(const void* __p);
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/ostream:179:20: note: candidate function not viable: no known conversion from 'data' to 'std::__1::basic_ostream<char> &(*)(std::__1::basic_ostream<char> &)' for 1st argument
basic_ostream& operator<<(basic_ostream& (*__pf)(basic_ostream&));
^
/Applications/Xcode.app/Contents/Developer/Toolchains
// CS3243 Operating Systems
// Summer 2014
// Project 3: Forks and Threads
// Matthew Tinney and Shade Alabsa
// Date: 10 June 2014
// File: parttwo.cpp
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
@shade34321
shade34321 / openstack_install_steps
Last active August 29, 2015 14:01
Openstack Failure
Paritions:
root@khazid:/home/shade34321#df -h
Filesystem Size Used Avail Use% Mount on
/dev/sda1 28G 1.4G 25G 6% / #ext4
none 4.0K 0 4.0K 0% /sys/fs/cgroup
udev 991M 4.0K 991M 1% /dev
tmpfs 201M 404K 200M 1% /run
none 5.0M 0 5.0M 0% /run/lock
none 1001M 0 1001M 0% /run/shm
none 100M 0 100M 0% /run/user
We can't make this file beautiful and searchable because it's too large.
History Date,Customer Type,Consumption
1/3/2011,COMM,1
1/3/2011,COMM,14
1/3/2011,COMM,1
1/3/2011,COMM,3
1/3/2011,COMM,1
1/3/2011,COMM,11
1/3/2011,COMM,16
1/3/2011,COMM,80
1/3/2011,COMM,18
@shade34321
shade34321 / Error.txt
Last active December 16, 2015 12:49
Restaurant Simulator
Ld /Users/shade/Library/Developer/Xcode/DerivedData/ResSim-fvkhqxhiupiizxgffxqgoxgolsmv/Build/Products/Debug/ResSim normal x86_64
cd /Users/shade/Dropbox/School/Gwinnett_Tech/CIST_2362/final/ResSim
setenv MACOSX_DEPLOYMENT_TARGET 10.8
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk -L/Users/shade/Library/Developer/Xcode/DerivedData/ResSim-fvkhqxhiupiizxgffxqgoxgolsmv/Build/Products/Debug -F/Users/shade/Library/Developer/Xcode/DerivedData/ResSim-fvkhqxhiupiizxgffxqgoxgolsmv/Build/Products/Debug -filelist /Users/shade/Library/Developer/Xcode/DerivedData/ResSim-fvkhqxhiupiizxgffxqgoxgolsmv/Build/Intermediates/ResSim.build/Debug/ResSim.build/Objects-normal/x86_64/ResSim.LinkFileList -mmacosx-version-min=10.8 -stdlib=libstdc++ -o /Users/shade/Library/Developer/Xcode/DerivedData/ResSim-fvkhqxhiupiizxgffxqgoxgolsmv/Build/Products/Debug/Re
@shade34321
shade34321 / ExceptionHandling.java
Last active December 15, 2015 13:39
Write a program with the following requirements: 1. ask the user to enter an integer. Then display what the user entered back on the screen if the user entered an integer ("you entered ..."). If the user enter something other than an integer then display on the screen a message that says "you did not enter an integer". 2. next, the program asks …
import java.io.*;
import java.text.SimpleDateFormat;
import java.util.*;
import java.lang.SecurityException;
public class ExceptionHandling{
private Scanner input;
public ExceptionHandling(){
input = new Scanner(System.in); //so we can take in the users input