Thanks David, It is a custom transform. However, I can't rule out that we may have some ISC code in place that tidy's things looped into ours. Do you know what I might check for?
- Log in to post comments
Thanks David, It is a custom transform. However, I can't rule out that we may have some ISC code in place that tidy's things looped into ours. Do you know what I might check for?
ChatGPT recommends:
ClassMethod SortVersion(input As%String[]) As%String[] {
Set sorted = []
for i=1:1:input.%Size() {
Set version = input.Get(i)
Set major = $NUMBER($PIECE(version, ".", 1))
Set minor = $NUMBER($PIECE(version, ".", 2))
Set patch = $NUMBER($PIECE(version, ".", 3))
// Create a new dynamic object to store the version number and its corresponding string representationSet versionObj = {}
Set versionObj.version = version
Set versionObj.major = major
Set versionObj.minor = minor
Set versionObj.patch = patch
// Add the version object to the 'sorted' arrayDo sorted.Insert(versionObj)
}
// Sort the 'sorted' array based on major, minor, and patch valuesDo sorted.Sort("major", "minor", "patch")
// Create a new array to store the sorted version numbersSet sortedVersions = []
// Iterate over the sorted objects and extract the version numberFor i=1:1:sorted.%Size() {
Set versionObj = sorted.GetAt(i)
Do sortedVersions.Insert(versionObj.version)
}
Quit sortedVersions
}
Seems to make sense. Usage is:
Set input = ["1.4.5", "0.5.3", "6.3.2", "1.2.4"]
Set sortedVersions = ##class(YourClassName).SortVersion(input)
Write !, sortedVersions.%ToString()Thanks John. I don't think VSCode is reaching the server. The connection is timing out:
http://mongo.il.intersystems.com:57772/api/atelier/ failed, reason: connect ETIMEDOUT 10.10.74.225:57772
For me to connect to these servers, I must use a VPN. I verified that the VPN was on when I tried to connect. I also verified that the IP address, 10.10.74.225 was reachable.
I DID notice that the port number was not as expected. It showed 57772 but we use 1972. So I changed it to 1972. I think I got further but the new error is:
http://mongo.il.intersystems.com:1972/api/atelier/ failed, reason: socket hang up
I did an experimental connect with that IP:port to see if I could discover anything:
$ telnet 10.10.74.225 1972
Trying 10.10.74.225...
Connected to 10.10.74.225.
Escape character is '^]'.
Connection closed by foreign host.
I also doublechecked in Studio that the port number 1972 is correct for that server.
Feels like I am very close. Any other suggestions?
@Robert: Thanks. I'll study this to get a better idea where I went wrong!
@Julius: That works. Showing my revised code:
Method AddContentTypeCode5(pContentStream As %Stream.GlobalCharacter, Output pNewContentStream As %Stream.GlobalCharacter) As %Status{Set tStatus = $$$OKtry {Set pNewContentStream=##class(%GlobalCharacterStream).%New()Set tLocatorString = "<ns2:Description>"Set tInsertPoint = pContentStream.FindAt(1,tLocatorString,.tStr,0)-1Do pContentStream.Rewind()Do pNewContentStream.Write(pContentStream.Read(tInsertPoint)), pNewContentStream.Write(..ContentTypeCodeInsertable), pNewContentStream.Write(pContentStream.Read(pContentStream.Size-tInsertPoint))$$$HSTRACE("AddContentTypeCode5","pNewContentStream,tInsertPoint,pContentStream",pNewContentStream,tInsertPoint,pContentStream)} catch ex {Set tStatus = ex.AsStatus()}Quit tStatus}Thanks! I will check that out.
This documentation shows how to connect and interact with IRIS using Python. Following this worked for me:
https://docs.intersystems.com/irislatest/csp/docbook/DocBook.UI.Page.cl…
Using port 1972 per the example worked in my case but your installation may vary. It requires Python 3 (3.4+). When you download the Intersystems wheel file, make sure that the filename remains unchanged otherwise pip won't be able to install it.
Marlin
Thanks Robert! I got it working. I just needed to set my port correctly. It was incorrectly set to 58772 which is what we use for making http connections. I changed it to 1972 and it worked.