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 ]

Gentle introduction to Monte Carlo sampling for probability

Categories

Tags big-data data-science machine-learning miscellaneous python

Jason Brownlee wrote this piece about Monte Carlo. Monte Carlo methods are a class of techniques for randomly sampling a probability distribution.

Ddesired quantity can be approximated by using random sampling, referred to as Monte Carlo methods. These methods were initially used around the time that the first computers were created and remain pervasive through all fields of science and engineering, including artificial intelligence and machine learning.

Monte Carlo methods, or MC for short, are a class of techniques for randomly sampling a probability distribution.

This tutorial is divided into three parts; they are:

  • Need for Sampling
  • What Are Monte Carlo Methods?
  • Examples of Monte Carlo Methods

You may be using Monte Carlo methods all the time without thinking about it. Good read, with code examples in NumPy!

[Read More]

Promises in Javascript: Complete Guide for 2019

Categories

Tags javascript nodejs app-development

Promises are an important concept that is essential for a JavaScript developer to understand. If this concept is clear, the developer can utilize promises in a variety of ways in their day-to-day lives. An article by Nilesh Sanyal.

In this article, author tried to elaborate on promises in-depth, so you won’t need to go through other resources.

The article covers:

  • What Is a Promise?
  • Promise Use Cases
  • How Promises Work
  • Different States in a Promise
  • Chaining Promises in Javascript
  • How Does Promise.all() Work?
  • Are Javascript Promises Synchronous or Asynchronous?

… and much more. Plenty of code examples explaining the concepts in the article. Nice read for aspiring JavaScript developer.

[Read More]

Fastest way to cache for lazy developers: Angular with RxJS

Categories

Tags angular nodejs javascript

Dler Ari is author of this piece about HTTP caching and Angular. HTTP caching simply means the browser stores local copies of web resources for faster retrieval the next time the resource is required, thus reducing the number of server calls.

The aim of this article is to show how you can implement caching with only two RxJS operators: publishReplay() and refCount().

The topics covered include:

  • What is caching?
  • Caching with RxJS + two operators
  • A practical example of how to cache
  • Summary

Caching is a viable choice if we want to save numbers of server requests, especially for data that rarely changes such as daily, weekly etc. However, one should always be cautious when dealing with caching and don’t overdo it. Easy!

[Read More]

Mocking is catching

Categories

Tags programming tdd big-data data-science

When writing unit tests for a package in R, you might find yourself wondering about how to best test the behavior of your package or you might even wonder how to test at least part of that package of yours that calls a web API or local database without accessing the web API or local database during testing. By R-hub blog.

In this post authors shall offer a round-up of resources around mocking, or not mocking, when unit testing an R package.

The article then deals with:

  • Packages for mocking
  • Web mocking
  • Temporarily modify the global state
  • To mock or… not to mock
  • Stored data from a web API / a database
  • Different operating systems

In this post authors offered a round-up of resources around mocking when unit testing R packages, as well as around not mocking. Good read for anybody in big data business.

[Read More]

From REST to GraphQL: Different way to create API (with Apollo & Node.js)

Categories

Tags apis nodejs javascript web-development nosql restful

Dirk Wolthuis wrote this tutorial about moving from REST to GraphQL. If you already have a MySQL database you have an excellent starting point for creating a scalable API.

In this tutorial, he will cover how to create models based on your database, create a NodeJS GraphQL API that reads the data from the database, and learn how to make relations in your GraphQL API between different tables.

The content of the tutorial:

  • Step 1: database layer
  • Step 2: bootstrapping the application
  • Step 3: creating the database models
  • Step 4: implementing the database models
  • Step 5: setting up an Apollo server
  • Step 6: creating our GraphQL types and resolvers

… and much more. If you want to code along, you can check out this repository and clone the start of the tutorial release. You have a usable GraphQL API that you can customize any way you want. Excellent!

[Read More]

Running a serverless Go web application

Categories

Tags golang programming performance web-development

Recently Google introduced the beta program for Google Cloud Run. This is a service to run stateless containers on a fully managed environment by Google. An article by Bart Fokker.

It is essentially serverless for any container, scaling your containers up and down as requests (and peaks) come and go. The benefit of using tools like Cloud Run is that it abstracts away all the infrastructure, thus you can focus more on what really matters, building your application.

The article describes in great detail:

  • Setting up – since cloud run is still in beta we need to install the beta components in the gcloud utility
  • Building the application

Includes all teh code, link to GitHUb repository and detailed explanation of each step. Deploying web applications with cloud run is very easy. It is as simple as defining a Dockerfile and publishing the image to google cloud. Seems pretty simple!

[Read More]

Cloning Memcached with Go

Categories

Tags golang programming performance software

Andrew Healey tutorial how to write key value store in Go. He uses caching pretty often but had never coded up a Least Frequently Used (LRU) cache by hand before. Neither had I used Go’s net/http or container/list packages. Both packages are elegant and have great documentation and readable source code – the latter being one of my favorite things about Go.

This time author created two packages. Api – an HTTP server which responds to GET requests like /set?key=name&value=Andrew&expire=1571577784 and /get?key=name. Cache – an LRU cache that allows an expire time and a max number of keys.

The article delves into following:

  • Caching – mapped strings to doubly linked list elements
  • Give key, get value
  • Insert into cache

Author had a great “Google experience” alongside his Go programming. All code included in the tutorial. Superb!

[Read More]

Using the Python zip() function for Parallel Iteration

Categories

Tags python programming code-refactoring performance

Leodanis Pozo Ramos wrote this tutorial about Python’s zip() function. It creates an iterator that will aggregate elements from two or more iterables. You can use the resulting iterator to quickly and consistently solve common programming problems, like creating dictionaries.

he resulting iterator can be quite useful when you need to process multiple iterables in a single loop and perform some actions on their items at the same time.

Python’s dictionaries are a very useful data structure. Sometimes, you might need to build a dictionary from two different but closely related sequences. A convenient way to achieve this is to use dict() and zip() together.

By the end of this tutorial, you’ll learn:

  • How zip() works in both Python 3 and Python 2
  • How to use the Python zip() function for parallel iteration
  • How to create dictionaries on the fly using zip()

A lot of code examples to demonstrate efficient actions on items in parallel. Nice one!

[Read More]

Keras vs tf.keras: What's the difference in TensorFlow 2.0?

Categories

Tags big-data data-science software machine-learning

In this tutorial we will discover the difference between Keras and tf.keras (tf - TensorFlow), including what’s new in TensorFlow 2.0. By Adrian Rosebrock.

Understanding the complicated, intertwined relationship between Keras and TensorFlow is like listening to the love story of two high school sweethearts who start dating, break up, and eventually find their way together — it’s long, detailed, and at some points even contradictory.

Article also discusses some of the most popular TensorFlow 2.0 features you should care about as a Keras user, including:

  • Sessions and eager execution
  • Automatic differentiation
  • Model and layer subclassing
  • Better multi-GPU/distributed training support

… and much more. Code examples, charts and further resources all provided. Excellent!

[Read More]

Using SSH port forwarding on Fedora

Categories

Tags linux software infosec

Posted by Paul W. Frields. The protocol behind ssh allows terminal input and output to flow through a secure channel. You can also use ssh to send and receive other data securely.

A standard Linux system has a set of network ports already assigned, from 0-65535. Your system reserves ports up to 1023 for system use. Quite a few ports are commonly expected to run specific services. You can find these defined in your system’s /etc/ services file.

You can think of a network port like a physical port or jack to which you can connect a cable. That port may connect to some sort of service on the system, like wiring behind that physical jack. An example is the Apache web server (also known as httpd). The web server usually claims port 80 on the host system for HTTP non-secure connections, and 443 for HTTPS secure connections.

Further information in this article:

  • Local port forwarding
  • Remote port forwarding

Finally, remember port forwarding only happens as long as the controlling ssh session is open. Sweet and short!

[Read More]