Populate separate arrays in iPhone from data in NSMutableArray - iphone

In one of my applications I have a requirement to fetch data from an NSMutableArray and store the data which we got in separate arrays in iPhone. Please provide a solution for me. How do I accomplish this?
Requirements are listed below:
Actually total projects are available in one array (this I got from server).
Total number of filters available in another array (this also I got from server).
Based on each filter (each filter is linked with few projects) I have to fetch projects from projects array.
I am able to fetch projects related to separate filter, but the problem is that after fetching the projects I have to store those projects in separate new arrays related to each filter (means here I have to create new array in runtime).
It is here that I am having trouble. How do I create arrays dynamically at runtime instead of declaring them in advance? Because the filters count will vary at any point of time at server side, I cannot predict in advance how many arrays I need.
I’m following this approach, but this is the issue I am facing.

Create one Mutable Dictionary in which add the project with respective filter and add that object in new NSMutable array.This you will each different project with respective filter.You can fetch the projects form respective Key for project.

Related

Can I refresh all the Word Document metadata using DocumentFormat.OpenXml

I have an application that uses the DocumentFormat.OpenXml API to a Word document from one or more originating documents, inserting and deleting chunks of data as it goes. In other words, the resulting document will be significantly different from the constituent documents.
I have already successfully created things like Custom Document Properties, Document Variables and Core File Properties.
But: is it possible to get the other metadata items (number of pages, words, paragraphs, etc.) refreshed, without actually having to calculate these?
Thank you to #Cindy Meister for the answer.
I was hoping that there might be some method or other in the DocumentFormat.OpenXML SDK that I could call, but it seems that is not possible.

Trying Tree Walking algorithm using for loop for Firebase on Swift to save a tree of data with different node lengths per key

Essentially I've made an app that utilizes Firebase in Swift for iOS that allows it's users to note the pieces and parts of a greater whole using a Tree Style database. Currently I am trying to copy a tree of information from one reference on firebase to another reference. There is a question similar thread which can be found here: iOS Swift FIrebase: moving data to another firebase ref. I will even note the other threads asker is using a similar tutorial as a starting point however, I took a different approach. The answer referenced is helpful however only deals with copying one node with one firebase reference, where as my project has many more nodes and further depth, which means using an array of of the original snapshot values to append the key.name to the reference than returning a snapshot of that new reference, then the next, and continue to dive many levels deep, then reconstruct the whole tree at a new reference.
very rudimentary code...
I apologize as this is the first question I am asking and I am still terribly new to programming. Any help or pointers to better understand what I'm trying to accomplish would be much appreciated.
A quick basic look at how the database is set up under each users ID is here. Imagine the data branching >5-10 nodes deep
database structure

Comparing Documentum Docbases

I would like to know is there a way to compare two doc bases of Documentum to ensure that they are same. For example, to compare the child-parent relationship for an object in 2 doc bases.
Any pointers towards this is much appreciated.
Thanks in advance.
You could write a query that gets all of the documents and folders (using a join), and order/compare the folder paths. That would at least give you a way to determine if all the documents and folder exist.
However, unless you actually did a backup and load from database/content store to the other, the objects will all have different r_object_id values because it is based on the unique repository id.
You can start running the Documentum job "dm_StateOfDocbase" and compare the results.
If you need more specific informations about a relation, you can query the object dm_relation_type.

Xcode dynamically create arrays depending on user?

I'm trying to build an iphone fitness app to allow the user to first create 1 routine. then within the routine to create exercises, and within each of those exercises to create sets. I'd like to allow the user to create as many sets/routines.
My plan is to create an array within an array within an array.
The first array will hold the exercises (represented by an array). And within the exercise array will be the sets(represented by an array). And finally the set array will actually store the information.
I guess my question is, is this possible? To dynamically create arrays based on the user? I can't seem to find any information on this subject,.
Yes, this is definitely possible: NSArray and its subclass NSMutableArray let you create and manage arrays dynamically, growing and shrinking them as needed.
Rather than using arrays of arrays of arrays, I would use special-purpose classes that hold arrays, but hide them, and present some functionality that is related to your specific application.
For example, you may want to consider creating a class for Routine and for Exercise. Routine would have methods like
-(void)addExercise:(MyExercise*)exercise;
-(MyExercise)getExerciseForIndex:(int)index;
-(void)removeExerciseAtIndex:(int)index;
and so on, with NSMutableArray serving as a storage for exercises.

Couchbase: Synchronizing views with a bucket

I've got a question for you couchbase pros: Is it possible to synchronize a subset of documents (eg. the documents within a view) with an other bucket?
So that the other bucket documents are always a direct subset of the "master" bucket?
if so, isn't that to much expensive in terms of perfomance? or does couchbase have any functionality to only create deeplinks to the documents instead of copying it?
Alternatively: is it possible to write views on views?
Thank you in advance!
--- EDIT ----
Let's say I want to have two sets (buckets) of documents S1 and S2. S2 is a subset of S1. Each set contains the same views V1, V2 and V3 since I want to be able to query any of them with the same logic/interface. In my case set S2 is build per user/company/store/whatever, in production there should be like 1000ish subsets S2 - to stay abstract let's call them S2a S2b and S2c.
The selection of documents which to be contained in any subset is done by a filtering instance (for example a view). Let's call these filtering instances F1 for filtering S1 to S2 hence F1a, F1b and F1c.
So with my actual knowledge of couchbase this results in the following design/view architecture: I've got the three "base" views to display V1,V2 and V3, and to realize S2a, S2b and S2c I must create the design views S2aV1, S2aV2, S2aV3, S2bV1, S2bV2, etc. (9 Views).
One could say "Well choose your keys wisely and you can avoid the sub views" but in my opinion this isn't that easy because of the following circumstances: In worst case the filter parameters change every minute and contain many WHERE IN constraints which could (at my actual point of view) not be handled efficiently querying k/v lists.
This leads to the following thoughts and the question I initially asked. If I use the same views in any subset (defined by a filter) shouldn't it be possible to build up an entity which helps me handling complex filtering? For example a function which is called during runtime while generating the view output? This could look like /design/view?filter=F1 or something like that.
Or do you have any other ideas to solve this problem? Or should I use SQL since it's more capable of handling frequently changing filters?
Generally speaking for most models you don't really need to have bucket "subsets", is there a particular reason you are trying to do this and why you would want that data broken out? You can also query your views, or instead of a view on a view, you can just make a separate view that maps/filters further based on your needs (i.e. does the same job as a view on a view).
We are working on Elastic Search integration. Maybe better for your use case
I think what you want to do is write a view on your original bucket, and then copy the key/values from that view, to be documents in a new bucket.
It shouldn't be hard to write an automated framework for managing this so that you can keep the derived data up to date in near real time.