Using Beyond Compare's Replacement Function - replace

I have a line of text that needs to be updated each time a compare is run.
Original
COMP Update 2005-08-27 (Date will vary)
Replaced with
COMP Update 2015-08-07
Is there a way to use the replacement script to have the program update this automatically?

The Replacement feature won't work for this because it requires fixed text for the second side, but v4 supports marking arbitrary text as unimportant separate from the file format. Use the Importance tab instead of the Replacements one.
1) Click the + button below "Unimportant text"
2) Set Text to Find to
COMP Update \d{4}-\d{2}-\d{2}
3) Check the Regular expression checkbox
4) If you want it to affect all future comparisons, change the Use for this view only combobox at the bottom of the Session Settings dialog to Also Update Session Defaults
If you want it to only affect one specific file type, and it's not embedded in another grammar item (e.g., within a string), you can alternatively use the steps in this answer.

Related

Sheets, conditional formatting

I am looking to create a conditional formatting function that will highlight "C2:E2" if "E2" > 5000 & "B2" does not contain the word "treasury".
any help would be appreciated!
try on range C2:E:
=($E2>5000)*(NOT(REGEXMATCH(LOWER($B2), "treasury")))
Navigate in top menu to Format -> Conditional formatting
There you can specify range as E2:E29
Use conditional formatting with just one AND formula that refers dynamically to the values of the same row, but different column
AND comparision of the current value
=AND(indirect(address(row();column()-3))<>"Treasury";indirect(address(row();column()))>5000)
This can maybe be simplified, but definitely works with more conditions at once.
Some explanation:
To avoid typing new formulas for each row, we use INDIRECT joined with ADDRESS
column()-3 refers to current column (the one you call formula in) . Have in mind that means for each columns (C->E) you need a different formula that refers to another column for checking if it contains "treasury". In your case you'll need different formulas for column C,D and E. column()-3 works for E, because Treasury is in B column (3 columns earlier from E)
P.S: translating from my native language, so not sure if English UI is the same, but should be intuitive from here.
You'll want a custom Conditional Formatting Rule.
Click in cell C2, then from the menu choose:
Format > Conditional formatting
In the dialog box, set your range:
C2:E29 (or change 29 to whichever row is the last one you want to include in the formatting rule)
Under Format rules > Format cells if..., choose the bottom option from the dropdown menu: "Custom formula is."
In the field below, enter this formula:
=AND(NOT(ISNUMBER(SEARCH("treasury",$B2))),$E2>=5000)
Set your formatting style and click Done.

How to check if field on desktop application is empty or filled, and if it's filled mark as exception, and if it's empty proceed?

I am new to UI path and am trying to build a workflow/sequence to check if a field in my desktop application is filled or not.
If the field is empty then I want to proceed with the process, and if it is filled I want it to be marked as an exception.
I currently have it so the flow goes as follows:
1. Identified element
2. used Text Exists activity for that field, and I inputed "" as the Text
What are the next steps?
It would be better if you used Get Text command, and using if condition, check if the text is null or empty and take action.
First you want to use Get text on the Text box to extract its contents and store this in a variable in UiPath (Note: if you create the variable from the side properties panel it will give it the type GenericValue, you'll want to change this to String)
Next depends an what you mean by filled:
If you want to accept spaces as been filled then you can use String.IsNullOrEmpty(YOUR_VARIABLE)
If you want the filed to be filled with characters that aren't spaces you can use
String.IsNullOrWhiteSpace(YOUR_VARIABLE)
for your exception it will depend on weather you want to throw it as an
Application exception (new System.Exception("EXCEPTION MESSAGE"))
or
Businessexception (new UiPath.Core.BusinessRuleException("EXCEPTION MESSAGE"))
So your workflow will want to look something like this

Setting selection by text in CComboBox (MFC)

I have a CComboBox of type DropList (i.e. it's not editable). What's the easiest way to set the current selection by string?
I know I can use SetCurSel() to set it by index, but I want the function to search through the list-items by string and set it.
You can call FindStringExact() to obtain the index of the string you want to select, then pass that index to SetCurSel():
yourComboBox.SetCurSel(yourComboBox.FindStringExact(0, yourString));
Note that is the string is not found in the combobox, -1 will be passed to SetCurSel(), which will result in any previous selection being cleared. You may want to perform an explicit test if that behavior does not suit you.
Note that Max's answer should be preferred for new developments. However, SelectString() is only supported from Windows Server 2003 onwards, so you may not be able to leverage it, depending on the platforms you want to support.
What about CComboBox::SelectString ?
"Searches for a string in the list box of a combo box, and if the string is found, selects the string in the list box and copies it to the edit control."
https://msdn.microsoft.com/en-us/library/30ft9e54(v=vs.110).aspx

Infragistics UltraGrid - How to use displayed values in group by headers when using an IEditorDataFilter?

I have a situation where I'm using the IEditorDataFilter interface within a custom UltraGrid editor control to automatically map values from a bound data source when they're displayed in the grid cells. In this case it's converting guid-based key values into user-friendly values, and it works well by displaying what I need in the cell, but retaining the GUID values as the 'value' behind the scenes.
My issue is what happens when I enable the built-in group by functionality and the user groups by a column using my editor. In that case the group by headers default to using the cell's value, which is the guid in my case, so I end up with headers like this:
Column A: 7F720CE8-123A-4A5D-95A7-6DC6EFFE5009 (10 items)
What I really want is the cell's display value to be used instead so it's something like this:
Column A: Item 1 (10 items)
What I've tried so far
Infragistics provides a couple mechanisms for modifying what's shown in group by rows:
GroupByRowDescriptionMask property of the grid (http://bit.ly/1g72t1b)
Manually set the row description via the InitializeGroupByRow event (http://bit.ly/1ix1CbK)
Option 1 doesn't appear to give me what I need because the cell's display value is not exposed in the set of tokens they provide. Option 2 looks promising but it's not clear to me how to get at the cell's display value. The event argument only appears to contain the cell's backing value, which in my case is the GUID.
Is there a proper approach for using the group by functionality when you're also using an IEditorDataFilter implementation to convert values?
This may be frowned upon, but I asked my question on the Infragistic forums as well, and a complete answer is available there (along with an example solution demonstrating the problem):
http://www.infragistics.com/community/forums/p/88541/439210.aspx
In short, I was applying my custom editors at the cell level, which made them unavailable when the rows were grouped together. A better approach would be to apply the editor at the column level, which would make the editor available at the time of grouping, and would provide the expected behavior.

How to determine if a given word or phrase from a list is within an anchor tag?

We have a ColdFusion based site that involves a large number of 'document authors' that have little or no knowledge of HTML. The 'documents' they create are comprised of HTML stored in a table in the database. They use a CKEDITOR interface. The content that they create is output into specific area of the page. The document frequently has tons of technical terms that readers may not be familiar with that we would like to have tooltips automatically show up for.
I and the other programmer want to have some code insert 'tooltip' code into the page based on a list of words in a table on our SQL server. The 'dictionary' table in our database has a unique ID, the word/phrase we will look for and a corresponding definition that would be displayed in the tooltip.
For instance, one of the word/phrases we will be looking for is 'Scrum Master'. If it occurs in the document area, we need to insert code around the words to create a tooltip. To do that, we need to see if certain conditions exist. Are the words within an anchor tag? If yes, is there already a title value for the tag (title is used to contain the info to be displayed in a tooltip)? If a title tag exists, don't do anything. If the words are not in an anchor tag, then we would put anchor tags around the words along with the title that will contain the definition.
The tooltip code we use is via jQuery (http://jqueryui.com/tooltip/). It is quick and simple to use. We just need to figure out how to use it dynamically based on our dictionary table.
Do you have any suggestions of how to go about this?
I was hoping that jSoup might have a function that I could use, but that doesn't seem to be the right technology for what I want to do, but I could be wrong and I am happy to be corrected!
We have a large number of these documents and so manually inserting and maintaining the tooltip code is just not an option.
Update you content with something like:
strOut = ReplaceList(strIn, ValueList(qryTT.find), ValueList(qryTT.replace));
Since words are delimited by spaces, the qryTT.find needs to have spaces. The replace column is going to need to include some of the original content. You are going to have to be careful with words followed by a comma or a period too.
I would cache the results because I would expect it to be memory intensive.