Articles

Milvus is an open-source vector database for AI applications. It provides a variety of installation methods, including building from source code and installing Milvus with Docker Compose/Helm/APT/YUM/Ansible. Users can choose one of the installation methods depending on their operating systems and preferences. However, there are many data scientists and AI engineers in the Milvus community who work with Python and yearn for a much simpler installation method than the currently available ones.

Therefore, we released embedded Milvus, a user-friendly Python version, along with Milvus 2.1 to empower more Python developers in our community. This article introduces what embedded Milvus is and provides instructions on how to install and use it.

Source de l’article sur DZONE

We wanted to share our findings and experiences from creating our first GitHub Action. In this article, you’ll learn how to write a simple GitHub Action in Python.

Brief Overview of GitHub Actions

In 2019, GitHub released its own CI tool called GitHub Actions. According to GitHub, Actions make it easy for developers to automate tasks within the software development life cycle (SDLC). The native ecosystem integration enables projects to be automated from the moment developers commit code for deployment into production.

Source de l’article sur DZONE

Alert windows are widely used across websites where an alert message acts as a mode to ‘interrupt’ the current flow of the user journey. A simple example of a JavaScript alert would be someone filling in details on the sign-up page and submitting the details without entering some mandatory information. This user flow also needs to be verified when Selenium automation testing is performed on the web product. 

Handling pop-ups and alerts are one of the common test scenarios that should be tested using Selenium WebDriver. In this post of the Selenium Python tutorial series, we look at how to handle JavaScript alerts in Python. It is worth mentioning that the core fundamentals of JavaScript alerts and popups remain unchanged irrespective of the programming language used for Selenium.

Source de l’article sur DZONE

Securing applications is not the easiest thing to do. An application has many components: server-side logic, client-side logic, data storage, data transportation, API, and more. With all these components to secure, building a secure application can seem really daunting.

Thankfully, most real-life vulnerabilities share the same root causes. And by studying these common vulnerability types, why they happen, and how to spot them, you can learn to prevent them and secure your application.

Source de l’article sur DZONE

For demos, system tests, and other purposes, it is good to have a way to easily produce realistic data at scale utilizing a schema of our own choice.

Fortunately, there is a great library for Python called Faker that lets us build synthetic data for tests. With a simple loop and a Pulsar produce call, we can send messages to topics at scale.

Source de l’article sur DZONE

Zato is an integration platform and backend application server which means that, during most of their projects, developers using Zato are interested in a few specific matters.

The platform concentrates on answering these key, everyday questions that Python backend developers routinely ask:

Source de l’article sur DZONE

Ever since the Python programming language was born, its core philosophy has always been to maximize the readability and simplicity of code. In fact, the reach for readability and simplicity is so deep within Python’s root that, if you type import this in a Python console, it will recite a little poem:

    Beautiful is better than ugly. Explicit is better than implicit. Simple is better than complex. The complex is better than complicated. The flat is better than nested. Sparse is better than dense. Readability counts…

Simple is better than complex. Readability counts. No doubt, Python has indeed been quite successful at achieving these goals: it is by far the most friendly language to learn, and an average Python program is often 5 to 10 times shorter than equivalent C++ code. Unfortunately, there is a catch: Python’s simplicity comes at the cost of reduced performance. In fact, it is almost never surprising for a Python program to be 10 to 100 times slower than its C++ counterpart. It thus appears that there is a perpetual trade-off between speed and simplicity, and no programming language shall ever possess both.
But, don’t you worry, all hope is not lost.

Taichi: Best of Both Worlds

The Taichi Programming Language is an attempt to extend the Python programming language with constructs that enable general-purpose, high-performance computing. It is seamlessly embedded in Python, yet can summon every ounce of computing power in a machine — the multi-core CPU, and more importantly, the GPU.
We’ll show an example program written using taichi. The program uses the GPU to run a real-time physical simulation of a piece of cloth falling onto a sphere and simultaneously renders the result.
Writing a real-time GPU physics simulator is rarely an easy task, but the Taichi source code behind this program is surprisingly simple. The remainder of this article will walk you through the entire implementation, so you can get a taste of the functionalities that taichi provides, and just how powerful and friendly they are.
Before we begin, take a guess of how many lines of code this program consists of. You will find the answer at the end of the article.

Algorithmic Overview

Our program will model the piece of cloth as a mass-spring system. More specifically, we will represent the piece of cloth as an N by N grid of point-masses, where adjacent points are linked by springs. The following image, provided by Matthew Fisher, illustrates this structure:
The motion of this mass-spring system is affected by 4 factors:
  • Gravity
  • Internal forces of the springs
  • Damping
  • Collision with the red ball in the middle
For the simplicity of this blog, we ignore the self-collisions of the cloth. Our program begins at the time t = 0. Then, at each step of the simulation, it advances time by a small constant dt. The program estimates what happens to the system in this small period of time by evaluating the effect of each of the 4 factors above, and updates the position and velocity of each mass point at the end of the timestep. The updated positions of mass points are then used to update the image rendered on the screen.

Getting Started

Although Taichi is a programming language in its own right, it exists in the form of a Python package and can be installed by simply running pip install taichi.
To start using Taichi in a python program, import it under the alias ti:
import taichi as ti
The performance of a Taichi program is maximized if your machine has a CUDA-enabled Nvidia GPU. If this is the case, add the following line of code after the import: ti.init(arch=ti.cuda)

If you don’t have a CUDA GPU, Taichi can still interact with your GPU via other graphics APIs, such as ti.metal, ti.vulkan, and ti.opengl. However, Taichi’s support for these APIs is not as complete as its CUDA support, so, for now, use the CPU backend: ti.init(arch=ti.cpu)And don’t worry, Taichi is blazing fast even if it only runs on the CPU. Having initialized Taichi, we can start declaring the data structures used to describe the mass-spring cloth. We add the following lines of code:

Python

 

 N = 128 x = ti.Vector.field(3, float, (N, N)) v = ti.Vector.field(3, float, (N, N))

Source de l’article sur DZONE

This is the second in a series of blogs on data-driven microservices design mechanisms and transaction patterns with the Oracle converged database. The first blog illustrated how to connect to an Oracle database in Java, JavaScript, Python, .NET, and Go as succinctly as possible. The goal of this second blog is to use that connection to receive and send messages with Oracle AQ (Advanced Queueing) queues and topics and conduct an update and read from the database using all of these same languages.

Advanced Queuing (AQ) is a messaging system that is part of every Oracle database edition and was first released in 2002. AQ sharded queues introduced partitioning in release 12c and is now called Transaction Event Queues (TEQ).

Source de l’article sur DZONE

A lot, if not all, of data science projects, require some data visualization front-end to display the results for humans to analyze. Python seems to boast the most potent libraries, but do not lose hope if you’re a Java developer (or if you’re proficient in another language as well). In this post, I will describe how you can benefit from such a data visualization front-end without writing a single line of code.

The Use Case: Changes From Wikipedia

I infer that you are already familiar with Wikipedia. If you are not, Wikipedia is an online encyclopedia curated by the community. In their own words:

Source de l’article sur DZONE

Fundamentally Hyperlambda is really just a Turing complete markup language, with some added capabilities resembling features from XSLT and XPath. You could argue Hyperlambda is the programming equivalent of YAML. On the index of « programming level abstractions » if we argue that CISC x86 assembly code is at level 1 (the bottom level) and C# and Java is at level 5, while Python and PHP are at level 10 – Hyperlambda is at level 100+ somewhere.

Of course, the point being, that 95% of the times you need a low level programming construct, Hyperlambda implicitly creates your C# objects and ties these together 100% correctly out of the box. This reduces the cognitive complexity of your resulting app’s code by orders of magnitudes. To illustrate this difference, please have a look at the following code snippet taken from Microsoft’s official documentation for how to correctly create an HTTP request from C#.

Source de l’article sur DZONE