CSSE2310 Command Line Arguments

stylebar:Vim插件。 状态栏协助CSSE2310的样式标记 样式栏 Vim插件。 状态栏,用于辅助CSSE2310的样式标记。 用法 mark () { vim \ -p $( find ~ /marking/ " $1 " -name ' *.c.styled ' -o -name ' *.h.styled ' ) \ -c " cd ~/marking/ $1 " } mark s1234567 立即下载

CSSE2310 – Semester 2, 2024

Assignment 3

Introduction

The goal of this assignment is to demonstrate your skills and ability in fundamental process management and communication concepts (pipes and signals), and to further develop your C programming skills with a moderately complex program.

You are to create a program (called uqzip) which allows users to compress a file (or set of files) using any one of a set of external compression programs (zip, gzip, xz or bzip2). This will create a .uqz archive file. The program will also allow decompression of the files that it creates.

The assignment will also test your ability to code to a particular programming style. guide, and to use a revision control system appropriately.

Specification

The uqzip program will allow a user to create a .uqz archive file that will hold a compressed file (or files) that can later be extracted from the archive (decompressed) using uqzip. uqzip won’t actually do the compression itself – it will rely on external programs (such as zip, gzip, xz or bzip2 available on moss) to do the compression and will package up the resulting data into a .uqz archive. The .uqz archive file will also store the method of compression used and the filename for each compressed file stored in the archive.

When used for decompression, uqzip will extract each compressed data stream from the .uqz archive file and pipe it to an external decompression program whose output will be saved to a file in the current directory with the original filename. uqzip is to support both sequential and parallel compression and decompression. Sequential processing means files are compressed (or decompressed) one after the other. Parallel processing means files are compressed (or decompressed) in parallel – each using a separate child process of uqzip (or two child processes per file in the case of parallel decompression).

Command Line Arguments

Your uqzip program is to accept command line arguments as follows when doing file compression, i.e. creating a .uqz archive file:

./uqzip [--nozip|--gz|--zip|--xz|--bzip2] [--parallel] [--output outFilename ] filename ...

and as follows when doing decompression (archive extraction):

./uqzip [--parallel] --extract uqz-file

The square brackets ([]) indicate optional arguments or groups of arguments. The pipe symbol (|) indicates a choice. The italics indicate placeholders for user-supplied value arguments. An ellipsis (. . . ) indicates the previous argument can be repeated. Note that the option arguments (those beginning with “--” and their associated value, if any) can be in any order.

When used for compression, uqzip will accept an optional argument specifying the compression method. When none of --bzip2, --gz, --zip, --xz or --nozip are specified then the program is to act as if --nozip is specified – i.e. no compression is used when creating the archive file.

When used for compression, an optional output file name (outFilename ) can be specified by using the --output option argument. If this argument pair is not specified, then the default filename out.uqz is to be used. It can be assumed that (i.e. we will not test a situation when) the outFilename (or default output filename) is given as a filename argument on the command line.

When used for compression, one or more existing filenames to be compressed into the .uqz archive must also be specified after any option arguments. It can be assumed that the first (or only) file name argument does not start with the characters “--”. (If the user wants to specify a file whose name does start with “--” then they should prefix the name with “./”. Any arguments after the first file name are also assumed to be file names, even if they begin with “--”.)

When used for decompression (with the --extract option argument specified), uqzip expects a filename argument to be present (uqz-file , which must be the last argument). This is the name of the .uqz archive file to be decompressed.

If the --parallel option argument is present, then uqzip is to use child processes running in parallel to do the compression or decompression. If this argument is not present, then uqzip will use child processes running sequentially. Full details of the required functionality are provided later in this document.

Some examples of how the program might be run include the following:

./uqzip /usr/dict/share/words

./uqzip --parallel --bzip2 one.txt two.txt three.txt

./uqzip --zip --output lists.uqz --parallel list1 list2 list3 list4 list5 list6

./uqzip --output archive --xz /usr/share/dict/words local/dictionary

./uqzip --extract archive.abc

./uqzip --parallel --extract out.uqz

More details on the expected behaviour of the program are provided later in this document.

Prior to doing anything else, your program must check the command line arguments for validity. If the program receives an invalid command line then it must print the following (two line) message:

Usage: ./uqzip [--nozip|--gz|--zip|--xz|--bzip2] [--parallel] [--output outFilename] filename ...

Or: ./uqzip [--parallel] --extract uqz-file

to standard error (with a newline at the end of each line), and exit with an exit status of 14. Note that the colon (:) symbols on each line are aligned, i.e. three spaces precede “Or:”.

Invalid command lines include (but may not be limited to) any of the following:

• More than one of the option arguments --bzip2, --gz, --zip, --xz, --nozip or --extract is given on the command line

• Any of the option arguments is listed more than once.

• The --output option argument is given but it is not followed by a filename argument

• No filenames are given on the command line.

• --extract is given on the command line along with --output

• --extract is given on the command line along with more than one filename

• An unexpected argument is present.

• Any argument is the empty string.

Checking whether files exist or can be opened is not part of the usage checking (other than checking that filename values are not empty). This is checked after command line validity as described below.

File Checking

Compression

If uqzip is creating an archive file (i.e. --extract is NOT specified on the command line) then it must attempt to open the output file (the given outFilename from the command line, or, if none is present, then the default output filename – out.uqz) for writing. If the file already exists, it must be truncated and overwitten. If the file is unable to be opened for writing then uqzip must print the message:

uqzip: can’t write to file "filename "

to standard error (with a following newline) where filename is replaced by the name of the file that could not be opened for writing. uqzip must then exit with status 17.

The files to be compressed are not checked for existence.

Decompression

If --extract is specified on the command line and uqzip is unable to open the given archive filename (uqz-file argument) for reading, then your program must print the message:

uqzip: unable to read from file "filename "

to standard error (with a following newline) where filename is replaced by the name of the .uqz archive file from the command line. The double quotes must be present. uqzip must then exit with status 6.

Program Behaviour – Compression (Archive Creation)

If the command line and file checks described above are successful and an archive file is to be created (the argument --extract is NOT specified on the command line) then uqzip is to behave as described below.

First, uqzip must write out the header section for the archive file. (See Table 1 for details of the file format, including the header section.) Placeholders should initially be used for the file record offsets because these aren’t known yet. These will need to updated in the file after the compressed files are added to the archive.

如何使用Ray和PyTorch训练模型 用户编写训练函数 → 定义单机训练逻辑。通过扩缩容配置 → 指定需要多少资源(Worker 数量、CPU/GPU)。训练器整合训练函数和配置 → 自动将训练函数分发到多个 Worker 上并行执行。Worker 运行训练函数 → 在分布式环境中完成模型训练。通过这种模式,Ray Train 实现了对分布式训练的抽象,用户只需关注单机训练逻辑,无需手动管理分布式通信和资源分配。 阅读详情

相关推荐

示波器实测RGMII信号:从125MHz时钟判断千兆模式,到时序抓取与PHY寄存器避坑

本文详细介绍了使用示波器实测RGMII信号的完整流程,包括125MHz时钟频率判断、时序参数测量及PHY寄存器配置避坑指南。通过实战操作和典型故障案例分析,帮助硬件工程师快速定位和解决千兆以太网接口的调试问题,提升通信稳定性。

weixin_30015371的博客 263

c++ 海战棋_C语言代写 | CSSE2310 - Semester 2 2020 Assignment 2 (v1.1) - BEST代写

这个作业是用C语言开发一个海战棋游戏CSSE2310 – Semester 2 2020Assignment 2 (v1.1)Your task is to write a group of three programs to participate in a naval battle tournament. One of the programswill be called 2310hub an...

weixin_36295973的博客 500

块坐标下降法实战:如何用Python一步步优化无人机通信网络?

本文通过Python实战案例,详细介绍了块坐标下降法在优化无人机通信网络中的应用。文章以最大化网络吞吐量为目标,将复杂的非凸问题拆解为功率分配和轨迹规划两个子问题,并提供了完整的算法实现、代码示例及调参指南,为机器学习工程师解决类似优化问题提供了实用参考。

sat99的博客 976

0.4 文件与文件夹:数据是怎么存放的,一篇讲清目录树

电脑里几万个文件怎么归类?本文讲清文件是有名字的数据单位、文件夹(目录)是可层层嵌套的收纳容器,二者共同构成目录树,最顶层是根目录;建立字节/KB/MB/GB 的大小直觉,介绍 Linux 一切皆文件的设计;用一张表讲清复制、移动、重命名、删除的区别,以及 Delete 进回收站、Shift+Delete 永久删除的差异;最后从安全视角讲文件上传(伪装脚本上传即 WebShell)与路径穿越(ZipSlip 把文件写到敏感位置),提醒凡是文件读写都要警惕路径被操纵。

一个安全白帽子的成长记录:Web 安全、漏洞复现、内网渗透。完整目录在 gysec.top 266

自动驾驶轨迹规划算法——Apollo Lattice Planner

Apollo Lattice Planner是百度Apollo自动驾驶系统中的一种基于采样的实时轨迹规划算法。其核心思想是在离散化的状态空间中,对终端状态进行采样,并通过多项式曲线连接当前状态与候选终端状态,形成候选轨迹集,最后基于代价函数选择最优轨迹。该算法将车辆可达状态按纵向距离、横向偏移和速度等维度规则离散化,形成"格点"状态空间。 Lattice Planner通过三个主要步骤实现轨迹规划:1)终端状态采样,在规划时域内枚举多种驾驶意图;2)轨迹生成,使用五次多项式连接起点与各终

swaggytiger的博客 1624

PID温控实验平台搭建(二)——PID进阶知识介绍及源码分享

最近,我突发奇想去翻阅了一些我本科期间所做的一些小项目,发现都挺有意思的!希望通过我的讲解文章可以帮助你们少走一些弯路!今天,我要分享的是一个PID温控实验平台的搭建,这是一个系列文章,手把手地教你学习和认识PID算法,了解这种算法在温度控制中的应用。由于我知识有限,如果出现一些错误,希望大家可以帮助我指出来,我们一起学习进步!!!

qq_35953617的博客 8051

LangGraph 本地 build 频频翻车,最终在服务器跑通流式对话

先说结论:我本地那个,一次都没成功过。三次,三次,全挂在拉镜像上。而顺得像刚上过油。这就很像我高中那辆自行车:骑着能走,一上锁就坏。那天晚上我盯着终端里那行红字看了很久,想的不是技术方案,想的是——为什么同一个工具,可以一边让我觉得自己很行,一边让我觉得自己不太行。

人工智能AI技术 323

SquareLine Studio汉化版安装激活全攻略:LVGL嵌入式UI设计从入门到出代码

嵌入式GUI开发中,LVGL作为轻量级开源图形库,广泛应用于STM32、ESP32等MCU平台。可视化设计器通过拖拽生成LVGL代码,大幅提升UI开发效率。SquareLine Studio正是这类工具的代表,支持界面设计、事件绑定与代码导出。其安装、汉化与激活是初学者常见门槛,尤其涉及LVGL版本匹配、字体配置及FreeRTOS移植等关键环节。本文围绕汉化版安装、一个月免费激活码使用及最小可用流程展开,帮助开发者快速上手LVGL界面设计,规避常见环境与集成问题。

weixin_29189987的博客 431

自建 Git 服务器和裸仓库差在哪:要能提合并请求

在一台 Linux 上 git init --bare 就能自建 Git 服务器,但它只能推拉代码,没有网页、合并请求、评审和按仓库分配的权限。对照裸仓库和 AngusGit 各自能做什么,再走一遍在 AngusGit 上发起合并请求的最短路径,以及已有裸仓库怎么完整搬过来。

AngusTester 339

SPSSAU 中介效应分析实战:Bootstrap 95%置信区间解读的3个关键步骤

本文详细解析了SPSSAU中介效应分析中Bootstrap 95%置信区间的解读方法,涵盖三种典型场景的判别标准与应对策略。通过实战操作指南,帮助研究者准确判断中介效应显著性,特别针对边界模糊和小样本情况提供专业建议,提升统计分析结果的可靠性。

weixin_33691817的博客 502

SpringBoot实现电子发票生成

电子发票是近年来比较流行的一种票据形式,它取代了以往传统的纸质发票,具有减少纸张浪费、方便有效查验等优点。本文将介绍如何使用Spring Boot和Vue.js构建一个仿真电子发票生成应用程序,借助微信二维码扫描功能和第三方库,实现用户扫描二维码获取发票信息并填写相关开票信息,最后生成电子发票。在本文中,我们介绍了如何使用Spring Boot和Vue.js构建一个仿真电子发票生成应用程序,借助微信二维码扫描功能和第三方库,实现用户扫描二维码获取发票信息并填写相关开票信息,最后生成电子发票。

不愧是暮言的博客 6094

VSCode_RemoteSSH_一直卡在下载服务器_解决教程

解决VSCode远程一直卡在下载服务器

m0_69395553的博客 158

fragstats:景观指数趋势分析

优快云@_养乐多_本文将介绍景观指数时间序列的趋势分析,包括趋势类型、斜率、截距等。以及景观指数突变分析所用的软件和 python 代码。结果如下图所示,

养乐多的博客 2864

Linux epoll 一篇讲透:从 select/poll 到红黑树、LT/ET,再到完整 TCP 服务器

一万个客户端已经连上服务器,眼下只有十个客户端发来了数据。服务器怎样把时间花在这十个连接上?理解这个问题,就抓住了 epoll 的主线。接下来,我们沿着“为什么需要它 → 接口怎么用 → 内核如何实现 → LT/ET 怎么写 → 完整服务器怎么运行”的顺序,把知识连起来。**阅读基础:**了解socketbindlistenaccept的基本用途即可。本文示例面向 Linux,服务器使用 C++17,实验脚本使用 Python 3。

2601_94861874的博客 483

Data-Structures-and-Algorithm-Analysis-in-Java.pdf

作者: Weiss, Mark A. 出版社: Addison Wesley Data Structures and Algorithm Analysis in Java is an “advanced algorithms” book that fits between traditional CS2 and Algorithms Analysis courses. In the old ACM Curriculum Guidelines, this course was known as CS7. This text is for readers who want to learn good programming and algorithm analysis skills simultaneously so that they can develop such programs with the maximum amo...

文档:亲测可用解决vnc灰屏,黑屏,鼠标大黑叉情况

主要解决vnc-viewer灰屏,黑屏,鼠标大黑叉等现象,详细见文档。

宝塔装在服务器上,极目装在本机,差别到底在哪

宝塔 极目 装服务器 装本机 区别,不是比谁好用,是比"软件落在谁的账上"。宝塔的端口、资源、维护都记在服务器;极目这些都落在你电脑,服务器保持和纯 SSH 管理一样的干净。想保护服务器资源和安全面,选装本机的方案;想浏览器点就完事,装服务器的面板也行。

AI_Lab01的博客 350

VC中sqlite的使用

在VC中对sqlite的使用,实现数据库大批数据的快速插入,读取数据库中的数据在ListCtrl中显示

推理服务器的调度器:连续批处理与请求生命周期

推理服务器的性能上限不取决于模型,取决于调度器——同样的模型,换一个调度策略,吞吐可以差三倍。传统深度学习服务的静态批处理在 LLM 场景下完全失灵:请求的输出长度不可预知,短请求被长请求拖着浪费算力。这篇文章实现 LLM 时代的标准答案——连续批处理(continuous batching),并管理一个请求从到达到完成的完整生命周期。

2601_96733043的博客 208

数学建模模型总结

这是本人在两年内准备参加数学建模竞赛搜集到的模型资料,已经经过了本人的筛选和整理,希望能够对准备参加数学建模竞赛的学弟学妹们提供一些帮助!

Nginx代理服务器从入门到实战:静态部署、反向代理与负载均衡全解析

本文系统讲解Nginx代理服务器:涵盖核心概念、安装启动、配置结构,静态部署与虚拟主机,正向/反向代理原理与实战,以及五种负载均衡策略,适合后端开发与运维入门学习。

Daisy0304的博客 258

把电脑变成一台“假“GNSS 设备 —— 一个蓝牙 SPP 服务器从零到联调

本文介绍如何用Qt6实现一个蓝牙SPP服务器(H11BtServer),将电脑模拟为一台可被发现的GNSS设备。该服务器支持经典蓝牙SPP协议,注册SDP服务并监听连接,响应AT命令(如AT+DEVINFO),每秒主动推送带正确校验和的NMEA帧($GNPOS/$GGA等),数据基于时间驱动正弦与随机扰动,实现位置、精度等参数动态变化。通过解析行式协议、计算校验和、严格对齐字段顺序,可在无真实硬件情况下联调RTK客户端(如rtklib SDK或手机App),完整验证数据链路。代码结构清晰,参数集中配置,易于

Hi20240217的博客 244

高性能图形服务器搭配云飞云共享云桌面的方案

非标自动化、智能装备、工程机械等行业研发,大量使用 SolidWorks 开展大装配建模、干涉检查、运动仿真与工程图输出。传统一人一台图形工作站的模式,硬件资源独占,设计师不跑大模型时 CPU、GPU 长期闲置,算力利用率偏低;图纸分散存放在工程师本地电脑,项目迭代衍生大量版本文件,文件互传、版本对齐耗费大量时间。同时每台工作站单独安装 SolidWorks 与各类插件,版本很难统一,图纸导出、外发管控难度大,存在核心资料泄露风险,多台工作站分散运维,IT 维护工作量高。

jsyunfeiyun的博客 148

企业级物理服务器的备份策略

备份策略

chuang123的博客 339

银河麒麟高级服务器操作系统日志采集标准处理流程

本文档提供银河麒麟高级服务器操作系统标准化日志采集流程,便于统一技术支持标准、缩短问题定位周期,且确保采集的信息完整、准确、可直接用于根因分析。本文档适用于技术支持工程师及具备操作系统操作权限的技术人员,覆盖银河麒麟高级服务器操作系统,适用阶段为服务器故障排查、问题复现、根因分析阶段的日志采集工作。执行1次,快速定位负载类型# 系统整体负载与CPU占用# 内存与虚拟内存状态# 进程维度信息(按CPU/内存排序)# 异常进程排查。

qq_39496637的博客 350

不装宝塔,怎么一个服务器放多个网站

不用装宝塔 多个网站 反向代理,核心是一个 Nginx 按把不同域名引到不同目录或后台端口。面板、客户端、命令行做的都是同一份配置,差别只在你用什么写。记住域名解析到这台机、改完nginx -t再 reload、同机多站要盯资源,这三件比工具要紧。

NextTech_的博客 215

CFCA推出首款抗量子密码产品:签名验签服务器SVS-PQC

SVS-PQC在标准签名验签服务器基础上,实现抗量子算法能力的集成,具备抗量子算法数字证书全生命周期管理功能和灵活的数字证书绑定机制。SVS-PQC产品是CFCA运用抗量子密码领域技术累积进行产品化输出的首款成果,覆盖主流业务场景的安全强度需求,标志着CFCA在抗量子密码产业化方面迈出坚实的一步。后续,CFCA将陆续推出PKI体系抗量子算法系列产品,构建完整的抗量子替代解决方案,助力客户完成平滑切换,让密码技术、产品和服务成为能够持续承载数字信任的坚实底座。

AIpress的博客 161

在 Linux 服务器上用 Docker 从零部署 Nexent:从环境准备到首次登录验证

本文解决:拿到一台干净的 Linux 云服务器,如何用 Docker 把开源智能体平台 Nexent 完整部署起来,并确认它真的能用——包括容器状态检查、浏览器访问、超级管理员首次登录、租户初始化以及进入主工作区。全文命令均基于 Nexent 官方 AtomGit 仓库()当前版本实测整理,照着做即可,不依赖任何图形界面。文中也会把我实际踩中的两个高概率坑()连同排查过程一起写清楚。

2302_79376097的博客 9227

使用OpenCode管理服务器和网站优化实操分享_opencode ai coding agent open source terminal 是什么

文章浏览阅读137次。本文介绍如何利用OpenCode这一开源AI编程智能体,在Debian服务器上实现自动化运维(如安装1Panel、Halo、MySQL)和免密登录配置,并通过WorkBuddy结合OpenCode完成SEO/GEO评估与分优先级优化执行。强调其模型中立、隐私优先特性及CLI/桌面/Web多端支持能力。

ocean1010的专栏 154

基于Blackwell架构:Pro6000八卡服务器整机配置与工程交付解析

构建一台合格的Pro6000八卡服务器,核心在于整机的兼容性设计与工程交付能力。从CPU通道匹配、散热风道设计,到冗余电源配置和出厂拷机,每一个环节都决定了这套算力基础设施的长期稳定性。作为专注算力基础设施的团队,深圳智恒百亿始终致力于为AI企业提供从硬件选型、整机交付到运维支持的全链路解决方案。声明:本文配置方案基于特定业务场景设计,仅作技术交流与参考。具体硬件规格请以NVIDIA及原厂官方发布信息为准。

Z1980658_的博客 299
上一篇: GSOE9820 The project management plan
下一篇: COMM1190 Data, Insights and Decisions
vx___codinghelp
博客等级 码龄2年 778粉丝 101原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值