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 ]

How to use Decorators with Factory Functions

Categories

Tags javascript programming nodejs

Cristi Salcescu detailed post on Decorators. Method decorators are a tool for reusing common logic. They are complementary to Object Oriented Programming. Decorators encapsulate responsibility shared by different objects.

A function decorator is a higher-order function that takes one function as an argument and returns another function, and the returned function is a variation of the argument function.

The blog post then walks through some common use cases for Decorators:

  • Log duration
  • Authorization
  • compose() – apply multiple decorators the new composed decorator to the original function
  • Order, when execution order of decorators matter

Author then explains what are Factory Functions and how to decorate the Factory Function. He favors factory functions over classes for the flowing reasons:

  • Encapsulation. Members are private by default.
  • There are no issues with this losing context.
  • Objects have a better security. The internal state is encapsulated and the API is immutable.

Further resources to extend your knowledge with links to external resources are also provided. Good read for any JavaScript fun!

[Read More]

Building a simple Keras + deep learning REST API

Categories

Tags big-data data-science programming

Adrian Rosebrock tutorial in which he will present a simple method to take a Keras model and deploy it as a REST API. The examples covered in this post will serve as a template/starting point for building your own deep learning APIs.

The Keras library is an amazing tool that allows us to launch deep learning models with relative ease. This Python’s high-level package can be used on top of a GPU installation of either TensorFlow or Theano.

The post’s focus is on:

  • How to (and how not to) load a Keras model into memory so it can be efficiently used for inference
  • How to use the Flask web framework to create an endpoint for our API
  • How to make predictions using our model, JSON-ify them, and return the results to the client
  • How to call our Keras REST API using both cURL and Python

Detailed code is provided in the repository with explanation and charts. It is meant to be used as a template for your own Keras REST API. ßGood read!

[Read More]

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]