Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am jdeweese1 on github.
  • I am jaroddeweese (https://keybase.io/jaroddeweese) on keybase.
  • I have a public key ASDgNsyqwfJEXBXpUGs8TVDAUs_KnpkeoEyXL7Ihxtf-pwo

To claim this, I am signing this object:

from sklearn.datasets import load_iris, load_boston, load_wine
from sklearn.model_selection import train_test_split
from sklearn.linear_model import LogisticRegression
from sklearn.metrics import classification_report, precision_score, plot_confusion_matrix
x,y = load_iris(return_X_y=True)
x_train, x_test, y_train , y_test = train_test_split(x,y, train_size=.8)
lr = LogisticRegression(max_iter=50, multi_class='ovr')
lr.fit(X=x_train, y=y_train)
passports = [
'eyr:2029 iyr:2013 hcl:#ceb3a1 byr:1939 ecl:blu hgt:163cm pid:660456119',
'hcl:#0f8b2e ecl:grn byr:1975 iyr:2011 eyr:2028 cid:207 hgt:158cm pid:755567813',
'byr:2002 pid:867936514 eyr:2021 iyr:2012 hcl:#18171d ecl:brn cid:293 hgt:177cm',
'hgt:193cm iyr:2010 pid:214278931 ecl:grn byr:1953 eyr:2021 hcl:#733820',
'iyr:2010 eyr:2020 hcl:#866857 byr:1934 pid:022785900 hgt:161cm ecl:oth',
'hgt:166cm hcl:#602927 cid:262 ecl:brn pid:393738288 eyr:2021 byr:1928 iyr:2010',
'ecl:grn hcl:#6b5442 cid:317 byr:2001 eyr:2023 iyr:2016 pid:407685013 hgt:177cm',
'hcl:#86127d ecl:grn pid:113577635 iyr:2018 hgt:180cm eyr:2022 cid:59 byr:1921',
'byr:1984 eyr:2023 iyr:2015 hgt:152cm cid:177 ecl:amb hcl:#fffffd pid:379600323',
passports = ['''eyr:2029 iyr:2013
hcl:#ceb3a1 byr:1939 ecl:blu
hgt:163cm
pid:660456119''',
'''hcl:#0f8b2e ecl:grn
byr:1975 iyr:2011
eyr:2028 cid:207 hgt:158cm
pid:755567813''',
{'name': 'Taylor Flores', 'sex': 'F', 'mail': 'stanleyparsons@gmail.com', 'birthdate': date(2004, 3, 19),'zip_code':66502}
{'name': 'Cathy Rodriguez', 'sex': 'F', 'mail': 'alecjames@hotmail.com', 'birthdate': date(1953, 10, 25),'zip_code':66502}
{'name': 'Melissa Johnson', 'sex': 'F', 'mail': 'christine77@hotmail.com', 'birthdate': date(1979, 12, 7),'zip_code':66502}
{'name': 'Robin Fletcher', 'sex': 'F', 'mail': 'andrew53@hotmail.com', 'birthdate': date(1966, 4, 14),'zip_code':66502}
{'name': 'Joshua Lopez', 'sex': 'M', 'mail': 'griffithmegan@gmail.com', 'birthdate': date(1947, 7, 5),'zip_code':66502}
Retrieving speedtest.net configuration...
Testing from Cox Business (24.248.230.58)...
Retrieving speedtest.net server list...
Selecting best server based on ping...
Hosted by Eagle Broadband Investments, LLC (Abilene, KS) [62.54 km]: 22.919 ms
Testing download speed................................................................................
Download: 54.47 Mbit/s
Testing upload speed................................................................................................
Upload: 27.83 Mbit/s
Share results: http://www.speedtest.net/result/9793330154.png
expected_vars = ["AdjMatrix", "RowSums", "LaplaceGraph", "V", "D", "V2", "pos", "neg", "Social", "DiagSocial", "LaplaceSocial", "order", "P", "SocialOrdered"];
all_defined =1;
for i = 1:length(expected_vars)
test_var = expected_vars(i);
if exist(test_var) == 0
all_defined = 0;
fprintf("%s is not defined\n", test_var);
end
end
expected_vars = ["movies", "users_movies", "users_movies_sort", "index_small", "trial_user", "m", "n", "ratings", "m1", "n1", "eucl", "MinDist", "DistIndex", "closest_user_Dist", "ratings_cent", "trial_user", "pearson", "MaxPearson", "PearsonIndex", "closest_user_Pearson",];
all_defined =1;
for i = 1:length(expected_vars)
test_var = expected_vars(i);
if exist(test_var) == 0
all_defined = 0;
fprintf("%s is not defined\n", test_var);
end
end
Briefly define the following and discuss their major tradeoffs (advantages/costs). What problem are they addressing?
Kernel threads - Threads that are executed on the operating system level. They are more expensive than user level threads, due to overhead, involve more context switching. These are a good choice for processes that block frequently.
Multiprogramming - Allows for more than one task to be happening at a time. Can drasticilly speed up programs, allow for backround tasks. The code and implemenation is substantially more complex, can run into weird bugs (race conditions etc).
Address space - range of addressses that are available for a program to access. Using address space prevents programs from writing over restricted memory, preventing lots of errors. This is also more expensive and requires more overhead to decide which programs get access to memory sectors.
Buffered (asynchronous) I/O - Buffered IO acts as an intermeditary between a program and the medium it is reading/writing to. For insta
# you need to cp ~/cis520/pintos/src/utils/pintos-gdb ~/pintos-goodfile
mkdir cis520
cd cis520
cp /pub/CIS520/pintos.tgz .
mkdir pintos
tar xvzf pintos.tgz -C pintos --strip-components=1
# Begin part 2
cd ~/cis520/pintos/src/threads