eclipse sorting bookmarks by creation time - eclipse

My eclipse workspace has about 70 interdependent java projects and bookmarks set in various areas of interest over the last few months.
I like to see the bookmarks sorted by creation time so that I can see the sections of code I was working on when fixing specific bugs.
Unfortunately, sorting by Creation Time doesn't seem to work since some dates are showing up out of order.
And sorting by ID was OK for a while, but when we moved to a different revision control system I had to try copying my marker files to the projects in the new source tree and eclipse's notion of current bookmark ID changed so all the new bookmarks appear out of sequence with the old ones.
So it looks like I'm back to trying to deal with sorting by Creation Time.
One other data point; if I ctl-a and copy all of the bookmarks into a text file, the date shows up as a long int value; sorting on this value seems to produce the correct result.
So I'm not sure why eclipse fails to sort properly.

Related

Cleaning up duplicate files in TYPO3

There are several duplicate files in my TYPO3 installation. Also some dupes in sys_file for the same file (different 'uid', same 'identifier' and 'storage').
These have several reasons:
first of all, this is an older site, so the previous behaviour (before FAL) resulted in duplicates anyway which were then moved to _migrated. (I am not sure if the upgrade wizard at that point did some cleaning up as well.)
editors just upload things more than once sometimes and lose track of existing files (in spite of filemounts used and a sensisble directly structure and thumbnails)
I don't know the exact reason for the dupes in sys_file, but they appear to be mostly related to the _migrated files.
What I would now like to do is create a script / extension to clean this up or assist editors to clean it up (e.g. show duplicates).
files with same content hash (but different filename / path) could be merged which means also merging all references
duplicates in sys_file should also get merged
I have a rough idea how this could be done but would like to know if there are already tools, experiences or knowledge anyone could share.

Eclipse indexing - what do the various options do

When you right-click > index on a project there are a few options:
Rebuild
Freshen All Files
Update with Modified Files
Re-resolve Unresolved Includes
I've been just hitting rebuild everytime but now I'm working on a huge project and can't afford to do that; when I modify a file, whether it's a .cpp or .h, I need to know which 'index' operation to do.
For each of the 'index' options:
What does it precisely do?
What is the cost (relative memory, CPU time)?
Documentation from Eclipse would be helpful but already searched and didn't find any.
Rebuild can only be performed on the whole project. It throws away the project's entire index and rebuilds it from scratch, indexing each file in the project.
Since it starts by throwing away the previous index, cancelling a Rebuild will result in an empty or partially built index.
The other actions can be performed either on the whole project, or on a folder or file (or group of folders/files) in the project.
They all go through the files in the selection, and update some or all of them in the index. Unlike Rebuild, they do not start by clearing the index, so cancelling them is relatively safe.
Freshen All Files updates all files in the selection. If called on the project, the end result is comparable to Rebuild.
Update with Modified Files only updates those files in the selection which have changed since the last time they were updated in the index, as determined by their timestamp and a hash of their contents.
Re-Resolve Unresolved Includes only updates those files in the selection for which configuration info (such as specified include paths) has changed, and the change resulted in an include that was previously unresolved now being resolved.
The performance characteristics can vary a lot depending on the project size and the kind of machine you're running on. I work on a very large project (millions of lines) for which a Rebuild can take 20-30 minutes on a relatively modern desktop. The operation is typically CPU-bound, but the indexer is currently single-threaded, so it will only use up one CPU core.
Finally, I'd like to mention again what I said in my comment on the question: if you configure the index to be updated automatically in Preferences | C/C++ | Indexer, you shouldn't need to manually invoke these commands at all, at least in theory. In practice, I find an occasional Rebuild is necessary (say once every few weeks), especially after a configuration change (e.g. adding a new include path).
Sources: this mailing list post, reading the implementation of the actions, and experience using CDT.

Symfony: getting form values before and after form handling

Hello I want to be able to compare values before and after form handling, so that I can process them before flush.
What I do is collect old values in an array before handlerequest.
I then compare new values to the old values in the array.
It works perfectly on simple variables, like strings for instance.
However I want to work on uploaded files. I am able to get their fullpath and names before handling the form but when I get the values after checking if form is valid, I am still getting the same old value.
I tried both calling $entity->getVar() and $form->getData()->getVar() and I have the same output....
Hello I actually found a solution. Yet it is a departure from the strategy announced in my question, which I realize is somewhat truncated regarding my objective. Which was to compare old file names and new names (those names actually include full path) for changes, so that I would unlink those of those old names that were not in the new name list anymore. Basically, to operate a cleanup after a file was uploaded to replace another, without the first one being deleted first. And to save the webmaster the hassle of having to sort between uniqid-named files that are still used by the web site and those that are useless.
Problem is that my upload functions, that are very similar to those given in examples to the file upload code shown on the official documentation pages, seemed to take effect at flush time.
So, since what I wanted to do with those files had nothing to do with database operations, I resorted to having step two code launch after flush, which works fine.
However I am intrigued by your solutions, as they are both strategies I hadn't thought of. Thank you for suggestions.
However I am not sure if cloning the whole object will be as straightforward as comparing two arrays of file names.

Eclipse Virtual TableViewer filtering and Sorting? [duplicate]

Our application is an RCP appliction and needs to display table of several thousands items. For this reason, we're using SWT.VIRTUAL in our TableViewer. That works pretty well except for selection.
We're having following issue :
Our TableViewer support sorting and filtering. When we use a virtual tableviewer, changing the selection does not preserve the current selected item but the row currently selected.This leads to another item being selected.
e.g: If Item 'A' present at the 5th row is selected by user and sorting is performed, then after sorting the Item at the 5th row gets selected instead of the Item 'A'.
Using a non virtual TableViewer, everything works fine.
We tried to go into debug and found out that the cache from the AbstractTableViewer.VirtualManager class seems to be up to date with the model.
Forcing the cache to be used in the AbstractTableViewer.virtualSetSelectionToWidget() can be a possible approach.
We have tried to implement a solution suggested in https://bugs.eclipse.org/bugs/show_bug.cgi?id=338696. However it didn't work.
Please suggest some pointers or alternative work around.
Thanks for the answers.
As a workaround for working with huge tables I would suggest you to take a look at the Nattable project http://www.eclipse.org/nattable/. It supports everything you need (sorting, filtering, tree structured elements, lazy loading etc.). We successfully use it in our project, where it is necessary to display hundreds of thousands elements as a tree with around 160 columns. It also has some pretty cool styling features, which can make your table more user-friendly and interactive. Hope this helps

eclipse CVS usage: clean timestamps

during synchronisation with the CVS server, eclipse compares the content of the files (of course it uses internally CVS commands). But files without any content change are also shown as different, if they have another timestamp, because they are "touched". You always have to look manually per file comparison dialog if there was really a change in it or not.
Due to auto-generation I have some files that always get new timestamps and therefore I always have to check manually if they really contain any change.
At the eclipse docu I read :
Update and Commit Operations
There are several flavours of update and commit operations available
in the Synchronize view. You can perform the standard update and
commit operation on all visible applicable changes or a selected
subset. You can also choose to override and update, thus ignoring any
local changes, or override and commit, thus making the remote resource
match the contents of the local resource. You can also choose to clean
the timestamps for files that have been modified locally (perhaps by
an external build tool) but whose contents match that of the server.
That's exactly what I want to do. But I don't know how!? There is no further description/manual ...
Did anybody use this functionality and can help me (maybe even post a screenshot)?
Thanks in advance,
Mayoares
When you perform a CVS Update on a project (using context menu Team->Update), Eclipse implicitly updates the timestamp of local files whose contents match that of the server.