January 25, 2017
MIPS | CMPUT 229 (Winter 2017) – Homewor

CMPUT 229 (Winter 2017) – Homework #1 Instructor: Karim Ali
Question 1: (5 points)
Consider that a processor architecture ToyProc, which was initially designed as big- endian, is changed to use little-endian byte ordering. Assuming the subset of the MIPS ISA that you are familiar with, and assuming a memory with a word-level interface, give examples of instructions whose operations will be affected by such a change in endianness.
Question 2: (5 points)
Write the C code that best corresponds to the following MIPS assembly code. Assume that registers $s1, $s2, and $s3 store the values of 32-bit integers x, y, and z.
L1: beq $s1, $zero, L2
addu $s1, $s1, $s2
addu $s1, $s1, $s3
L2:
Question 3: (15 points)
For this question, assume that:
• p, q, i, j are 32-bit integers whose values are stored in $s0, $s1, $s2, and $s3, respectively.
• A and B are arrays of integers.
• r is a pointer declared as int *r.
• r, the base address of array A, and the base address of array B are all in the stack frame of the current function, as shown below
For each of the C statements below, give the translation into MIPS. Do not use pseudo- instructions in your code. Clearly label which MIPS instructions are for which statement.
a. (5 points) q = *r
b. (5 points) B[i] = A[j]
c. (5 points) p = q + A[B[j]] Question 4: (15 points)
Write the assembly code to implement the following C function:
int selector(int array[], int i) {
return array[array[i]];
}

December 13, 2016
Machine Learning | 代写 | CSE 491: Introduction to Machine Learning (Fall 2016)

CSE 491: Introduction to Machine Learning (Fall 2016)
Exam 3 Take Home, Due: 11:30AM on Dec 14, 2016
• The exam should be completed independently and discussions of any type are NOT allowed.
• A PDF version should be electronically submitted to D2L Dropbox with the file name
LastName_FirstName_CSE491EXAM3.pdf
1. (20 points) Support Vector Machines. Given two data points x1 = (1, 0)T , y1 = −1, and x2 = (3, 0)T , y2 = 1.
(a) Compute the optimal w and b in support vector machine by solving the primal formu- lation given as follows:
min 1wTw w,b 2
subject to yi(wT xi + b) ≥ 1, ∀i.
(b) Compute the optimal α in the dual formulation of support vector machine.
(c) Compute the optimal w based on the optimal α obtained from the dual formulation of support vector machine and compare with the results in (a).

October 6, 2015
Socket Programming

CSEE 4119: Computer Networks, Fall 2015
Programming Assignment 1: Socket Programming
Due October 8th
Academic Honesty Policy
You are permitted and encouraged to help each other through Piazza’s web board. This only
means that you can discuss and understand concepts learnt in class. However, you may NOT
share source code or hard copies of source code. Refrain from sharing any material that could
cause your source code to APPEAR TO BE similar to another student’s source code enrolled
in this or previous years. Refrain from getting any code off the Internet. Cheating will be
dealt with severely. Cheaters will be penalized. Source code should be yours and yours only.
Do not cheat.
1. Introduction
In this assignment, starting from the simplest chat functionalities, you will develop more
comprehensive servers for messaging applications, including elementary security features and
current state of the chatroom.
This will require that various processes in different machines
are able to work with each other, and recuperate in case of asynchronous messaging and
failure. This chat program is based on a client server model consisting of one chat server and
multiple chat clients over TCP connections. The server is mainly used to authenticate the chat
clients and direct the chat messages to one another. Besides, the server also has to support
certain commands that the clients can use. Detailed specifications of the functionalities are
given under Section 2.
2. Specifications