My question is about resource files (.resx) in c#.(the "strings" part)
I'm using it to store my messages,and I want to know how can we use the "value" of a resource entry with parameters ?!
example :
Name : ShowCellValue
Value : value on cell : ? and row : ? is : ?
and I want to fill the "?" parameters with different values.
Thank you,
You can use string.Format on strings stored in your resource files.
Store ShowCellValue as
string showCellValue = "value on cell {0} and row {1} is {2}";
Then when you want to use it, just use the ResourceManager:
ResourceManager rm = new ResourceManager("resource root name",
Assembly.GetExecutingAssembly());
MessageBox.Show(string.Format(rm.GetString("showCellValue"),
cellName, rowName, cellValue);
Related
This is my json which read via a lookup activity
{
"key1" : { "id" = "100" },
"key2" : "XYZ",
"key3" : [1,2,3]
}
I need a activity that gives me all the keys alone from above json
Lookup.output.firstrow.key2 gives me the string XYZ
What expression i can use to get all the keys alone
I really looking for some expression like Lookup.output.firstrow.getKeys() which returns array of keys such as
["key1", "key2", "key3"]
How do i get only the Json keys as a output from ADF lookup activity
There is no such direct way to achieve this you have to do it by setting the variables and string manipulation.
Follow below procedure:
I took json file in look up and its output is as follow:
To get all keys from above Json first I took set variable activity and created a demo string variable with value.
#substring(string(activity('Lookup1').output.value),2,sub(length(string(activity('Lookup1').output.value)),4))
here we are converting lookup output to string and removing braces from start and end.
Then I took another set variable activity and created a demo2 array variable with value.
#split(substring(string(split(variables('demo'),':')),2,sub(length(string(split(variables('demo'),':'))),4)),',')
Here we are splitting the string with : and ,
Then I created an array with default range of even numbers of values 0,2,4,6 etc.
Then Passed it to ForEach activity
Then Inside For Each activity I took append variable activity and gave value as
#variables('demo2')[item()]
Output:
Note: if your values contain : or , the above expression will also split those values. and if we split the values with : then I will split the string with : only and rest thing it will consider as single value. In below image the highlighted value it is taking as single value.
I Want to customise automatically in Excel a Reference number according to the content of the line it is representing.
I have a table for test procedure that looks like this :
Ref
Action
Check
A 001
Name of the Action to perform
Empty if it is an Action
C 001
Empty if it is a Check
Name of the Check to perform
C 002
Empty if it is a Check
Name of the Check to perform
C 003
Empty if it is a Check
Name of the Check to perform
A 002
Name of the Action to perform
Empty if it is an Action
The logic would be the following:
To iterate separately references starting with A and the ones starting with C depending on the type of procedure, that is to say whether the name of the procedure is in Action Column or Check Column.
I would like to implement an algorithm like this, or a formula that does the same thing :
For line in TABLE1 :
if ( TABLE1[line,Action] =! NULL && TABLE1[line,Check] = 0) :
Ref_Action = Ref_Action + 1
Ref_Code = "A" + Ref_Action
elif ( TABLE1[line,Action] =! NULL && TABLE1[line,Check] = 0) :
Ref_Check = Ref_Check + 1
Ref_Code = "C"+ Ref_Check
else raise error : "a procedure shall be either an action or a Procedure"
TABLE1[line,Ref] = Ref_Code
(It is not a code language, just my way of representing the algorithm, I hope it is readable.)
Unfortunately, I have no experience in VBA and I couldn't find a way to write an appropriate formula. Or maybe there is another way ?
Thank you,
Gautier
I'm using Get-Diskfree function described here: https://binarynature.blogspot.com/2010/04/powershell-version-of-df-command.html
I want to sum all values from Used column, but as I try to call out a specific properties of Get-Diskfree output, I've got nothing, null.
Function is showing output like this:
FileSystem : NTFS
Type : Local Fixed Disk
Volume : C:
Available : somevalue
Computer : somevalue
Used : somevalue
Size : somevalue
FileSystem : NTFS
Type : Local Fixed Disk
Volume : D:
Available : somevalue
Computer : somevalue
Used : somevalue
Size : somevalue
I want to be able to call out Used property by parsing Get-Diskfree output into variable like this:
function {...}
$variable = Get-Diskfree
$variable.Used
Last line don't give me any output, in comparision to for example:
$variable = get-service
$variable.Name
long list of service names
Is function (or functions overall) designed in a way, that this method is impossible to use?
I plan to sum them by using more less the method I used in this script Powershell: System.Object[] in export-csv file
What I want to achieve is to sum Used column for first 8 disks (there are 20 of them on VM), export an output as csv and send an html email based on that csv file.
I have an alias pointing to two indices. I would like to use the alias name to search the documents rather than passing two index names and getting the results.
Example :
Like this : SearchResponse response = client.prepareSearch("alias")
Not like this : SearchResponse response = client.prepareSearch("index1", "index2")
Just replace the index name with alias name and work with it the same way.
We have users in our system and their nicknames can contain commas which is the special character that Elasticsearch uses for separate values. I have the following users stored:
{
"nickname" : "John"
}
{
"nickname" : "John,2"
}
If I execute the query nickname:John I get both documents what is not the expected.
I am not sure of what I need. I mean a tokenizer, an analyzer...
Thanks in advance
String fields are analyzed by default in ElasticSearch, that's why your 2nd user is indexed with 2 terms : "John" and "2" and match your nickname:John query.
If you want your nickname not to be analyzed (treated as a single string), you have to explicitly set the mapping of this field to "keyword".
More information about that : http://www.elasticsearch.org/guide/reference/index-modules/analysis/keyword-analyzer/ and about the mapping API : http://www.elasticsearch.org/guide/reference/api/admin-indices-put-mapping/