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 ]

Why is the human brain so efficient?

Categories

Tags data-science big-data

Liqun Luo, professor in the School of Humanities and Sciences, and professor, by courtesy, of neurobiology, at Stanford University, published this interesting essay about human brain efficiency and how massive parallelism lifts the brain’s performance above that of AI. The brain is complex; in humans it consists of about 100 billion neurons, making on the order of 100 trillion connections.

Both the brain and the computer contain a large number of elementary units – neurons and transistors, respectively – that are wired into complex circuits to process information conveyed by electrical signals

The highest frequency of neuronal firing is about 1,000 spikes per second. The fastest synaptic transmission takes about 1 millisecond. Thus, both in terms of spikes and synaptic transmission, the brain can perform at most about a thousand basic operations per second, or 10 million times slower than the computer.

A pro tennis player can follow the trajectory of a ball served at a speed up to 160 mph. The calculations performed by the brain, however, are neither slow nor imprecise.

Read to learn more interesting facts about human brain and how engineers have taken inspiration from the brain to improve computer design. Top notch!

[Read More]

Do we really need swap on modern systems?

Categories

Tags programming servers

Christian Horn from Red Hat Advanced Mission Critical program published this interesting blog. It is a short and straight to the point article describing how is swap used and how much of it is recommended today.

Virtual Memory Management (VMM) is code in the kernel which, among other things, helps us to present each process with its own virtual address space.

Overcommitment means that processes can request more memory from the kernel than we have available physically and as swap.

Article then goes in detail into:

  • Overview: When is swap used?
  • The details: How is swap used?
  • How much swap is recommended nowadays?
  • Can I run without swap? Is further tuning possible?

Great refresher for any Linux enthusiast.

[Read More]

Using unit tests to identify and avoid memory leaks in Swift

Categories

Tags programming swiftlang tdd

John Sundell blog post about memory leaks in Swiflang. In it he discusses managing memory and avoiding leaks and how it is a crucial part of building any kind of program. According to author Swift makes this relatively easy in most situations – thanks to Automatic Reference Counting (or ARC for short).

Memory leaks in Swift are often the product of a retain cycle, when one object will hold a strong reference to an object that also strongly references the original object. So A retains B and B retains A.

He then guides you through setting up of unit tests to both help us identify memory leaks and also make it easier to avoid common mistakes that could end up causing leaks in the future.

For a purpose of common memory leaks sources, following patterns are mentioned:

  • Delegate pattern
  • Observer pattern
  • Closures – closure-based API

The usage of these in unit tests is explained in detail plus code examples. Even though tests like presented in the article won’t completely protect you against memory leaks, they can potentially reduce the amount of time you’ll have to spend hunting down the cause of memory related issues in the future. Good read!

[Read More]

Let's code a web server from scratch with NodeJS Streams!

Categories

Tags javascript programming nodejs servers

Ziad Saab tutorial exploring new technologies abound. In it you will go back to the basics and build a simple web server from scratch with NodeJS. You will review the structure of HTTP requests and responses and get an introduction to Node’s Stream API.

Author explores a simple HTTP server built in NodeJS. This server allows us to listen on an arbitrary port and provide a callback function that will be invoked on every incoming request.

Main points described in detail:

  • Dissecting HTTP
  • Receiving and parsing an HTTP request

By using some lower-level building blocks such as net, Stream, and Buffer, author was able to create a rudimentary HTTP server based on a TCP server and some parsing logic. In the process, you will learn a bit about how HTTP requests and responses work, as well as the basics of readable and writable streams and buffers.

Plenty of code examples. Good read!

[Read More]

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 mobile-apps apps 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 api 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 mobile-apps apps

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]