Question 5 of Assignment 1, Semester 1 reads currently as follows: S -> aX | Yb X -> ZXYZ Y -> b | bY | "" (Empty string) Z -> a | "" (Empty string) Non-terminal X is useless. This is unfortunately incorrect. To correct this error you should please add the production: X -> a Thus the CFG to be converted to CNF should be aby AndreB - COS3701
Well - more accurately, g(n) does not accumulate in Best-first search, only in A*. They only give us the h values so that's all that can be used.by AndreB - COS3751
Thanks Carina - the heap is used for the create of new objects, specifically those instantiated with the new keyword -> i.e. used for dynamic memory allocation. IIRC, this is probably biggest section of memory given to process and each thread. Each thread will be given their own heap memory, as each thread may need to dynamically allocate memory to objects that need to be created. See theby AndreB - COS3216
No worries - unfortunately all work and no play. I agree that each thread is given a stack - but I don't believe the stack is shared with other threads or the parent process.by AndreB - COS3216
Eddy - I haven't sold my textbooks yet (and don't intend to either), but I am unfortunately a good 11000kms away from my books. I'm currently traveling in Australia. I vaguely recall the diagram you are referring to - although IIRC (and my memory is a little dodgy - still fighting off jet lag and loss of sleep), the diagram may have been a schematic of the parent-child processby AndreB - COS3216
The only problem which requires a bit of thought when evaluating processes with different arrival times, is what to do when a process arrives at the same time another process is preempted. There is usually a simple rule to follow or assumption to make when evaluating processes this - it usually states that the newly arrived process is added to the end of the waiting queue, but ahead of the proceby AndreB - COS3216
Can you elaborate on what Q3 is? Maybe some of us that have completed this module could help? - just maybe. The scheduling algorithms aren't too difficult, nor is figuring out how they perform. The best is usually to evaluate each algorithm given by running through: Only 1 process 2 Processes 3 Processes - you should have identified a trend by now.by AndreB - COS3216
Dimo001 - it's great that you've asked for help - although it may not be forthcoming. Most of the people on these forums find themselves in the same boat - working full time and trying to get there head around the studies at night or on weekends. In most cases the study material may not be enough get you though all you need to know. I'd suggest you keep trying the module specifiby AndreB - COS3216
There used to be, prior to 2010. There is a crap load of data to process, so start early.by AndreB - COS3216
Pretty much, although I don't think it is the complete COS114 module as it has been semesterised.by AndreB - INF1511
It would appear as though who ever set up the paper went about looking for obscure crap to try and catch people out - which is unnecessary. Compare the paper to the assignments and there is no obvious relationship. I get the questions on where and how to apply the different patterns, even the comparison between a process and a thread. But where not to apply a pattern and the comparison betweenby AndreB - COS3114
Not as bad as I was expecting, although I would have appreciated more design pattern based questions as opposed to kak on QTimer/QThread/QRexExp. I didn't even touch QRexExp - 9 bloody marks. The patterns related questions weren't bad. 6 to go.by AndreB - COS3114
Sounds about right - check this out Command Pattern I used this website to go through all the design patterns.by AndreB - COS3114
5.2 Each class that derives from QObject must: Include the Q_OBJECT macro be defined in a separate .h file have the implementation in a separate .cpp file have the class header wrapped in #ifndef have the .cpp file listed in the .pro file in the "Sources" section include Q_PROPERTY macros in the header file describing the class's properties.by AndreB - COS3114
@Alucard - thanks, Can you show me what the signal in FileVisitor looks like, and how it emits a filename as a string?by AndreB - COS3114
4.7 Option 1 - Complex Language: C++ (QT)Customer cust("ABC Buyer"); int amount = 125000; [..] eligible = MicroLending::getInstance()->isEligible(cust, amount); Option 2 - easier to read Language: C++ (QT)Customer cust("ABC Buyer"); int amount = 125000; [..] MicroLending *ml = MicroLending::getInstance(); eligby AndreB - COS3114
4.6 Language: C++ (QT)class MicroLending : public QObject { Q_OBJECT public: bool isEligible(Customer cust, int amount); static MicroLending* getInstance(); protected: MicroLending() { } // Inline declaration as nothing happens here. } // MicroLending.cpp MicroLending::getInstance() { static MicroLending* instance = 0by AndreB - COS3114
4.5 - When is it appropriate to make use of an abstract factory design pattern in the Facade design pattern? When the Facade needs to decide which object to create. In the example given, the Facade acts as a front for all three classes, and creates an object of each. However, if only a subset of the objects where required, then an Abstract Factory and Factory Method could be used to decide wby AndreB - COS3114
Guys - can someone please explain how FileVisitor and CodeVisitor are going to work once they are decoupled. I get the part of FileVisitor emitting a signal that a certain file has been found that meets the search criteria, and that CodeVisitor now has a signal to process the file. But how does FileVisitor broadcast the name of the file, and how does CodeVisitor receive it? That is, how doesby AndreB - COS3114
Try QObject::children -> I don't think it is recursive.by AndreB - COS3114
Anyone using ui files? I don't see anything stating that we may not use ui files???by AndreB - COS3114
@Ronica - I only saw the second part of your question now. Page 3 has a similar statement for the National Administrator. At a quick glance I would think the following: You log on once, and depending on whether your the National Administrator or a Regional Administrator, you invoke the Singleton List of members (Complete list for National, or the Regional specific list of members). This happenby AndreB - COS3114
@Ronica - in this case, every bit of info that needs to be read (i.e. requires reader class) will also require a writer. The Regional Administrator will use most of the writers as they create the regional lists that are to be read by the National Administrator.by AndreB - COS3114
I would think that it means that at least one of your classes should make use of the Signal / Slot mechanism - other than GUI stuff.by AndreB - COS3114
Nothing wrong with sharing thoughts and ideas for this project. You could possibly come up with a dozen solutions that work - some less complicated than others. The more we share, the more we learn. I'll start looking at this project in earnest over the weekend.by AndreB - COS3114
I've just glanced at the "spec". I'm not too sure that you need to over complicate matters by first creating an entry object and then if successful a CompetitionEntry object - but that's just my opinion. Taken from task 2: Appropriate CompetitionEntry objects are created and added to a CompetitionEntryList, which is a Singleton. An object must contain the member ID,by AndreB - COS3114
Got an exam this week - so will have to skip this assignment.by AndreB - COS3216