Encontrar

Article
· Nov 10, 2024 3m de lecture

第十七章 TCP 客户端 服务器通信 - 使用OPEN命令

第十七章 TCP 客户端 服务器通信 - 使用OPEN命令

使用OPEN命令

OPEN命令保留一个TCP绑定设备供使用。其语法为:

Discussion (0)1
Connectez-vous ou inscrivez-vous pour continuer
Article
· Nov 10, 2024 2m de lecture

Java External Language Gateway

If you like Java and have a thriving Java ecosystem at work into which you need to incorporate IRIS, it's not a problem. Java External Language Gateway will do it seamlessly, almost. This gateway serves as a bridge between Java and Object Script in IRIS. You can create objects of Java classes in IRIS and call their methods. You just need a jar file to do this.

Connection diagram: proxy object <-> Gateway object <-> TCP/IP <-> External server <-> target object

The first thing you need to do is set up the environment. To start using the Java Gateway, ensure you have the following:

  1. InterSystems IRIS: Installed and running.
  2. Java Development Kit (JDK): Installed and configured.

The second requirement may sound simple, since you're already using Java in your work, but it isn't. Thanks to this question, it turned out that you need to use JDK version 11 at the most. Which means that you need to change the version in your IDE which may case quite a bit of trouble.

Next step, we can check that everything works and try to instantiate the object of a Java system class. To do this, you have to start a connection, creat a proxy object, and call a method. Sounds like a lot of code, but in reality it's just one statement:

write $system.external.getJavaGateway().new("java.util.Date").toString()

This will print the current date and time on screen.

To go further, we can create our own Java class:


public class Dish {
	private String name;
	private String description;
	private String category;
	private Float price;
	private String currency;
	private Integer calories;
	
	public void setName(String name) {
		this.name = name;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public void setCategory(String category) {
		this.category = category;
	}

	public void setPrice(Float price) {
		this.price = price;
	}

	public void setCurrency(String currency) {
		this.currency = currency;
	}

	public void setCalories(Integer calories) {
		this.calories = calories;
	}
	
	public String describe() {
		return "The dish "+this.name+" costs "+this.price.toString()+
				this.currency+" and contains "+this.calories+" calories!";
	}
}

and call it's methods from Object Script:

 set javaGate = $SYSTEM.external.getJavaGateway()
 do javaGate.addToPath("D:\Temp\GatewayTest.jar")
 set dish = javaGate.new("Dish")
 do dish.setCalories(1000)
 do dish.setCategory("salad")
 do dish.setCurrency("GBP")
 do dish.setDescription("Very tasty greek salad")
 do dish.setName("Greek salad")
 do dish.setPrice(15.2)
 write dish.describe()

As a result we will get a string with the description of the created dish:

The dish Greek salad costs 15.2GBP and contains 1000 calories!

Quite neat, don't you think?

Anyway, learn more about using Gateways from the Documentation and good luck implementing this knowledge in your projects!

Discussion (0)1
Connectez-vous ou inscrivez-vous pour continuer
Article
· Nov 10, 2024 1m de lecture

Levereging InterSystems IRIS database to quickly find possible resistence genes in DNA

Speeding Up Antibiotic Resistance Detection with InterSystems IRIS

Antibiotic resistance is a critical health challenge, requiring rapid detection to inform effective treatments. We worked on developing a solution that leverages InterSystems IRIS vector database technology that would quickly identify resistance genes in DNA.

How It Works

Using vector embeddings, DNA sequences are transformed into numerical representations that capture essential genetic information. InterSystems IRIS then enables high-speed searching and matching of these vectors, identifying possible resistance genes.

The Benefits

This approach should in practice reduce diagnostic time, helping healthcare providers quickly detect resistant infections and choose appropriate treatments. As resistance genes evolve, the system can be updated, ensuring long-term effectiveness in combating antibiotic resistance.

Our work highlights how innovative database and machine learning tools can tackle real-world health challenges. 😁

4 Comments
Discussion (4)1
Connectez-vous ou inscrivez-vous pour continuer