Solving WSO2 Virtual15 hackathon query using WSO2 CEP 4.0.0

In this post, it discusses a possible solution to the first query of WSO2 Virtual15 hackathon, which was held on 26th September 2015. This post was written as a follow up to “Querying complex event streams with WSO2 CEP 4.0.0” to provide more in-depth knowledge on querying complex event streams using a real world example.

The hackathon took the same format as the DEBS 2014 Grand Challenge, posing a real world data set and a set of problems. The data set it used was originated from 2125 smart plugs deployed across 40 houses, where events get emitted to the stream roughly every second for each sensor in each smart plug. At the hackathon, participants were expected to came up with a solution to two queries. Among them, the first query was to come up with a load prediction query to predict load based on current load measurements and those of recorded historical data. In this post, it discusses a possible query (or a solution) to predict load according to their specification. Continue reading Solving WSO2 Virtual15 hackathon query using WSO2 CEP 4.0.0

Querying complex event streams with WSO2 CEP 4.0.0

What are complex event streams?

Events such as flight arrivals, departures and passenger check-ins in a busy airport, credit card processing in a credit card company, usage statistics generated by smart equipment such as smart plugs, fitness trackers can generate a constant high volume, stream of events. Such streams, which contains a large number of event data are known as complex event streams.

What is complex event processing?

Simply put, processing multiple event streams to identifying meaningful patterns from complex event streams, analyze their impacts, and acts on them in real time is known as complex event processing. To perform that process, CEP incorporates  event visualization, event databases, event-driven middleware, and event processing languages (such as SiddhiQL, StreamSQL)

In the modern competitive business environment, complex event processing helps businesses to become a more agile and connected. Moreover, it also allows businesses to anticipate risks or flag opportunities in real time, thereby responding to urgent business situations with both speed and precision. Continue reading Querying complex event streams with WSO2 CEP 4.0.0

Set Maven compiler version from the command line

In this quick tutorial, it shows how to set the Maven compiler version from both pom.xml  and the command line (as a parameter to mvn). This comes in handy if you run in to situations like;

The reason for this errors is Maven compiler version. Earlier, Maven 2 shipped with compiler version 1.3 by default. Later on they changed it to compiler version 1.5 by default. In Maven 3, it allows the user to set the compiler version using the parent pom of the project ( pom.xml  in root of the project) by adding below plugin configuration.

However, when you are not in a position to edit the parent pom of the project (i.e. you might not be the owner of the project or you might not be in the team maintaining the project) and you still need to change it since you are using a different maven/compiler version by default, you can use -Dmaven.compiler.source  and  parameters with maven command line tool ( mvn) like shown below;

If you find this post useful, Please share or leave a comment below 🙂

Simple Chat Application Using Jaggery Framework

In this blog post, it’s going to guide you through the steps which involve in creating a simple chat application using WSO2‘s Jaggery Framework.

What is Jaggery?

Jaggery is a framework, which offers a completely Javascript way to write all parts of Web applications and services as a way to minimize impedance mismatches across different layers of the Web application and API development experience while closing the gap between Web apps from Web services by allowing one to create both applications and APIs at the same time.

Functionality of the Chat Application

In this tutorial, it will only focus on providing these basic requirements for the Chat application.

  • Create a chat room with a unique id.
  • Join existing chat-room using it’s unique id.
  • Have multiple chat rooms opened in multiple tabs.
  • Kick off users from the chat room.

Continue reading Simple Chat Application Using Jaggery Framework

How to create a Persistable Dictionary in Python

I came across a situation where I had to implement a Python class which can;

  • handle dynamic attributes
  • can be initialized with a dictionary
  • can be persisted on the local storage as a file
  • can be used as a dictionary as well as a object. ( allow both  foo['key']  and  foo.key  to access its attributes )

So I came up with this Class. It inherits from python’s built in Dictionary class ( dict ). Therefore it can be initialized with an existing dictionary.  And it also overrides  __getattr__   __setattr__  __delattr__ . Therefore it can handle dynamic attributes and act as a dictionary as well as a object. Finally It uses Python’s cPickle to serialize and persist it self in the local storage.

Please share your thoughts on this approach. 🙂