Eclipse navigator and project explorer sort the numbers in files names wrong - eclipse

For instance, when I have the following files:
pro0.cpp
pro1.cpp
pro2.cpp
pro3.cpp
pro10.cpp
pro11.cpp
I expect to see them in the above-mentioned order. But Eclipse would sort them like the following:
pro0.cpp
pro1.cpp
pro10.cpp
pro11.cpp
pro2.cpp
pro3.cpp
I made a lookup but I failed to find any related information about that issue. Is not it an issue at all? Or did this problem only occurred to me?

This is working as intended. These views just sort the file names using the result of the Java String.compareTo method. This just compares the strings character by character left to right. It does not try and look for numbers in the strings. This gives the result you see.
Some file viewers (macOS Finder for one) do look for numbers in the file names and sort using the whole number. This is quite a bit more complex and the Eclipse views don't try to do this.

Related

Dataprep import dataset does not detect headers in first row automatically

I am importing a dataset from Google Cloud Storage (parameterized) into Dataprep. So far, this worked perfectly fine and one of the feature that I liked is that it auto detects that the first row in my (application/octet-stream) .csv file are my headers.
However, today I tried to import a new dataset and it did not detect the headers, but it auto assigned column1, column2...
What has changed and or why is this the case. I have checked the box auto-detect and use UTF-8:
While the auto-detect option is usually pretty good, there are times that it fails for numerous reasons. I've specifically noticed this when the field names contain certain characters (e.g. comma, invisible characters like zero-width-non-joiners, null bytes), or when multiple different styles of newline delimiters are used within the same file.
Another case I saw this is when there were more columns of data than there were headers.
As you already hit on, you can use the following snippet to do mostly the same thing:
rename type: header method: filter sanitize: true
. . . or make separate recipe steps to convert the first row to header and then bulk-rename to your own liking.
More often than not, however, I've found that when auto-detect fails on a previously working file, it tends to be a sign of some sort of issue with the source file. I would look for mismatched data, as well as misplaced commas within the output, as well as comparing the header and some data rows to the original source using a plaintext editor.
When all else fails, you can try a CSV validator . . . but in my experience they tend to be incredibly opinionated when it comes to the formatting options of the file—so depending on the system generating the CSV, it could either miss any errors or give false-positives. I have had two experiences where auto-detect fails for no apparent reason on perfectly clean files, so it is possible that process was just skipped for some reason.
It should also be noted that if you have a structured file that was correctly detected but want to revert it, you can go to the dataset details, select the "..." (More) button, and choose "Remove structure..." (I'm hoping that one day they'll let you do the opposite when you want to add structure to a raw dataset or work around bugs like this!)
Best of luck!
Can be resolved as a transformation within a Flow:
rename type: header method: filter sanitize: true

Two closely matching files: get corresponding lines?

I'm in a situation where I'm programmatically generating LaTeX code, and I want my Synctex to point to the correct lines in the original file.
The generation is basically doing template expansion, so the original files are nearly identical to the generated ones, but with some snippets expanded.
I'm wondering, is there a diff tool or library that will easily give me the line number of the original file that corresponds to a given line in the generated one? Can this be extracted from a normal Unix diff somehow?
This is part of a build script, so ideally something easy to run, like bash or python, is preferred to something that needs to be compiled.
Google’s diff-match-patch lib is a neat solution to questions like these: https://github.com/google/diff-match-patch

Is there a limited number of merge levels html help can retain index/search items for?

I created a RoboHelp html help project that merges three projects into a master project. Indexes and search terms work fine in the Master.chm. However, this Master.chm gets merged into another "Super-Master" application that my application is a plug-in for. After that merge, the sub help .chms items do NOT appear in index and search does not find them. Is there a limited number of "levels" merged help will allow index/search to work? Or is it more likely there is some other problem (ie. Super project doesn't use Binary index) or something?
Mostly it's the binary index. Please check following list of general tips from Rob Chandler's website:
All CHM files should be installed to the same folder.
You can install any number of Slave CHMs but the Master CHM must always be installed if you want the slaves to reference the master
Table Of Contents.
Each project must enable the "Binary Index" in order for index merge to work.
A binary index will not be created if you select 1.0 as the version in the Compatibility box > Compiler tab > Project Options
dialog or if the Create a binary index check box is cleared.
Rick Stone reminded that the Master index must contain at least one index term in order for the merge to work.
Similarly "Binary TOC" must be disabled otherwise merge will not work.
Include HHC works recursively, so you can have groups of optional modules. I.E. HHC files including HHC files that include other HHC
files and so on.
Merging of Index and ALink keywords. This does not work recursively, because they do not know about the TOC inclusions. If
you want to have a unified Index or cross-module ALinks you have to
tell every CHM file which others might be available belonging to the
same project. Again: Do not merge yourself.
Another idea: If you have identical keywords from several files, HTML Help uses the <title> tags in the list of targets. We extended
the title of each topic with the title of the module itself (the
"book"), leading to: <title>This fine topic title (This fine book
title)</title>.
An include statement in a HHC file can refer to a standalone HHC file. The HHC file should be placed in the same folder as the CHM
files.

Localizable.strings woes

My Localizable.strings file has somehow been corrupted and I don't know how to restore it.
If I open it as a Plain Text File it starts with weird characters that I can't copy here.
If I leave the file be the app builds. If I make any changes either the values aren't interpreted properly or I get an error at compile time.
Localizable.strings: Conversion of string failed. The string is empty.
Command /Developer/Library/Xcode/Plug-ins/CoreBuildTasks.xcplugin/Contents/Resources/copystrings failed with exit code 1
I suspect this is an encoding problem but I don't know how it happened (maybe SVN is to blame?) nor how to solve it. Any tips will be much more appreciated.
I have issues with the same file that sound very similar to your own. What happens for me is that Xcode doesn't know the correct file formating. I often get this when rearranging the project and I remove and re-add this file to the Xcode project. When I re-add the file, its encoding gets set to something like Western Roman which can't seem to render anything other than ASCII.
Here's what I do to fix the problem:
In Xcode select the Localizable.stings file in the Groups&Files panel.
Do a Get Info on that file.
On the info panel select the General tab.
In that tab go to the File Encoding and change its value.
The last step is where the trick lies as you now have to guess the right encoding. I find that for most European languages that "Unicode (UTF-8)" works. And for Asian languages I find that "Unicode (UTF-16/32)" are the ones to try.
I just had that error because I forgot a semicolon. Took me a while to figure it out. Seems like a really ambiguous compiler error but the fix was simple.
Make sure in File-Get Info, that UTF-16 is selected. If it's set to none or UTF-8 as encoding then you need to change it. If your characters have spaces between them then you choose to "re-interpret" the file as UTF-16. If there are weird characters in the file, then you need to remove them.
Execpt the UTF-8 problem, sometimes you still have to check the content in case if there are some syntax problems.
Use the following Regular Expression to verify your text line by line, if there's any line not matched, there must be a problem.
"(.+?)"="(.+?)";
You can use the plutil command line tool. Without options or with the -lint option, it checks the syntax of the file given as argument. It will tell you more precisely where the error is.
This happens to me when there is a missing quote or something not right with the file. MOst commonly, since my language files are done by another team member, he tends to forget a quote or something. Usually XCode shows an error on that line, sometimes it does'nt and just throws "Corrupted data" error.
Double check if all your strings are properly closed in quotes
Open the file in Xcode.
Right click it in Project Navigator.
Select Open as -> ASCII Property List

Matlab: how to find functions on path that use a given function

It sometimes happens that I need to change the behavior of a function. Is there an easy way to find functions (on the matlab path) that use that function?
The way I do this is to look for files that contain the name of the function I'm interested in. Thus, I don't only see who calls my function, but also what signature they use.
In the editor: Edit->Find Files
Start with help deprpt.
EDIT: when I run a dependency report there are 3 checkboxes at the top of the report window. One of these, by default unchecked, is called 'Show parent functions (current folder only)'. That is probably the beginning of what you want but it only works in a single folder.
If you want more than that, I suggest that you try edit deprpt.m.
I would use a tool like grep. I posted a tool called mgrep on the file exchange a few years ago. It can search through entire directories of m-files for any given string, and it searched recursively down into sub-directories. So to find functions in my directories that call fminsearch, I would merely execute this at the command line.
mgrep('fminsearch','.','show','off')
Searching directory(ies)...
/Users/woodchips/Desktop/My_FEX/cylinderfit.m
/Users/woodchips/Desktop/My_FEX/fminspleas.m
/Users/woodchips/Desktop/My_FEX/fminspleas2.m
/Users/woodchips/Desktop/My_FEX/fminspleas3.m
/Users/woodchips/Desktop/My_FEX/fminspleasnnls.m
/Users/woodchips/Desktop/My_FEX/BoundedFSOLVE/fsolvebnd.m
/Users/woodchips/Desktop/My_FEX/FMINSEARCHBND/fminsearchbnd.m
...
you mean like looking for dependencies? that would be tools -> show dependency report