Welcome to curated list of handpicked free online resources related to IT, cloud, Big Data, programming languages, Devops. Fresh news and community maintained list of links updated daily. Like what you see? [ Join our newsletter ]

Compiler hinting with Kotlin contracts

Categories

Tags java android app-development kotlin

Jarno Walgemoed short introduction on some new interesting features in Kotlin 1.3. Kotlin’s built-in null-safety makes it easy for us to write code that’s less error-prone and less susceptible to the unwanted and unexpected NullpointerException at runtime.

Kotlin is introducing Contracts in the upcoming 1.3 release in which we can use contracts to tell the compiler how a function behaves and what results are implied, so we can benefit from improved smart-casts.

Starting with Kotlin 1.3, we can start defining contracts for our functions.

Supplying the compiler with contracts for applicable functions can help clean up code on the call site and remove redundant null-checks.

You will find example code describing a User and implementation defining the contracts using Returns and Implies. Excellent intro into contracts in Kotlin!

[Read More]

Building a RESTful blog APIs using Python and Flask

Categories

Tags python apis microservices

Olawale Aladeusi blog post about building Application Programming Interface in Python. This shall be a very easy to learn path in creating RESTFUL API using Python and Flask micro-framework.

In the tutorial he takes on the journey of allowing all four basic CRUD (Create, Read, Update and Delete) operations. Flask is a micro web framework written in Python. It is called a micro-framework because it does not require any specific libraries or tools.

Author also uses PostgreSQL relational database for this project. You will get information how to:

  • Set up project virtual environment using pipenv
  • Installing Project Dependencies
  • How to create meaningful project structure
  • Database basics
  • Flask configuration
  • Model app

Detailed steps with explanation of the code examples is provided. You should have enough information about configuring Flask environment, creating models, making and applying migrations to the database, grouping resources using Flask blueprint, validating the authenticity of a user using JWT token and also complete set up for all RESTful endpoints.

Excellent intro into Python’s Flask!

[Read More]

Using Behave framework for Selenium BDD testing

Categories

Tags tdd software browsers agile python code-refactoring cicd learning

An article by Dzmitry Ihnatsyeu published by guys from BlazeMeter about automating the testing of an application. There are many ways of testing – like unit testing, test-driven development, keyword-driven development, behavior-driven development and so on. In this article, autho talks about one of the most popular approaches to test automation – BDD or behavior-driven development.

Behavior tests come from specification and business requirements. Business stakeholders, QA engineers, analysts, application and test developers work together to identify the correct flow and test it.

In the article you will find:

  • What is BDD
  • BDD scenarios in Gherkin
  • Automation with Selenium and Behave
  • Browser initialization with fixtures (and info when to use them)
  • How to implement parameterized steps

More technical article for Python programmers requiring a certain degree of experimentation. Overall very good!

[Read More]

Step-by-Step guide to building a quick Q&A chatbot

Categories

Tags bots nodejs miscellaneous robotics azure

Tutorial by Purna Virji about starting with chatbots or virtual assistants. Chatbots, infobots, socialbots, salesbots, superbots! Bots are a great way to help serve your customers, build your business, and cut down costs.

The author walks you through building a bot, step-by-step, starting with a simple informational bot based on a template create by Microsoft. Informational bots make it easy for you to quickly get information via simple text-based chat.

She creates a bot to answer questions defined in a knowledge set or FAQ using QnA Maker and displayed in a Cortana bot using Azure Bot Service. You will be able to import source for Q&A from url or file, which makes it extremely easy even for non programmers to start developing bots.

These topics are explained in detail:

  • QnAMaker Service creation
  • How to explore, edit, extend and replace the Knowledge Base
  • Knowledge Base testing
  • Knowledge Base publishing
  • Updating resources
  • Integration with Azure Bot Service

It also explains how to connect to channels. WebChat is the default, but we can add other favorites. Excellent, yet so easy!

[Read More]

Build a Hello World API with Scala and Akka HTTP

Categories

Tags devops akka scala functional-programming web-development apis

Miguel Lopez short and sweet tutorial about building a Hello World web application with Akka. Akka is a popular actor-based toolkit for building concurrent and distributed applications in the JVM. These applications mostly use Scala or Java.

Akka toolkit has several modules that help to build such distributed applications, and Akka HTTP is one of them. Akka HTTP has both client-side and server-side utilities.

The tutorial covers:

  • Project setup (sbt and Scala)
  • Adding and instantiating of dependencies
  • Route creation
  • Server
  • Logging

While using Scala and Akka HTTP is not the fastest way to develop APIs, it allows you to integrate other Akka modules, such as actors, streams, clusters, and more, making it easier to develop resilient and scalable systems.

Code repository is provided together with link to free course containing 14 videos related to the Akka topic. Nice!

[Read More]

REST API design -- resource modeling

Categories

Tags restful apis web-development json

In this older article by Prakash Subramaniam from ThoughtWorks looks at the REST API design best practices. The key abstraction of information in REST is a resource. A resource is a conceptual mapping to a set of entities, not the entity that corresponds to the mapping at any particular point in time.

Resources form the nucleus of any REST API design. Resource identifiers (URI), Resource representations, API operations (using various HTTP methods), etc. are all built around the concept of Resources.

The starting point in selection of resources is to analyze your business domain and extract the nouns that are relevant to your business needs

The article then depicts and explains in detail some important design choices for REST API:

  • Fine grained CRUD resources versus Coarse Grained resources
  • Preventing migration of business logic to API consumer
  • Coarse grained aggregate resources for business processes
  • Nouns versus Verbs
  • Reification of abstract concept
  • REST without PUT and CQRS

… and much more. Very in depth and informative article. Excellent read!

[Read More]

Quadrupling Ansible performance with Mitogen

Categories

Tags devops ansible cicd how-to

David Wilson article about writting Ansible extension for Mitogen. Ansible is the simplest way to automate apps and IT infrastructure. Application Deployment + Configuration Management + Continuous Delivery. Mitogen is a Python library for writing distributed self-replicating programs.

Mitogen is perhaps most easily described as a kind of network-capable fork() on steroids. It allows programs to establish lazily-loaded duplicates on remote hosts, without requiring any upfront remote disk writes, and to communicate with those copies once they exist. The copies can in turn recursively split to produce further children – with bidirectional message routing between every copy handled automatically.

Mitogen is a library for writing distributed programs that require zero deployment, specifically designed to fit the needs of infrastructure software like Ansible. Without upfront configuration it supports any UNIX machine featuring an installed Python interpreter, which is to say almost all of them.

It massively speeds up Ansible playbook execution on remote hosts, while saving bandwidth and momory. An unmodified playbook executes over 7 times faster while consuming 50x less bandwidth.

Dive into this exciting reading about how to speed up your Ansible playbooks execution!

[Read More]

Understanding Android Gradle build

Categories

Tags android java app-development cicd

Ɓukasz Wasylkowski article about Android Gradle builds. In his post he’ll write, step by step, Gradle configuration files for a single Android project in order to take some of the magic away.

Gradle is an open-source build automation system that builds upon the concepts of Apache Ant and Apache Maven and introduces a Groovy-based domain-specific language (DSL) instead of the XML form used by Apache Maven for declaring the project configuration.

The article will guide you through following:

  • Groovy syntax used in Gradle files
  • Closures – lambdas on steroids
  • Script files
    • build scripts in build.gradle files
    • settings scripts in settings.gradle files
    • init scripts used for global configuration (executed against Gradle instance)
  • Projects

Author also describes how to go about creating a Gradle projects and configure Android subproject with code examples and supporting illustrations. Also how to deal with extensions, dependencies, flavors, build types, signing configurations. Gradle files aren’t that magical after all. Nice!

[Read More]

How to build a simple auto-login bot with Python and Selenium

Categories

Tags programming bots tdd python software

Malik Brahimi blog post about automation and how to use it for tasks that are repetitive, boring, time-consuming, or otherwise inefficient without the use of a script.

With web automation, you can easily create a bot to perform different tasks on the web, for instance to monitor competing hotel rates across the Internet and determine the best price.

Tutorial then describes and guides you through:

  • Installation and setup
    • including Python
    • Google Chrome browser
    • Selenium browser automation toolkit
    • Chrome Driver web driver
  • Starting the Selenium programmatically
  • Finding the input elements

To the point intro into automation with Selenium and Python. Code examples are included. Good read!

[Read More]

An overview of privacy in cryptocurrencies

Categories

Tags fintech blockchain infosec

Blog post by Richard Chen about privacy consideration when dealing with cryptocurrencies. It’s no secret that privacy is an important topic in cryptocurrencies these days. Neither companies nor individuals want to publish all of their information onto a public blockchain that can be arbitrarily read without any restrictions.

It quickly became clear that it was possible to identify individuals based on usage patterns of certain addresses and transactions when using Bitcoin…

Overall, privacy is one of the most exciting areas of cryptography research right now. Many of the privacy techniques used in coins, smart contracts, and infrastructure were only invented a few years ago.

Author covers:

  • Privacy coins
  • Smart contract privacy
  • Privacy infrastructure
  • Privacy research

Due to the public nature of the Bitcoin blockchain, it quickly became clear that it was possible to identify individuals based on usage patterns of certain addresses and transactions. This led to creation of several new cryptocurrencies to support private transactions.

Privacy in smart contracts is different to privacy in payments since smart contracts publicly contain program code. However, smart contracts currently lack both confidentiality (hiding payment amounts) and anonymity (hiding the identities of senders and recipients).

Follow the link to find detailed information on above mentioned topics.

[Read More]