It's UWAweek 48

help2002

This forum is provided to promote discussion amongst students enrolled in CITS2002 Systems Programming.
Please consider offering answers and suggestions to help other students! And if you fix a problem by following a suggestion here, it would be great if other interested students could see a short "Great, fixed it!"  followup message.

383 articles posted by this person
Showing 383 of 919 articles.
Currently 2 other people reading this forum.


SVG not supported 2:52pm Thu 24th Nov, Christopher M.

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...


 UWA week 44 (2nd semester, 1st exam week) ↓
SVG not supported 6:04am Tue 1st Nov, Christopher M.

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 ...


SVG not supported 5:57pm Mon 31st Oct, Christopher M.

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...


SVG not supported 3:09pm Mon 31st Oct, Christopher M.

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...


SVG not supported 3:03pm Mon 31st Oct, Christopher M.

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...


SVG not supported 3:00pm Mon 31st Oct, Christopher M.

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...


SVG not supported 2:47pm Mon 31st Oct, Christopher M.

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...


SVG not supported 2:42pm Mon 31st Oct, Christopher M.

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...


SVG not supported 2:32pm Mon 31st Oct, Christopher M.

ANONYMOUS wrote Yes - though, of course, whether that will work will depend on the rest of your implementation.


 UWA week 43 (2nd semester, study break) ↓
SVG not supported 2:52pm Sun 30th Oct, Christopher M.

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() ...


SVG not supported 2:49pm Sun 30th Oct, Christopher M.

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...


SVG not supported 5:54pm Sat 29th Oct, Christopher M.

Well, I'm giving up on this for a while. Please just test your project in a directory without spaces in its name.


SVG not supported 5:49pm Sat 29th Oct, Christopher M.

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...


SVG not supported 5:43pm Sat 29th Oct, Christopher M.

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 ...


SVG not supported 5:35pm Sat 29th Oct, Christopher M.

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 ...


SVG not supported 5:32pm Sat 29th Oct, Christopher M.

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...


SVG not supported 5:22am Sat 29th Oct, Christopher M.

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...


SVG not supported 4:22am Sat 29th Oct, Christopher M.

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 ...


SVG not supported 4:12am Sat 29th Oct, Christopher M.

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


SVG not supported 4:08am Sat 29th Oct, Christopher M.

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...


SVG not supported 4:04am Sat 29th Oct, Christopher M.

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...


SVG not supported 3:03am Sat 29th Oct, Christopher M.

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...


SVG not supported 6:36am Fri 28th Oct, Christopher M.

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...


SVG not supported 6:14am Fri 28th Oct, Christopher M.

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...


SVG not supported 6:04am Fri 28th Oct, Christopher M.

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.


SVG not supported 4:58am Fri 28th Oct, Christopher M.

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...


SVG not supported 11:42am Thu 27th Oct, Christopher M.

No marks for anonymous people - you'll need to email me.


SVG not supported 4:30am Thu 27th Oct, Christopher M.

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...


SVG not supported 4:03am Thu 27th Oct, Christopher M.

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...


SVG not supported 2:01pm Wed 26th Oct, Christopher M.

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,...


SVG not supported 12:54pm Wed 26th Oct, Christopher M.

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...


SVG not supported 10:18am Wed 26th Oct, Christopher M.

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...


SVG not supported 9:42am Wed 26th Oct, Christopher M.

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...


SVG not supported 9:30am Wed 26th Oct, Christopher M.

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...


SVG not supported 9:29am Wed 26th Oct, Christopher M.

ANONYMOUS wrote Yes, very important. Please watch the video recording from Tuesday 18th Oct.


 UWA week 42 (2nd semester, week 12) ↓
SVG not supported 5:48am Sun 23rd Oct, Christopher M.

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...


 UWA week 43 (2nd semester, study break) ↓
SVG not supported
Project1 👍x1  (all 4)
6:07pm Mon 24th Oct, Christopher M.

ANONYMOUS wrote That's the plan.


SVG not supported 5:22pm Mon 24th Oct, Christopher M.

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).


 UWA week 42 (2nd semester, week 12) ↓
SVG not supported 4:20pm Sun 23rd Oct, Christopher M.

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.


SVG not supported 4:22pm Fri 21st Oct, Christopher M.

Thanks Alan, will try to find time to fix this soon for students still reliant on it. I hope the intended operation is, however, clear.


SVG not supported 12:37pm Fri 21st Oct, Christopher M.

ANONYMOUS wrote If little success with Google, https secure.csse.uwa.edu.au run help2002?opt St search garbage may help.


SVG not supported 5:47pm Thu 20th Oct, Christopher M.

ANONYMOUS wrote The marking will not involve testing the same test multiple times.


SVG not supported 5:37pm Thu 20th Oct, Christopher M.

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.


SVG not supported 5:35pm Thu 20th Oct, Christopher M.

Stated some where previously, can't find it - only use the -l option with -b and -u.


SVG not supported 5:34pm Thu 20th Oct, Christopher M.

ANONYMOUS wrote Because src lecture17 is a directory, not a file. ??


SVG not supported 5:28pm Thu 20th Oct, Christopher M.

ANONYMOUS wrote What does the sample solution do?


SVG not supported 5:27pm Thu 20th Oct, Christopher M.

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...


SVG not supported 5:24pm Thu 20th Oct, Christopher M.

Print it to the stdout stream any way you choose. Why not use printf() ?


SVG not supported 5:23pm Thu 20th Oct, Christopher M.

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 ) ...


SVG not supported 5:19pm Thu 20th Oct, Christopher M.

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', ...


SVG not supported 5:15pm Thu 20th Oct, Christopher M.

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.


SVG not supported 5:13pm Thu 20th Oct, Christopher M.

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,...


SVG not supported 11:24am Thu 20th Oct, Christopher M.

ANONYMOUS wrote This is the wrong way around. Should be dup2(fd1, 1); close(fd1);


SVG not supported 11:14am Thu 20th Oct, Christopher M.

ANONYMOUS wrote Can have only one of -b, -r, or -u. What does the sample solution do?


SVG not supported 3:33am Thu 20th Oct, Christopher M.

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.


SVG not supported 3:32am Thu 20th Oct, Christopher M.

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...


SVG not supported 3:26am Thu 20th Oct, Christopher M.

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 ...


SVG not supported 3:17am Thu 20th Oct, Christopher M.

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.


SVG not supported 3:15am Thu 20th Oct, Christopher M.

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...


SVG not supported 3:10am Thu 20th Oct, Christopher M.

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...


SVG not supported 3:03am Thu 20th Oct, Christopher M.

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'.


SVG not supported 3:00am Thu 20th Oct, Christopher M.

Great to hear you solved it. Yes, you should either truncate or remove ( unlink() ) an existing trove-file.


SVG not supported 2:59am Thu 20th Oct, Christopher M.

The video has no audio.


SVG not supported 4:27pm Wed 19th Oct, Christopher M.

You first compile all C files with cc's -c option, then link the object files together with cc 's -o option. Lecture-17.


SVG not supported 4:25pm Wed 19th Oct, Christopher M.

ANONYMOUS wrote And that's why we call fork() before calling execl() in the new child process. Lecture-9.


SVG not supported 4:21pm Wed 19th Oct, Christopher M.

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...


SVG not supported 4:05pm Wed 19th Oct, Christopher M.

Thanks James, I learn something new every day


SVG not supported 4:04pm Wed 19th Oct, Christopher M.

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.


SVG not supported 4:02pm Wed 19th Oct, Christopher M.

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...


SVG not supported 3:57pm Wed 19th Oct, Christopher M.

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.


SVG not supported 3:54pm Wed 19th Oct, Christopher M.

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...


SVG not supported 3:50pm Wed 19th Oct, Christopher M.

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...


SVG not supported 2:15pm Wed 19th Oct, Christopher M.

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 ...


SVG not supported 2:13pm Wed 19th Oct, Christopher M.

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


SVG not supported 4:03am Wed 19th Oct, Christopher M.

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.


SVG not supported 4:01am Wed 19th Oct, Christopher M.

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...


SVG not supported 3:44am Wed 19th Oct, Christopher M.

It's possible (if the buffer is shorter than the whole file), but it can easily be detected and handled with the next read from the file.


SVG not supported 3:42am Wed 19th Oct, Christopher M.

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...


SVG not supported 3:30am Wed 19th Oct, Christopher M.

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.


SVG not supported 6:34pm Tue 18th Oct, Christopher M.

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...


SVG not supported 6:17pm Tue 18th Oct, Christopher M.

It's unclear if you're asking a question, or just writing down your thoughts.


SVG not supported 4:04pm Tue 18th Oct, Christopher M.

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...


SVG not supported 1:56pm Tue 18th Oct, Christopher M.

ANONYMOUS wrote Unusual At least try it with -std c99


SVG not supported 1:42pm Tue 18th Oct, Christopher M.

What have you tried? You can design test approaches independent of needing compression decompression working.


SVG not supported 1:07pm Tue 18th Oct, Christopher M.

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.


SVG not supported 12:50pm Tue 18th Oct, Christopher M.

ANONYMOUS wrote Perhaps review the steps here https teaching.csse.uwa.edu.au units CITS2002 labsheets software.php


SVG not supported 12:18pm Tue 18th Oct, Christopher M.

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.


SVG not supported 12:17pm Tue 18th Oct, Christopher M.

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.


SVG not supported 11:59am Tue 18th Oct, Christopher M.

ANONYMOUS wrote (in your last post you were using Linux...?) Yes, all files; no need to look for, or exclude, certain files.


SVG not supported 11:58am Tue 18th Oct, Christopher M.

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.


SVG not supported 9:33am Tue 18th Oct, Christopher M.

No idea, but I have LANG "en AU.US-ASCII" LC COLLATE "C" LC CTYPE "C" LC MESSAGES "C" LC MONETARY "C" LC NUMERIC "C" LC TIME "C" LC ALL "C"


SVG not supported 5:58am Tue 18th Oct, Christopher M.

Full details of the unit's final examination are available from https teaching.csse.uwa.edu.au units CITS2002 examinations.php


SVG not supported 4:54am Tue 18th Oct, Christopher M.

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,...


SVG not supported 4:46am Tue 18th Oct, Christopher M.

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() ...


SVG not supported 4:41am Tue 18th Oct, Christopher M.

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.


SVG not supported 4:38am Tue 18th Oct, Christopher M.

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...


SVG not supported 4:34am Tue 18th Oct, Christopher M.

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 ...


SVG not supported 4:03pm Mon 17th Oct, Christopher M.

You can use the C processor to only conditionally define things once if defined( TROVE H ) define TROVE H .... .... endif TROVE H


SVG not supported 5:15am Mon 17th Oct, Christopher M.

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...


SVG not supported 4:28am Mon 17th Oct, Christopher M.

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...


 UWA week 41 (2nd semester, week 11) ↓
SVG not supported 4:45pm Sun 16th Oct, Christopher 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."


SVG not supported 4:05pm Sun 16th Oct, Christopher M.

I use the command-line utility od -c .... or od -a ... for a quick look.


SVG not supported 3:53pm Sun 16th Oct, Christopher M.

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...


SVG not supported 3:38pm Sun 16th Oct, Christopher M.

Quick answer... What does the project sheet say?


SVG not supported 5:25am Sun 16th Oct, Christopher M.

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...


SVG not supported 5:18am Sun 16th Oct, Christopher M.

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...


SVG not supported
Binary Files 👍x1  (both)
12:22pm Sat 15th Oct, Christopher M.

ANONYMOUS wrote The correct approach is to search this forum for terms such as binary and non text files. Use of fgets() is incorrect.


SVG not supported 9:23am Sat 15th Oct, Christopher M.

Implementing decompression with zcat, using a pipe and dup2, should be just the reverse of how you implemented compression with gzip.


SVG not supported 9:14am Sat 15th Oct, Christopher M.

All debug output will be ignored. No need to remove trove-file after use.


SVG not supported 5:45am Sat 15th Oct, Christopher M.

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; ...


SVG not supported 8:21pm Fri 14th Oct, Christopher M.

Of course, if you knew ahead of time what the longest line s length was


SVG not supported 7:45pm Fri 14th Oct, Christopher M.

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() .


SVG not supported 2:27pm Fri 14th Oct, Christopher M.

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.


SVG not supported 2:05pm Fri 14th Oct, Christopher M.

Please read this almost identical question, and my reply https secure.csse.uwa.edu.au run help2002?p np opt U645


SVG not supported 2:03pm Fri 14th Oct, Christopher M.

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 ...


SVG not supported 1:52pm Fri 14th Oct, Christopher M.

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 ' '.


SVG not supported 9:18am Fri 14th Oct, Christopher M.

ANONYMOUS wrote Via the command-line you may be asked to index files from anywhere. They could be 'local', absolute, or relative to where you are.


SVG not supported 8:18am Fri 14th Oct, Christopher M.

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).


SVG not supported 6:22am Fri 14th Oct, Christopher M.

ANONYMOUS wrote Has the modified sample solution helped you find the problem?


SVG not supported 5:23am Fri 14th Oct, Christopher M.

If the file no longer exists in the absolute location stated in the trove-file. No need to try and find it elsewhere.


SVG not supported 5:22am Fri 14th Oct, Christopher M.

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...


SVG not supported 3:31am Fri 14th Oct, Christopher M.

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...


SVG not supported 3:12am Fri 14th Oct, Christopher M.

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...


SVG not supported 3:06am Fri 14th Oct, Christopher M.

This has been discussed a number of times on this forum already. Search for strdup


SVG not supported 3:05am Fri 14th Oct, Christopher M.

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...


SVG not supported 2:59am Fri 14th Oct, Christopher M.

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??)


SVG not supported 2:56am Fri 14th Oct, Christopher M.

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...


SVG not supported 1:19pm Thu 13th Oct, Christopher M.

"usr bin zcat" should be " usr bin zcat"


SVG not supported 9:41am Thu 13th Oct, Christopher M.

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() ...


SVG not supported 7:00pm Wed 12th Oct, Christopher M.

ANONYMOUS wrote Before I repeat myself (or before anyone else replies - please??), can we ask if you've watched Lecture-17?


SVG not supported 6:53pm Wed 12th Oct, Christopher M.

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...


SVG not supported 6:49pm Wed 12th Oct, Christopher M.

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...


SVG not supported 9:17am Wed 12th Oct, Christopher M.

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...


SVG not supported 4:56am Wed 12th Oct, Christopher M.

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...


SVG not supported 7:49pm Tue 11th Oct, Christopher M.

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 ...


SVG not supported 6:49pm Tue 11th Oct, Christopher M.

Yes. And you can confirm this with man isalnum


SVG not supported 6:47pm Tue 11th Oct, Christopher M.

ANONYMOUS wrote Great news


SVG not supported 3:45pm Tue 11th Oct, Christopher M.

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 ...


SVG not supported 4:30am Tue 11th Oct, Christopher M.

(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...


SVG not supported 6:38pm Mon 10th Oct, Christopher M.

fread() - sorry, typo.


SVG not supported 6:27pm Mon 10th Oct, Christopher M.

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...


SVG not supported 12:15pm Mon 10th Oct, Christopher M.

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.


SVG not supported 11:41am Mon 10th Oct, Christopher M.

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...


SVG not supported 10:00am Mon 10th Oct, Christopher M.

What does the sample solution do?


SVG not supported 3:34am Mon 10th Oct, Christopher M.

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...


 UWA week 40 (2nd semester, week 10) ↓
SVG not supported 5:21pm Sun 9th Oct, Christopher M.

ANONYMOUS wrote If working on Windows, and using Linux from within WSL-2, you should be using Linux-format pathnames, not Windows-format pathnames.


SVG not supported 5:19pm Sun 9th Oct, Christopher M.

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.


SVG not supported 3:56pm Sun 9th Oct, Christopher M.

ANONYMOUS wrote You need to first build a trove-file (upper command) and then, within 60 seconds, search for a word using the lower command.


SVG not supported 3:55pm Sun 9th Oct, Christopher M.

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...


SVG not supported 6:57am Sun 9th Oct, Christopher M.

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...


SVG not supported 6:54am Sun 9th Oct, Christopher M.

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.


SVG not supported 6:52am Sun 9th Oct, Christopher M.

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 ...


SVG not supported 3:41am Sat 8th Oct, Christopher M.

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...


SVG not supported 3:15am Sat 8th Oct, Christopher M.

Thanks; yes, recursively traverse all named directories to locate all files to be indexed. Try this on the sample solution.


SVG not supported 9:38am Thu 6th Oct, Christopher M.

realpath() does not do this; it must be something else in your code.


SVG not supported 9:18am Thu 6th Oct, Christopher M.

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 ...


SVG not supported 4:12am Thu 6th Oct, Christopher M.

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...


SVG not supported 3:24am Thu 6th Oct, Christopher M.

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 ...


SVG not supported 3:20am Thu 6th Oct, Christopher M.

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...


SVG not supported 7:23pm Wed 5th Oct, Christopher M.

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...


SVG not supported 7:15pm Wed 5th Oct, Christopher M.

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 ...


SVG not supported 6:53pm Wed 5th Oct, Christopher M.

ANONYMOUS wrote Just to 'clean up' from any previous commands, and to show that . trove -b ... creates a new trove-file.


SVG not supported 4:13pm Wed 5th Oct, Christopher M.

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...


SVG not supported 4:02pm Wed 5th Oct, Christopher M.

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


SVG not supported 3:59pm Wed 5th Oct, Christopher M.

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, ...


SVG not supported 11:53am Wed 5th Oct, Christopher M.

ANONYMOUS wrote If no trove-file is given on the command-line, you use the default trove-file name. Watch the sample video.


SVG not supported 11:48am Wed 5th Oct, Christopher M.

It searches for the requested word, reading from the previously built trove-file.


SVG not supported 11:32am Wed 5th Oct, Christopher M.

ANONYMOUS wrote Not a silly question. Exactly zero or one of them may be provided - that's what the (cryptic) notation " -b -r -u " means.


SVG not supported 9:07am Wed 5th Oct, Christopher M.

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...


SVG not supported 3:34am Wed 5th Oct, Christopher M.

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...


SVG not supported 3:24am Wed 5th Oct, Christopher M.

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...


SVG not supported 3:00am Wed 5th Oct, Christopher M.

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?


SVG not supported 4:29pm Tue 4th Oct, Christopher M.

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...


SVG not supported 3:53am Tue 4th Oct, Christopher M.

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...


SVG not supported 3:43am Tue 4th Oct, Christopher M.

ANONYMOUS wrote We're unable to solve this because all you've provided is "... keeps giving me errors".


SVG not supported 6:06pm Mon 3rd Oct, Christopher M.

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...


SVG not supported 2:36pm Mon 3rd Oct, Christopher M.

ANONYMOUS wrote Yes, as explained in this morning's lecture. Though I can't yet give you a date time when, as I also need to finish Project-1 marking.


SVG not supported 1:27pm Mon 3rd Oct, Christopher M.

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.


SVG not supported 1:25pm Mon 3rd Oct, Christopher M.

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...


SVG not supported 1:06pm Mon 3rd Oct, Christopher M.

"Getting started", point 11.


SVG not supported 12:45pm Mon 3rd Oct, Christopher M.

ANONYMOUS wrote Many years' worth of past CITS2002 final-exam papers are available from the UWA Library - simply make a OneSearch query for CITS2002


SVG not supported 3:02am Mon 3rd Oct, Christopher M.

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...


SVG not supported 2:58am Mon 3rd Oct, Christopher M.

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...


 UWA week 39 (2nd semester, week 9) ↓
SVG not supported 5:57pm Sun 2nd Oct, Christopher M.

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...


SVG not supported 2:13pm Tue 27th Sep, Christopher M.

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...


 UWA week 38 (2nd semester, week 8) ↓
SVG not supported 7:30am Sun 25th Sep, Christopher M.

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...


SVG not supported 3:09am Wed 21st Sep, Christopher M.

"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...


SVG not supported 1:36pm Mon 19th Sep, Christopher M.

Yes, just started a new thread https secure.csse.uwa.edu.au run help2002?p np opt B463


SVG not supported 1:35pm Mon 19th Sep, Christopher M.

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...


 UWA week 37 (2nd semester, week 7) ↓
SVG not supported 4:56pm Sun 18th Sep, Christopher M.

ANONYMOUS wrote Yes, though it's the array definition . It is not initialised.


SVG not supported
midsem 2019 q10 👍x1  (all 6)
2:07pm Sun 18th Sep, Christopher M.

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...


SVG not supported 2:01pm Sun 18th Sep, Christopher M.

Line C does not contain a syntax error. The output from the C-preprocessor for Line C is for(int i 0 ; i 10; i) which is perfectly valid.


SVG not supported 3:13pm Fri 16th Sep, Christopher M.

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.


SVG not supported 12:12pm Fri 16th Sep, Christopher M.

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.


SVG not supported 11:50am Fri 16th Sep, Christopher M.

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.


SVG not supported 8:17am Fri 16th Sep, Christopher M.

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...


SVG not supported 7:10am Fri 16th Sep, Christopher M.

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 ...


SVG not supported 5:54am Fri 16th Sep, Christopher M.

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...


SVG not supported 5:25am Fri 16th Sep, Christopher M.

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...


SVG not supported 5:18am Fri 16th Sep, Christopher M.

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.


SVG not supported 5:16am Fri 16th Sep, Christopher M.

ANONYMOUS wrote Yes, printing with printf() will be fine.


SVG not supported 5:14am Fri 16th Sep, Christopher M.

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.


SVG not supported 4:03pm Thu 15th Sep, Christopher M.

ANONYMOUS wrote Yes (but see how many times the project description says 'text files'). What does the sample solution do?


SVG not supported 4:01pm Thu 15th Sep, Christopher M.

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...


SVG not supported 3:14pm Thu 15th Sep, Christopher M.

We hadn't planned or budgeted for it, and we've had additional people in the labs Tue-Thu this week. Attached is the lab bookings for this week.


SVG not supported 1:59pm Thu 15th Sep, Christopher M.

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??)


SVG not supported 7:33am Thu 15th Sep, Christopher M.

"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...


SVG not supported 5:50am Thu 15th Sep, Christopher M.

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).


SVG not supported 5:45am Thu 15th Sep, Christopher M.

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...


SVG not supported 5:42am Thu 15th Sep, Christopher M.

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.


SVG not supported 5:37am Thu 15th Sep, Christopher M.

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 ...


SVG not supported 5:25am Thu 15th Sep, Christopher M.

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?


SVG not supported 7:25pm Wed 14th Sep, Christopher M.

I cannot imagine why you re using floating point values in this project, and suggest you try to remove them.


SVG not supported 7:03pm Wed 14th Sep, Christopher M.

ANONYMOUS wrote Was not anticipating compiling with -lm Why do you need it?


SVG not supported 4:07pm Wed 14th Sep, Christopher M.

ANONYMOUS wrote It won't happen (during testing), but it you are already checking for it, leave the working code in there.


SVG not supported 3:59pm Wed 14th Sep, Christopher M.

The loop include stdint.h for(uint64 t i 0 ; i UINT64 MAX ; i) ... will loop 18,446,744,073,709,551,615 times, but I won't be waiting for it.


SVG not supported 2:56pm Wed 14th Sep, Christopher M.

ANONYMOUS wrote Because months are numbered from 0, so month 9 is October, which has 31 days. ??


SVG not supported 11:44am Wed 14th Sep, Christopher M.

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...


SVG not supported 6:20am Wed 14th Sep, Christopher M.

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...


SVG not supported 6:50pm Tue 13th Sep, Christopher M.

No workshop this Friday, as it's our 1st project's deadline (and history shows that no-one turns up )


SVG not supported 4:54pm Tue 13th Sep, Christopher M.

Use this one.


SVG not supported 4:40pm Tue 13th Sep, Christopher M.

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...


SVG not supported 4:27pm Tue 13th Sep, Christopher M.

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...


SVG not supported 1:30pm Tue 13th Sep, Christopher M.

What does the sample solution do?


SVG not supported 5:36am Tue 13th Sep, Christopher M.

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...


SVG not supported 3:01am Tue 13th Sep, Christopher M.

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...


SVG not supported 4:02pm Mon 12th Sep, Christopher M.

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 ...


SVG not supported 3:34pm Mon 12th Sep, Christopher M.

Don't worry - we've all done that before -)


SVG not supported 3:03pm Mon 12th Sep, Christopher M.

ANONYMOUS wrote Not sir - that's my Dad's name -)


SVG not supported 1:02pm Mon 12th Sep, Christopher M.

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...


SVG not supported 4:41am Mon 12th Sep, Christopher M.

(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...


 UWA week 36 (2nd semester, mid-semester break) ↓
SVG not supported 8:10pm Sun 11th Sep, Christopher M.

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 ...


SVG not supported 8:06pm Sun 11th Sep, Christopher M.

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...


SVG not supported 7:41am Sun 11th Sep, Christopher M.

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...


SVG not supported 7:30am Sun 11th Sep, Christopher M.

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.


SVG not supported 7:11am Sun 11th Sep, Christopher M.

Solutions to the 2 items of Formative Assessment are now available from here https teaching.csse.uwa.edu.au units CITS2002 formative.php


SVG not supported 6:40am Sun 11th Sep, Christopher M.

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."


SVG not supported 6:37am Sun 11th Sep, Christopher M.

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...


SVG not supported 8:01pm Sat 10th Sep, Christopher M.

Yes (and the month and day names, too).


SVG not supported 5:45pm Sat 10th Sep, Christopher M.

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...


SVG not supported 5:36pm Sat 10th Sep, Christopher M.

ANONYMOUS wrote Please search for and read previous posts asking very similar things. For example https secure.csse.uwa.edu.au run help2002?opt B335


SVG not supported 7:09am Sat 10th Sep, Christopher M.

ANONYMOUS wrote I suggest that you review our Workshop which involved days and months. And https pubs.opengroup.org onlinepubs 9699919799 functions mktime.html


SVG not supported
size of structure 👍x1  (both)
7:03am Sat 10th Sep, Christopher M.

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 '...


SVG not supported 4:29pm Fri 9th Sep, Christopher M.

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.


SVG not supported 6:36am Fri 9th Sep, Christopher M.

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...


SVG not supported 4:59am Fri 9th Sep, Christopher M.

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...


SVG not supported 3:28pm Thu 8th Sep, Christopher M.

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...


SVG not supported 3:06pm Thu 8th Sep, Christopher M.

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...


SVG not supported 3:01pm Thu 8th Sep, Christopher M.

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" ?)


SVG not supported 2:59pm Thu 8th Sep, Christopher M.

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 ...


SVG not supported 2:56pm Thu 8th Sep, Christopher M.

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...


SVG not supported 4:05am Thu 8th Sep, Christopher M.

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 (...


SVG not supported 3:53am Thu 8th Sep, Christopher M.

ANONYMOUS wrote Nothing wrong with long thread if it's useful -)


SVG not supported 3:52am Thu 8th Sep, Christopher M.

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 ...


SVG not supported 3:47am Thu 8th Sep, Christopher M.

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...


SVG not supported 3:46pm Wed 7th Sep, Christopher M.

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...


SVG not supported 3:31pm Wed 7th Sep, Christopher M.

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.


SVG not supported 3:29pm Wed 7th Sep, Christopher M.

ANONYMOUS wrote This question has no context. What is "the top command" ? What function? When you say "header", do you mean "prototype" or "declaration" ?


SVG not supported 3:28pm Wed 7th Sep, Christopher M.

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 ...


SVG not supported 3:25pm Wed 7th Sep, Christopher M.

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 ...


SVG not supported 7:23am Wed 7th Sep, Christopher M.

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 ...


SVG not supported 7:20am Wed 7th Sep, Christopher M.

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...


SVG not supported 5:13am Tue 6th Sep, Christopher M.

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 ...


SVG not supported 5:09am Tue 6th Sep, Christopher M.

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...


SVG not supported 6:20am Mon 5th Sep, Christopher M.

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...


 UWA week 35 (2nd semester, week 6) ↓
SVG not supported 5:05pm Sun 4th Sep, Christopher M.

Yes, as stated in lectures and workshops, and written here https secure.csse.uwa.edu.au run help2002?p np opt B239


SVG not supported 5:03pm Sun 4th Sep, Christopher M.

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...


SVG not supported 5:49am Sun 4th Sep, Christopher M.

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, ...


SVG not supported 5:38am Sun 4th Sep, Christopher M.

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...


SVG not supported 5:33am Sun 4th Sep, Christopher M.

- 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?


SVG not supported 5:30am Sun 4th Sep, Christopher M.

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...


SVG not supported 5:41am Sat 3rd Sep, Christopher M.

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.


SVG not supported 5:40am Sat 3rd Sep, Christopher M.

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...


SVG not supported 5:36am Sat 3rd Sep, Christopher M.

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 ...


SVG not supported 5:31am Sat 3rd Sep, Christopher M.

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.


SVG not supported 2:44pm Thu 1st Sep, Christopher M.

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...


SVG not supported 6:20am Thu 1st Sep, Christopher M.

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...


SVG not supported 5:41am Thu 1st Sep, Christopher M.

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 ...


SVG not supported 5:29am Thu 1st Sep, Christopher M.

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...


SVG not supported 5:16am Thu 1st Sep, Christopher M.

Turning into an interesting story -) SPOILER ALERT https www.youtube.com watch?v 3W27UwYQnD0 t 10s


SVG not supported 5:08am Thu 1st Sep, Christopher M.

"Australian Signals Directorate releases coin with secret code to mark cyber-spy agency's 75th anniversary" https www.abc.net.au news 2022-09-01 act-spy-agency-releases-coin-with-secret-code 101391964 ABC News suggests - "If you can crack the code ...


SVG not supported 4:36am Thu 1st Sep, Christopher M.

"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...


SVG not supported 6:18am Wed 31st Aug, Christopher M.

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...


SVG not supported 6:13am Wed 31st Aug, Christopher M.

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...


SVG not supported 6:06am Wed 31st Aug, Christopher M.

There could be a million comment lines in a file but, as comment lines (once detected) are ignored and never stored, they should introduce no problem.


SVG not supported 6:05am Wed 31st Aug, Christopher M.

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...


SVG not supported 6:02am Wed 31st Aug, Christopher M.

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...


SVG not supported 5:59am Wed 31st Aug, Christopher M.

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...


SVG not supported 12:26pm Tue 30th Aug, Christopher M.

Please re-read the project description, and experiment with the sample solution.


SVG not supported 11:22am Tue 30th Aug, Christopher M.

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.


SVG not supported
1st project Output 👍x1  (all 5)
5:24am Tue 30th Aug, Christopher M.

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...


SVG not supported 4:55am Tue 30th Aug, Christopher M.

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) ...


SVG not supported 4:26pm Mon 29th Aug, Christopher M.

Didn't like or understand my reply?


SVG not supported 2:39pm Mon 29th Aug, Christopher M.

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...


SVG not supported 12:59pm Mon 29th Aug, Christopher M.

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...


SVG not supported 12:56pm Mon 29th Aug, Christopher M.

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 ...


SVG not supported 12:38pm Mon 29th Aug, Christopher M.

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...


SVG not supported 5:01am Mon 29th Aug, Christopher M.

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


SVG not supported 4:28am Mon 29th Aug, Christopher M.

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 ...


 UWA week 34 (2nd semester, week 5) ↓
SVG not supported 5:00pm Sun 28th Aug, Christopher M.

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...


SVG not supported 4:56pm Sun 28th Aug, Christopher M.

Yes - nothing wrong with wishing to run the same command at multiple times throughout the month. Try it for yourself on the sample solution.


SVG not supported 10:05am Sun 28th Aug, Christopher M.

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 ...


SVG not supported 9:23am Sun 28th Aug, Christopher M.

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...


SVG not supported 10:43am Sat 27th Aug, Christopher M.

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 ...


SVG not supported 6:14am Sat 27th Aug, Christopher M.

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-...


SVG not supported 4:30am Sat 27th Aug, Christopher M.

"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


SVG not supported 12:53pm Fri 26th Aug, Christopher M.

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...


SVG not supported 6:07am Fri 26th Aug, Christopher M.

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,...


SVG not supported 4:41am Fri 26th Aug, Christopher M.

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...


SVG not supported 3:23pm Thu 25th Aug, Christopher M.

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...


SVG not supported 2:57pm Thu 25th Aug, Christopher M.

Thanks Simon; very helpful.


SVG not supported 2:22pm Thu 25th Aug, Christopher M.

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...


SVG not supported 11:20am Thu 25th Aug, Christopher M.

Do you mean that the non-comment lines have the correct number of columns?


SVG not supported 11:11am Thu 25th Aug, Christopher M.

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...


SVG not supported 5:09am Thu 25th Aug, Christopher M.

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...


SVG not supported 5:23pm Wed 24th Aug, Christopher M.

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.


SVG not supported 1:19pm Wed 24th Aug, Christopher M.

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...


SVG not supported 12:17pm Wed 24th Aug, Christopher M.

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)."...


SVG not supported 10:58am Wed 24th Aug, Christopher M.

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 ...


SVG not supported 10:54am Wed 24th Aug, Christopher M.

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 ...


SVG not supported 6:03am Wed 24th Aug, Christopher M.

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...


SVG not supported 5:58am Wed 24th Aug, Christopher M.

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 ...


SVG not supported 5:53am Wed 24th Aug, Christopher M.

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 ...


SVG not supported 5:50am Wed 24th Aug, Christopher M.

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...


SVG not supported 11:51am Tue 23rd Aug, Christopher M.

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...


SVG not supported 5:19am Tue 23rd Aug, Christopher M.

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 ...


SVG not supported 4:19am Tue 23rd Aug, Christopher M.

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...


SVG not supported 4:14am Tue 23rd Aug, Christopher M.

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 ...


SVG not supported 3:09pm Mon 22nd Aug, Christopher M.

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...


SVG not supported 12:14pm Mon 22nd Aug, Christopher M.

ANONYMOUS wrote Neither question requires a sorting algorithm. There are far simpler solutions (because you don't need to sort the data).


SVG not supported 12:12pm Mon 22nd Aug, Christopher M.

(politely) this is something you should be able to reason about for yourself. You will need to handle contradictory data (as an error).


SVG not supported 11:46am Mon 22nd Aug, Christopher M.

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.


SVG not supported 6:41am Mon 22nd Aug, Christopher M.

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...


SVG not supported 3:51am Mon 22nd Aug, Christopher M.

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...


 UWA week 33 (2nd semester, week 4) ↓
SVG not supported 5:24am Sat 20th Aug, Christopher M.

"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...


SVG not supported 4:38am Sat 20th Aug, Christopher M.

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...


SVG not supported 8:22am Fri 19th Aug, Christopher M.

"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...


SVG not supported 7:58am Wed 17th Aug, Christopher M.

Workshop 4 is (finally) available from https teaching.csse.uwa.edu.au units CITS2002 workshops workshop4.php


SVG not supported 4:21pm Tue 16th Aug, Christopher M.

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?


SVG not supported 12:58pm Tue 16th Aug, Christopher M.

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).


SVG not supported 11:46am Tue 16th Aug, Christopher M.

Anyone able to help Nicholas with this?


SVG not supported 11:37am Tue 16th Aug, Christopher M.

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...


SVG not supported 7:58am Tue 16th Aug, Christopher M.

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...


SVG not supported 5:06am Tue 16th Aug, Christopher M.

ANONYMOUS wrote It's not an exact science, but hopefully this Friday afternoon, or Saturday.


SVG not supported 2:17pm Mon 15th Aug, Christopher M.

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...


SVG not supported 12:12pm Mon 15th Aug, Christopher M.

Are you include-ing stdlib.h in all cases? It provides both the declaration for the exit() function, and the constants EXIT SUCCESS and EXIT FAILURE.


SVG not supported
%.1fm\n 👍x1  (all 4)
12:10pm Mon 15th Aug, Christopher M.

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...


SVG not supported 11:12am Mon 15th Aug, Christopher M.

No; just one or two. Sorry.


SVG not supported 11:01am Mon 15th Aug, Christopher M.

(still weird) but random buttons??? It does, but not usually enabled or set by default https linuxhint.com use-auto-indent-in-vim


 UWA week 32 (2nd semester, week 3) ↓
SVG not supported 6:40pm Sun 14th Aug, Christopher M.

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


SVG not supported 9:45am Sat 13th Aug, Christopher M.

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...


SVG not supported 5:18am Thu 11th Aug, Christopher M.

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 ...


SVG not supported 9:01am Wed 10th Aug, Christopher M.

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


SVG not supported 7:18am Wed 10th Aug, Christopher M.

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, ...


SVG not supported 5:56am Wed 10th Aug, Christopher M.

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'...


SVG not supported 3:37pm Tue 9th Aug, Christopher M.

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...


SVG not supported 3:29pm Tue 9th Aug, Christopher M.

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...


SVG not supported 1:51pm Mon 8th Aug, Christopher M.

Can you email me your source code?


SVG not supported 1:34pm Mon 8th Aug, Christopher M.

ANONYMOUS wrote OK, that should be harmless. Are you sure that your source file, check.c, has a function named main() ?


SVG not supported 1:31pm Mon 8th Aug, Christopher M.

What command (exactly, as typed) is giving you that error?


 UWA week 31 (2nd semester, week 2) ↓
SVG not supported 7:46am Sun 7th Aug, Christopher M.

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...


SVG not supported 7:20am Sun 7th Aug, Christopher M.

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...


SVG not supported 7:10am Sun 7th Aug, Christopher M.

ANONYMOUS wrote I don't know, having never installed only command-line tools. Unless you find an answer on the web, you'll just have to try it.


SVG not supported 7:48am Sat 6th Aug, Christopher M.

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 ...


SVG not supported 7:43am Sat 6th Aug, Christopher M.

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...


SVG not supported 7:35am Sat 6th Aug, Christopher M.

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...


SVG not supported 5:35am Fri 5th Aug, Christopher M.

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 ...


SVG not supported 3:49pm Thu 4th Aug, Christopher M.

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...


SVG not supported 9:40am Thu 4th Aug, Christopher M.

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...


SVG not supported 9:23am Thu 4th Aug, Christopher M.

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, ...


SVG not supported 7:11am Thu 4th Aug, Christopher M.

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 ...


SVG not supported 2:13pm Tue 2nd Aug, Christopher M.

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...


SVG not supported 8:54am Tue 2nd Aug, Christopher M.

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...


SVG not supported 6:41am Tue 2nd Aug, Christopher M.

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...


SVG not supported 7:48pm Mon 1st Aug, Christopher M.

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.


SVG not supported 11:32am Mon 1st Aug, Christopher M.

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...


 UWA week 30 (2nd semester, week 1) ↓
SVG not supported 11:11am Fri 29th Jul, Christopher M.

As soon as my voice comes back, I'll record the workshop (likely Saturday).


SVG not supported 10:47am Wed 27th Jul, Christopher M.

The recording for Lecture 02 is now available from the usual place LMS Units CITS2002 Lecture Recordings.


SVG not supported 10:46am Wed 27th Jul, Christopher M.

The recording for Lecture 02 is now available from the usual place LMS Units CITS2002 Lecture Recordings.


SVG not supported 5:21am Tue 26th Jul, Christopher M.

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,...


SVG not supported 5:16am Tue 26th Jul, Christopher M.

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...


SVG not supported 6:59am Mon 25th Jul, Christopher M.

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...


 UWA week 29 (last week before 2nd semester) ↓
SVG not supported 4:00pm Mon 18th Jul, Christopher M.

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...

The University of Western Australia

Computer Science and Software Engineering

CRICOS Code: 00126G
Written by [email protected]
Powered by history
Feedback always welcome - it makes our software better!
Last modified  1:17AM Sep 14 2022
Privacy policy