When creating a relation in SAP and in case there are several possible types of relations, SAP shows a dialog to choose the relation like this:
However, when I query the node text using SapTree.getText() of Silk4J, I get the following results:
U
B ZE3 9V
B ZE3 U
B 003 O
Where does this text come from, what does it mean and how do I get the text that is displayed to the user?
I have tried
there are no column names returned by SapTree.getColumnNames()
there are no column titles returned by SapTree.getColumnTitles()
SapTre.getColumnHeaders() returns two items, HierarchyHeader and ListItems. Calling getItemText() with any of those header names does not return the text displayed to the user.
You can right click the relation and choose "Show keys":
This results in
which explains the text. It consists of three parts:
X is the relationship type (A: bottom up, B: top down)
YYY is the relationship (relations starting with Z are custom relations)
ZZ is the type of the object to be linked (objects starting with 9 are custom objects)
To get the text displayed to the user:
you can call SapTree.getItemText(key, "1") to get the relation text (e.g. B ZE3 9V)
you can call SapTree.getItemText(key, "2") to get the human readable relation description (e.g. beinhaltet)
you can call SapTree.getItemText(key, "3") to get the human readable target object text (e.g. Externe Person)
Related
I am using the code below to perform an esearch, but the IDs that I get from IdList are not matching up with the IDs on the online search.
from Bio import Entrez
Entrez.email = "myEmail#gmail.com"
handle = Entrez.esearch(db = "nucleotide", term = "chordata[orgn] AND
chromosome", retmax = 10, idtype = "acc")
genome_ids = Entrez.read(handle)['IdList']
print(genome_ids)
When I print the id's out they don't match up with the ones online.Does anyone know why? These are the id's I get when I print out genome_ids:
['NG_017163.2', 'NM_017553.3', 'NG_059281.1', 'NM_005101.4',
'MH423692.1', 'MH423691.1', 'MH423690.1', 'MH423689.1', 'MH423688.1',
'MH423687.1']
Here is the link to the online search:
https://www.ncbi.nlm.nih.gov/nuccore/?term=chordata%5Borgn%5D+AND+chromosome
Also does anyone know how I can download the chromosomal and mitochondrial genome of all the organisms from the chordata phylum.I want to do it using BioPython through the E-utilities.
How I can download the chromosomal and mitochondrial genome of all the organisms from the chordata phylum
Go to https://www.ncbi.nlm.nih.gov/Taxonomy/Browser/wwwtax.cgi
Enter chordata in the 'search for' box, select complete name in the dropdown list
Enter a high number for the levels (e.g. 30), and select the filter has genome sequence in the dropdown list
Check the nucleotide checkbox
You will now view a full taxonomic tree of the chordata with its subtaxa. The number behind each taxid is the number of sequences for that taxid. So, NCBI contains 84,366,537 different sequences of chordata.
You probably don't have enough space to download them all, so make a selection, click on the number behind the taxid, and choose Send to > File > FASTA.
I've created some xpath expressions to locate the first item by it's "index" after "h4". However, I did something wrong that is why it doesn't work at all. I expect someone to take a look into it and give me a workaround.
I tried with:
//div[#id="schoolDetail"][1]/text() --For the Name
//div[#id="schoolDetail"]//br[0]/text() --For the PO Box
Elements within which items I would like the expression to locate is pasted below:
<div id="schoolDetail" style=""><h4>School Detail: Click here to go back to list</h4> GOLD DUST FLYING SERVICE, INC.<br>PO Box 75<br><br>TALLADEGA AL 36260<br> <br>Airport: TALLADEGA MUNICIPAL (ASN)<br>Manager: JEAN WAGNON<br>Phone: 2563620895<br>Email: golddustflyingse#bellsouth.net<br>Web: <br><br>View in AOPA Airports (Opens in new tab) <br><br></div>
By the way, the resulting values should be:
GOLD DUST FLYING SERVICE, INC.
PO Box 75
Try to locate required text nodes by appropriate index:
//div[#id="schoolDetail"]/text()[1] // For "GOLD DUST FLYING SERVICE, INC."
//div[#id="schoolDetail"]/text()[2] // For "PO Box 75"
Locator to get both elements:
//*[#id='schoolDetail']/text()[position()<3]
Explanation:
[x] - xPath could sort values using predicate in square brackets.
x - could be integer, in this case it will automatically be compared with element's position in this way [position()=x]:
//div[2] - searches for 2nd div, similar to div[position()=2]
In case predicate [x] is not an integer - it will be automatically converted to boolean value and will return only elements, where result of x is true, for example:
div[position() <= 4] - search for first four div elements, as 4 <= 4, but on the 5th and above element position will be more than 4
Important: please check following locators on this page:
https://www.w3schools.com/tags/ref_httpmessages.asp
//table//tr[1] - will return every 1st row in each table ! (12 found
elements, same as tables on the page)
(//table//tr)[1] - will return 1st row in the first found table (1 found element)
I have 2 collections of the same type elements. Let's call those elements lettersOfAlphabet. Each letter has ID as int and Name as string.
So
ID Letter
0 A
1 B
2 C
3 D
and so on.
First collection contains the alphabet, second contains selected letters.
In first step I create new selectedLettersCollection and this is easy. I simply add element from alphabet collection to selectedLettersColletion and immediately renove it from source collection (alphabet). So let's say I created collection of first 5 letters of the alphabet and saved it to SQL table. Now the alphabet collection starts at F and contains letters through Z, selectedlettersCollection contains letters A,B,C,D and E.
Now let's say I want to remove letter C form selectedLettersCollection and move it back to alphabet and get letter G from alphabet and move it to selectedLettersColletion.
What is the most efficient way to perform this opetation in LINQ, generic collections and/or T-SQL?
I would certainly create a new temporary collection of selected items and load selected elements into it. I would then perform my add remove operations. But so far the only thing that comes to my mind to reconcile those collections would be to iterate through selectedLettersColletion and new temporary collection and move elements accordingly but I was wondering if there is a method that would not require iteration akin TSQL's joins looking for NULLs.
I'll use A and B for the table names.
To move the row with Id = 1 from table A to table B use the following:
DELETE A
OUTPUT deleted.Id, deleted.Letter INTO B
WHERE Id = 1;
I need help with the following H.W. problem. I have done everything except the instructions I numbered. Please help!
A furniture manufacturer makes two types of furniture—chairs and sofas.
The cost per chair is $350, the cost per sofa is $925, and the sales tax rate is 5%.
Write a Visual Basic program to create an invoice form for an order.
After the data on the left side of the form are entered, the user can display an invoice in a list box by pressing the Process Order button.
The user can click on the Clear Order Form button to clear all text boxes and the list box, and can click on the Quit button to exit the program.
The invoice number consists of the capitalized first two letters of the customer’s last name, followed by the last four digits of the zip code.
The customer name is input with the last name first, followed by a comma, a space, and the first name. However, the name is displayed in the invoice in the proper order.
The generation of the invoice number and the reordering of the first and last names should be carried out by Function procedures.
Seeing as this is homework and you haven't provided any code to show what effort you have made on your own, I'm not going to provide any specific answers, but hopefully I will try to point you in the right direction.
Your first 2 numbered items look to be variations on the same theme... string manipulation. Assuming you have the customer's address information from the order form, you just need to write 2 separate function to take the parts of the name and address, take the data you need and return the value (which covers your 3rd item).
To get parts of the name and address to generate the invoice number, you need to think about using the Left() and Right() functions.
Something like:
Dim first as String, last as String, word as String
word = "Foo"
first = Left(word, 1)
last = Right(word, 1)
Debug.Print(first) 'prints "F"
Debug.Print(last) 'prints "o"
Once you get the parts you need, then you just need to worry about joining the parts together in the order you want. The concatenation operator for strings is &. So using the above example, it would go something like:
Dim concat as String
concat = first & last
Debug.Print(concat) 'prints "Fo"
Your final item, using a Function procedure to generate the desired values, is very easily google-able (is that even a word). The syntax is very simple, so here's a quick example of a common function that is not built into VB6:
Private Function IsOdd(value as Integer) As Boolean
If (value Mod 2) = 0 Then 'determines of value is an odd or even by checking
' if the value divided by 2 has a remainder or not
' (aka Mod operator)
IsOdd = False ' if remainder is 0, set IsOdd to False
Else
IsOdd = True ' otherwise set IsOdd to True
End If
End Function
Hopefully this gets you going in the right direction.
I have two arrays and I want to see the total number of matches, between the arrays individual items that their are.
For example arrays with:
1 -- House, Dog, Cat, Car
2 -- Cat, Book, Box, Car
Would return 2.
Any ideas? Thanks!
EDIT/
Basically I have two forms (for two different types of users) that uses nested attributes to store the number of skills they have. I can print out the skills via
current_user.skills.each do |skill| skill.name
other_user.skills.each do |skill| skill.name
When I print out the array, I get: #<Skill:0x1037e4948>#<Skill:0x1037e2800>#<Skill:0x1037e21e8>#<Skill:0x1037e1090>#<Skill:0x1037e0848>
So, yes, I want to compare the two users skills and return the number that match. Thanks for your help.
This works:
a = %w{house dog cat car}
b = %w{cat book box car}
(a & b).size
Documentation: http://www.ruby-doc.org/core/classes/Array.html#M000274
To convert classes to an array using the name, try something like:
class X
def name
"name"
end
end
a = [X.new]
b = [X.new]
(a.map{|x| x.name} & b.map{|x| x.name}).size
In your example, a is current_user.skills and b is other_users.skills. x is simply a reference to the current index of the array as the map action loops through the array. The action is documented in the link I provided.