It's UWAweek 5

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.

 Posts from 2022 will be available until after the Deferred and Supplementary Exams
42 articles posted by this ANONYMOUS person
Showing 42 of 919 articles.
Currently 3 other people reading this forum.


 UWA week 44 (2nd semester, 1st exam week) ↓
SVG not supported 3:28pm Mon 31st Oct, ANONYMOUS

Hi Chris, Hope you had a great morning. I was wondering whether we should know pthread types and pthread functions for tomorrow's exam since they were taught in the last few lectures of this semester? There's quite a bit to understand and implement i...


 UWA week 42 (2nd semester, week 12) ↓
SVG not supported 4:19pm Wed 19th Oct, ANONYMOUS

Hi Chris, could you please help me with this error message when compiling one of my source code files? This is the message "Undefined symbols for architecture x86 64 " main", referenced from implicit entry start for main executable ld symbol(s...


SVG not supported 3:03pm Wed 19th Oct, ANONYMOUS

Thank you for elaborating. Now, I'm just stumped with the method of removing these references. I'm thinking about reading in the trove-file, checking whether the filename(s) are found within the file and overwriting it, but I'm still not sure. Would ...


SVG not supported 1:50pm Wed 19th Oct, ANONYMOUS

Hi, regarding project 2's command line options would '-r' involve reading in the trovefile, checking whether the filename (from the filelist) is found within the trovefile and remove that particular line? With '-u', would we open a new trovefile, co...


 UWA week 41 (2nd semester, week 11) ↓
SVG not supported 12:04pm Fri 14th Oct, ANONYMOUS

Hi, I'm having trouble indexing all the words in a file, line-per-line if the length of each line is unknown. People have suggested realloc() and malloc() but you would need to know the length of a line to use them, so I'm hitting a wall at this stag...


SVG not supported 12:03pm Mon 10th Oct, ANONYMOUS

Hi Chris, Regarding what you said about the trove-file do we 'input' the real pathnames of the relevant files into a trove-file and return the contents of this trove-file? The project description says "the filenames stored in the trove-file should b...


 UWA week 37 (2nd semester, week 7) ↓
SVG not supported 2:58pm Thu 15th Sep, ANONYMOUS

Would it be possible to have an extra lab session tomorrow 16th Sep either in the morning or late afternoon as we won't have a workshop session anyway?


SVG not supported 2:37pm Tue 13th Sep, ANONYMOUS

I have the same question and am stuck on this, too. If we loop over the entire month in minutes, how would we know at what time the command should be executed? Let's say "0 3 say hello", would we 'execute' at the 180th minute? How is it possi...


SVG not supported 11:38am Mon 12th Sep, ANONYMOUS

Hi, if we wanted to simulate the execution of our tasks within a given month, how would we run a timer to coincide with the scheduled timing and store them? I've declared struct tm and assigned their values to the fields of my task structure but I do...


 UWA week 36 (2nd semester, mid-semester break) ↓
SVG not supported 3:13pm Thu 8th Sep, ANONYMOUS

Hello I've got a question about retrieving values from a struct for this project, if someone can please help me with if we wanted to match a given value with a corresponding struct's field value, would it make sense to Firstly, for example, match an...


SVG not supported 11:40am Thu 8th Sep, ANONYMOUS

Can we have a printf statement and a return statement in one function? I want to debug my code by ensuring that the values I'm retrieving from my data structure are what I want (using printf()). But if I have a return statement and call printf, nothi...


SVG not supported 1:29am Thu 8th Sep, ANONYMOUS

ANONYMOUS wrote Oh, I've managed to return the string by declaring a pointer for the value of variable 'command' char command "m". Cheers for your time.


SVG not supported 8:38pm Wed 7th Sep, ANONYMOUS

Hi, yes thanks for the clarification. The top command is one of the values, which could be a sequence of characters, that we should be returning for Project 1 2022. If we were to create a function to return this value, what would the function declara...


SVG not supported 2:17pm Wed 7th Sep, ANONYMOUS

To return the top command, should the function's header be 'char my function()' or 'const char ' (suggested by Google)? The compiler returns "address of stack memory associated with local variable 'command' returned..." when returning "m" for testin...


SVG not supported 11:15pm Tue 6th Sep, ANONYMOUS

Regarding this , I have a function that checks if the month crontab value is an actual value, such that given a string, if the characters of this string are digits - convert to an int, but if the characters are letters, then check if the string matc...


SVG not supported 9:18pm Tue 6th Sep, ANONYMOUS

All good, I've managed to get it. I was missing important syntax.


SVG not supported 6:12pm Tue 6th Sep, ANONYMOUS

Thanks for the reply. I'm looking to check if the 'word' is an asterisk, and if it is, then 'convert' it to an int such as -1 for future use and storage.


SVG not supported 2:01pm Tue 6th Sep, ANONYMOUS

For example, I'm printing the minute and hour values but since the first two lines of the crontab files are ' ', my functions aren't returning -1. I've made sure to check if the string is an ' ' and if so, return an int. I've tried placing the condit...


SVG not supported 1:29pm Tue 6th Sep, ANONYMOUS

This is probably a really simple solution (and silly question) but how do we convert a char symbol to an int? I want to check if the given string is a symbol before returning an int value that's associated with that symbol but when I print the values...


SVG not supported 12:42pm Tue 6th Sep, ANONYMOUS

Yes, this makes sense. I've used my functions to assign the values but somehow it's reading the first two values of my file line as asterisks when only one of the values is an asterisk, and it halts my printing at the first line.


SVG not supported 11:27am Tue 6th Sep, ANONYMOUS

Yes, this makes sense. I'll be using my own functions now which will convert each valid sequence of chars to its designated int value before storing it into an array of structs.


SVG not supported 11:19am Tue 6th Sep, ANONYMOUS

To account for ' ' values, I was thinking of assigning the maximum value to it, such as for minute, hour, day of month, month and day of week 59, 23, 31, 11 and 6. But then they would actually be read as what they are, not for every value of that mo...


SVG not supported 2:06pm Mon 5th Sep, ANONYMOUS

Thanks so much, Ethan. I have those conversion functions and will take your advice. This is great, cheers.


SVG not supported 10:52am Mon 5th Sep, ANONYMOUS

As the file values are written as strings, how do we convert these values to an int for our struct? I tried using sscanf and storing the formatted values in int values but there's a mismatch error. For example, sscanf(" s", atoi(minute)); doesn't wor...


SVG not supported 10:30am Mon 5th Sep, ANONYMOUS

Yes, I asked this question poorly, my bad. My program is reading the file but it's duplicating desired lines for the total number the lines of the file (e.g 7 desired lines, printed 19 times - the total lines of file). How do I remove duplicate lines...


 UWA week 35 (2nd semester, week 6) ↓
SVG not supported 9:02pm Fri 2nd Sep, ANONYMOUS

How do we delete lines from a file we no longer need instead of placing each unwanted character with a null byte?


SVG not supported 4:30pm Fri 2nd Sep, ANONYMOUS

ANONYMOUS wrote It seems to be working now, I think, as the error isn't appearing. On another note, how do we know that our file has been read? I'm using sscanf() to read the crontab file but the program doesn't return anything. When I use sscanf(), ...


SVG not supported 2:18pm Fri 2nd Sep, ANONYMOUS

Hi, I'm getting a 'Segmentation fault 11' when running my program. All I have in my main function is checking the number of arguments, calling a reading-file function and printing a newline character. What does this 'fault' mean? Is my program even ...


SVG not supported 10:44pm Thu 1st Sep, ANONYMOUS

This is me thinking out loud should we be allocating the time values of 'struct tm' to the crontab values, so that tm min, tm hour, tm mday, tm month and tm weekday align with the syntax of our crontab files, so that our simulator knows which argume...


SVG not supported 1:26am Thu 1st Sep, ANONYMOUS

Would a struct be ideal for storing commands of a month, number of commands, max number of commands of each month (to be returned at the end)?


SVG not supported 1:22am Thu 1st Sep, ANONYMOUS

Hi, did you mean isdigit()? If so, it's defined in the ctype.h header file.


SVG not supported 1:19am Thu 1st Sep, ANONYMOUS

Hello, would we need to transfer the file contents to another file by writing or would we be storing them in an array? I read the lecture notes covering writing into files but is this necessary here? And would we need to remove carriage-returns or ne...


SVG not supported 2:17pm Wed 31st Aug, ANONYMOUS

That clears it up, thanks. I've tried my files using the sample solution but it returns " '' is an invalid minute" when all my minute values are valid values - no minute value is missing. I suppose I'd have to try again.


SVG not supported 2:13pm Wed 31st Aug, ANONYMOUS

Great What a breath of relief, thanks.


SVG not supported 11:43pm Tue 30th Aug, ANONYMOUS

Hello When we read the crontab file execution times (expressions), how do we relay this information to the system and what do we do with the estimates time information? I get how to store the data but am unsure of the 'linking' process of timing the...


SVG not supported 9:55pm Tue 30th Aug, ANONYMOUS

ANONYMOUS wrote I just rewatched the workshop and realised the sample solution consists of 380 lines. My bad. A big part of my code is from lecture slides, though, for example reading in files. I hope that's valid.


SVG not supported 9:26pm Tue 30th Aug, ANONYMOUS

Hi, how many lines does the expected solution consist of for Project 1? I currently have over 200 lines but am not sure if this what others have (approx) or if I'm completely out of it and writing a lot of unnecessary code. Reading in the file spans ...


SVG not supported 8:35pm Tue 30th Aug, ANONYMOUS

Hi, would we need to account for other, more complicated combinations such as, 1-20 or 8 (every eighth month) or 0-20 2 and such in the crontab file?


SVG not supported 12:39pm Mon 29th Aug, ANONYMOUS

Hi, I was wondering how we can read into any file, given that we don't have that particular file stored in our local computer. For example, when marking our source code, how would our work read the given sample data? This is what I'm still confused a...


 UWA week 32 (2nd semester, week 3) ↓
SVG not supported 1:39pm Mon 8th Aug, ANONYMOUS

Yes, this is the function main() header int main(int argcount, char argvalue )


SVG not supported 1:33pm Mon 8th Aug, ANONYMOUS

Hi, this is the exact command cc -std c11 -Wall -Werror -o check check.c


SVG not supported 1:29pm Mon 8th Aug, ANONYMOUS

Hi, I'm getting this error when it comes to compiling "Undefined symbols for architecture x86 64 " main", referenced from implicit entry start for main executable ld symbol(s) not found for architecture x86 64 clang error linker command faile...

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  2:26AM Jan 17 2023
Privacy policy