Can ClearCase's findmerge tool ignore a predefined conflict? - clearcase

There are 2 branches of a file. I have to merge from one branch to the other. The automatic merges fails as there are conflicts. The conflicts are due to the date command output stored in file. Can the findmerge tool ignore some conflicts using some filter options? I want findmerge to ignore Date: .* lines and auto merge the rest of file.
As there are many such files, manual merge of all such file having difference of "Date: .*" takes too much time. How can I automate such a merge ?
Date is different in all 3 files, so there is conflict:
file1.txt##/main/branch1/LATEST
Date: 03/03/2010 11:00PM
Some information1
file1.txt##/main/branch2/LATEST
Date: 11/11/2009 10:30AM
Some information1
New information2
New information3
Base file: file1.txt##/main/main/20
Date: 07/07/2005 05:30AM
Some information1
Thanks
Deepak

Keyword expansions in ClearCase have been debated before: without the right type manager, it isn't supported.
(Not mentioning the fact is doesn't bring much value in a VCS)
The crux of the issue is that the findmerge algorithm has a case where the actual file content is compared. Unfortunately, findmerge does not use the type manager's compare function, but something hard coded and will think the files are different even though the only difference is in the keywords
You still have in theory a way to develop a type manager, combined with a trigger, as discussed here. This isn't trivial by any mean, so the best solution is to:
either avoid modification in both branches (the merge will then be trivial for that section)
or avoid keyword expansion entirely (for instance, a meta data like a date should be associated with the revision date itself, and not as a textual metadata within the data itself)

Related

CSV file not recognized as csv, reason nominal value not declared in header

I am trying to load a dataset in weka, I have tried many solutions such as arff format, comas etc. but it was all a failure. Could any of you give me a working solution or load this dataset according to the format.
Here is a link to dataset
Instead of using Weka's functionality for reading CSV files, you could use ADAMS (developed at the same university; I'm the lead developer) instead.
Download the adams-ml-app snapshot and then use the Weka Investigator to load/save the file:
Load it as ADAMS Spreadsheets (.csv, .csv.gz)
Save it as Arff data files (.arff, .arff.gz) or Simple ARFF data files (.arff, .arff.gz)
The Reviews column contains an erroneous 3.0M, which prevents it from becoming numeric.
If you want to have an introduction to the Weka Investigator, then take a look at my talk from the Weka User Conference 2021: Taking Weka to the next level with ADAMS .
There are too many issues with lines in this file.
In line 23, I eliminated the odd looking brackets.
I removed all single quotes (')
I eliminated all repeated double quotes ("")
In line 10474 the first two fields (before the number) didn't seem to be separated, so I added a comma.
This allowed the file to go through initial screening, but...
The file contains a lot of odd emojis. I started to eliminate them one by one, but there are clearly more of these than I wish to deal with.
Each time I got rid of one, it would read farther into the file, then stop at the next one.
If I just try to read the top of the file, the first 20 lines before we get to any of these problems, it reads fine.
My partial editing can be found here: https://www.dropbox.com/s/ij707mb23dt1jvz/googleplaystore3.csv?dl=0
I think if you clear up the remaining emojis the file should be usable.

What does the + mean in software versioning

In libraries or packages I often see something like 0.5.4+6 or maybe 1.12.4+2, etc. I know the first number is the major version, the next one minor version, the next one maybe build number or revision. But what does the +2 or +6 signify?
Usually it is used to provide some metadata / build metadata (eg. a build number or date).
For more detailed info, see the Semantic Versioning spec.
Trailing part after MAYOR.MINOR.PATCH not defined strictly in SemVer (AFAICR), thus - everybody can add any useful information in it. Most common usage - provide (in case of using VCS) unique (but readable) id, which allow to identify exact changeset in source, used for building this artifact.
Because (mainly) tags (or equivalent) used for naming|numbering versions in VCSes and (internal) builds between tags (releases) are possible, such ids appear, which, in plain words, mean something "N commits after version X".
Sample from my labeling (don't try to grok hg-templating, I'll explain it)
semver = "{latesttag}{ifeq(latesttagdistance,0,'','+{latesttagdistance}')}"
Find latest tag in history
If there are commits after it - add "+" sign and this number of commits
Just human-friendly type of id, which also allow (rather) fast detection of commit in question, if it's needed. And it's a lot more readable and memorable and pronounceable than, f.e. b800644fcbe2

SAP FM EPS2_GET_DIRECTORY_LISTING file mask

The FM EPS2_GET_DIRECTORY_LISTING has a parameter file_mask which I guess that it should act as a pattern. I need to read from the AS the files containing a word but the file_mask is working faultly. For example if I pass "*ZIP" it returns a file named '.TXT'. Is there a proper way to use that parameter?
The parameters are described in SAP note 1860206 which I will not quote here because I'm not sure about the copyright status. However, wildcards generally do not work as expected in this case - your best bet is to read without the parameter and filter the table afterwards.
I had similar problem but due to poor(eg. * wildcard can be used only at the and of the file mask string :/ ) implementation of standard FILE_MASK-based filtering feature in EPS2_GET_DIRECTORY_LISTING I ended up with the solution where I read entire directory content and then process it with regular expressions to find matching files/directories.

clearcase config spec to select greater revision of two labels

I am trying to make a Clearcase config spec that will select a file based on the greater revision number when that file has 2 labels I want.
Example:
file1.c; rev 1 ---> PR438
file1.c; rev 2
file1.c; rev 3 ---> PR433
The "basic" config spec of:
element * PR438
element * PR433
would choose file1.c; rev1 since this label is first specified in the config spec.
What I want is to choose file1.c; rev 3 without having to analyze the label ordering of every file to properly order a config spec.
Basically, I want a rule that says choose PR438 and PR433 and if a file has both labels, use the file with the highest revision number.
Basically, I want a rule that says choose PR438 and PR433 and if a file has both labels, use the file with the highest revision number.
This isn't how a config spec uses selection rules.
If the naming convention of those labels is properly done, the highest (most recent) version will always by PR438.
That means selecting PR438 first, then, as a fallback, selecting PR433 is enough.
What you could have tried is to select first versions which have both labels.
Even if the config spec syntax doesn't specify AND or OR operators, that would be:
element * {lbtype(PR438)&&lbtype(PR433)}
This is a can of worms. In this case, if the NEWER label is attached to the OLDER version you can't use the age of the label type to solve the problem. You're wandering in to "create file-specific configspecs" territory.
So, you'd have to start with the output of something like this:
cleartool find -all -version "lbtype(PR438) || lbtype(PR433)" -print
From there, you would have to
parse it to locate all the duplicate element names (stripping out the version ID's)
Take the later version of the duplicate files
Put those versions starting on the SECOND line a configspec based on the labels (unless you're OK with not checking out those files, in which case, the "element * CHECKEDOUT" line isn't that important anyway.
Since you're already this far down the path, you could also just build the configspec based entirely on the find output. But that can get unwieldy and unreadable.

SSIS suitability

I'm tring to create an SSIS package to import some dataset files, however given that I seem to be hitting a brick
wall everytime I achieve a small part of the task I need to take a step back and perform a sanity check on what I'm
trying to achieve, and if you good people can advise whether SSIS is the way to go about this then I would
appreciate it.
These are my questions from this morning :-
debugging SSIS packages - debug.writeline
Changing an SSIS dts variables
What I'm trying to do is have a For..Each container enumerate over the files in a share on the SQL Server. For each
file it finds a script task runs to check various attributes of the filename, such as looking for a three letter
code, a date in CCYYMM, the name of the data contained therein, and optionally some comments. For example:-
ABC_201007_SalesData_[optional comment goes here].csv
I'm looking to parse the name using a regular expression and put the values of 'ABC', '201007', and
'SalesData' in variables.
I then want to move the file to an error folder if it doesn't meet certain criteria :-
Three character code
Six character date
Dataset name (e.g. SalesData, in this example)
CSV extension
I then want to lookup the Character code, the date (or part thereof), and the Dataset name against a lookup table
to mark off a 'checklist' of received files from each client.
Then, based on the entry in the checklist, I want to kick off another SSIS package.
So, for example I may have a table called 'Checklist' with these columns :-
Client code Dataset SSIS_Package
ABC SalesData NorthSalesData.dtsx
DEF SalesData SouthSalesData.dtsx
If anyone has a better way of achieving this I am interested in hearing about it.
Thanks in advance
That's an interesting scenario, and should be relatively easy to handle.
First, your choice of the Foreach Loop is a good one. You'll be using the Foreach File Enumerator. You can restrict the files you iterate over to be just CSVs so that you don't have to "filter" for those later.
The Foreach File Enumerator puts the filename (full path or just file name) into a variable - let's call that "FileName". There's (at least) two ways you can parse that - expressions or a Script Task. Depends which one you're more comfortable with. Either way, you'll need to create three variables to hold the "parts" of the filename - I'll call them "FileCode", "FileDate", and "FileDataset".
To do this with expressions, you need to set the EvaluateAsExpression property on FileCode, FileDate, and FileDataset to true. Then in the expressions, you need to use FINDSTRING and SUBSTRING to carve up FileName as you see fit. Expressions don't have Regex capability.
To do this in a Script Task, pass the FileName variable in as a ReadOnly variable, and the other three as ReadWrite. You can use the Regex capabilities of .Net, or just manually use IndexOf and Substring to get what you need.
Unfortunately, you have just missed the SQLLunch livemeeting on the ForEach loop: http://www.bidn.com/blogs/BradSchacht/ssis/812/sql-lunch-tomorrow
They are recording the session, however.

Resources