Marks and feedback for our 2nd project are now available via csmarks, and the overall marks for the unit (including the final exam) should be released by the Exams' Office this evening.
The unit finished with 372 students enrolled. 31 students have D...
Your approach sounds reasonable
- open each of the colon-separated directory names provided by the function's parameter,
- open each directory and iterate through its directory entries,
- identify each regular file in the directory,
- determine if it's ...
ANONYMOUS wrote
Just a normal morning, thanks.
The materials on multithreading are examinable, though you won't be expected to remember the exact function names or parameters. However, you should know roughly what functions are expected required in a...
Thanks for your kind words John (but it's really just 'Dr' or, even better, just 'Chris'). Glad that you can enjoy and see some positives in a difficult unit You'll appreciate it more when you've been working for a few years -)
Yes, the next sys...
ANONYMOUS wrote
This is a sort of 'compare and contrast' type question - if you're going to state that one approach is superior to the other (as you've done with your 4 good points), you should also be (correctly) critical of the alternative approach...
ANONYMOUS wrote
The short answer questions are not simply about providing N individual (correct) points reasons, but about answering the question by describing the significance of your points and how they relate to each other. The questions are unli...
ANONYMOUS wrote
We've only been considering the far more common monolithic kernels, not message-passing microkernels (usually only studied in graduate OS courses, and more advanced textbooks).
...
Obviously nothing to do with unit or the exam, but the...
ANONYMOUS wrote
Hey.
Can you outline what you understand the question is asking, and what attempts you've already made?
The spreadsheet will be a two dimensional array of 'things', and in this question those things are C's character strings (i.e. eac...
ANONYMOUS wrote
You'll never need to assume that - either the exam question will tell you if the parameter is an absolute pathname or, if it doesn't say anything, then there's no need for the parameter to be absolute. For example, the open() ...
Hi Mitchell,
It's messy territory, with different OS distributions and different compiler toolchains packaging things in (a limited number of) different places.
My Ubuntu 20.04 gcc system has only time.h , but my macOS 12.6 clang system has both time...
ANONYMOUS wrote
I think you've "got it", though the way you've expressed it makes it a little difficult to parse and, hence, understand.
Paging is always employed and, when it's known that a process with (at least some) of its required memory curren...
Yes - print the name of all executable programs that have the same name (2 or more instances, in different directories along the value of testpath .
Yes - no need to get find the value of PATH . It, or any other string, will just be passed ...
ANONYMOUS wrote
You cannot call exit() and return anything - one, or the other. exit() doesn't return again to where it was called.
Calling exit() in the child process allows the parent to learn of the process termination when it ...
ANONYMOUS wrote
Many thanks for that; that may have been why 'random' students were having similar problems with the marking script.
Have updated the marking script https secure.csse.uwa.edu.au run help2002?p np opt B837
(for this, and other reaso...
ANONYMOUS wrote
This question is asking about how process-management can be modelled using state transitions (the blue bubbles and arrows from lectures).
So to answer the question think about what state transitions occur when creating, running a diffe...
ANONYMOUS wrote
(wondering, and then did.... -)
There's no simple solution and, in fact, writing the requested in a very robust manner would double its length.
100000 bytes would clearly be overkill, and in all lab and workshop sample solutions we've ...
ANONYMOUS wrote
If execl() fails, you don't just return a result, but exit() the child process.
See https teaching.csse.uwa.edu.au units CITS2002 lectures lecture09 06.html
ANONYMOUS wrote
If you're able to copy an (existing) source file to a (new) destination file, you can address your problem by formatting the pathname of the new destination as "directory name filename" and then calling your existing code with that...
Hi Thomas,
(as long as this isn't interpreted as "Oooh, he's released a sample solution" -)
Without watching the lecture recording I can't remember which question you're asking about, but I think it was this one (2019 Q2) http teaching.csse.uwa.edu...
ANONYMOUS wrote
There shouldn't a problem, because the project webpage says "You may leave 'debug printing' in your submitted program, but all debug printing should be indented with one-or-more space or tab characters."
(and glad to hear that someone...
Hi, I wasn't the unit coordinator of '2002 last year, and didn't set the exam, but I can see that two-level page tables were covered last year, but not this year.
I've updated the Exam Info page - thanks.
Yes.
Yes.
The material of this question wasn't co...
ANONYMOUS wrote
You're writing a function, not a whole program, to execute a sequence of commands until one of them fails, or they all succeed.
No need to write a Makefile (either to compile this function, or as an input to the required function).
Not...
ANONYMOUS wrote
Invoking an external process to perform a file copy would be a massive overkill for this type of problem.
Suggest you review Lectures 8 and 16.
Now that all nearly all students with Special Considerations and UAAPs appear to have submitted their 2nd projects, you may download the sample solution's code from
https teaching.csse.uwa.edu.au units CITS2002 projects trove-sample-soln.zip
PLEAS...
It's a good and interesting question, and there's no single correct answer.
I'm not convinced by the thought that more system calls increase consistency - consistency of what?
Whether a new system supporting legacy systems through system-calls is consi...
ANONYMOUS wrote
As I've stated on the Exam info. page, I'll not be releasing solutions to past exams.
My reasons are not centred around a lazy desire to just keep re-using questions from past papers, but from my strong belief (through observation) tha...
We're definitely looking into this.
One suggestion (unsure if it's been tried or successful on WSL), is changing line 3 of the script from
PROJ "estimatecron"
to
PROJ ". estimatecron"
Those that don't have '.' inn their shell's search path should,...
ANONYMOUS wrote
Not being evasive, but it could be either 'format'.
I'm concerned that you may be trying to over-think this.
If you study and understand the unit's material content, then the actual format of the exam questions on the day will not be a...
ANONYMOUS wrote
There's a (small) number of ways that a C program can make requests, and receive information, from an OS kernel, but this unit has only focussed on the primary one.
There's isn't a single, or sequence, of slides providing the answer to...
ANONYMOUS wrote
The question is asking for the relationship between the two, how they work together. You certainly could summarise the similarities and differences in your answer (i.e. why they need to work together), but don't just describe the si...
ANONYMOUS wrote
Hi, seems that I've been talking too slowly this year, or encouraging 'too many' questions from the audience (not a bad thing), but we didn't quite finish the chess task.
Download the sample solution to it, from our unit's Schedule pag...
The marks for the 1st project are now FINALISED,
unless your mark is still 'Not Available' or if I've emailed you over the weekend.
...
Project-1 marks and feedback are now available in csmarks.
Project submissions were made by 121 individuals and 98 tea...
Almost there.... marking has finished (except for the 21 submissions that simply can't be compiled). Now reconciling the 71 late submissions against the 43 official extensions...
There has to be an easier way (because there once was).
ANONYMOUS wrote
Your question indicates that you are trying to compress things using C code from a library.
The project description says that the compression decompression must be performed by the gzip and zcat utility programs.
ANONYMOUS wrote
Only files are indexed, not directories, so directories are not stored in the trove-file, and so can't be removed.
Test with the sample.
Unsure what you're meaning by "...being parsed".
If an existing trove-file includes information about a particular absolute pathname, then the -r option should remove that absolute path from the trove-file, and the modified trove-file should no longer...
ANONYMOUS wrote
I cannot understand the problem you're describing.
What do you mean opendir() takes a pointer??
Even the following code, which doesn't do anything useful, doesn't crash
include dirent.h
int main(int argc, char argv )
...
ANONYMOUS wrote
I don't understand how your program is (not) working, or your explanation.
If you run your program, and it works successfully, it should work immediately again if invoked again.
Is your suggestion that your program works 'some times', ...
PLEASE search and read this forum for an answer to your question.
PNG files, JPG files, PDF files, .... are NOT text-files and cannot be processed as if they are text-files.
ANONYMOUS wrote
I'm unsure what you believe that you've achieved, or why it may have been difficult. Serious question??
The trove-file is always named tmp trove, unless the -f option requests a different name.
tmp is a directory on your computer,...
ANONYMOUS wrote
Different operating systems will have different default sizes for many things, such as I O buffers, and different limits on things, such as the number of directories and files that can be open.
ANONYMOUS wrote
Once your trove process is connected to gzip's standard input with a pipe, you can write anything to the pipe and gzip will read it.
The first 3 lines look correct (and familiar -) but the second parameter to execl() is incorre...
ANONYMOUS wrote
This will be difficult to diagnose (and even harder through help2002).
The error usually comes from a library function that detects a severe problem and so calls the library function abort() to ungracefully inform your code that ...
ANONYMOUS wrote
About 20 of the project. The concepts of forking execing a new process, creating communicating through pipes, and redirecting I O to from files are all important concepts being assessed.
ANONYMOUS wrote
By default, printf() prints to stdout, and you said you've just redirected stdout to a file.
You'll find your debug statements in the file ( ).
You can't have your stdout going to two different places, and should not try to toggl...
ANONYMOUS wrote
opendir() is a library function which is at liberty to dynamically allocate it own memory (which will be deallocated by closedir()) to perform its work. An obvious case is seen when opendir() returns a pointer to (an opaque) DIR stru...
ANONYMOUS wrote
Consider updating as a combination of removing and building.
If you're asked to update a trove-file with about file 'X', then remove all previous knowledge of (the old) file 'X', and then add knowledge about the current file 'X'.
ANONYMOUS wrote
I fully appreciate your concerns and the fact that you may be struggling with the project; we see it every semester, particularly in 2nd semester.
However, I will not be moving the deadline for a number of solid reasons
- the due da...
ANONYMOUS wrote
(at this stage) it's OK to keep them in there.
Though be careful, if the same word exists in fileA and fileB, and you remove info about fileB, then the word should still remain.
There's a word for that.
Your program does not have to go searching for files. They are either requested with either absolute or relative names.
As stated a number of times, and in my email to you this morning, the files "cits" and "cits.txt" are diff...
Hi Thomas,
That will be fine, as long as the top-level Makefile compiles and links it all.
I just (silently) changed the project description, saying that it's required in at least one of your source-code files.
ANONYMOUS wrote
It's possible to use either read() or fread() . It only depends on how you open, and eventually close, the input.
Yes, this is likely the problem.
Your understanding is correct, and both read() and fread() will r...
The ORIGINAL intention of the project was that the -r option would accept (absolute) pathnames from the command-line, those pathnames would have to exist in the trove-file, and they and all related information would be removed.
(and I still prefer tha...
ANONYMOUS wrote
For the -r option, every reference to every file provided via the filelist argument(s) should be removed from the trove-file - the absolute pathnames, and any information about the words used in those files.
Consider the -u option as ...
ANONYMOUS wrote
The contents of a JPG file is not a string - it will have many embedded null-bytes, which means you cannot treat the contents as a C string, and not simply print it out.
See https secure.csse.uwa.edu.au run help2002?p np opt U676
ANONYMOUS wrote
Something sounds quite wrong, perhaps with your installation of packages.
If direct.h was not being found by the compiler with the project's required options, then many other students would have mentioned it by now.
ANONYMOUS wrote
Yes, it's certainly possible, the sample solution does it, and calling or using pipe() will not terminate a program.
The code toward the end of Lecture-18 sets everything up for you, and for the project the child process would n...
ANONYMOUS wrote
Executing "echo ?" must be being performed at the shell level whereas, I presume the error is being reported after your trove process, C code, is executing gzip.
Thus, executing "echo ?" will report the exit status of your trove proc...
ANONYMOUS wrote
(at this stage, and as not defined) it doesn't really matter.
The sample solution does include it.
Of course, it will never be listed as matching and searched word.
ANONYMOUS wrote
This really has been discussed many, many times in this forum, already.
- text-files do not need to have a suffix of ".txt"
- filenames ending in ".txt" are not necessarily text-files.
- filenames may not have a ' ' character (or the nul...
ANONYMOUS wrote
When marking we compile your submisison just once, and then run it multiple times against a number of different (but not tricky) tests. With near 300 project submissions, we very much try to avoid 'touching modifying' your code and r...
I suspect we could wait 24 hours, and no other 'guys' would reply.
On the project sheet, the command at prompt.1 searches an existing trove-file
while the command at prompt.2 builds one.
You certainly can't search a non-existent file.
From the project description - "A trove-file will contain the absolute pathnames of the files..."
A trove-file does not record directory names, just filenames, so it makes no sense to try to remove a directory name.
ANONYMOUS wrote
The (compressed) trove-file, on disk, should remain until deleted (manually, with the 'rm' command).
A very common requirement would be to perform multiple searches, in a row, using the same trove-file.
ANONYMOUS wrote
You should not need to, and should not, require your own local copy of dirent.h
I do not know which one it is, but installing a standard package should install the correct version of dirent.h, for your system, in the correct location.
We can store the information about each word and pathname in a far shorter manner than just storing each whole item. For example, a typical absolute pathname may be 30 or more bytes long. Try to imagine a simple scheme that allows, for each word,...
zcat does not require any specific filename or extension if it reads from its standard input, rather than from a named file.
Setting this up is just that same as you must have done for compressing with gzip - opening a file and then using dup2() ...
ANONYMOUS wrote
It looks like you have an additional C file that
defines addFileWords() , findWord() , and readTroveFile()
but that C file is not being mentioned in the Makefile.
ANONYMOUS wrote
The lecture shows that you can easily read and write the contents of any memory (such as memory holding data-structures).
You do not need to format that data to a human-readable form using, for example, printf() .
However, as disc...
ANONYMOUS wrote
Yes, this is pretty much correct.
- obviously a student working alone gets all of their marks 50
- a pair agreeing to the same mark each get the same mark 50
- if a pair agree on a different ratio, one student's mark is increased at the ...
The tiny SBC "looks a lot like a Raspberry Pi Pico. But while Raspberry Pi's tiny board is powered by an RP2040 microcontroller, the Ox64 has a dual-core RISC-V processor, 64MB of embedded RAM, and support for up to 128Mb of flash storage plus a micr...
ANONYMOUS wrote
Thanks very much Anon; you can always hope, but never expect it
You can comfortably do that, though using larger values doesn't guarantee that you'll avoid collisions, just that you'll see fewer of them because the values get m...
Project description says
- "... if indexed words must be at least 3 characters long." If.
and
- "If the -l option is not provided, the default length is 4."
ANONYMOUS wrote
There's a non-alphanumeric character between the 4 and M
0001120 017 347 034 016 u 320 334 271 353 033 316 267 277 375 376
0001140 k 255 275 326 373 003 370 ? 257 301 300 k 4
0001160 032 M 035 035...
ANONYMOUS wrote
The names of files - filenames - cannot contain the ' ' character or the 0 character.
The ' ' character separates the components of a pathname, such as "dir1 dir2 dir3 file1".
As a special case, the pathname " " refers to the root-dir...
ANONYMOUS wrote
Hello; glad that the sample solution is helping.
If the value of BUFSIZ is, say, 1000 bytes, then a successful fread() will copy 1000 bytes into your buffer (and will not add a null-byte).
And any of those 1000 bytes may be nul...
If constructing a vector of things of type T, the general pattern I use is
T array NULL;
int nelements 0;
....
array realloc(array, (nelements 1) sizeof(array 0 ));
check success of allocation...
array nelements .....
nelements;
...
The approach seems to be overkill, because a large fixed size array will be sufficient in all practical situations, but you can check for the end of file condition with feof() .
ANONYMOUS wrote
If gzip is given any filenames, it attempts to compress those files, so those files must exist.
Read the introductory Description of man gzip again.
ANONYMOUS wrote
It has been stated and discussed many times in this forum, that the files you are indexing might not be text-files and, thus, do not contain well-formed lines, and cannot be read line-by-line (with fgets).
This should be of some help ...
ANONYMOUS wrote
I am unsure why this has become so convoluted.
By its very definition, an absolute pathname, whether it refers to a directory or a file, whether that named directory name or that named file exists, simply begins with a ' '.
ANONYMOUS wrote
It means you've set a variable (it's on the left-hand-side of an assignment statement), but have never used it (it's never on the right-hand-side of an assignment statement, or passed to a function).
ANONYMOUS wrote
Interesting, general question.
There's no golden rule for all situations, and your decisions are likely driven by personal preferences, or whatever your boss demands of the software you write for her so that she can make her next yacht...
ANONYMOUS wrote
I can replicate this on both macOS and Linux.
Suggest that you check the return result from realpath()
define DEFAULT SOURCE
include stdio.h
include stdlib.h
include errno.h
int main(int argc, char argv )
char ab...
ANONYMOUS wrote
Yes, this is a (well known) and widely discussed weirdness.
Your final example involving just the semicolon 'works' because that semicolon is the terminator of an empty statement, and new identifiers can be introduced between any two s...
ANONYMOUS wrote
It's very hard to imagine what's happening here.
Firstly, our words cannot have semicolons in them, as a semicolon is not an alphanumeric character.
Secondly, it's unlikely that your code is reporting that error message - it can only be...
The project does not have to do anything beyond list existing files.
It does not have to check for more recently modified files (and then index them again to ensure that the required search term is (still) present??)
ANONYMOUS wrote
Unsure what you mean by 'do all command line options'.
The strongly encouraged approach is to parse command-line options by calling getopt() , verify their meaning combinations in your main() function, and then call functio...
ANONYMOUS wrote
You cannot use strings like "gzip output.txt" in calls to execl()
That's syntax recognized by the shell, but not recognized by the gzip program (or any others).
You'll need to understand how the pipe() and dup2() ...
ANONYMOUS wrote
You must have missed it in many lectures, in the introductory labsheets, and in the comments of labsheet and workshop sample solutions.
The command-line options are requesting that the compiler check your program for conformance agains...
ANONYMOUS wrote
I feel that you're overthinking the efficiency aspect, and ignoring some important issues.
You're probably using a computer with 8 BILLION bytes of RAM, able to make 2 BILLION instructions comparisons per second.
So when you say 'take a...
ANONYMOUS wrote
I can only imagine that you're not correctly finding copying storing the sequences of alphanumeric characters.
I have modified the sample solution to add (just) those 3 non text-files to the drop-down filelist menu, and a link to list...
The UWA Robotics Club is collaborating with the Programing Competition Society to bring you a free CITS Study Night this Thursday at EZONE Nth 113 at the Industry Hub, from 4-6pm. Whether it's Python, Java, or any other programming language, come dow...
ANONYMOUS wrote
Your project will need to support the -f option.
The sample solution cannot support it, as multiple people using the same server cannot all use the same default trove-fill name, or be permitted to write to an arbitrary location on the ...
Hello Martin. There is nothing special about indexing non text-files, compared to text-files.
Our simple definition of text-files, all semester, has been the same - line oriented data (using n or r n to terminate each line) and the data being easy ...
(Always) very difficult to diagnose from the description alone, but some commonly seen reasons are
- are you using realloc() , not malloc() , to grow your vectors?
- are you incrementing that integer counter after each addition to the vector...
ANONYMOUS wrote
Providing you use them together, you may use
- open, read, write, close
or
- fopen, fread, fwrite, fclose
It makes little sense to use fgets() on non-text, non-line-oriented files, as it will stop reading each time it finds a newlin...
ANONYMOUS wrote
Yes, you write absolute pathnames into the trove-file.
In yellow highlighted text, the project sheet says "there is no required format for the trove-file". You choose.
It is unclear if you are talking about your own implementation, or what you're observing using the sample solution.
The instructions for the sample solution say "if you provide a -f trovefile option, it will be silently ignored". The sample solutio...
It is not a project requirement that trove supports wildcard matching of its command-line arguments.
Values such as ' ' are expanded by the shell, before it calls trove.
The sample solution does not support expansion because it does not invoke trove us...
ANONYMOUS wrote
With exactly one of -b, -r, or -u you are building or modifying a trove-file.
With none of those options you are searching an (existing) trove-file.
As you can only search on a single word, the sample solution treats the contents of the 'word' textbox as a single string, and does not split it into multiple words. I'll change it so that it does, and it'll then report an error if you provide it wi...
You're correct; the shell will break each command-line into words, separated by spaces and tabs, and pass each argument to a program without any spaces (unless you use double- or single-quotes).
Without using quotes, there's no way to know how many sp...
You should be able to index any type of file, text-files or 'binary' files.
You'll notice that the sample solution indexes an executable file and a JPG image file.
Hello Simon,
There's no always-correct answer, because it'll depend on the actual file being read and (one day) your choice will always be too small.
I typically just use BUFSIZ, for convenience, with gives 8KB on Linux, but only 1KB on macOS.
But both ...
Hello Lucas,
This problem arises because compression programs are typically used to compress files that are already on disk, and 'replace' them with a compressed version, using an additional suffix to identify what was used to compress them.
Review the...
There is nothing wrong with having spaces in a file or directory name; it must be your code that is trying to find break file or directory names into words or tokens.
If you place double quotes around multiple words on the command-line program ...
Internet searching always performs poorly with the wrong keywords.
But you do have a computer and compiler in front of you, so why not experiment?
include stdio.h
include stdlib.h
include getopt.h
define OPTLIST "abc"
int main(int argc...
Yes, anything within square brackets ... is optional, and any use of the square brackets may occur in any order.
It's exactly the same notation as you've seen in nearly every online manual for a command (in section 1 of the manual) - man cal ...
ANONYMOUS wrote
The ' ' is a shell-wildcard. Before invoking the trove program, the shell expands the ' ' to all files and directory names in the current directory, and then passes them to the trove program as command-line arguments. Thus, the filel...
ANONYMOUS wrote
Files ending in .txt DO NOT have to be text-files, and text-files DO NOT have to end in .txt
C source-code files are text-files, and they do not end in .txt
Reading? Review Lecture-8.
tmp trove is (will be) a file , not a direc...
ANONYMOUS wrote
I can't see any use of malloc() in your code.
strArray is NULL, so you cannot access strArray 0 .
Even if strArray were not-NULL, strArray 0 does not point to sufficient (not even any) space to hold the string.
Have a look at the ...
ANONYMOUS wrote
Mostly, NO.
If any request to run trove has the -f option, then the following filename is the one to read write the indexed information.
If the the -f option is not specified, then the deafult file " tmp trove" is used.
The contents...
ANONYMOUS wrote
Not quite true.
(On Linux) the manual also states that you need to define certain pre-processor standard constants to 'get' the required standard.
See the example in https secure.csse.uwa.edu.au run help2002?p np opt B519
It's possible (easy) to store the value of a pointer in a file - printf(" p n", (void )my pointer );
BUT, you should re-think your approach. The value of a pointer is meaningful in a process that allocated created it but, if written to a file, ...
We don't yet have a web-based version of the sample solution, but hopefully this video will provide greater understanding
http teaching.csse.uwa.edu.au units CITS2002 projects trove-sample.mp4 (47MB, 150secs)
It shows the sample solution being c...
ANONYMOUS wrote
(Any) trove-file is a file .
The default trove-file is named " tmp trove". Any other name, such as " tmp trove.txt" is not the same name, and not the correct file.
define DEFAULT SOURCE
include stdio.h
include stdlib.h
int mai...
ANONYMOUS wrote
I'm not going, or able, to provide a description of the trove-file format, because its design (and implementation) is completely up to you. There is no single required format, else it would have been specified on the project sheet.
You...
If your computer doesn't have a trove-file already, then the first command to build or update will need to create one (because it needs to place it's 'work' somewhere ).
What does CML stand for?
I've never seen the acronym CML before; guessing CoMmand Line??
Where did you see CML?
ANONYMOUS wrote
Could be (full) absolute pathnames, or relative pathnames. It does not matter.
No, you can 'convert' them all to absolute pathnames with the realpat...
ANONYMOUS wrote
Initially the trove file does not exist. You will need to create it before you can write to it, usually by open()ing it with the correct option to create it.
The filename to be created is named tmp trove, unless you provide another f...
That's quite a list of questions (but you're not interrupting anything by asking).
- it's quite feasible for all files in an index-file to have been deleted since the index-file was created.
- you only update the index-file if the -u option is provided...
The filelist is a sequence of one-or-more whitespace separated 'words' on the command-line - e.g. file1 file2 dir1 file3 dir2 ....
Just the same as the command-line arguments we have been passing to most commands all semester.
The project sheet says "Some example words are main, Australia, and GTHO351. The character sequence COVID-19 contains 2 words"
Yes, you would store "jdskjdku".
The project sheet does not mention the word "dictionary".
Alphanumeric characters form t...
Yes. You need to provide sufficient space for dest before calling strcat p()
You can increase the space associated with a pointer, and copy its original data too, with realloc() but, of course, that requires the pointer to have fir...
ANONYMOUS wrote
(a reminder that this is an 'ideal' situation, one striving to make the index-file as small as possible).
If you store each word only once overall, along with the files in which it occurs then, when searching for any word, you just de...
The 2nd project is now available from https teaching.csse.uwa.edu.au units CITS2002 projects project2.php
The project may be undertaken individually, or in teams of two. You are strongly advised to undertake the project in a team, if possible.
Comp...
Try moving the define right to the top of the file, before you incldue any other header files.
It may be the case that lines in those header files also include string.h , without the POSIX... token, meaning that your request to include string.h w...
Now that all students with Special Considerations and UAAPs appear to have submitted their 1st projects, you may download the sample solution from
https teaching.csse.uwa.edu.au units CITS2002 projects estimatecron-sample.c
The sample solution pro...
"The 'last man' selling floppy-disks says airlines continue to make orders for the ancient storage technology ... My biggest customers and the place where most of the money comes from are the industrial users," Persky said, in an interview fr...
As for the 1st project, you'll be able to undertake the 2nd project as individuals, or in teams of 2 (not 3).
So, if hoping to find a partner for the 2nd project, please post in this thread.
And some food for thought - Tips for working in groups https...
ANONYMOUS wrote
There's nothing invalid about having a semicolon on a pre-processor line.
A frequently seen technique, attempting to make code more readable, is to use something like
define FOREACH NODE for(int n 0 ; n nnodes ; n)
Re...
ANONYMOUS wrote
Being misquoted.
The project will not be tested with processes that run beyond the end of the month;
you do not have to check for that.
ANONYMOUS wrote
(Filename) extensions have no meaning for this project, and your project should work with or without them.
I cannot imagine what how having (any) extension would could affect the running of your project.
ANONYMOUS wrote
Other than what's stated in the last paragraph of this https secure.csse.uwa.edu.au run help2002?p np opt B239
YES, you should always provide attribution for code that you did not write - you cannot implicitly claim it as your own.
Disappointing that the average bid was only US 156; it was worth more than that
https www.freelancer.ph projects c-programming develop-system-utility-program-language
refs https www.uwa.edu.au students Getting-started Student-conduct
ht...
Having recently covered basic memory-management, paging, swapping, and virtual memory in lectures, the rules of the famous "Paging Game and The Thing King" should now make sense
https sac.edu AcademicProgs Business ComputerScience Pages Hester ...
Hi Thomas,
You are correct that pass-by-value will always be more expensive, both in terms of required space on the runtime stack and in the time required to copy the data before calling the function. On contemporary CPUs, all pointers are the same s...
Difficult to say how readable the modified code is would be without seeing it.
It sounds like Visual Studio is applying some coding style convention that, maybe, you can disable?
Ensure that the code you submit is readable (obviously ) and consistent...
ANONYMOUS wrote
If the code is already there, and doesn't break anything, leave it in.
There is no such thing as '...be marked down'.
There is no negative marking (at UWA); your mark starts at 0 and increases, not from 100 and decreases.
No simple answer.
Depending on how much code was similar, it would likely be detected by the software we use.
If too similar, the students would be contacted, asked to explain, and possibly be interviewed to see what each understands.
ANONYMOUS wrote
You're correct; that line should be checking for exactly 2 words, and not accepting 3. Sample now corrected.
But don't spend all of your available time looking for these (relatively insignificant) cases; focus on bigger aspects of th...
ANONYMOUS wrote
One submission per team, please. As a team, you need to decide which is the better code, else submit as two individuals.
(I imagine that if your team made two submissions, you'd expect to receive the higher mark??)
"Backup and cloud storage company Backblaze has published data comparing the long-term reliability of solid-state storage drives and traditional spinning hard drives in its data center. Based on data collected since the company began using SSDs as bo...
ANONYMOUS wrote
It is acceptable to have multiple commands with the same name running at the same time.
However, be careful when testing such long-running commands, that they don't keep running beyond the end of the month (Requirement 8).
ANONYMOUS wrote
As asked and answered many times on this forum, each command name will only appear once in an estimates file.
As asked and answered many times on this forum, a blank line is neither a comment-line or a command-line and, so, is an error...
ANONYMOUS wrote
Yes.
The sample solution prints the most frequently executed command-name appearing first in the estimates file.
You may assume that, but the testing files will ensure that only one command if the most frequently executed.
ANONYMOUS wrote
The description of the marking emphasis and marks breakdown meets the requirements of the Assessment Policy and has been approved; it just may look different to how rubrics are presented in other units.
There are many, many, examples ...
ANONYMOUS wrote
Rather than (incorrectly) assuming what the sample solution will print for the 2 files given on the project sheet, why not simply run the sample solution to help your understanding?
ANONYMOUS wrote
Both of them must already have a null-byte on the end of them, else they wouldn't be strings (or, if lucky, string handling functions would crash).
Could either of them be a command name, from the last column of the crontab file?
If so...
ANONYMOUS wrote
The strdup() function is not part of the C99 or C11 standards (but is, finally, defined in the new C23).
However, it has been defined in the POSIX standards for a long time, and this post https secure.csse.uwa.edu.au run help2...
ANONYMOUS wrote
If you're iterating from the first minute (starting at 12 00 midnight on the first day of the requested month) to the last minute (44K of them) you need to match the current minute against the 'pattern' of 5 numbers "0 3 ". I...
ANONYMOUS wrote
How you read in the two files is really a decision for you to make.
There's no technical reason, related to C and the OS interface, that would prevent your suggested approach from working.
I'm honestly unsure what you mean by an 'alignm...
ANONYMOUS wrote
That's about the simplest approach - iterate through each of the 40K minutes of the month, checking to see if any of the crontab entries match the current time date.
Do not worry about efficiency for your first 'attempt' - in fact don...
I think you've misunderstood the project's requirements.
The second word of the final output line is the "the total number of commands invoked" (Project Requirements 10), and this example correctly reports 30 30 60. It's not the total number of t...
ANONYMOUS wrote
To avoid any confusion (when marking) it would be better if your program did not convert the alphabetic case, as that turns an invalid input into a valid one (extending the project specification).
No, not at all.
Only the final line ...
Hi Rados,
Yes (I hope so); it also implements helpful debug output, but that is not required.
Do you have an example of what fails? The line
0 3 31 1 daily-backup
is correctly detected reported as an error.
The reverse does not hold.
That's a possi...
(applicable to ALL of your units, not just CITS2002)
Nominations for the UWA Teaching Excellence Awards for 2022 are now open.
The UWA Awards acknowledge the University's outstanding educators and support staff and are competitive at the University le...
ANONYMOUS wrote
This question could be paraphrased as "do we have to....?", so let me try to change your thinking.
- if you know that supporting both the Unix and Windows formats would produce a better, more portable project, why wouldn't you want to ...
ANONYMOUS wrote
What happened to benevolent?
Specifying GNU SOURCE gives the false impression that the declarations you're requiring are defined standardised by The Free Software Foundation (FSF); it's sort of a political trick by FSF.
And, if compi...
A new future career pathway...
"SiFive, Inc., the founder and leader of RISC-V computing, today announced it has been selected by NASA to provide the core CPU for NASA s next generation High-Performance Spaceflight Computing (HPSC) processor. HPSC i...
Please note that Thursday 22nd September will be a public and UWA holiday to commemorate Queen's Memorial Day.
There will be no laboratory sessions on the 26th.
ANONYMOUS wrote
The Project's Requirements point 8 states
"8. Your project only needs to simulate the execution of processes for the requested month (of the current year). All processes will have terminated before the end of the requested month."
I think there's a lot of confusion here.
A line beginning with define is processed by the C-preprocessor.
Your program's C source code is first read by the C-preprocessor, and the C-preprocessor's output is then read by the C compiler.
If your question...
The 'P' in POSIX stands for Portable, so (correctly) using POSIX functions is very unlikely to be causing problems.
That's true, but having such significant problems on a platform used by millions of people suggests a problem in the project code, whic...
ANONYMOUS wrote
I suggest that you review our Workshop which involved days and months.
And https pubs.opengroup.org onlinepubs 9699919799 functions mktime.html
ANONYMOUS wrote
Hi,
I'm unsure if it's just your description that is confusing (me), or if it correctly reflects your actual implementation (which, then, is confused). I'll change some of the terminology, as that may help.
Firstly, (text) files have '...
Please re-read the project sheet.
It should be apparent that, as months may be used requested in 2 places, that the same code should be used to check them.
ANONYMOUS wrote
From your own example output, it should be clear that fgets() is not the problem - it's your code to break the line (now in a character array) into words, or that you are not converting storing the words correctly (unsure if y...
ANONYMOUS wrote
This question was also asked in Workshop-5; unfortunately it's still the same answer - no.
It's part of your learning for the project to anticipate the possible types of commands and their times.
But, there really are no (possible) tri...
ANONYMOUS wrote
It's not an error message, just an 'announcement' printed by your zsh that the execution state of your process has changed.
There's an explanation of what's happening (in the case of vim) here https secure.csse.uwa.edu.au run help2...
ANONYMOUS wrote
Using the correct terminology will likely assist you understand what is going on when referring to online manuals or a textbook.
Correctly time.h is not a structure - it is a casual way of referring to the standard-C time.h head...
ANONYMOUS wrote
There should be very few differences; the main one I can think of is the amount of memory that may be allocated to local variables (on the runtime stack).
(meaning of "...exported to linux" ?)
ANONYMOUS wrote
Just Chris will be fine.
This looks like you are suspensing the execution of your running program by typing Control-Z.
If you wish to interrupt (terminate) a running program, the correct key sequence is Control-C.
The message is being ...
Yes (of course), you may have any number of calls to printf() and any number of return statements in a single function.
Whenever tempted to ask such a question, test things yourself by writing a small, stand-alone, program, independent of your p...
Hello,
You are correct - the sample solution was accepting 59 as a valid minute, whereas it should really only accept 59. The same applies for all other expected numeric fields, too.
I've changed the sample solution to accept 59, but to reject 59 (...
ANONYMOUS wrote
All are correct, except
... at least 6 words (as written on project sheet)
The above is not guaranteed.
Let me turn this list around, rather than identifying every single thing.
If you know that something is incorrect, or prevents ...
ANONYMOUS wrote
Glad that you've now solved this, but it should have been an easy one to work out
- char my function(...) returns just a single character
- char my function(...) returns a pointer to a character, which we assume to be the beg...
If you just pass endptr to the function, a copy of endptr will be passed (just the same as if you just passed an integer, or the result of any expression).
If the function tried to modify that parameter, it would modify the copy of the original val...
ANONYMOUS wrote
These limits are guaranteed, you do not need to check against for them.
They tell you the maximum size of variables that will be suitable to store the files' data.
ANONYMOUS wrote
This question has no context.
What is "the top command" ?
What function?
When you say "header", do you mean "prototype" or "declaration" ?
ANONYMOUS wrote
If endptr was just an integer, and you wanted the function to be able to change that integer's value, you'd have to pass the address of endptr to the function.
Similarly, even if endptr is a pointer to a char, if you want the function ...
ANONYMOUS wrote
The most likely cause of this is attempting to write too many characters into a local variable that is a character array. The compiler 'plants' extra information on the program's runtime stack to detect this form of problem - when ...
ANONYMOUS wrote
This code is invalid and, if you're compiling your code with correct strong arguments, the compiler will announce it as an error.
You are passing a string (value) as the first parameter to strcmp(), and a single character ('.') as the ...
This example has followed the way the standard strcpy() function works.
While C doesn't have a basic string datatype, we can't copy strings with string2 string1;
So strcpy() is written so that we can read it the same way - strcp...
ANONYMOUS wrote
For a start, this line doesn't make sense - atoi() is a function returning an integer, but you're then providing it 'to' an input format specifier, the s , that is trying to match a string (actually a whitespace separated ...
ANONYMOUS wrote
This sounds like a simple coding problem (in your code), not a misunderstanding, or something strange, with C's semantics. There are no 'duplicate' lines. It's your code that's printing any duplicate (copies of) lines, so you'll ne...
ANONYMOUS wrote
If working on a standard Ubuntu distribution, the default compiler (which we invoke with cc) is gcc, and the default command-line (not GUI based) debugger is gdb. However you may need to install gdb from a package if not already inst...
ANONYMOUS wrote
Just 'Chris' thanks; I am not a teacher.
No.
- appending ".txt" does not make a file a text-file (adding ".doc" does not make a file an MS-Word document)
- a filename ending in ".txt" only suggests, but does not cannot enforce, that a...
ANONYMOUS wrote
Similarly, consistency is more important, and the primary reason that many companies will have their own commenting conventions is to assist multiple programmers working on the same project code, or even across multiple projects.
But, ...
ANONYMOUS wrote
There are undoubtably published studies on this (and https en.wikipedia.org wiki Naming convention (programming) ), but I believe the more important issue is simply to be consistent within a single program. Consistency is importan...
- From the project description
"command lines consist of at least 6 'words' separated by one-or-more whitespace characters..."
At least.
- What does the sample solution do?
ANONYMOUS wrote
No, it doesn't mean that at all.
Comment-lines provide comments explanations for to human readers, or permit you to comment-out hide any lines you don't want to be used executed.
Comments have no effect on the running of the program, a...
ANONYMOUS wrote
Hopefully you're just asking this question poorly, or asking the wrong question, but there's no need to delete anything from input files, or even to write new files, for this project.
ANONYMOUS wrote
Glad that you've made progress, although your explanation of why(?) doesn't build confidence that you've really fixed it.
Segmentation faults nearly always occur when accessing memory that you process doesn't own, typically by accessi...
As you've discovered, there's no native support for sets in C, and no widely adopted 3rd-party approach.
Most implementations, yes, just use arrays of bools or chars; more exotic ones, often seen in code for vector embedding, etc, use all individual ...
ANONYMOUS wrote
This is a reasonable approach, though keep in mind that some fields of each struct tm are not specified in the crontab file (as they are not required). I've found it helpful to use the same field names, simply for readability.
Something a bit more descriptive than your second suggestion would surely be better.
The sample solution just says 'dog' is an invalid month
...
I'm struggling to find a reference to an old joke about Unix being very terse in reporting its errors - s...
ANONYMOUS wrote
Hello,
I'm afraid that I can't replicate this issue when I cut-and-paste the two files from the project description into the sample solution.
In this post https secure.csse.uwa.edu.au run help2002?p np opt B246 you said "....when t...
ANONYMOUS wrote
Yes, they probably want isdigit() .
To be pedantic, we generally say it's declared in the ctype.h header file, but defined (implemented) in the standard library.
...
Though, in honesty, to gain some efficiency, most ctype ...
ANONYMOUS wrote
There's certainly no need to use another file; unless the amount of data exceeds what can 'easily' fit in a computer's RAM, or if we wish to retain data for a long period, the usual approach is to read data from a file (once) and sto...
"Japan's digital minister, who's vowed to rid the bureaucracy of outdated tools from the hanko stamp to the fax machine, has now declared 'war' on a technology many haven't seen for decades - the floppy disk.
The hand-sized, square-shaped data storage...
ANONYMOUS wrote
(your question is a little confusing, but) we use the estimates of execution time to determine when a process should terminate.
If a command starts at 10 00am, and it's estimated to run for 9 minutes, we 'say' that it has terminated so...
ANONYMOUS wrote
The sample solution, today (it keeps getting improved ), has 520 lines, of which 390 are lines of code (including all its debug statements).
You may run the following shell commands to count yours
bin echo -n 'total lines ' ; wc...
ANONYMOUS wrote
No.
This was a question asked in the Workshop. The format of our crontab files is greatly simplified compared to the format supported by the system-provided cron utility.
If our 1st project required the complex combinations you've list...
ANONYMOUS wrote
Sorry, but I cannot diagnose your code's problems from this description.
Please attend one of our face-to-face or online lab sessions and discuss this with a lab demonstrator.
And I sincerely doubt that the compiler is introducing any o...
ANONYMOUS wrote
Yes to both questions.
The project description, under File Formats (for the crontab-file) states "The words for the month and the day of the week, may be 3-letter lowercase abbreviations of their possible values, such as jan, feb, mar...
It doesn't matter, provided it's not a value that could be valid as a 'fixed' (non- ) value.
But you wouldn't use NULL, because NULL represents a NULL-pointer and it's not an integer.
ANONYMOUS wrote
It's an unusual goal; generally robust programs are written to handle all possible inputs, detecting and reporting invalid inputs, and correctly handling valid inputs. But, for example, we couldn't imagine or generate all possible in...
I'm surprised that fflush() didn't appear to work for you.
The following program works as I'd expect, flushing its output every 4th character.
include stdio.h
include unistd.h
int main(int argc, char argv )
for(int i 0 ; i 20 ; i) ...
When using printf() the output is buffered (pending) until you 'flush' it out with a newline character, call fflush(stdout); or when the whole program terminates (and exit() flushes all non-empty output streams).
If you want to alway...
ANONYMOUS wrote
You will submit your project's source code, it will be compiled, and then run by providing filenames on its command-line.
Your project will be tested with files other than the samples from the project sheet.
Your project should not rely...
Hello Juliana,
I got a bit lost by the last part of your question, but the 3-letter abbreviations have a clear mapping to an integer representation - 0 sun...6 sat - so why not use an integer to hold the weekday number?
Lowercase only for weekdays and ...
Hello Everyone,
It was recently identified that the official UWA Unit Outline for CITS2002 listed the date and time of this year's final examination as (I think) 1st November, 9.00am.
This information was incorrect, as the (stupid) software managing t...
A summary
https arstechnica.com gadgets 2022 08 walmart-lists-a-30tb-portable-ssd-for-39-it-is-naturally-a-scam
and the interesting full tear-down on Twitter
https twitter.com RayRedacted status 1562914752762105856
Only loosely related to our project, but some students have asked why the tm mday field of a struct tm is the only one that starts from 1, and not from 0
int tm mday; Day of the month (1-31)
I've never known the answer to ...
Hello Juliana,
The crontab file is 'unlimited' in that it can contain requests to run commands at any date time, in any month and any year.
But we only need to simulate the execution of commands for a particular month (of the current year), as specif...
ANONYMOUS wrote
Asking questions is fine, but please first watch Workshop-5 and run the (new) sample solution
https secure.csse.uwa.edu.au run estimatecron-sample
Neither.
Print the name of the command which is executed most frequently throughout ...
You may run a sample solution to the project via https secure.csse.uwa.edu.au run estimatecron-sample
To execute this sample, enter the required month (of the current year) into the textbox, select your crontab-file and estimates-file (from your loc...
ANONYMOUS wrote
Yes, but I think clearer summaries are provided here
- a list of standard C99 functions here https www.mkompf.com cplus cliblist.html
- a list of POSIX functions here https www.mkompf.com cplus posixlist.html
both listed on https ...
Hello,
Your questions seem more related to programming in general, rather than this 1st project or C, in particular.
While very relevant questions, they're best discussed with a project partner.
Some of the issues and choices were mentioned in Workshop-...
"What was the largest piece of software we ever shipped?" The answer may surprise you
https au.pcmag.com software-services 95790 microsofts-largest-piece-of-software-weighed-more-than-40-pounds
The project doesn't require you to print out any explanation of how your project is working - in fact only the last line of output is considered during marking.
However, you'll invariably want to print some 'debug' output while developing your project...
Neither EOF or NULL are actual bytes that are read from a file - if you think about it, any program could write the byte with value -1 (EOF) or 0 (NULL) into a file and follow it by more data, but that byte doesn't signify the end-of-file.
Instead,...
Thanks for everyone's (correct) responses.
Command-names in the crontab file are guaranteed to appear in the estimates file (no need to check for, or report, an error).
Command-names appearing in the estimates file might not be ever used in the cront...
UWA's University Policy on Assessment (21 July 2021) states that all coursework students must be provided with formative feedback in the first half of a teaching period in each unit.
This year we will use two past mid-semester tests as items of format...
ANONYMOUS wrote
You're welcome to use whatever editing application environment you wish.
Xcode on Macs is probably the better of the two.
Be careful (warned) that, historically, Microsoft chose not to support C standards in their IDEs, saying that ther...
Hi Simon,
Yes, you may use it, but I'd strongly encourage you to reconsider your approach - using regex for either the reading parsing of the 2 input files, or matching the 'current' date time against crontab entries is a huge overkill, and not a ver...
ANONYMOUS wrote
It's a good question because it demonstrates the need for spending plenty of time designing your programs and their data well before you start coding (not suggesting that you're not doing that).
Unsure if this helps, or if it's alread...
I'm currently working on a webpage to provide a sample solution; then you'll be able to upload any files, and see the sample's solutions for with those files.
The project will only be tested on a computer with its year set in to 2022.
However, it's not the best design to restrict (the code) of your project to only work in 2022, as it's easy to request the current date time (i.e. year) using standard librari...
The project description says, report
"the name of the most frequently executed command (a single word), the total number of commands invoked (a non-negative integer), and the maximum number of commands running at any time (a non-negative integer)."...
Hi Alicia,
Yes. A pattern such as 1 1 32 7 is invalid because there are only 31 days in August.
Yes, but the asterisk cannot every represent the 32, because it's not part of a valid date.
It's not really a 'calendar system', and you don't need ...
Yes, that's how I interpret it.
I think about the asterisks as wildcards, and effectively ignoring them,
so the above matches any minute hour month when the 1st of the month is also a Monday.
Unsure if the Clarifications page also answers this question ...
ANONYMOUS wrote
I'm assuming that you're using vi vim; if so, re-read the description of its autowrite setting
https secure.csse.uwa.edu.au run help2002?p np opt B28 hl autowrite
Also, I'm confused by your wording "...modify my current home...
The project description provides a sample of one of each file; you can simply add or delete lines to your own copy of those.
Start, for example, with a single line in a crontab file that runs a command just once per day, or every minute, etc. Print ...
ANONYMOUS wrote
I honestly can't imagine what additional libraries you'd require for this project.
What additional libraries functions were you thinking about?
I've added a new point to the Requirements and fine-print section
13. Your project should ...
Please also read the (now numbered) section on Requirements and fine-print
8. Your project only needs to simulate the execution of processes for the requested month (of the current year). All processes will have terminated before the end of the req...
Just to clarify this, because someone asked.
You may, of course, include the standard C header files in your code include stdio.h etc.
There's no need to submit any standard header files for marking, because the marking environments will al...
Someone sent these questions by email - please post here, rather than emailing them to me.
You should assume that the 2 input files are created typed-in by humans, and humans often make mistakes.
You should report as an error any non-comment line that ...
Hi Taylah,
Yes; I've added 'one-or-more whitespace characters....' to the project description.
Once a line is determined to be a comment-line, the whole line is just ignored, so it has no expected layout.
Similarly, the columns words fields in command...
Hi Matthew, sorry, 'contradictory' was the wrong word.
Using today's date, Tue 23rd August (2022)
1 1 23 7 2 - applies in 2022 (the 2 looks redundant but it documents the requirement)
1 1 23 7 tue - applies in 2022 (the tue looks redundant ...
Hi Alicia,
After this morning's labs we made a few changes to the wording, so you may like to re-read parts of the page again.
Files with zero lines should be permitted - they just indicate nothing to be done.
No process will execute beyond the month i...
The files will not exceed the stated dimensions (number of lines, and width) - there is no need to check those.
But you will need to check the format of non-comment lines, and the data itself.
The 1st project description is now available from https teaching.csse.uwa.edu.au units CITS2002 projects project1.php
Please post requests for clarification about any aspect of the project to help2002 so that all students may remain equally inform...
ANONYMOUS wrote
There's a list of standard C99 functions here https www.mkompf.com cplus cliblist.html
and a list of POSIX functions here https www.mkompf.com cplus posixlist.html
(both listed on https teaching.csse.uwa.edu.au units CITS2002 re...
"A new software update will soon give NASA s Curiosity Mars rover a 50 per cent speed boost, allowing it to cover a greater distance and complete more science. But the update very nearly didn t happen because of a mysterious bug in the software t...
ANONYMOUS wrote
cc is the command to invoke the C compiler on your system.
mycc is a shell alias (stored in the memory of your shell process) which calls cc with some important command-line options.
Both are described toward the bo...
"It sounds like something out of an urban legend Some Windows XP-era laptops using 5400 RPM spinning hard drives can allegedly be forced to crash when exposed to Janet Jackson's 1989 hit "Rhythm Nation."
But Microsoft Software Engineer Raymond Chen s...
Were you expecting to have Desktop, backup, bin, lib and src in that directory?
Had you created them before, or had you just seen that they were directory names that I have on my laptop in lectures?
Just in case you haven't seen this yet, from the fantastic TV Series "Silicon Valley"
https www.youtube.com watch?v V7PLxL8jIl8
(mild language warning).
ANONYMOUS wrote
Are you confident that that is your home directory?
Is that confirmed by the command echo or echo HOME ?
Are there any files in that directory at all, with ls -la home username ?
Do you see any files with...
This famous StackOverflow question is being celebrated this week, 10 years after it was asked
https stackoverflow.com questions 11828270 how-do-i-exit-vim
viewed 2.7 million times
https thenewstack.io how-do-you-exit-vim-a-newbie-question-turn...
We know that the C processor receives our C program's source code before the C compiler, processes (modifies) the contents of the source code, and sends its output to the compiler. It can be instructive to see what the C preprocessor produces.
We nor...
Certainly.
reading from left-to-right the ' ' character starting for format specifier,
the '.' begins a request for a number of decimal-points,
the '1' says one digit to the right of the decimal-point,
the 'f' says we're formatting a floating-point value...
A reminder that this Wednesday 17th is PROSH, so our lab at 10-12 on Wednesday morning will be cancelled, but we'll be back for the 2-4 afternoon lab
https teaching.csse.uwa.edu.au units CITS2002 info-prosh.php
Hi Christofle,
That's weird - I can't replicate the problem on either my macOS (Monterey 12.5) or Linux
(Ubuntu 20.04) machines at home (12MB video attached).
I suspect something very odd with your machine's (or personal) vi configuration files.
Have yo...
Yes, vi is installed on new Mac installations (and linked to vim).
But there was never a suggestion to delete random system files - that would be quite a dangerous things to do.
But there are a number of free, 3rd-party applications which identify old ...
Not really a 'news' item, but a well thought out blog article on alternatives to C
https c3.handmade.network blog p 8486-the case against a c alternative
We've casually discussed that, when using languages (such as C) that manage their own memory allocation, we must be careful to also deallocate that memory to avoid memory 'leaks'. We'll discuss this much more in coming lectures.
With that background, ...
Yes, the space gets tight those 128GB drives, with macOS taking about 15GB and the mystery 'System Data' 30-40GB (https beebom.com system-data-mac-storage-delete ).
In this unit we won't be requiring the use of Xcode - after all, most students don'...
ANONYMOUS wrote
I think someone gave this link before (but I can't find it)
https docs.microsoft.com en-us windows wsl filesystems
When working within Linux, you may use the standard Linux file commands
cp oldfile Newfie
and
mv oldfile new...
ANONYMOUS wrote
Hi. Firstly, let's make sure we're using the correct C syntax, else we may be chasing a solution that doesn't exist.
Strings, sequences of zero-or-more characters, are represented between double-quotes, such as "1234".
Single character...
Hello Juliana,
I've found it a bit difficult to understand your question, so there may be some assumptions misunderstandings in my reply.
Firstly, to help understanding, let's not say "C script". The C source code is text to be (correctly) compiled be...
I suggest that, when using C's standard I O formatting functions, that you use i instead of d when dealing with integers.
For printf() there is no difference, but when reading input with scanf() i is a better choice as it makes the han...
You do not need to prefix each filename with its (assumed) directory. Just try to open the required filename, and if the user wishes to open a file located in another directory, then they will provide the required directory and file name themselves ...
ANONYMOUS wrote
The first time you download Xcode it downloads the whole thing, about 12GB. When you later upgrade Xcode it only downloads the changes, often about 2GB-4GB.
That original 12GB is compressed, so when expanded when being installed, proba...
Oops, forgot that one.
There's multiple ways to create new commands for your shell to execute
- shell aliases - usually single-line commands kept in the shell's memory
- shell functions - usually multi-line commands kept in the shell's memory
- sh...
The focus of the question is really 'just' about Boolean conditions and loops.
To get the value of change to be given, as you suggest, we could use scanf() to read it from the keyboard, or get it from a command-line argument (in both cases needing to ...
Using foreground background job control in your shell
The traditional (40 year old) way to run the vim editor is inside the
same window that receives your shell commands. I choose to edit files
and compile them in the same window (and in most of my wo...
Adding coloured syntax-highlighting in vim.
The default installation of vim simply displays its text in monochrome, but by adding
commands to (one of) vim's "startup files", it will add colours to code keywords, comments, ....
To download and add the ne...
A number of students are asking about some of the commands or techniques that I use in lectures (usually to compensate for my slow typing), and perhaps watching those recordings too closely - ) .
There isn't time in lectures to stop and explain them, ...
I received this general question via email
As you know, we're not following any particular text verbatim, but the concepts that are covered in our unit can be found in (any) good textbook on Operating Systems and or C. The title wording used on our ...
ANONYMOUS wrote
It actually says more than just "error", it explicitly reports the problem.
In fact, the problem is detected and reported by the rotate program itself, not by the shell or any other systems program.
You need to invoke the rotate program...
Hi Chris,
Our first lab each week is at 10am Mondays (after the 9am lecture) and you should have sufficient knowledge to (at least commence) it after the previous week's lectures (and Friday workshop, if that helps you).
But the the lectures and labs d...
If you were looking in LMS for the recording, it almost certainly said "not yet recorded", or "not yet available". It is now there.
Is this normal? No, the beginning of the semester has been a bit disrupted by a couple of events, but we should be get...
The Face-to-face Lab is on Wednesdays 2-4pm.
The Online lab is on Thursdays, 2-4pm.
For reasons explained on our unit's homepage, you can ignore the CAS times.
Thanks for reporting the problem.
Hello Everyone,
Welcome to week-2, where we'll hopefully get everything back on track.
Finishing my COVID isolation tonight, so I'll be back on campus from tomorrow.
Please drop by my office, Rm 2.20, if you have any questions about the unit.
To date, yo...
Hello Dana,
Unfortunately, this face-to-face session has been cancelled (see recent ANNOUNCEMENT) and will be replaced by a video recording (anyway).
...
CSSE Rm 2.07 was refurbished earlier in the year, turning an old computer lab into the much better,...
Hello Everyone,
Sadly, I've just tested positive for COVID and so, following the WA Govt's and UWA's policies, will be isolating, but still working, at home for 7 days.
The following CITS2002 face-to-face sessions are CANCELLED
- Lecture, 10am Tuesda...
Unfortunately, this face-to-face session has been cancelled (see following announcement),
but will be replaced by a video recording announced linked on our Schedule page.
...
On Wednesday 27th, 2-4pm in CSSE Lab 2.07,
I'll be presenting an informal prese...
Hello Everyone,
This semester (today) we have around 390 students enrolled, 50 of whom
are still resident overseas. We'll spend part of the first lecture
discussing how the unit will run this year, but first I'll head off some
common questions that stud...