BehaviorRelay/Variable slow RxDataSources if a lot of data in UITableview - rxdatasources

Using RxDataSources I have a UITableView with a lot of sections and cells. When I search and replace the data with a new data source, my UI is blocked.
I have tried throttle and debounce, but if I search at the 'right' moment, then the UI still gets blocked for 1-2 sec.
Anyway I can solve this?

The problem was that too many animations were done at the same time. I used decideViewTransition to decide when it should animate.

Related

How do you display rapidly updating data to the user in a win32 GUI app?

So im building a basic win32 GUI app and I have a vector of data that gets constantly updated through an external source via a port. Im interested in displaying that list of data to the user but im not sure the best approach to go about it without causing update flickering.
I originally had an edit box in which I build a string with the information and update the window. But it has proved troublesome as the amount of data grows since I cant scroll down to look at additional data. Any ideas?
My idea is no point of updating the visual control as the same speed you receive the data. Because even-though you update at the same speed the users cannot see that change at the speed of data receiving. Human eye does not see a change happening in speed as 1/8th of a second. So better to update the visual control in a controlled manner. Maybe using a timer.
Appending to the text of an edit control for each subsequent data point will lead to flickering as the whole control re-renders as the text has changed.
I'd advise one of the following options:
1) use a ListBox or ListView control; when you add another row item, it only re-draws the new/changed/scrolled item. https://learn.microsoft.com/en-us/windows/desktop/controls/create-a-simple-list-box and https://learn.microsoft.com/en-us/windows/desktop/controls/list-view-controls-overview
2) If you only want an always-scrolling list of data, consider just having a command-line application that writes to the standard output and saves you a lot of trouble - cout or printf your data.
You can also use EM_SETSEL and EM_SCROLLCARET to automatically scroll, but also check the position of the scroll bar before doing that. If not at the bottom, it means that the user wanted to pause, so you can scroll.
Also, you can have the scroll lock key checked in order whether to scroll or not, after all that is what it's name is supposed to do.

Is there a window setting for keeping a selected passage of text even after the text has been changed/refreshed?

I have a CEdit-Box containing some text, which is being refreshed by a thread every ~0.25 seconds. The problem is that everytime the text is being refreshed, a possible selection of text is being erased.
I found 2 ways to avoid this so far:
My implementation right now (1) :
Use quite a passage of logic in order to assure that the text is actually really changing, and not just refreshing itself with the exact same string. This is kind of avoiding the problem, but it feels very clunky to be honest.
Another idea (2) :
Every cycle, before the text is being refreshed, we need to grab the selection we currently have, store it, and try to reconstruct it after our text has been refreshed. However, I don't know how this would turn out if the new text doesn't contain our old string at all. I guess the functionality is implemented in WTL, but I don't think this is a very good approach.
Is there any other way? Something like a control setting which would do something like this?

removeItem in iCloud instantly

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.

Refreshing a Qt form - Seems stuck

My Qt form has a table and some labels. The table content and label contents changes so fast that sometimes it seems that the form is stuck. However when I minimize the form and maximize it again the latest values appear. Any suggestions on resolving this issue.
Do not update the user interface thousands of times per second. The image you see on the display is usually updated only 60 times per second. If you have CRT display the refresh rate may be something like 50 Hz - 120 Hz, but in most displays the refresh rate is 60 Hz.
There is absolutely no need to update contents of labels more often than the display's refresh rate is. The content is never seen. But updating the user interface widgets is quite costly, so it is expected that the window seems to be frozen. You are doing a lot of unnecessary work.
Do not update the widgets every time that your data changes. Use a timer to update the widgets. Timer interval of 16 ms means that the widgets are updated about 60 times per second. But even slower update rate is most probably good enough.
My suggestion is using repaint() after chaning the items:
Repaints the widget directly by calling paintEvent() immediately,
unless updates are disabled or the widget is hidden.
We suggest only using repaint() if you need an immediate repaint, for
example during animation. In almost all circumstances update() is
better, as it permits Qt to optimize for speed and minimize flicker.
Instead of direct calling, you can connect a signal to that widget, because repaint() is a slot.
My crystal ball suggests that you are using a custom model for a QTableWidget, yet your custom model does not emit the dataChanged signal properly. Your post does not contain enough data -- what kind of "a table" are you using, and how do you provide data to it?
Completely agree with Roku answer. There is no need to update user interface with a speed faster then user can read it. I doubt that something which is more 2-3 times per second has any sense for update.. Ok, if you using smart delegates like progress bars in grid or other visual things you can go up to 5-10 times a second.. but still it's never a point to implement grid updates 1000 times a second

Best solution for managing navigation (and marking currently active item) in CakePHP

So I have been looking around for a couple hours for a solid solution to handling site navigation in CakePHP. Over the course of a dozen projects, I have rigged together something that works for each one, but what I'm looking for is ideally a CakePHP plugin that handles the following:
Navigation Model
Component for handing off to the view
Element View Helper for displaying the navigation (with control over sublevels displayed and automatically determining the "active" item based on URL and/or controller/model/slug
Admin pages for managing a tree of navigation
Any suggestions for an all-in-one solution or even the individual components would be very appreciated! Or even suggestions on how you have handled it in the past
We had this issue at work recently and i ended up whiping up a helper that would take query from the contents table and convert that into a menu. As it needed to become more flexible the code got worse and worse up to the point where i am currently rewriting it.
Don't hold your breath though as i will be taking my time to make it work right as it needs to be very flexible but it cant be confusing to use.