发布新帖

Encontrar

文章
· 四月 26, 2024 阅读大约需 2 分钟

Geo Vector Search #1

Geographic use of vector search

The basic idea is to use Vectors in the mathematical sense.
I used geographic coordinates. These are of course only 2-dimensional
but much easier to follow as vectors in text analysis with >200 dimensions.

The example loads a list of worldwide capitals with their coordinates
The coordinates are interpreted as vectors from geographic point 0°N/0 W
(some very wet spot in the Gulf of Guinea, >400 km from the African Coast)
Finding common directions from that spot is a quite theoretical case.
So adjustment to your preferred starting point is implemented.
Now finding similar directions for some target city makes sense.
It's a methematical use of VECTOR_COSINE() function other than text search.

And as this is just 2 dimensional COSINE is just what we (hopefully) learned at school.
So the results are far better to understand: 

  • 1  =  total match, same direction 0° deviation from original
  • 0  = no match at all,  direction points 90° away from original
  • -1 = total opposite direction pointing backward by 180° from original
  •  ~0.999  = quite close to original 

You just get information on the direction, not on the size.
So your vector from Paris to Budapest  points also to Minsk or someplace In Asia

The demo is controlled by a rathrer simple menu:

  Use Geographc Vectors
=========================
     1 - Initialize Tables
     2 - Import Data
     3 - Set Base Location
     4 - Generate Vectors
     5 - Select Target Location
     6 - Show Best Matches
Select Function or * to exit :

for multiple retries, you always restart at

  • #3 set your starting location
  • #4 adjust coordinates to your selected base
  • #5 set your target location  defining your base vector
  • #6 see what's in between or in front of your vector
    • adjust tolerance from -1...+1

GitHub

Video

DemoServer Mgmt Portal
DemoServer WebTerminal
 

3 Comments
讨论 (3)1
登录或注册以继续
问题
· 四月 26, 2024

How to read XML data in a routing rule

I am receiving an XML input to my router and in the routing rule I need to traverse through the xml data , apply a for loop and fetch data.

How can I do that ?

Input :

 

<?xml version="1.0" encoding="UTF-8"?>
<Input>
   <data>
      <Ids>
         <Id>
            <Type>A</Type>
            <Value>123</Value>
         </Id>
         <Id>
            <Type>B</Type>
            <Value>456</Value>
         </Id>
      </Ids>
   </data>
</Input>

 

I would like to read 123 from above xml in a rule ..

3 Comments
讨论 (3)1
登录或注册以继续
问题
· 四月 25, 2024

Switch schema

The setSchema () method is not implemented in CacheConnection, so how should I switch Schema?
 

9 Comments
讨论 (9)4
登录或注册以继续
问题
· 四月 25, 2024

How to debug with VSCode

This question originally appeared in the comments of the post: IDE platform for beginners
 

Hello All,

Visual studio code doesn't allow debugging of code or running of code as far I can see. Since I am new, could someone guide me on this. 

Thanks 

11 Comments
讨论 (11)3
登录或注册以继续
问题
· 四月 25, 2024

Possible to export a class without specific members?

Is there a way to exclude specific members from a class when exporting to an XML or UDL file? Bonus question: is there a way to import from that file without overwriting those members that were excluded?

The use case is to export an interoperability production class without the ProductionDefinition XDATA. We plan to source control the production items through the Ensemble Deployment Manager, but we still need to export any custom code in the class definition itself.

3 Comments
讨论 (3)1
登录或注册以继续