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 ]

Best practices for unit testing in Kotlin

Categories

Tags programming app-development android

Philipp Hauer post about how unit testing in Kotlin is fun and tricky at the same time. We can benefit a lot from Kotlin’s powerful language features to write readable and concise unit tests. His post contains the best practices and guidelines to write unit test code in Kotlin that is idiomatic, readable, concise and produces reasonable failure messages.

Some interesting points raised in the article:

  • What is idiomatic Kotlin code?
  • Avoid static and reuse the test class instance
  • Change the lifecycle default for every test class
  • Use backticks and @nested inner classes
  • How to handle the mocks

… and much more. There are many Kotlin libraries setting out to ease testing with Kotlin, for example author suggests KotlinTest and Spek. You will also find code examples and further resources in the article. Learn more!

[Read More]

GraphQL, everything you need to know

Categories

Tags programming nosql apis software-architecture

Weblab Technology post about what GraphQL is all about and how it’s different from the traditional approach. The purpose of this article is to highlight the major features associated with GraphQL along with discussing the significant pros and cons associated with this particular API specification.

GraphQL is usually described as a frontend-directed API technology as it allows front-end developers to request data in a much simpler way than ever before.

One of the basic problems with conventional REST is the failure of the client to demand a personalized data set. In addition to that, running and controlling multiple endpoints is another difficulty as clients are mostly needed to request data from diversified endpoints.

Included in the post:

  • GraphQL vs REST
  • Data fetching via single endpoint
  • Over or under data fetching
  • Error management
  • Caching
  • Authorization Problems

and much more (versioning, deprecation etc). And plenty of code examples. Nice read!

[Read More]

How to build your own serverless platform

Categories

Tags serverless devops containers

In this post, Tomasz Janczuk, will provide a blueprint for building your own serverless platform, based on the lessons learned from working on Auth0 Extend in the recent years.

The serverless (Function-as-a-Service) computation model is a powerful complement to the webhook-based extensibility of a SaaS platform.

Serverless platform will need to meet this minimum set of requirements:

  • Core concept of a function as a unit of custom business logic
  • Must support adequately rich programming environment
  • API surface that allows managing functions as individual webhooks
  • Provide a mechanism to isolate the execution of functions
  • Latency of execution of your serverless webhooks must be acceptably small
  • Scalability and reliability

Also, execution of functions requires basic computing resources: CPU, memory, disk, and network. Learn more by reading this insightful article.

[Read More]

The character of Kotlin

Categories

Tags programming app-development kotlin

Marcin Moskala interesting blog post inspired by Seven Languages in Seven Week book in which he presents characteristics of Kotlin language. And one very typical Kotlin trait is that it isn’t really introducing anything new into programming languages family.

The purpose of this article is not to teach the language, but to show the character of Kotlin instead. You don’t need to understand everything. Instead, concentrate on thinking how presented features would influence the way you are programming.

The blog post then explains:

  • Kotlin basics – everything in Kotlin is an object
  • Safety, security and scalability (Properties must be initialized)
  • Smart casting
  • Minimal, simple things should be simple
  • Flexibility (top level functions, mutable and immutable)

You will also find plenty of code examples in the post demonstrating discussed Kotling features. Great read!

[Read More]

Locking down Kubernetes workers: hardening Kubernetes security

Categories

Tags kubernetes devops containers

Kontena’s blog on ht topic of Kubernetes security. One of the trickiest parts in setting up a proper Kubernetes cluster is making it secure. There are numerous communication paths that must be secured.

In this article we focus on locking down the worker nodes in the cluster. In practice this means locking down kubelet and the various “sidekick” services it uses on the nodes. NIST (National Institute of Standards and Technology) has also developed a guide for securing your container based application environment.

The article then deals with:

  • Securing kubelet and its sidekicks
  • Setting up kubelet
  • Securing 3rd party cluster components
  • Securing the worker nodes
  • Tools for ensuring security on Kubernetes clusters

The authors strongly advise you to use these tools as part of the validation process of any Kubernetes cluster setup. Also see the links to further reading and resources in the post. Great read!

[Read More]

How to build a realtime chart in iOS

Categories

Tags ios app-development

Neo Ighodaro article about building real time application in iOS. Nowadays, gathering data is one of the keys to understanding how products are perceived. However, all the data in the world would be useless without a way to visualize it.

In this article, we will explore how to create a simple realtime chart in iOS. The chart will receive data and update in realtime to the screens of everyone currently logged into your application.

Article is then split into few sections:

  • Requirements for building a realtime chart in iOS
  • Preparing to create our realtime chart application in Xcode
  • Creating our realtime chart application views
  • Adding basic functionality to our iOS chart application
  • Adding realtime functionality to our iOS chart application
  • Testing the application

… and more. Charts and code examples are included with the article. You will get insight how you can combine Pusher and the Charts package to create a realtime iOS chart application. Interesting!

[Read More]

How we failed with Angular & Elm is the solution

Categories

Tags programming nodejs javascript

Asaf Cohen article about their journey from Angular to Elm. Their address the main problem AngularJS created, and that is the illusion they could use it to design the UX as we please (uh … like develop) and that was not the case.

After playing with React they compared what some other tech companies where using and they settled on Elm.

Elm is a pure functional language with static type checking, that generates Javascript, css and html and provides a complete solution for web development and it’s toolset include the time-traveling-debugger.

Some benefits they observed:

  • A development environment that includes a dedicated debugger
  • Type safety can be applied to css – never have css errors!
  • No problem preserving application state
  • More safety! You cannot hijack elm network requests

… and more. But not everything is roses. To learn about caveats, Elm architecture and list of other resources, including 3rd party comparison on how popular frameworks stack up against each other solving the same problem - read this article!

[Read More]

Algorithms and Data Structures in JavaScript

Categories

Tags nodejs javascript programming

Oleksii Trekhleb straight to the point article about data structures in JavaScript. It describes a collection of classic algorithms and data-structures implemented in ES6 JavaScript with explanations and links to further readings and YouTube videos.

Author also tried to make this process even smoother for learners. He has tried to put some graphical illustrations for each algorithm and data structure where it was possible just to make the idea behind those algorithms to be easily grasped and memorized.

All code is 100% covered with tests. Repository also has a playground.

Explained and covered data structures:

  • Linked List
  • Queue
  • Stack
  • Hash Table
  • Heap
  • Priority Queue

… and more. On top of these data structures more than 50 popular algorithms are implemented. Great resource!

[Read More]

A large-scale study of programming languages and code quality in Github

Categories

Tags programming

Baishakhi Ray, Daryl Posnett, Premkumar Devanbu, Vladimir Filkov detailed study of programming languages and code quality. They tried to answer the question: What is the effect of programming languages on software quality?

In this study, we gather a very large data set from GitHub (728 projects, 63 million SLOC, 29,000 authors, 1.5 million commits, in 17 languages).

The reasonably large sample size allowed authors to use a mixed-methods approach, combining multiple regression modeling with visualization and text analytics.\

Functional languages have a smaller relationship to defects than other language classes whereas procedural languages are greater than or similar to the average.

One should take care not to overestimate the impact of language on defects. While the observed relationships are statistically significant, the effects are quite small. Analysis of deviance reveals that language accounts for less than 1% of the total explained deviance.

Great article full of insights!

[Read More]

Angular security -- Authentication with JSON Web Tokens (JWT), complete guide

Categories

Tags nodejs javascript angular infosec apis

Angular university brought you this a step-by-step guide for both designing and implementing JWT-based Authentication in an Angular application. The goal here is to discuss JWT-based Authentication Design and Implementation in general.

In a nutshell, JWTs are digitally signed JSON payloads, encoded in a URL-friendly string format. A JWT can contain any payload in general, but the most common use case is to use the payload to define a user session.

The guide follows the complete journey of a JWT from creation on the Authentication server and back to the client, and then back to the Application server and talk about all the design options and decisions involved.

Selected points touched by the article:

  • JWT-based Authentication in a Nutshell
  • User Login in an Angular Application
  • Creating a JWT Session Token using node-jsonwebtoken
  • Sending a JWT back to the client
  • Where to store a JWT Session Token?
  • Checking User Expiration
  • Building a custom Express middleware for JWT validation

… and much more. Perfect!

[Read More]