Linux C/C++ 作业辅导

CSE320 Fall 2015 – Homework 4

CSE320 Fall 2015 – Homework 4
Due Friday 10/30/2015 @ 11:59pm
Introduction
The goal of this assignment is to become f amiliar with low-level Unix/POSIX system calls related to
process and job control, f ile access, and IPC (pipes and redirection). You will write a mini-shell with basic
operations (a small subset of Bash’s f unctionality). Expected length of this C program is 1000-2000
lines of code (not very long, but the code will be challenging, so start early).
Takeaways
Af ter completing this homework you should:
Understand process execution, pipes, and f orks
Enhance your understanding of *nix commands and the command line
Working with existing C libraries and system calls
Enhance your C programming abilities
Working with a partner
You are allowed to have groups of up to two members f or the remaining assignments. If you wish to
have a partner you must email cse320@cs.stonybrook.edu. The email should have the subject:
[CSE320] Group Formation . The contents of the email should contain the f ollowing inf

Linked lists #2

Goals

This assignment extends your work on hw06 with linked lists, but also includes an extra focus on algorithmic complexity. The goals are as follows:

  1. Learn how to keep data separate from containers
  2. Practice designing algorithms and data structures
  3. Practice using code that uses the following:
    1. linked lists
    2. structures for data encapsulation
    3. dynamic memory (i.e., malloc)
    4. struct initializer syntax (C99)
  4. Learn how analyze the complexity of algorithms

Simple TCP like transport layer protocol

CSEE 4119: Computer Networks, Fall 2015
Programming Assignment 2: Simple TCP like transport  layer protocol
Due Friday, November 6 th 11:55 pm
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 programming assignment, you will implement a simplified TCPlike
transport layer
protocol. Your protocol should provide reliable, in order delivery of a stream of bytes. It
should recover from innetwork
packet loss, packet corruption, packet duplication and packet
reorderi

COMP3331/9331 15s2 Assignments (Programming)

COMP3331/9331 15s2 Assignments (Programming)

 

 

Programming Assignment (60 Marks + 5 bonus):

Due Date: 23 October 2015, 11:59 pm, Friday

CSE-version:

Specification can be found here (version 1.1, Last update: 14/10/15).

Setup script for Java can be found here

Setup script for C can be found here

 

Sample Client Server Programs:

This is a sample client server program using TCP that you can download and execute. This will provide you with a working example of a simple application and will be useful when you start developing your assignment. As the name suggests this

C++ basic

For this problem, you will use the rand function (srand, time) to generate a sequence S of k random integers in the range [m, m+1, …, n].

You will need to prompt the user to enter values for k, m, and n in your main function. Implement the MergeSort sorting technique as follows:

– Make a function called get_random that returns a random integer in the range [m, m+1, …, n]

int get_random(int m, int n)

Race Condition Vulnerability Lab

Race Condition Vulnerability Lab

Lab Overview The learning objective of this lab is for students to gain the first-hand experience on the race-condition vulnerability by putting what they have learned about the vulnerability from class into actions. A race condition occurs when multiple processes access and manipulate the same data concurrently, and the outcome of the execution depends on the particular order in which the access takes place. If a privileged program has a race-condition vulnerability, attackers can run a parallel process to “race” against the privileged program, with an intention to change the behaviors of the program. In this lab, students will be given a program with a race-condition vulnerability; their task is to develop a scheme to exploit the vulnerability and gain the root privilege. In addition to the attacks, students will be guided to walk through several protection schemes that can be used to counter the race-condition attacks. Students need to eva

c++ programm assignments

This project is the main assessment of this subject. It is worth 40% of your total

assessment. You are required to write a C++ program to solve all problems. All work is

to be completed individually. If parts or all of the source code you submit is not your own

work, you will receive ZERO.

Part 1. Design

This first part is worth 20% of you total assessment. It is consist of 5 tasks. You need to

prepare

• Programming object list

• Algorithm

• C++ Coding

Task1: Miles per Gallon.

A liter is 0.264179 gallons. Write a program that will read in the number of liters of

gasoline consumed by the user’s car and the number of miles traveled by the car, and

will then output the number of miles per gallon the car delivered. You must show the

outputs as given in the example. You must show the numbers in fixed point left justified

and in three decimal places as in the example.

Example

This program read the number of liters of gasoline consumed (gasoline In

Liters) and the number of miles traveled by the ca

ESE 224 minesweep 实现

ESE 224 Spring 2015 Course Project Description

Over the course of this semester, you learn various coding concepts in C++ that are applicable to programming in general. This class project is designed to show you how many of these concepts can be used together in a single application and will test your familiarity with programming these concepts. This project is intended for 2-4 people groups.

We will provide a rigid skeleton guide which you MUST follow, but how to implement components in the skeleton is your decision. This means that any public method signature should not be modified (its return type, name, and parameters). However, you are free to remove, add, or edit any private methods you feel necessary. The private methods are included as a guideline to structuring and organizing your code. The private variables should also not be modified, as much of the public functions rely on these private variables. This means we (i.e

CSCI212 assignment3 solution: shell interpreter implementation

 

CSCI212/MCS9212

Assignment 3 (7.5 marks)

Due 11:59pm Sunday May 17, 2015.

The aim of this assignment is to write a simple shell interpreter demonstrating you knowledge of process

control. In addition to this you will get some experience with file system API’s.

Task One (4.5 marks)

You first task is to write a simple shell interpreter, which executes commands. You shell interpreter should

display a $ prompt and wait for user input.

You shell interpreter is to be a little simplistic, all you can do is execute commands. If a command cannot be

found you should display a suitable error message. When executing a command the shell interpreter should

wait until the command terminates. To implement command execution simply use the function call fork()

and exec(). Note that there are many variations on the exec() function call. To block the shell, you

should use the wait() (or similar) function call.

At the end of this step you should be able to do this:

$ ./foobar

./foobar does not exist.

$ ls

b+ tree implementation

Introduction

In this project, you will implement a B+-tree in which each node contain entries of the form [key, ptr] and some required header information. In the leaf node, ptr is the pointer pointing to the record id of a data record with search key value, and in the non-leaf node(index node), ptr is the pointer pointing to the child node which may be index or leaf node. Since we are not implementing data file layer in this project, we will keep all leaf node pointers NULL. You must implement the full search and insert algorithms as discussed in class. In particular, your insert routine must be capable of dealing with overflows (at any level of the tree) by splitting pages. Keys should be stored in sorted order. Deletes will be handled by simply deleting the key and pushing the remaining keys in the node. You do not need to implement merging of nodes on deletes. But, you do need to keep all nodes updated without any holes when records are deleted(i.e, when you delete a key