ANONYMOUS wrote
Thanks for highlighting this omission.
It's now correctly stated on our Clarifications' page https teaching.csse.uwa.edu.au units CITS2002 projects project1-clarifications.php
I'm unsure of the acronym PEMDAS (suspecting it has the same meaning to the one I know, which is BOMDAS).
As you do not have to check the validity of the expressions, you do not have to check or 'handle' the precedence of operators.
ANONYMOUS wrote
Syntactic errors in an ml program should be reported on a line beginning with a ' ', such as unrecognised statement
They are different to any other debug statements that you wish to print out, such as n w i u c i n...
ANONYMOUS wrote
Thanks for the question; I'll clarify the wording.
When you find the first error (if there is one), print your error message and then terminate exit your runml program.
Hello Josiah,
You appear to missed a significant amount of understanding about the project.
Your program, runml , will transpile translate convert a small ml program into a C11 program (creating a new text file to hold that C11 program).
That C11 p...
ANONYMOUS wrote
There shouldn't be any issues, in that there's no OS-specific features requirements in the project, and both Linux and macOS support all of the necessary POSIX functions.
"Soon after a team of engineers discovered a moth in a machine at Harvard, the word bug became a standard part of the programmer s lexicon. Or did it?"
https daily.jstor.org the-bug-in-the-computer-bug-story
ANONYMOUS wrote
You do not need to validate expressions, thus you do not need to detect or report an error as in x - double 2
However, you will need to locate any identifiers within expressions, such as double above, - depending on y...
I can't quite understand the 2nd part of your question.
If p is a pointer of type T, the incrementing or decrementing of p will increase or decrease its value by sizeof(T).
The sizeof(T) is not always 4 - it literally depends on the amount of memory re...
ANONYMOUS wrote
Your understanding is the wrong way around. An ml function must be defined before it can be called.
The C code generated by your runml program should not have any C syntax errors, so the C compiler should not find or report any err...
ANONYMOUS wrote
No - you cannot introduce a new function if its name is already used as a variable's name, or introduce a new variable if its name is already used as a function's name.
Parameters are passed as they are in C. A copy of an actual param...
A good question (but, unfortunately, something I was hoping would be recognised as something that "should be done", rather than "must be done").
Yes.
The ml variable arg0 'comes from' C's argv 1 , as the C program's name is unlikely to be a...
Not quite sure of the context of this post.
The intention is to not make any changes to the project description once it is finalised (as it was very early this morning, and announced in an announcement on this forum).
Any necessary changes from now w...
Hello,
The focus of the project is not on designing and fully implementing a mini-language - it's 'only' about performing a quite mechanical syntactic translation from one language to another (C11), compiling, and then executing the program. The goal...
The 1st project description is now finalised.
Please post requests for clarification about any aspect of the project to help2002 so that all students may remain equally informed.
Significant clarifications and corrections will be also added to the proj...
Very sorry, but I'm going to reverse my decision on this point (to make it easier for all to implement)
All statements and function prototypes (1st line) must begin at the left-hand-margin (column 1).
The statements forming a function's body must ...
ANONYMOUS wrote
Yes, BUFSIZ (8192 on Linux, 1024 on macOS) is a suitable choice for your maximum line length.
You should write your own test programs, and not rely on a finite number of sample cases.
There will be a webpage to which you can enter your ...
Hello,
The project specification is not quite finished, yet, but ...
The language's syntax does not permit nested functions https teaching.csse.uwa.edu.au units CITS2002 projects project1-syntax.php
Functions are introduced with the 'function' keywor...
No, it has not been released yet. My current focus is tomorrow's mid-sem test.
When it's released, it will be announced linked in all the usual, obvious, places.
ANONYMOUS wrote
If the size of one integer was always 4 bytes, then the answer would be A) 400 bytes .
The C11 standard (nor any C standard) does not specify sizeof(int) to always be 4.
For what reasons might sizeof(int) not be 4?
ANONYMOUS wrote
It's certainly an error if you correctly perform the textual substitution for N .
A couple of students have asked if this is a trick question - not really, misunderstandings about how the preprocessor works are reasonably common....
Notice that the Y-axis is logarithmic
https ourworldindata.org grapher historical-cost-of-computer-memory-and-storage
And there's links to many other interesting plots near the bottom of the page.
ANONYMOUS wrote
Not the "Extra reading" links, as they're to daily and weekly news, blog, and review sites.
But the "Information resources" page will certainly assist.
Lecture 3.
The answer to this is not explicitly stated on a lecture slide, but readin...
The define preprocessor directive, when used as define pattern1 pattern2 , results in all later instances of pattern1 being replaced by pattern2 .
In this example, N is not a variable, and is not being initialised, but ev...
ANONYMOUS wrote
B) is certainly the correct answer. Yes, it's undoubtably defined in the (huge) standards document, but there is no requirement to read it to answer the question.
We've highlighted that C is quite a small language by contemporary stan...
ANONYMOUS wrote
Not all assessed information comes from lecture slides, but you have been referred to information resources that introduce discuss the topic of the question.
All of the questions in this sample test have been taken from past tests.
It's...
This is the correct 'answer', thank you.
I wonder how why the OP has break statements in the posted question.
Perhaps they had been introduced by an IDE trying to be helpful by (incorrectly) anticipating what was coming 'next' ??
Thank you to the 126 (of 552) students that responded to our week-3 survey (quite a high response rate). You may find all responses, and (verbatim) comments at https teaching.csse.uwa.edu.au units CITS2002 feedback 2024 week3-survey
Good luck,
Full details here https teaching.csse.uwa.edu.au units CITS2002 examinations.php
The page also includes a link to a sample mid-semester test paper.
Good luck,
You can find all details about the test here - https teaching.csse.uwa.edu.au units CITS2002 examinations.php
A sample test paper coming later this morning.
ANONYMOUS wrote
A very good expanded definition of a 'word' in the context of computer architecture can be found on Wikipedia
https en.wikipedia.org wiki Word (computer architecture)
(Wikipedia receives a lot of undeserved criticism for being 'd...
Always good advice, thanks Josh, but the lab exercises are NOT assessable.
However, the knowledge learnt by completing the exercises will certainly re-appear in the assessed components.
A student recently emailed me with this related question. Thought the answer may also interest others.
...
Hi Dr.McDonald,
I got a question out of interest inspired by a lab question. We know that calculating the floating number is inaccurate in comput...
In Monday's lecture we highlighted that arrays in C are (generally) of a fixed size, and it's a serious fault to access an element outside of the array, either before its beginning, or beyond its end.
Right on cue
CrowdStrike releases root cause analy...
In last Monday's lecture we saw both the sizeof() and strlen() functions when discussing arrays and, in particular, arrays of characters which we treated as strings. The two functions serve different roles and, so, shouldn't be confused....
While we're not focussed on writing highly optimised programs in this unit, it's sometimes useful to measure the execution time of your programs. I've been doing this in lectures by preceding commands with the shell's builtin time command.
Here...
ANONYMOUS wrote
Firstly, since the C99 standard (and hence in C11), main() must be a function returning an int , so you'll typically see
int main(void)
or
int main(int arc, char argv );
Within main() you can either retur...
Jigsaw Puzzle Robot, Or How We Solved a Puzzle in 15 Months
https docs.google.com document u 0 d 1BUCGdZCe8JevGYF3pJ4ZjPqpcSgA7LF0kV6sWbHrT1Q mobilebasic
The Echo360 recording of Workshop-2 has a problem with its audio, which cuts off after 10 minutes or so.
I've uploaded the similar recording of Workshop-2 from 2023.
It's not on this year's Echo360 page, but from our unit's Schedule page https teac...
(as introduced in last Friday's workshop)
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...
ANONYMOUS wrote
Lecture slides ar available from our Schedule page https teaching.csse.uwa.edu.au units CITS2002 schedule.php
by clicking on the required lecture's name (link) or the PDF icon.
The first 4 are there already, with the coming week's be...
ANONYMOUS wrote
It seems that you're unsure where you're working.
From any shell prompt, you can issue the command pwd (print working directory) to find out where you are.
If you are naming and using files by just providing their filename, witho...
ANONYMOUS wrote
Thanks, yes, a few other students have reported this, too - strangely stating the problem occurs at different times.
Unfortunately lecture recordings don't always work; that's why they are not the primary mechanism for delivering lect...
Anyone have any idea what this is about?
A US 200 mouse that requires a software subscription.
Logitech has an idea for a forever mouse that requires a subscription
https arstechnica.com gadgets 2024 07 logitech-has-an-idea-for-a-forever...
(today's workshop was 2, so I've changed the title of this thread)
ANONYMOUS wrote
Yes; sample solutions will appear each week on our https teaching.csse.uwa.edu.au units CITS2002 schedule.php page
(but not instantly, when I've often other things to...
A couple of students have reported a problem trying to install the recommended packages to get started. It appears that their machine (or the default Ubuntu 24.04 LTS in WSL-2 on Windows) was unaware of, or not searching, remote repositories to find...
In this morning's lecture, I mentioned that recent work on the sustainability of computing had recently measured the power consumption of contemporary programming languages on a series of benchmarks.
The paper is titled Ranking programming languages...
In today's lecture we saw why real-valued (floating-point) numbers are used very rarely, if at all, in systems programming and operating systems kernels.
Here's an article describing the problem,
Stop Using Floating-Point Numbers to Store Money
http...
Harry R. Lewis has been a Harvard CS professor, and thinks there's a lesson for today from a time when "Computers were experienced as physical things"
Mechanical Intelligence and Counterfeit Humanity
https www.harvardmagazine.com 2024 07 harry-l...
Hello Everyone,
This semester (today) we start with around 550 students enrolled. 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 students are already asking by emai...