Questions tagged [invalidation]
568 questions
64
votes
3 answers
What does postInvalidate() do?
What is the use of the postInvalidate() function in Android? I have been seeing this function in a lot of places. When I Googled, I came out with this much:
postInvalidate-- post an invalidate request on the UI-thread
I don't know what the phrase…

rogerstone
- 7,541
- 11
- 53
- 62
33
votes
5 answers
How can I invalidate the file system cache?
I want to measure/optimize the "cold boot" startup performance of an application, and it's difficult to do this without an actual reboot, which is obviously not an ideal solution.
Is there a way I could invalidate entire system's file cache, so that…

user541686
- 205,094
- 128
- 528
- 886
30
votes
4 answers
How to find if NSTimer is active or not?
I have a timer something like this:
NSTimer* timer = [NSTimer scheduledTimerWithTimeInterval:1.0
target:self
selector:@selector(updateCountdown)
…

Rahul Vyas
- 28,260
- 49
- 182
- 256
28
votes
2 answers
Momentjs : How to prevent "Invalid date"?
I have the following code :
var fomattedDate = moment(myDate).format("L");
Sometimes moment(myDate).format("L") returns "Invalid date", I want to know if there is a way to prevent that and return an empty string instead.

R3tep
- 12,512
- 10
- 48
- 75
26
votes
4 answers
How can I manually tell an owner-drawn WPF Control to refresh/redraw without executing measure or arrange passes?
We are doing custom drawing in a control subclass's OnRender. This drawing code is based on an external trigger and data. As such, whenever the trigger fires, we need to re-render the control based on that data. What we're trying to do is find out…

Mark A. Donohoe
- 28,442
- 25
- 137
- 286
24
votes
1 answer
What is the difference between Android's invalidate() and postInvalidate() methods?
What is the difference between Android's invalidate() and postInvalidate() methods? When does each one get called? Must the methods be called only in classes which extend View?

user918197
- 1,129
- 6
- 17
- 29
23
votes
2 answers
Invalidate vs Update
I have code that lets be drag around a borderless form in winforms that I've been using for several months now, which works extremely well.
But when I first was given the code, they used this.Invalidate(); in the MouseMove event of the Form, and the…
anon271334
17
votes
2 answers
Memcache invalidate entries according to a pattern?
Is there a way to invalidate entries in memcache according to a wildcard key?
So if I have the following memcache keys:
data/1
data/2
data/3
Is there a way I can invalidate those keys with something like data/*? It would be extremely helpful to…

Kekoa
- 27,892
- 14
- 72
- 91
16
votes
3 answers
Difference between invalidate metadata and refresh commands in Impala?
I saw at this link which affects Impala version 1.1:
Since Impala 1.1, REFRESH statement only works for existing tables. For new tables you need to issue "INVALIDATE METADATA" statement.
Does this still hold true for later versions of Impala?

covfefe
- 2,485
- 8
- 47
- 77
15
votes
1 answer
When does one need to call revalidate() on a swing component to make it refresh, and when not?
When dealing with swing components, and when changing the components during runtime, one (often) needs to call the revalidate() method on the components in order for them to refresh.
What are the rules that determine whether or not one needs to…

Datoraki
- 1,223
- 13
- 26
15
votes
3 answers
Android ImageView.setMatrix() and .invalidate() - repainting takes too much time
Task: I want to resize and move an image across the screen. I want to do this smoothly no matter how big the image is. The code should be supported by the API level 8.
Problem: I tried to use ImageView with scaleType="matrix". Calling…

Filip Hazubski
- 1,668
- 1
- 17
- 33
15
votes
2 answers
Android: How to get a custom view to redraw partially?
I have a custom view that fills my entire screen. (A piano keyboard)
When a user touches the key, it causes invalidate() to be called and the whole keyboard gets redrawn to show the new state with a touched key.
Currently the view is very simple,…

Peterdk
- 15,625
- 20
- 101
- 140
15
votes
1 answer
std:: insert iterator for unordered sets (or maps)?
Is there an insert iterator in std:: for unordered sets? As far as I can see, std::inserter requires an iterator argument. This is unsafe for unordered containers (at least for boost::unordered_set), because they may reallocate during an insert…

Johannes Schaub - litb
- 496,577
- 130
- 894
- 1,212
15
votes
3 answers
When the data structure is a template parameter, how can I tell if an operation will invalidate an iterator?
Specifically, I have a class which currently uses a vector and push_back. There is an element inside the vector I want to keep track of. Pushing back on the vector may invalidate the iterator, so I keep its index around. It's cheap to find the…

Neil Kirk
- 21,327
- 9
- 53
- 91
15
votes
7 answers
Why is vector::iterator invalidated upon reallocation?
I don't understand why a vector's iterator should be invalidated when a reallocation happens.
Couldn't this have been prevented simply by storing an offset -- instead of a pointer -- in the iterator?
Why was vector not designed this way?

user541686
- 205,094
- 128
- 528
- 886