React-Virtualized: How can I insert/remove a row without re-rendering the rows beneath it? - react-virtualized

I have a virtualized list of expensive Components. Occasionally, the list will mutate but it will force a re-render of the rows that have shifted either up or down one position.
For example, if there are 5 visible rows and I insert a new row at index 3, the component that was in row 3 unmounts and then remounts in row 4.
How can I prevent that unmount and re-render?

As you know, the rowRenderer function gives out a 'key' prop. DO NOT use that key value and use your own key (for example the item ID).
This will reduce your re-renders.

Related

Delete bottom two rows in Azure Data Flow

I would like to delete the bottom two rows of an excel file in ADF, but I don't know how to do it.
The flow I am thinking of is this.
enter image description here
*I intend to filter -> delete the rows to be deleted in yellow.
The file has over 40,000 rows of data and is updated once a month. (The number of rows changes with each update, so the condition must be specified with a function.)
The contents of the file are also shown here.
The bottom two lines contain spaces and asterisks.
enter image description here
Any help would be appreciated.
I'm new to Azure and having trouble.
I need your help.
Add a surrogate key transformation to put a row number on each row. Add a new branch to duplicate the stream and in that new branch, add an aggregate.
Use the aggregate transformation to find the max() value of the surrogate key counter.
Then subtract 2 from that max number and filter for just the rows up to that max-2.
Let me provide a more detailed answer here ... I think I can get it in here without writing a separate blog.
The simplest way to filter out the final 2 rows is a pattern depicted in the screenshot here. Instead of the new branch, I just created 2 sources both pointing to the same data source. The 2nd stream is there just to get a row count and store it in a cached sink. For the aggregation expression I used this: "count(1)" as the row count aggregator.
In the first stream, that is the primary data processing stream, I add a Surrogate Key transformation so that I can have a row number for each row. I called my key column "sk".
Finally, set the Filter transformation to only allow rows with a row number <= the max row count from the cached sink minus 2.
The Filter expression looks like this: sk <= cachedSink#output().rowcount-2

Is there a better way to store data in subsequent cells per iteration in Excel?

I am working on a rock, paper, scissors project for fun and trying to find a way to store the outcomes of each game in subsequent cells without overwriting the previous events. Currently I've created a lookup function that returns a cell of "win"/"lose"/"tie and 3 columns win/lose/tie. When an event occurs, it references the returned cell and stores the event as 1 or 0 depending on if it happened or not. I have a total count to track (n) events/Total Count.
I've created another column as my Unique Key with a descending number list to 500 which would be 500 Total Events.
Rock,Paper,Scissors End Result:
Workaround:
Win Column: IF({TotalCount}={UniqueKey},(IF({Outcome}="win",1,0),{Self-Reference})
Lose Column: IF({TotalCount}={UniqueKey},(IF({Outcome}="lose",1,0),{Self-Reference})
Tie Column: IF({TotalCount}={UniqueKey},(IF({Outcome}="tie",1,0),{Self-Reference})
Back-end Database Creation:
This allows the cell to only change if the Event Count = The Row which is identified by the Unique Key of Events. This in turn creates a binary True/False database of what occurred. (All cells are still changing but it is self referencing itself if the Event Number is different from the Unique Key)
Is there a better way to do this either in VBA or not? Is there a way to increment without establishing an existing array of 0s? (Currently it you can only run 500 events because I've created the array stopping at 500 events but it would be cool to be able to increment per each event).
*This is my first question!

Create Notes view for duplicate parent documents

We have an Xpages application and recently discovered an issue where there are several Notes documents that have duplicates but the duplicates are PARENT documents too and NOT response documents. Is it possible to create a Notes view that will show duplicates where all the duplicates are parents? I know the formula for showing conflicts is the following but what about where they are all parents?
SELECT #IsAvailable($Conflict)
Expounding on my comment:
Create a view which is categorized on the first column
In the first column formula, put in criteria that you would use to determine a duplicate. This may be the Document Unique ID, or maybe another field or combination of fields.
Add a second column that contains the number 1. Then enable column totals on this column.
Now look at this view you created. With the view categories collapsed, look for any number greater that 1 to determine which documents are duplicates.
I think what you are asking is not how to identify the duplicates - but how to find out which of them are parent documents. So basically you would create a view as Steve suggests - but instead of putting a constant of 1 into the second column I would suggest putting either #DocChildren (for immediate responses) or #DocDescendants (for all responses and responses to responses).
If I understand your logic then all the ones returning 0 (zero) are child documents and those returning 1 or higher would be parent documents. Of course you could also use an item on the document in your view formula - if it only exists on the parent doc (or its value can tell that it is a parent doc)
View selection formulas act on only one document at a time. They cannot perform lookups. They have no way to compare two documents. There is therefore no possible way for a view to identify duplicates.
A view can, as per the other answers, categorize documents based on common values. If there is a single field that is supposed to be unique across all documents, you can categorize on that field. That will give you a visualization of the duplicates, but it won't filter them in or out.
The only way for a view to filter duplicates - either to show only duplicates, or to exlude duplicates - would be if you run an agent that reads all documents, looks for those that are duplicates, and marks them with a special field value - e.g., IsDuplicate = 1. Once you do that, you can create a view that selects all documents with IsDuplicated = 1, or a view that excludes IsDuplicated = 1.

repeat control from categorized view

I have tried to get the column values in repeat control from Categorized view in xPages,that time i got the column values are coming with single row,and the same row repeated
How to get the column values in "repeat control from categorized view"?
Thanks
I had a situation where I had to drill down from a much larger view and repeated the info back out with the following.
View is categorized in first column by what I'm drilling down by. I achieve this in the XPage/Custom Control by defining the view as a source in the data tab, then select "filter by category name", bind my repeater to that view data source, and compute the value I'm drilling down.
Then in my repeated table, each of my computed fields for each of the column entries read like:
rowData.getColumnValues()[1]
Adjust for your other columns by position with the array modifier after your getColumnValues method. This is not an elegant solution, but worked for my needs. Hope this helps if it's what you're looking for.
[Update]
It's worth noting that doing this can potentially create a memory handle for any DateTime objects which may be returned in the entirety of the getColumnValues method. If you're going to use this approach, I strongly recommend getting a handle on the column values separately, so you can perform a session.recycle(colVals); on them to prevent any memory creep.
[/Update]

grouped UITableView to generate block rows

I want each row of my table view to appear, as it's own independent block, a little like how the Twitter app has on the Discover section (they have the top 3 trending word as 3 blocks.
I am trying to recreate this and the route I am trying to go down is having my table as a grouped tableview but instead of treating each row as a row of one section, I will treat a row as a section, thus generating blocks, each block will have only 1 row.
It sounds like a hack, I'm sure it's not the way to be doing it, but can anyone lend some tips about this kind of setup ?
Also I am using NSFetchedResultsController and I need to specify I want my objects ordered by date, but the section be defined by a unique id which would allow me to generate a section per row. I am not getting any luck with my fetch request either, so I guess this is 2 questions.
Although if I am wrong with the first part, the second becomes irrelevant.
Thank you.
I would not do it this way. Looking at the Twitter app, I have no doubt that this is a grouped table view, and the block sections use the first row as the title and a second row with a bigger row height for the content.
You can adjust the sections and rows as needed in the table view datasource methods, based on what comes back from the NSFetchedResultsController. Only caveat is that you have to be careful when you use the index path to refer to the core data objects.
The design of the Twitter "blocks" suggest a grouped table view, in fact I did manage to achieve this with a plain table view I just needed to be careful with the borders and background colours behind the cells...

Resources