.. (לתיקייה המכילה) | ||
Did we go over handling files? | |
Handling files was covered on tutorial 3 |
Where can I find the supplied ADTs? | |
All files are in the path ~/mtm/public/1112b/ex2/ |
Where can I find library files for windows 64 bit? | |
There are none supplied. Use windows 32 bit libraries, they should be compatible |
In eclipse, how do I add the library (.a) file you supplied? | |
Select Project->properties Choose C/C++ Build -> Settings Under the MinGW C Linker select Libraries Now you can add Libraries (-l) or paths (-L) Add the path to where you put the library file and add the library (the library is named mtm. Not libmtm.a, just mtm) |
I'm getting the following error: | |
Check that you are using the C99 standard. |
In question1/part 1, should I print to the screen some request for a criterion from the user and work accordingly? | |
Notice that the person using the function isn't necessarily a human user sitting by a computer but rather some other written code. |
In question1/part1, can we define an enum and pass it to the function? | |
Yes you can, but think if this solution allows the person using this function to give any criteria he desires without changing your solution in the future. |
In question1/part1, how complex can the criteria be? | |
The criterion is as complex as the user can think of. A legal criteria can even be "print lines where the 8th character is divisible by 5" You've seen in the tutorial how to get complex criterions. |
In question2, should we implement the ADT? | |
No, you only need to create the interface. |
In question2, can we assume any other ADTs or structures? | |
You cannot assume. If you assume, you must write your assumption. If you assume something with any sort of structure or functionality you must also describe them (a full description. If you assume an ADT is available describe its interface only, If you assume struct give it). |
In question2, should I limit the GEN size? | |
No, assume a GEN can be infinitely large. |
In question2, what should I pass as arguments to the functions? | |
That is up to you and what you see as needed by each function. |
In question2, what does it mean to generate a GEN and say who it's for | |
Generating a GEN means creating the ADT. And saying who it's for is to define (on creation) who is the "center of the GEN" as the definition is described in the question. |
In question2/parts 6-8, should we print the resolt? | |
No. Also, as noted before, you are not supposed to implement the ADT, only write its interface |
In the wet part, if an allocation fails, what should we do? | |
If it's because of a memory issue (lack of memory) you should free all memory you allocated and orderly exit the program. |
In the wet part, where should I put the tests? | |
withing the HW folder, in another folder called tests |
In the wet part (Map), what should we implement? | |
You should implement everything. Every function given (as described in the assignment pdf) and the struct for the map. The only exception are the pointers to functions, those should be implemented by you but for each data-type you use and not specifically for the map. |
In the wet part (Map), how should we implement the Map? | |
You are given a list of functions to implement, you have to implement them all and you have to build your map as a list. |
In the wet part (Map), what does it mean that we are not to use given ADTs in the Map implementation? | |
It means that neither the Set.h or the List.h should be included by the Map implementation. You must write the list yourself. |
In the wet part (Map), why does the map_example_test have an include that is "../map.h" and not "map.h"? Can we change it? | |
This is a test file. Like all test files, it should be located in a directory called tests within your project directory. map.h is part of your project so it should be in your project directory. This way, map.h is located one folder above map_example_test, so relatively it is located at "../" from map_example_test Please notice you are not supposed to changeany file we give you nor are you supposed to submit them, so any change you make will not be available for the automatic checker. |
In the wet part (Map), where should I implement the Map? | |
As this is an ADT, you are to implement the ADT on a separate c file, not in the header file. |
In the wet part (Map), the file map_example_test.c contains functions not found in the map header file (mapAdd, mapLookup). Are they defined elsewhere or should we add them to the header? | |
These functioned were renamed in the new files. Please download the new test example from the course directory. |
In the wet part (Map), should the map keys be sorted according to the compare function? Or should we sort before printing? | |
We did not ask for that. You may sort the keys at any time you want, but that is up to you. |
In the wet part (Map), how do I generate a new Map? | |
That is the purpose of the mapCreate function you need to implement. |
In the wet part (Map), the pdf says that mapPut should add the new keys but the header says mapPut should fail if the key does not exist. Which is correct? | |
The pdf is correct. The header files were updated accordingly. |
In the wet part (Map), what should the mapPut function return if the data or key are NULL? | |
Same as if the map was NULL, return MAP_NULL_ARGUMENT. |
In the wet part (Map), what sort of data-types should the Map be able to handler? | |
The map should be able to handle any data-type, including user created ADTs. |
In the wet part (Map), there are pointers to function in the Map header file, what are they for? | |
The Map requires these functions to perform its operations. These functions are data-type specific and should be supplied by the Map user and not the Map implementation. You should be able to induce from the header file the exact signature of the functions and the comments tell what they are for. |
In the wet part (Map), why does Map need any pointers to functions during its creation? | |
The Map is a generic container, meaning it needs to be able to contain any sort of data-type, including user defined ADTs. The Map needs these function to know how to perform copy/free/compare operations on those data-types. |
In the wet part (Map), should the function mapGet return a copy of the data or the actual data? | |
mapGet should return a copy of the data element. mapGetFirst and mapGetNext should return the keys themselves |
In the wet part (Map), what is the internal iterator? What does it do? Is it like an index? | |
The internal iterator is an internal part of the implementation which can resemble the index in a way that it allows you to go over the element (in this case, keys). The iterator functionality is described by the mapGetFirst and mapGetNext functions and is effected by other functions as described in their documentation. |
In the wet part (Map), how can the iterator be in an illegal state and what does it mean? | |
Some functions change the iterator state to be illegal or undefined, as described by the functions. When in illegal state, the iterator should not be used, and using it should cause an error to occur. |
In the wet part (Map), what should be the iterator status after mapCopy for both maps? | |
For both maps the iterator status is undefined |
In the wet part (Map), how should I implement the iterator? | |
That is an implementation question and is up to you. You just have to make sure it follows the rules given in the assignment. |
In the wet part (Map), when copying a Map should the order in the keys remain as in the original map? | |
No, there is no need to maintain order. The new copy can have any order as long as it contains all the keys and the correct data. |
In the wet part (Map), why should the map be initiated with freeing functions? Aren't they only for the Map destruction? | |
The map sometimes needs to delete elements or destroy itself on the fly and for those occasions the Map needs to know how to do so. |
In the wet part (Map), should the map contain a few data-types of keys and data elements? | |
No. When the map is created it is generated with the knowledge of what data-types are the keys and data elements. A Map should not mix several types of keys or several types of data, only a single type of key and a single type of data (but the key and data doesn't need to be of the same type). |
In the wet part (Map), What should the function mapRemove return if the keyElement is NULL | |
You should return MAP_NULL_ARGUMENT |
In the wet part (Social Networks), when an error occurs and we need to use your function of mtmPrintErrorMessage, what file descriptor should we give? | |
For this assignment, all error should go to the standard error. |
In the wet part (Social Networks), the enumeration MtmErrorCode does not contain a MAP_SUCCESS. is this a mistake? can we add one ourselves? | |
This is no mistake. MtmErrorCode is an enumeration of possible errors. Success is not a type of error. Even if you add one yourself, our function mtmPrintError won't know what to do with it (not to mention that you are not supposed to submit any files you get from us, so your changes won't be available in our test runs) |
In the wet part (Social Networks), do all users automatically join all new networks that are created? | |
No, a user must specify he's desire to join. |
In the wet part (Social Networks), should the user be logged in to the system to do any operations? Are some operations permitted only to specific users? | |
All users can perform all functions. There is no meaning to log-in at such low-level code. You may assume all users are always permitted to do everything, using the right function. |
In the wet part (Social Networks), can two users become friends even if they are not in the same social network? | |
Yes |
In the wet part (Social Networks), can a user be born in a negative year? | |
Yes, users were born some time in the past, maybe even BC |
In the wet part (Social Networks), in the suggest_friends function, what does it mean "at least 0"? Should we check all users in the system? | |
At least 0 means the value can't be negative. And it can be zero. We are talking about two numbers, each can be zero but their sum has to be more then 0 to be printed. |
In the wet part (Social Networks), does accepting or denying request from user A to B affect requests from user B to user A? | |
Sometimes. When a request is approved, both requests are approved and the users are friends. When a request is denied, requests from A to B are removed, open requests from B to A remain unanswered. |
In the wet part (Social Networks), what does it mean numbers aren't necessarily in the valid range? | |
No, all the numbers are valid integers. But they can be outside the legal range of values for the function (say a birth-year that is in the future). |