dexie.js difference between Table.bulkAdd() and Table.bulkPut() - dexie

The Dexie.js documentation for Table.bulkAdd()
https://dexie.org/docs/Table/Table.bulkAdd()#remarks
says: Add all given objects to the store.
The Dexie.js documentation for Table.bulkPut()
https://dexie.org/docs/Table/Table.bulkPut()#remarks
says: Add all given objects to the store.
Why are there two function if they both do the same thing, i.e. create a new records? I would have expected bulkPut() to execute updates on existing records.
Am I missing something?

It's a documentation issue. Will update docs. The difference between add and put is better described in the docs of Table.put() at https://dexie.org/docs/Table/Table.put() where it explains "Adds new or replaces existing object in the object store." and "If an object with the same primary key already exists, it will be replaced with the given object. If it does not exist, it will be added."

Related

How do I add an "author" field in the strapi cms?

I can't figure out how to set up the links. I have created a collection. I need an creator to be automatically specified in that record when adding a record to the collection. How do I do that?
I've faced this problem...
I found the solution in the documentation:
need to add
"populateCreatorFields": true
in the file (strapi v3) /api/your-type-name/models/your-type-name.settings.json
in options object
like:
...
"options": {
"increments": true,
"timestamps": true,
"draftAndPublish": true,
"populateCreatorFields": true
},
...
More information can be found at strapi documentation
Strapi does not support it by default. As mentioned in this form you can achieve it by editing the strapi's controller. But I will not recommend you to edit the strapi controller at all. Please avoid it.
There is a simple and better solution to this. You can achieve this by creating one to one relationship. Create an author table/collection. Make one to one relationship with your other collection. You can make it a required option as well. So whenever someone creates an entry they have to select an author from your already created collection of authors.
And now you can get relation in your API and use it wherever you want to.
As stated in my comment, Strapi (tested on v3) comes with a created by field. To ascertain the claim, the following steps can be followed;
Create a new content type. Here I am setting only one field, called test
Add an entry for that content type. Notice the last update and by field on the right.
Save and open the entry. The last update and by fields have been automatically populated.

CoreAudio: What is "AudioBox" as contrasted to "AudioDevice"

The header file CoreAudio/AudioHardware.h refers to a class "AudioBox" and indicates that it is distinct from but related to the class "AudioDevice". Searching developer.apple.com yields no hits for AudioBox. There is, unfortunately, a commercial product called AudioBox™, which makes googling for the term painfully low-yield.
Here are the comments containing the references:
kAudioHardwarePropertyBoxList
An array of AudioObjectIDs that represent all the AudioBox
objects currently provided by the system.
kAudioHardwarePropertyTranslateUIDToBox
This property fetches the AudioObjectID that corresponds to the
AudioBox that has the given UID. The UID is passed in via the qualifier as a CFString while the AudioObjectID for the AudioBox is
returned to the caller as the property's data. Note that an error
is not returned if the UID doesn't refer to any AudioBoxes.
Rather, this property will return kAudioObjectUnknown as the value of the property.
The header file: AudioHardwareBase.h contains numerous references to AudioBox, but does not define or explain it, although it associates it with AudioDevice.
Searching the docs via XCode just takes me back to AudioHardwareBase.h.
I can infer that perhaps an "AudioBox" is an audio device that is accessed via a plugin. But this does not appear to be stated anywhere.
So What Is An AudioBox?
An AudioBox is a container of (usually) AudioDevices

SharePoint Business Connectiviy Data Model Update method failing

I have an external list in SharePoint that references a BCDM I created inside visual studio. The entity as an ID that is auto generated in the database, which means it's read-only.
Create and read method works fine, I'm trying to implement the update method. I have set an input parameter that match my entity and I'm getting this error.
Failed to update a list item for this external list based on the Entity(External Content Type) ‘Notification’ in EntityNamespace ‘Namespace’. Details: The TypeDescriptor with name ‘Id’ in the Method ‘Microsoft.SharePoint.BusinessData.MetadataModel.Static.Method’ on Entity (External Content Type) with Name ‘Namespace’ in Namespace ‘Notification’ is marked ‘PreUpdaterField’, but is contained by another TypeDescriptor marked ‘PreUpdaterField’.
I tried every possible combinaison to make this work, make the id type descriptor read only, pre-updater field = true/ false/, updater field = true/false, removing it, adding another parameter outside the entity. NOTHING WORKS !!! Obviously, I'm about to commit a murder as something so simple just turned out to be the biggest waste of time in my programmation history. What can I do to make this works??
This has been resolved and is explained here:
http://www.dotnetmikael.com/2014/02/sharepoint-2013-bcdm-with-visual-studio.html

setObjectId is not working

I wonder if is possible to assign an id when an item is created with parse:
ParseObject parseWord = new ParseObject(DataBaseHelper.TABLE_WORD);
parseWord.setObjectId(idRow);
parseWord.put(Word.NAME, word.getName());
parseWord.put(Word.TYPE, word.getType());
parseWord.put(Word.TRANSLATE, word.getTranslate());
parseWord.put(Word.EXAMPLE, word.getExample());
parseWord.put(Word.NOTE, word.getNote());
parseWord.put(Word.SYNC_AT, today);
parseWord.saveInBackground();
This code is not working, it doesnt save the item in the server. If I delete the setObjectId(idRow); it works. What am I doing wrong?.
Is there anyway to know when the saveInBackground is done?
Thanks
According to the ParseObject.setObjectID() API doc:
Setter for the object id. In general you do not need to use this.
However, in some cases this can be convenient. For example, if you are
serializing a ParseObject yourself and wish to recreate it, you can
use this to recreate the ParseObject exactly.
Also from the API doc:
An object id is assigned as soon as an object is saved to the server.
A reason, as the quote suggests, you might need to set the object ID is if you, wish to do something like save the fields of a parse object to a file. If you wanted to take the fields from your file and recreate a parse object, THEN you'd need to set it, as that's not done for you if you're not saving it to the server and just using an instance of the object for purposes internal to your application.

Identify ABRecord records uniquely: Is [ABRecord uniqueId] immutable?

I need to reference ABPerson records from within an application. I use the unique ID provided by
- (NSString *)uniqueId
and attach it to my in-app contact record.
Additionally, I save ABPerson's vCardRepresentation as a fallback. In case the app isn't any longer able to locate the ABRecord using the uniqueID, the app asks the user to recover the adressbook record using the saved vCardRepresentation. All works fine.
Unfortunately, a friend told me, that uniqueId isn't immutable: During a sync, uniqueId may suddenly change.
According to him, somewhere in iOS documentation, Apple explains that no way exists to immutable identify ABPersons using uniqueId. In OS X' Cocoa documentation, I failed to find such a hint.
On a given Mac, may the uniqueId change suddenly? If that's true, what's the correct way to identify ABPerson records from within an external application?
In case the uniqueID isn't immutable, I certainly may assign a custom property with a GUID. Unfortunately, custom fields do not sync.
Certainly, I'd prefer to use uniqueId.
For whats its worth, from Apple's techdoc:
kABUIDProperty
The unique ID for this record. It’s guaranteed never to change, no matter how much the record changes. If you need to store a reference to a record, use this value. Type: kABStringProperty.
Available in Mac OS X v10.2 and later.
Declared in ABGlobals.h.
It looks like the kABUIDProperty approach might not work anymore. I came across this blog entry with more discussion in the comments at: http://blog.clickablebliss.com/2011/11/07/addressbook-record-identifiers-on-mac-and-ios/.
A case in point: If a user decides to turn on iCloud sync, the unique ids in that user's address book will change. If the users turns off iCloud sync, they'll change again.
Addendum: it might be worthwhile looking at the StackOverflow entry here.
Apple's docs do say this (quoted from the link):
"The recommended way to keep a long-term reference to a particular record is to store the
first and last name, or a hash of the first and last name, in addition to the identifier.
When you look up a record by ID, compare the record’s name to your stored name. If they don’t match, use the stored name to find the record, and store the new ID for the record."

Resources