removeItem in iCloud instantly - icloud

Im using NSFM's method removeItemAtURL to remove some item in iCloud, though right after that i run a NSMetaDataQuery and it can still see this item for like 3 seconds. Is there a way to fix this?
Im trying to upload an item to iCloud, and if file with such name exists i need to replace it, and then track NSMetaDataItem's uploadingPercentKey to show it to user, though as i said before, the item is still returns YES from valueForKey:NSMetadataUbiquitousItemIsUploadedKey like for 3 seconds after removal.

As far as I know there is no way to speed this up. The metadata is handled separate to your app by a daemon. That could take a little while to update the metadata, and even longer to send that metadata to the cloud, and then to other devices.
I think you just have to try to design around this delay. Assume that the metadata may not be completely up to date.

Related

django-channels: keeping track of users in "rooms"

TL;DR - How do I maintain a list of users in each room so that I can send that data to the front-end to display a list of participants in this room.
I'm designing a collaborative web application that uses django-channels for websocket communication between the browser and the server. A room can be joined by more than one user and every user should be aware of every other user in the room. How would I go about achieving this using django-channels (v2)?
I already went through the documentation and a few example projects available online but none of them have added a similar functionality. I also know about django-channels-presence but the project doesn't seem to be actively maintained so I didn't really bother looking into examples using that.
Here's what I've come up with so far:
- For every room, I create an object in the database and those objects can keep track of the users that are in the room. So for e.g in the WS consumer's connect() method I could do a get_or_create_room() call and room.add_participant(self.user_name) (or fetch this from the scope) and in the disconnect() method I could remove myself from the room. The problem with this, however, is that I might end up creating race conditions? I think? Also since I'm fetching objects from the ORM, I have to make sure that every time, before using this object I have to re-fetch it from the DB because it can (and will) become outdated quickly. This doesn't seem ideal at all.
- Another way I can think of is attaching data to self.channel_layer in the consumer where I can do something like setattr(self.channel_layer, f'users_{room_id}', {}) and maintain this dictionary for every user entering and leaving. This again doesn't sound very safe and I didn't see anyone using this so I'm unsure.
Any help regarding this would be appreciated. I'd also like to be able to see how existing applications do this if anyone can point me to one?
so in short there is no way to ask channels for the members in a group so you either need to:
Write some info into the db, with a timestamp so that you can see if it is old
or
send a message every (n seconds) over the channel group (machine readable item with the users id) then your consumers (or frontend) can maintain a list of users and filter this to those that have a resent timestamp. The disadvantage here is it might take a few seconds to detect all the users in a chat room.
You can't do anything like writing to a dict or global object since this is not shared over all the consumers.

Performance issue when typing into search input when retrieving objects from store

I have a search field, which lets the user search books (filters records, which are retrieved with ember-data).
I have found that any access the store from the results computed property within my component (see jsbin) makes the typing into the search field very slow (noticeable on my PC, and terrible on smartphone).
Here is a screenshot of the Timeline pane when typing a search query. The displayed part show that every keypress causes A LOT of layout (the search field seems to rerendered on every keypress). I also provide the exported timeline which you can load into your dev tools as explained here
I have tried to recreate the issue in a jsfiddle, but it seems to work just fine. The difference might be that in the jsbin I am using fixtures, while in my app I retrieve data from a real API.
I don't understand what is causing this behavior. It may be hard to come to any conclusion from the data I can provide, but does anyone have any ideas? Has anyone experienced similar performance issues?
Update 2014-03-01
I should note that the performance hit only happens if the results computed property contains a call to the store. If I replace it with any other thing (like just returning [], or some random async method -- like $.get) it not display this performance hit.
Additionally, I should make it clear (in case you didn't read the code), that the results computed property is not called on every keypress, but only when the search is submitted.
This is not a Ember/Ember-data bug, but apparently a Google Chrome bug.
I have created a new question regarding the issue here

Black box test plan to see whether a value is hard coded

I need to make a manual test plan (black box testing) to see whether a value is hard coded in a drop down list (its' the acceptance criteria).
Can anybody give me any suggestions on that?
Thanks in advance
Saj
Until you will describe your application a bit more is hard to say something.
If you can using adming priviliges add/remove values on the dropdown then test is simple.
However if not, if any functionality do not allow you to change values on the DDL why test it then?
The requirment should be descoped as part of Test Report abrevation from Test Plan with given resonable why it is not tested, why it cannot be tested in black box methodology and approved by Product Owner or bussines users.
if the data of the drop down list is taken from data base u can change the data from the data base and check the hard code issue or else
As per the unique id the data is populated in the drop down u can change that unique id and identify is there any hard cord.
There at at least three options:
If you have possibility to change values in that list by making something in the application just try it
If not - perhaps you have possibility to add something to the list
If not - maybe you have to the database and can change the data
If not - ask someone - maybe administrator can make some changes in database for a short time - just to make some test.
Take into account that changing in application and in database may not look the same - when you change in application everything should work, changing in database may require some other actions (triggers, procedures) or time (some things may be refreshed during night or in other schedule).

Getting new tweet count Only using Twitterizer

let me first say a big thanks for Twitterizer, it's made my dev work much easier. I'll definitely be donating. In my app, I load tweets using a webservice and since I keep a track of the last tweet, I'd like to be able to just get the count of new tweets.
is there a faster way other than using TwitterTimeline.HomeTimeline()? Since I assume this method fetches all the content?
I ended up counting new tweets clientside and hiding the content. I realised that since I was loading the content there was no need to re-fetch it again later on so I hide all of them in a div until the user expands it.

Caching data (image, rss) with django

That's my first question in here, I've been looking through old questions, but nothing matched with my problem. Here it is.
I'm creating some site with one main functionality. We want this site to display content of other sites, but in a specific way. User chooses let's say two pages from five and want to see their content. He clicks button 'Display' and goes to next page where he finds let's say view from web cam, and here comes problem.
I want to cache image that is hidden behind the url from which image was downloaded, so after refresh image won't be downloaded again, but browser will get it from cache.
I've been looking through documentation of Django, but nothing seemed to be useful.
I know that I should:
1) create table which stores cache
2) add to settings.py some CACHE_BACKEND = ...
3) use #cache_page(300) before declaration of function which returns content which should be cached,
but... it doesn't seem to work.
I will be greateful if someone tells how to solve that problem, maybe with some sort of code showing the mechanism.
Cheers,
Chris.
I think that right way to do this will be to store image somewhere on your server and delete it later with cron or something similar.
Django cache framework wasn't created for the purpose you are trying to use it.