Clearprompt command: Element-list generation - version-control

In view of my previous question Script for recursive add-to-source control: How to ignore specific files and folders, an issue that arose in regard to the command clearprompt (whereby to generate a list of elements for source control) is that it has restrictions on the number of elements it can process. So my question is: Is there a way to allow for a larger number of elements?

clearprompt has some limitation, in term of size, number of character per lines, and as you see, number of elements.
Those aren't fixed, on Windows or Unix, as far as I know.
So it is best to split your list, and to display several clearprompt dialogs, with a header specifying the number of said dialog over the total of number of windows expected (1/6, 2/6, 3/6, ...)
The only other solution would be to rely on another library to dispolay that dialog, but the advantage of using ccperl is that it is installed with the ClearCase client, which means it is available on all client workstation.

I believe I encounter a similar issue where because of this limit, the clearprompt dialog was empty. I debugged the script and the error seems to be because of the system limit of the max command line which was passed to echo in the following statement
`echo $listelement > $list_add`
I just changed this line to the following
open(LIST_ADD,">".$list_add);
print LIST_ADD $listelement;
close(LIST_ADD);
or basically, instead of relying on the shell to copy the content, I am doing the same through perl and that resolved the issue.

Related

Merge 2 pdf files and preserve forms

I'd like to merge at least 2 PDF files into one while preserving all the form elements in the original PDFs. The form elements include text fields, radio buttons, check boxes, drop down menus and others. Please have a look at this sample PDF file with forms:
http://foersom.com/net/HowTo/data/OoPdfFormExample.pdf
Now try to merge it with any other arbitrary PDF file.
Can you do it?
EDIT: As for the implementation, I'd ideally prefer a command line solution on a linux plattform using open source tools such as 'ghostscript', or any other tool that you think is appropriate to solve this task.
Of course, everybody is welcome to supply any working solution to this problem, including a coded solution that involves writing a script which makes some API calls to a pdf-processing library. However, I'd suggest to take the path of least resistance first (CMD Solution).
Best Regards
EDIT #2: Well there are indeed several CMD tools that merge PDFs. However, these tools don't seem to, AFAIK, to preserve the forms in the original PDFs! These tools appear to simply just concatenate the printouts of all those PDFs into a single Printout, which is then presented as a single PDF.
Furthermore, If you printout a PDF file with forms into a file, you lose all the forms in it. This clearly not what I'm looking for.
I have found success using pdftk, which is an open-source software that runs on linux and can be called from your terminal.
To concatenate multiple pdfs into one (and preserve form-fillable elements), you can use the following command:
pdftk input1.pdf input2.pdf cat output output-file.pdf

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

Generate executable larger than 4GB with TurboStudio

Thinapp has no problem generating virtual applications above 4GB.
Whenever I try something similar with TurboStudio it fails. Is there a way around it?
Okay, after several experiments I think I found an answer.
Spoon Studio (or Turbo Studio as it is now called) cannot create executables larger than 4GB. Checking the "Compress Payload" option reduces output size, but these captures perform usually a bit slower (due to the decompression required at runtime) and of course, there are always apps that will exceed the 4GB limit even with this option checked.
A workaround, however, is to divide the installation process in multiple captures (when possible) and use svm files.
For example, assume you are capturing a large application (Myapp) and some addons or plugins to it which together generate a capture larger than 4GB in size.
The solution would then be to first capture the application without any addons. Then install the plugins/addons and capture them separately. When you capture the plugins choose as Project Type "Component". At the end of this process you will have a captured application in executable "myapp.exe" and the plugins captured separately in "plugins.svm". It is possible to repeat this process several times, thus ending with "myapp.exe" and multiple SVMs, such as "plugins.svm", "plugins02.svm" etc.
In order to load the "plugins.svm" in "myapp.exe" without importing it as a component (which would defeat the purpose as it would still blow up the size beyond 4GB), go to Settings-->Process Configuration-->SVMs.
In the SVM search pattern you enter a text string to specify the SVMs to be loaded during startup of the application.
You can specify a single SVM by entering something like
#APPDIR#\plugins.svm
or multiple SMVs by entering something like
#APPDIR#\plugins.svm;#APPDIR#\plugins02.svm
or even use a wildcard by entering something like
#APPDIR#\*.svm
All of the above examples imply that the desired SVMs exist in the application's folder. Else, use a different path.
If multiple SVMs are specified in one search pattern through the use of the '*' wildcard, the SVMs are applied in reverse-alphabetical priority.
If SVMs are specified by name (not with a wildcard), then the SVMs specified first in the list will take precedence over SVMs specified later in the list.
You can also make specific svm files Required, by adding them to the "Required SVM name" list. In this case, the application won't start if it doesn't find the SVM file in the specified location and will instead give an error message that a required SVM was not located.
I hope this will be of help to people trying to capture large applications and hitting the 4GB limit with Turbo (Spoon) Studio.

how to find the number of lines which got changed from one label to another in clear case?

I would like to find the number of lines of code which got added/modified/deleted between two releases. I have a label which is applied at the end of release.
There is ClearCase Report Viewer which shows list of elements which got modified between two labels. But I am looking for number of files which got changed.
Any solution to this?
The easiest way (without involving any commercial third-party tool) is to use linux commands diff and diffstat and apply it to two dynamic views, each one with their own config spec selecting a label:
element * LABELx
element * /main/LATEST
That way, you can get a full report of the differences between the two diffstat reports.
See "Difference between two versions in ClearCase dynamic view" for a concrete example.
diff -u /view/VIEW1/SOMEVOB/some/dir /view/VIEW2/SOMEVOB/some/dir | diffstat
Note: this is valid for Windows as well, since any Git distribution includes diff.exe, and diffstat is available for Windows.

Screen scraping: Automating a vim script

In vim, I loaded a series of web pages (one at a time) into a vim buffer (using the vim netrw plugin) and then parsed the html (using the vim elinks plugin). All good. I then wrote a series of vim scripts using regexes with a final result of a few thousand lines where each line was formatted correctly (csv) for uploading into a database.
In order to do that I had to use vim's marking functionality so that I could loop over specific points of the document and reassemble it back together into one csv line. Now, I am considering automating this by using Perl's "Mechanize" library of classes (UserAgent, etc).
Questions:
Can vim's ability to "mark" sections of a document (in order to
perform substitutions on) be accomplished in Perl?
It was suggested to use "elinks" directly - which I take to mean to
load the page into a headless browser using ellinks and perform Perl
scripts on the content from there(?)
If that's correct, would there become a deployment problem with
elinks when I migrate the site from my localhost LAMP stack setup to
a hosting company like Bluehost?
Thanks
Edit 1:
TYRING TO MIGRATE KNOWLEDGE FROM VIM TO PERL:
If #flesk (below) is right, then how would I go about performing this routine (written in vim) that "marks" lines in a text file ("i" and "j") and then uses that as a range ('i,'j) to perform the last two substitutions?
:g/^\s*\h/d|let#"=substitute(#"[:-2],'\s\+and\s\+',',','')|ki|/\n\s*\h\|\%$/kj|
\ 'i,'js/^\s*\(\d\+\)\s\+-\s\+The/\=#".','.submatch(1).','/|'i,'js/\s\+//g
I am not seeing this capability in the perldoc perlre manual. Am I missing either a module or some basic Perl understanding of m/ or qr/ ??
I'm sure all you need is some kind of HTML parser. For example I'm using HTML::TreeBuilder::XPath.