Why posting new BuiltFileObject clears array of BuiltFileObject from built app? Did i miss anything? - ios

I am fetching BuiltClass from my built app through SDK and I get list of built file objects in it like e.g: List<BuiltFileObject>
Below listed properties I get from BuiltFileObject:
app_user_object_uid, content_type,file_size,filename, tags[], uid ,url
Now if I upload any file then I get same BuiltFileObject with all properties and I inserted that file object in List<BuiltFileObject> and saved BuiltClass. But in response I don't get list of BuiltFile Objects.
Am I missing anything in save call?

You need to save the upload before your save your BuiltClass. See the documentation for Uploads.

Related

Logic App retrieve values from custom created parameter names in a text file

having trouble with Logic App usage, so i am receiving a file with example text below and need to map them according to their tags. so for each tag they will go to different fields in my database. Keep in mind I cannot change the structure of the file, stays as is due to previous systems:
:2e:hello
:3t:there
:fy:people
What I do is pull the file from file storage and them i can access the content which are the values above. But what I need to do is check if i have ':2e:' and if so take its value which is 'there'.
Any suggestions?
thanks

Storing gps location data in Parse

I want to build an app like RunKeeper, as detailed in this tutorial. But I want to save the data in Parse cloud.
I will have a user object, and a user can have multiple runs. I am not sure how to save the gps locations for each run. Since there can be hundreds of locations for each run. Can someone please explain what would be the best/efficient way to save the locations.
Thanks.
Save lat/long pairs as double precision floating point values. That's all there is to it.
To solve your problem,
In the user class I would add an array of _runId.
After I would create a class Run with the specific property. So when the user do a run you append the id in the _runId array of the user class.
In the Run class, you could have a property like: location. It should also be an array (_location). So when the user is running you can append to the location array the location of the user for the specific run.
After that you would be able to get all the location of the user with the runId.
Hope this help!
What if you save all geo data to a JSON file, let's say that each JSON file will be a run, then save the JSON files into your Parse.com.
Good luck.

Index if not exists using bulk processor in elasticsearch

I am trying to index a document if it doesn't already exist in elasticsearch. I am using BulkProcessor when indexing my documents and using Requests.add action. I will have the exact same id sometimes, does it not add automatically, but update?
P.S. Update is not a requirement, it can stay as is.
P.S.2 I am trying to integrate a user's past tweets into elasticsearch-twitter-river's user stream.
If you index a doc with the same document id then it will do an update. Otherwise it will add a new document.
In other words, if you PUT a doc to {index}/{type}/{id}, then it will always update (overwrite) the document with that id. If you POST a doc to {index}/{type} then in general Elasticsearch will generate a new document for each of your POSTs. That is, unless you mapped a document field to the _id field in mappings.
It seems that the Twitter River uses the PUT method with explicitly specifying the id so tweets with the same id will probably be overwritten.

Session loses its data with Carrierwave multi files upload using jquery file upload

Simply I've a model called Estate which has many :images (Image model) and
I'm using CarrierWave & jQueryFileUpload to handle these in Estate New/Edit forms.
While creating new estate, and upload an image, jQueryFileUpload is doing that using AJAX request, so I make all uploaded images paths be stored in a session array then I use this array in create or update actions to save the images from tmp directory to actual directory.
This works fine with me, but The problem is when I've selected more than one photo at a time, session array store only last selected image, and not all images be pushed to the session array except the last one.
def images_url_list
#image = Image.new(image_params)
session[:cached_images_paths] << #image.image_file.current_path
end
I've debugged this action and I found that if I selected 5 images at a time, images_url_list action is fired 5 times, so say that I upload an image called "path0" then I uploaded 5 images which paths called ["path1","path2","path3","path4","path5"] and the session already has a path called "path0", first time after uploading first image the session will be ["path0", "path1"], second time ["path0","path2"] and so on until last image which is path5.
So the final count of image paths is only 2 rather than 6 image paths.
Can anyone tell me what exactly the problem is?
I think the problem is the multi-request and the session save.
In my case using a similar environment, only the last uploaded file was saved. I couldn't make it work adding it in a filesUploaded array, so I though about an alternative solution.
A good approach might be:
Generate a session upload hash and store it for each uploaded file on the upload listener
Use it to identify the uploaded files after the multi-upload is finished

Multiple File Uploads for a new record

I have implemented multiple file uploads for existing records as seen here https://github.com/websymphony/Rails3-Paperclip-Uploadify
I would like to know if it is possible to implement multiple file uploads when creating a new record.
Since we need flash to do the multiple file uploads, how would it be possible to associate the uploaded files with the record if the record has not yet been created.
I have thought of a hack-ish way to essentially make a "draft" and update it. However, I hope there is a better way to do this.
There is no better than the kind of hackish way you present:
creating orphans objects and give them parents later or delete them (sad huh? :) )
creating parent object by default, add some confirmation field in the form so that you know what objects really have an owner, delete the rest.
BTW, you don't "need" flash for multiple uploads, see here: http://blueimp.github.com/jQuery-File-Upload/
Yes, you can use http://blueimp.github.com/jQuery-File-Upload/. But there are still some points you need to be careful.
Don't forget to remove appended array after you define the file field with "multiple". For example: replace "photo[image][]" with "photo[image]".Otherwise file uploaders like "carrierware" will not be working.
If you are using rails 3.2.13, the appended array will always appear no matter whether you set the name to be without appended array. You can use "file_field_tag" to resolve this problem. Please refer this issue to: https://github.com/tors/jquery-fileupload-rails/issues/36.
For the association:
You need to create a hidden text field which contains IDs of images that will be associated to the record you are going to create.
Upload images by "jquery-fileupload"(it is ajax), then get IDs of images from response bodies.
Set these IDs to the hidden field.

Resources