Hello everyone, In this post, you will learn How to Create a Simple Window in Python. The example program has been tested and shared in the same post. Example Program import tkinter as tk # creating an instance for Tk root = tk.Tk() # setting a title root.title("My Title") # starting a window root.mainloop() Output
Hello everyone, In this post, you will learn, How to Pass Multiple Arguments into Function in Python. The example has been tested and shared in the post. Example Programm # defining a function def add(*numbers): sum = 0 for number in numbers: sum += number return sum # calling the function print("Result : %s" % […]
Hello everyone, In this post you will learn How to Swap Two Numbers in Python. The sample program has been tested and shared in this post. # defining a function def swap(a, b): print("Before: a = %s, b = %s" % (a, b)) a = a + b b = a - b a = […]
Hello everyone, In this tutorial, you will learn how to use Stanford Core NLP library in Java programming language. Also, you will learn how to perform core Natural Language Processing (NLP). In this tutorial, the following topics would be covered. Stanford Core NLP – Maven Dependency Setup Pipeline & Load Properties Tokenizing Sentence Analysis Parts […]
In this post, we will show you simple program about, How to reverse an array in Java. The example program has been tested and shared in the same post. Example Program package com.javatraineronline; import java.util.Arrays; /** * * @author Dinesh Krishnan * */ public class Example { /** * reverse the array * * @param […]
In this post, we will show you a simple program about, How to get trailing zero count in Java. The example program has been tested and shared in the post. Example Program package com.javatraineronline; /** * * @author Dinesh Krishnan * */ public class Example { public static int getTrailingZeroCount(int number) { int count = […]
Hello everyone, In this post, you will learn how to perform polling REST service in apache camel framework. This example code tested and shared in the post. Maven Dependencies <dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-core</artifactId> <version>${camel-version}</version> </dependency> <dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-http</artifactId> <version>${camel-http-version}</version> </dependency> Service Class package com.dineshkrish; /** * * @author Dinesh Krishnan * */ public class MyRestService { […]
Hello everyone, In this post, you will learn How to Poll GitHub Commit using Apache Camel. The example has been tested and shared in the post. Maven Dependencies <dependency> <groupid>org.apache.camel</groupid> <artifactid>camel-core</artifactid> <version>${camel-version}</version> </dependency> <dependency> <groupid>org.apache.camel</groupid> <artifactid>camel-github</artifactid> <version>${camel-github-version}</version> </dependency> <dependency> <groupid>org.eclipse.mylyn.github</groupid> <artifactid>org.eclipse.egit.github.core</artifactid> <version>${github-core-version}</version> </dependency> Service Class package com.dineshkrish; import org.eclipse.egit.github.core.CommitUser; import org.eclipse.egit.github.core.RepositoryCommit; /** * * @author […]
Hello everyone, In this post, you will learn How to Poll RSS Feed using Apache Camel. The example has been tested and shared in the post. Maven Dependencies <dependency> <groupid>org.apache.camel</groupid> <artifactid>camel-core</artifactid> <version>${camel-version}</version> </dependency> <dependency> <groupid>org.apache.camel</groupid> <artifactid>camel-rss</artifactid> <version>${camel-rss-version}</version> </dependency> Example Program package com.dineshkrish.example7; import org.apache.camel.CamelContext; import org.apache.camel.ConsumerTemplate; import org.apache.camel.builder.RouteBuilder; import org.apache.camel.impl.DefaultCamelContext; /** * * @author Dinesh […]
Hello everyone, In this post, you will learn How to Convert File to String using Apache Camel. The example has been tested and shared in the post. Maven Dependencies <dependency> <groupid>org.apache.camel</groupid> <artifactid>camel-core</artifactid> <version>${camel-version}</version> </dependency> Example Program package com.dineshkrish.example6; import java.io.File; import java.nio.file.Files; import org.apache.camel.CamelContext; import org.apache.camel.ConsumerTemplate; import org.apache.camel.Exchange; import org.apache.camel.Processor; import org.apache.camel.builder.RouteBuilder; import org.apache.camel.impl.DefaultCamelContext; /** […]
Hello everyone, In this post, you will learn How to Convert JSON to XML using Apache Camel. The example has been tested and shared in the post. Maven Dependencies <dependency> <groupid>org.apache.camel</groupid> <artifactid>camel-core</artifactid> <version>${camel-version}</version> </dependency> <dependency> <groupid>org.json</groupid> <artifactid>json</artifactid> <version>${json.version}</version> </dependency> Example Program package com.dineshkrish; import org.apache.camel.CamelContext; import org.apache.camel.ConsumerTemplate; import org.apache.camel.Exchange; import org.apache.camel.Processor; import org.apache.camel.ProducerTemplate; import org.apache.camel.builder.RouteBuilder; […]
Hello everyone, In this post, you will learn How to Convert XML to JSON using Apache Camel. The example has been tested and shared in the post. Maven Dependencies <dependency> <groupid>org.apache.camel</groupid> <artifactid>camel-core</artifactid> <version>${camel-version}</version> </dependency> <dependency> <groupid>org.json</groupid> <artifactid>json</artifactid> <version>${json.version}</version> </dependency> Example Program package com.dineshkrish.example6; import org.apache.camel.CamelContext; import org.apache.camel.ConsumerTemplate; import org.apache.camel.Exchange; import org.apache.camel.Processor; import org.apache.camel.ProducerTemplate; import org.apache.camel.builder.RouteBuilder; […]
Hello everyone, In this post, you will learn How to use Processor Class in Apache Camel. The example has been tested and shared in the post. Maven Dependencies <dependency> <groupid>org.apache.camel</groupid> <artifactid>camel-core</artifactid> <version>${camel-version}</version> </dependency> Camel Processor package com.dineshkrish.example51; import org.apache.camel.Exchange; import org.apache.camel.Processor; /** * * @author Dinesh Krishnan * */ public class MyProcessor implements Processor { […]
Hello everyone, In this post, you will learn How to Send an Object to ActiveMQ using Apache Camel. The example has been tested and shared in the post. Maven Dependencies <dependency> <groupid>org.apache.camel</groupid> <artifactid>camel-core</artifactid> <version>${camel-version}</version> </dependency> <dependency> <groupid>org.apache.activemq</groupid> <artifactid>activemq-camel</artifactid> <version>${activemq-camel-version}</version> </dependency> Example Program package com.dineshkrish; import java.util.Date; import javax.jms.ConnectionFactory; import org.apache.activemq.ActiveMQConnectionFactory; import org.apache.camel.CamelContext; import org.apache.camel.ProducerTemplate; import […]
Hello everyone, In this post, you will learn How to Send an File to ActiveMQ using Apache Camel. The example has been tested and shared in the post. Maven Dependencies <dependency> <groupid>org.apache.camel</groupid> <artifactid>camel-core</artifactid> <version>${camel-version}</version> </dependency> <dependency> <groupid>org.apache.activemq</groupid> <artifactid>activemq-camel</artifactid> <version>${activemq-camel-version}</version> </dependency> Main Program package com.dineshkrish.example4; import javax.jms.ConnectionFactory; import org.apache.activemq.ActiveMQConnectionFactory; import org.apache.camel.CamelContext; import org.apache.camel.builder.RouteBuilder; import org.apache.camel.component.jms.JmsComponent; import […]
Hello everyone, In this post, you will learn How to Call a Method using the Bean Component in Apache Camel. The example has been tested and shared in the post. Maven Dependencies <dependency> <groupid>org.apache.camel</groupid> <artifactid>camel-core</artifactid> <version>${camel-version}</version> </dependency> Service Class package com.dineshkrish; /** * * @author Dinesh Krishnan * */ public class MyService { public void […]
Hello everyone, In this post, you will learn How to Call a Method using the Class Component in Apache Camel. The example has been tested and shared in the post. Maven Dependencies <dependency> <groupid>org.apache.camel</groupid> <artifactid>camel-core</artifactid> <version>${camel-version}</version> </dependency> Service Class package com.dineshkrish; /** * * @author Dinesh Krishnan * */ public class MyService { public void […]