Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
I have an app which tests students' knowledge. After each unit, it transitions to an overall level view controller which I would like to keep score of how many units are complete. What would be the best way of doing this? I would like to present the results in a table view if possible.
Any help would be much appreciated.
Your question, as the commenters have said, is rather vague, so I will only offer general advice. In the class (or classes) where you test the students knowledge, you need to have some method that passes the name of that unit, and presumably a score, to the overall level view controller. There are a bunch of ways that this could be done. One way would be to post a notification with the NSNotificationCenter method postNotificationName:object:userInfo:. The userInfo could include the name of the unit, the score, and any other info you want. The overall level controller would register as an observer of that notification. The same notification could be sent from other classes, if you have a different class for each unit. The controller would then take the info in the notification and add it to an array which would be the data source for your table view.
Related
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 4 years ago.
Improve this question
I'm writing an online whiteboard application for fun, where multiple users view the same whiteboard and can draw on it. I'm using websockets (vanilla JS on the frontend, Scala on the backend), and right now am essentially just broadcasting mouse events from one user to the rest of the users, and rendering the image client-side.
However, this results in a transient shared state, whereas I would like to have users be able to hop on at any time and see the preserved shared state. I'm thinking this will probably require having shared rendering code on the backend and the frontend, so that clients render events as they stream but the server can send raw image data when clients associate.
So my question here is: what are some other design patterns I should be aware of for this kind of project? This is a for fun/learning project, so this is an open-ended question, but I'll accept an answer that contains some useful references for this kind of data flow.
So my question here is: what are some other design patterns I should
be aware of for this kind of project?
You don't have to have rendering code on the server. You can just save all the accumulated events that led to the current whiteboard and send those to a new client and let the new client render the whiteboard for itself as if they were listening when all the events originally happened.
If that's more data than is practical, then you can compress raw events. For example a straight or nearly straight line segment does not need all the intervening mouse positions, it really just needs the first and last position of the segment.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I'm trying to write a small dictionary Ruby app where I can look up existing entries, add and remove entries (ALL ENTRIES ARE PUT INTO A HASH). So right now I'm creating a Dictionary class and I'm not quite sure what exactly should be 'initialized' method.
I'm still pretty new to Ruby, so if someone could explain what should be initialized at the beginning of a class I'd be extremely grateful.
How do you know what to initialize?
Time and experience. In general, #new should:
Initialize instance variables.
Configure any object defaults.
Register itself with observers.
Housekeeping tasks needed to reach a minimal "ready" state.
Sometimes an object needs to do a lot more work to be "ready" (whatever that means for your class), and #new can just as easily do too little as too much. Finding the right balance for your application is what matters, so feel free to open new questions here or on Code Review Stack Exchange with more concrete questions and some actual code.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 4 years ago.
Improve this question
All,
I'm interested in the ability to retrieve a specific element within a FHIR resource using a single URL call. For example, suppose I'm interested in the gender of my patients. I would read the using the URL, without having to walk the XML node path every time. Right now, this functionality does not appear to exist. What do you think about the usefulness of this? Would like to get a sense of the community interest. Thanks.
-Jeff
For the default query mechanism, you can't bring anything back other than the full resource. (And don't even have a guarantee that the desired element will be present on all instances of the resource unless that element was part of your search criteria - in which case, why bother asking? :>). There's a new mechanism for defining custom queries. Refer to _query in the search/query section of the FHIR spec. However, it's not clear whether this will allow retrieval of anything other than full resource instances either.
This functionality does not exist at this time. It's on the wishlist, and we're trying to decide whether we can frame it in a sensible and safe fashion. The case you describe is relatively obvious, but many others aren't. And, in fact, when I think about it, it's not really clear to me how it works. what do you get back? just the gender element? so the server needs to - in effect - do the node walk for you, and you get, instead, to deal with a profusion of different schemas. It's not really obvious to me that this is a net saving for the client, and it's certainly a greater cost for the server.
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
The software we are designing allows students to register and participate in different training courses.
When the user logs into the system they get a list of courses they have registered for. They click on the course and then they are redirected to the specific course content.
My question is, what is the best practice upon login if the student is only currently registered for a single course?
Option 1: Just list the single course, but still require the user to click on it before redirecting. Same behavior as if there were multiple courses to select?
Option 2: Upon login, immediately re-direct the user to the specific course content. Save them from having to do the extra click of selecting the course.
Option 3: Open to suggestions...
EDIT: There are no other options available on this page. They register/pay for the courses elsewhere.
Are there any other options on the course selection page other than selecting a course (like registering for another course)? If not, then take them directly to their single course (Option 2). If there are other options, take them to the list and require them to select their course (Option 1).
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
Where do you draw the line between functional requirements and aspects of design?
If i can illustrate, one function of my system is that it must implement a user hierarchy.
In this instance would the definition of what those hierarchies are come under requirements (assuming you already know what the user hierarchies are) or would they come under the design aspect of a project?
Where do you draw the line between functional requirements and aspects of design?
Requirements is what the code needs to do. Design gets into how it will do it, with class hierarchies, design patterns used, etc.
Requirements:
There must be A, B, and C types of
user. Type A is only able to edit
their own account, type B can edit
their own account and post to hidden
forums, type C can edit all accounts
and post to all forums. The application must have a small memory footprint because blah blah blah....
Design:
Each instance of the user class will
contain a member variable of a
permissions object. The permissions
object is a wrapper for a bit field
because memory is tight, but has
several convenience methods, called
foo, bar, and baz. foo does XXX and is
public, (eventually design gets very low level and is turned
into code).
I'm not saying that would be the actual design, but that's how the design should analyze the requirements and eventually become a working implementation.