Contact or address book app using Core Data and a SQLite storage file - core-data

I was wondering if it is possible to create a address book or contacts app, like Apple's, that uses Core Data and an SQLite storage file.
The part I am not sure if it is possible, or how to do it is having multiple properties for phones. So a user could input five different phone numbers for the same contact.
The only way I could think of doing it is say... have one entity for the person... then another entity for phones with them having a relationship. So one person could have multiple phones but one phone could only have one person. But that didn't seem to like it would be a good way to do it... anyone have a suggestion?

I don't see how you came to the conclusion that several entities are not a good way to do something like this. That's the only way to do it if you want flexibility. Adding three phone number attributes to your entity is definitely the wrong way.
I would use a simple data model like this:
Each record has a type (e.g. email, phone, fax, IM contact) a key (e.g. office, home, mobile, twitter, jabber) and a value (e.g. 55512345, foo#bar.com, #foobar).
Such a model offers the most flexibility and it's not very complicated to implement.
Though you need a couple of predicates to get phone numbers, emails etc.

Related

Dialogflow dont recognize phonenumber

Im tring to create a booking system for a restaurant so the assistant go to ask to user number of guest, time and day to reserve, and finally the name and the phone number of guest! But many time the phonenumber is confused by the guest number.
I set in parameters for #guest the value of #sys.number and for $telephone the entity of #sys.phone-number, but sometimes get wrong recognize. I could make it work?
The Dialogflow team has a really full-featured example on Github here (it's a bike shop, rather than a restaurant, but most of the functionality is the same). Give it a look for some inspiration.
Regarding the specifics of recognizing phone numbers: I'd recommend adding a bunch (like more than 10) of example training phrases to the appropriate Intent that include phone numbers. Often the problem with matching these things is just a matter of the number of examples the system gets to learn from.
Good luck!

How to put information from one database to a spesific form in another in Lotus notes

The aim is: to create two DB in the first should be information about all cities and streets, in another there should be an opportunity to fulfill the name, middle name and to choose town and street from the first DB. The problem is that I really don't understand how to put the information about town and street to this fields with an opportunity to choose.
Why have it in two different databases? Who came up with that design?
But it is not very hard to do, it just depends on exactly how you want it to work, if it is a Notes client application or a web application, etc.
Check #DBColumn and #DbLookup in the help, or possibly the GetDocumentByKey method of the NotesView class if you are using Lotusscript.
I suggest that you take some classes in how to develop for Lotus Notes, or pick up a book.

Similar paradigms as readers-writers prob and producer-consumer prob

for my Operating Systems Networking class, we must come up with a common paradign that is faced when developing operating systems and propose a solution to the paradigm. Some possible topics suggested in class were: Producer/Consumer problem, reader/writer problem and there was a third one, idk the name for it. It was something like this:
Protection of Private Data – When a user has personal or private data he must share with a network in order to get information, but doesn’t want his information to be released.
-If a user must request a server for information and must provide some private data, the user tells his OS to request the information by sending a series or an array of data to the server. Some are actual data and some are fake. The server responds, handling each set of data as a separate request, it then returns the results and the OS picks the right one.
Example:
1) Person A uses his phone which uses his GPS coordinates to locate the closest bank. The OS on the phone knows that if the GPS coordinates were to get out, this could be bad. The phone instead, sends a request to AT&T asking for the closest bank for the following locations: the actual location person A is at, as well as 3 other fake locations. AT&T has no way of telling which location is the true location and which are the fake ones and is therefore forced to treat each one as a separate request. The results are sent back to the phone and the phone uses only the result for the location that is correct.
Another problem one of my friends did last semester was DDoS. I was wondering if you guys new of any other problems,issues or paradigms that are still lurking about.
Thank you for your suggestions.

Allowing Users to create custom groups of Countries

I'm working on a project for a customer, and one of the requirements is that Users should be allow to assign to each Product (in their case, a Node) a Country or a Region, where the Region is simply a group of Countries, not necessarily in the same area.
I've seen there are many different ways to manage a list of Countries, often suggesting to use Taxonomy for them, but I can't figure out how could I allow users to create these "Regions". To make things complicated, customer wants to have a simple interface, where only one field is present on the form. In this field, Users must be able to choose either a Country or a Region.
Perhaps I could implement everything using Nodes, i.e.:
- Country Nodes
- Region Nodes, with a multiple-valued Node Reference to Country Nodes
But I wonder if that would not be too heavy...
I hope the issue is clear, if not feel free to ask and I'll try to explain it better. Thanks for all suggestions.
I ended up creating my own tables and code to handle the whole thing, as I couldn't find any better solution. I used tables from IP2Country module as a source for Country Codes.

CQRS and CRUD screens

One of the basic tenets of CQRS, as I understand it, is that commands should be behaviour-centric, and have a value in the business or the UL, and not data-centric, ie., CRUD. Instead of focusing on updating a customer, we have commands like CustomerHasMoved. What if you have CRUD screens which are there to correct certain data. For example, we need to change the name of a customer which is misspelled. This doesn't really have much value in the business. Should this just be under the umbrella of an UpdateCustomer command?
I just want to put a comment on this quickly as it popped up.
It is important to note that some objects are actually CRUD and thats ok. I may not really care why a name is changing in my domain where I ship products to people and only need that data to print mailing labels. The trick is in making behavior the default and THEN reverting to a CRUD interface once you are sure you really don't care about the reasons as opposed to vice versa.
Greg
Actually, there could be various reasons to update the name of a customer. As you were saying, it could be misspelled or... you could get married and change your name to your husband's.
If you had only an UpdateCustomer command, you would loose the original intent and you would not be able to have different behaviours for each of them. If the name was misselled it could be as simple as updating the database, whereas if your customer got married you might need to notify the marketing departement so tthat they can offer a discount.
In the case that your entity is purely CRUD, that is there is no intent that you can associate with modifying the properties, then it's OK to have an UpdateEntityCommand. You can then transition slowly to something more task based
CustomerHasMoved is the event that is fired after you have updated the customers location. This event updates the read databases/cache databases. The command from the gui should be MoveCustomer or something like that. I think I would put the update of the customer name in a command like UpdateCustomer.

Resources