API Publish/Subscribe Between Zato Services

One of the additions in the upcoming Zato 3.2 release is an extension to its publish/subscribe mechanism that lets services publish messages directly to other services. Let’s check how to use it and how it compares to other means of invoking one’s API services. 

How Does It Work?

In your Zato service, you can publish a message to any other services as below. Simply point self.pubsub.publish to the target service by the latter’s name and it will receive your message.

Transforming TCP Sockets to HTTP With Go

Sometimes, we need to work with legacy applications, and legacy applications can be hard to rewrite and change. Imagine, for example, we have an application that is using raw TCP sockets to communicate with another process. Raw TCP sockets are fast, but they have various problems. For example, all data is sent in plain text over the network and without authentication (if we don’t implement a protocol).

One solution is to use HTTPS connections instead. We can also authenticate those requests with an Authentication Bearer. For example, I’ve created a simple HTTP server with Python and Flask:

Python Memo 2: Dictionary vs. Set

Basis of Dictionaries and Sets

A dictionary is composed of a series of key-value mapping elements. In Python 3.7 +, a dictionary is determined to be ordered, however, before 3.6, a dictionary was disordered. Its length is mutable and elements can be deleted and changed arbitrarily. Compared with lists and tuples, the performance of dictionaries is better, especially for search, add, and delete operations. A dictionary can be completed within a constant time complexity. A set and a dictionary are basically the same, the only difference is that a set has no key-value pairing and is a series of disordered and unique element combinations. 

First, let's look at the creation of dictionaries and collections. There are usually the following ways;

A Primer on ML and Jupyter Notebook

Recently, I was working on an edge computing demo[1] that used ML (machine learning) to detect anomalies for a manufacturing use case. While I had a generic understanding of what ML is, I lacked the practitioner's understanding of how to use it. Similarly, I’d heard of Jupyter Notebook and was vaguely aware that it was connected with ML, but didn’t really know what it was and how to use one. This article is geared towards people who just want to understand ML and Jupyter Notebook. There are plenty of great resources available if you want to learn how to build ML models.

Caution: If you’re a data scientist then this article is not for you! We’ll be using very simple analysis techniques to serve as a teaching aid. 

Packaging Python Classes as a Wheel

Introduction

Recently, while working on a project where we were using Python, I realized how easy the Java package mechanism makes it, to organize and reuse common classes and functions.

Due to my Java hangover, I organized the common classes and functions in a directory hierarchy like com.<company>.<project>.util. The util package contained a few classes for UUID creation as well as classes for date and time manipulation. After placing the files in the above-mentioned directory, I started developing the application as a micro-service. I placed the micro-service code in the directory com.<company>.<project>.<service>. While trying to use the date and time classes in the micro-service, I used the syntax from com.<company>.<project>.util.mydatetime import MyDateTime.

Instant API Backends

Is backend creation blocking your Mobile App Dev? Or strategic B2B/internal integration?

 Imagine that you could...
Create a database API, instantly?
And declare logic, with spreadsheet-like rules?
Plus an instant Web App, to engage Business Users?

Execute Spark Applications on Databricks Using the REST API

Introduction

While many of us are habituated to executing Spark applications using the 'spark-submit' command, with the popularity of Databricks, this seemingly easy activity is getting relegated to the background. Databricks has made it very easy to provision Spark-enabled VMs on the two most popular cloud platforms, namely AWS and Azure. A couple of weeks ago, Databricks announced their availability on GCP as well. The beauty of the Databricks platform is that they have made it very easy to become a part of their platform. While Spark application development will continue to have its challenges - depending on the problem being addressed - the Databricks platform has taken out the pain of having to establish and manage your own Spark cluster.

Using Databricks

Once registered on the platform, the Databricks platform allows us to define a cluster of one or more VMs, with configurable RAM and executor specifications. We can also define a cluster that can launch a minimum number of VMs at startup and then scale to a maximum number of VMs as required. After defining the cluster, we have to define jobs and notebooks. Notebooks contain the actual code executed on the cluster. We need to assign notebooks to jobs as the Databricks cluster executes jobs (and not Notebooks). Databricks also allows us to setup the cluster such that it can download additional JARs and/or Python packages during cluster startup. We can also upload and install our own packages (I used a Python wheel).

Top 18 Python Pattern Programs You Must Know About [Snippets]

Preparing for technical interviews takes a lot of preparation, and it’s highly probable that you might have to create Python pattern programs there. That’s why we’ve sorted a list of multiple ideas for pattern printing in Python to start your preparations. 

We have multiple kinds of Python pattern programs in this list, so choose your expertise and experience. Make sure that you understand what part of code does what before you move onto the next pattern. Without a proper understanding of how the system works, you would face a lot of difficulty in explaining its working.

Choosing the Best Technology Stack for Web Application Development

The market demand for web applications is rapidly increasing. It is important to consider several factors when building these platforms. Perhaps most important for web application development is choosing the right technology stack.

The technologies users choose to use will affect both the quality and performance of the created software. Many tools and frameworks have been introduced in the market, and each provides different boosts to the productivity and performance of these developed applications.

How I Used Hotglue and Databox to Monitor All My KPIs in One Place

Being able to visualize your company's KPIs (key performance indicators) is one of the most essential components of understanding your business. But monitoring them across many different platforms can be an absolute hassle.

You have to check how many users are visiting your site via Google Analytics, how users are interacting with your site through Mixpanel, and how your recurring revenue is trending in Stripe. I hated having to deal with this for my business, so I decided to find a solution that would let me see all of this data in one place.

7 Best Python Libraries You Shouldn’t Miss in 2021

With more than 137,000 python libraries available today, choosing the one relevant for your project can be challenging.

Python libraries are critical if you’re looking to start a data science career. However, we will walk you through some of the best libraries that are worth learning this year.

Python Memo 1: Tuple vs. List

Tuple vs. List

Both Tuple and List can store mixed types of values.

Plain Text
 




x


 
1
a = [1,"Hello",bool(0)]
2
b = (1,"Hello",bool(0))
3
a, b
4
Out: ([1, 'Hello', False], (1, 'Hello', False))


Tuple is immutable and length is fixed. List is mutable and length is not fixed.

Why Python Is Best for Machine Learning

Today, most companies are using Python for AI and Machine Learning. With predictive analytics and pattern recognition becoming more popular than ever, Python development services are a priority for high-scale enterprises and startups. Python developers are in high-demand — mostly because of what can be achieved with the language. AI programming languages need to be powerful, scalable, and readable. Python code delivers on all three.

While there are other technology stacks available for AI-based projects, Python has turned out to be the best programming language for this purpose. It offers great libraries and frameworks for AI and Machine Learning (ML), as well as computational capabilities, statistical calculations, scientific computing, and much more.