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 ]

Laravel OOP principles for writing better code explained

Categories

Tags php programming web-development oop

An blog post by Peter Matisko about PHP framework Laravel and how to use Object Oriented Programming (OOP) for writing better code.

Start your design with layers; your life will become much easier!

Author describes his experiences with “red situation” encountered several times. A client asked him to update some else’s messy code. It was clear to him, that it just wasn’t possible. The programmer himself told the client that he was not able to update it anymore and he had given up.

In the article he does not explain the main principles, but rather shows some examples on how to actually use OOP effectively.

However you should get understanding on few most important terms. Including SOLID principles. SoC — Separation of Concerns, SRP — Single Responsibility Principle, IoC — Inversion of Control, Design patterns, Anti-patterns

One of the most important programming principles is an architectural pattern – simply Layers. Author then explains possible layers of a typical web application in Laravel. Excellent read!

[Read More]

Introduction to ZGC: Scalable and experimental low-latency JVM garbage collector

Categories

Tags jvm programming java

Attila Fejér is author of this interesting read about address issue with managing memory for highly available and scalable systems in Java. Java 11 introduced the Z Garbage Collector (ZGC) as an experimental garbage collector (GC) implementation.

Today, it’s not uncommon for applications to serve thousands or even millions of users concurrently. Such applications need enormous amounts of memory. However, managing all that memory may easily impact application performance.

The article then explains:

  • Memory management
  • Garbage collection
  • GC phase properties
  • GC concepts, including
    • Pointer coloring
    • Multi-mapping
    • Load barriers
    • Marking
    • Relocation
    • Remaping

Great article, in which you will discover that ZGC intends to support large heap sizes with low application pause times.

[Read More]

Running your own DBaaS based on your preferred DBs, Kubernetes operators and containerized storage

Categories

Tags kubernetes programming devops

Posted by Evan Powell this is excellent guide for those who want to get advice about running their own Redis or Cassandra or MongoDB in Kubernetes.

Many enterprises such as financial service and health care providers or those that are concerned about AWS as a competitor choose to run their own Kubernetes on their own environments in part due to concerns about data being viewed by the cloud provider or by some external attacker.

There is a huge number of DB solutions. There are at least eight main types: key value stores, column stores, document stores, graph databases, row stores, in memory database, “synthetic” – able to retain consistency while scaling horizontally, time series databases…

The article then dives into:

  • Composing a stack that better serves the DB
  • Integrating your disparate data sources more easily
  • DevOps autonomy
  • Problems with building and running stateful workloads

And much more in the article. It outlines some of the things to think about when running your own DBaaS. Well worth the read!

[Read More]

How to make Python wait

Categories

Tags python programming learning

Posted by Miguel Grinberg this article explains various (in)correct ways of implementing threads for time when it is necessary to pause the running of the program until some external condition occurs.

You may need to wait until another thread finishes, or maybe until a new file appears in a directory on disk that is being watched.

In these and many other situations you will need to figure out a way to make your script wait, and this isn’t as easy as it sounds if you want to do it properly! In this article author shows you a few different ways to wait.

The author then shows you a few different ways to implement this wait, starting from the worst and working the way up to the best:

  • The ugly: busy waiting
  • The bad: busy waiting with sleep
  • The good #1: joining the thread
  • The good #2: waiting on an event
  • The good #3: waiting while displaying a progress percentage

In most cases, the operating system provides efficient wait mechanisms, so all you need to do is find how to access those from Python. Refreshing read!

[Read More]

Running Concourse-based CD on Azure Kubernetes

Categories

Tags web-development devops azure software-architecture cicd

Roman Alekseenkov published this straightforward tutorial about getting Concourse based continous delivery running on Azure Kubernetes. The author guides you through what it takes to stand up and operate your own full CD stack on Kubernetes.

Concourse is an open-source continuous thing-doer. You can think of a pipeline as a distributed, higher-level, continuously-running Makefile.

Their deployment contains: 60 CD pipelines, 400 jobs, deployed on Kubernetes, Git is the source of truth for everything — configuration, application data, CD pipelines, and pipeline tasks.

The author then describes architecture and open source components they use with Concourse being the main engine for CD pipelines and Vault as a backend for secrets:

  • CD - Concourse
  • Secrets - Vault (with Consul as a backend)
  • Monitoring & Alerting - Grafana, Prometheus, InfluxDB w/ Telegraf
  • Logging & Alerting — Kibana, Elasticsearch w/ Elastalert
  • Misc - Chartmuseum, Letsencrypt Certificate Manager

For full code and detailed guide with charts and further resources follow the link to original tutorial. Very nice!

[Read More]

Benchmarking Angular, React and Vue for small web applications

Categories

Tags programming miscellaneous learning

A benchmark and comparison article by Abhay Srivastav about comparing 3 main JavaScript frameworks for small web projects. These are Angular, React and Vue. In the article author takes more practical approach to compare these 3 frameworks by creating a simple application using each of them.

Author walks you through building sample application (Movies of 2018). Application makes an api call, to get the movies having the word “Love” in their title, in the year 2018 and displays them in tabular format. You can sort the movies according to year and name. The links to the application hosted on Github are provided.

Author selected simple comparison criteria:

  • JS bundle size
  • First Contentful Paint (FCP)
  • Learning curve

Simple methodology for both criteria are explained. For First Contentful Paint author uses limitations to make xperience more real life like. CPU and Network throttling is set to: Fast 3G, 4x CPU slowdown. To see which result, click for the whole article!

[Read More]

Programming paradigms for dummies: what every programmer should know

Categories

Tags programming miscellaneous learning

Adrian Colyer published this review on a chapter by Peter Van Roy mapping out the space of programming language designs. This chapter gives an introduction to all the main programming paradigms, their underlying concepts, and the relationships between them… We give a taxonomy of about 30 useful programming paradigms and how they are related. Link to 49 pages long resource included.

Programming paradigms are approaches based on a mathematical theory or particular set of principles, each paradigm supporting a set of concepts.

A language should ideally support many concepts in a well-factored way, so that the programmer can choose the right concepts whenever they are needed without being encumbered by the others.

Van Roy is a believer in multi-paradigm languages: solving a programming problem requires choosing the right concepts, and many problems require different sets of concepts for different parts.

Plenty of charts and diagrams helping to explore various paradigms. Really good read!

[Read More]

Handling imbalanced datasets in machine learning

Categories

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

An article by Bapriste Rocca about handling imbalanced datasets in machine learning. He searches and answer on question what should and should not be done when facing an imbalanced classes problem.

The acrticle first gives an overview of different evaluation metrics that can help to detect “naive behaviours”. It then discusses a whole bunch of methods consisting in reworking the dataset and shows that these methods can be misleading. Finally, it shows that reworking the problem is, most of the time, the best way to proceed.

For detecting the naive behaviour author suggests to use one of:

  • Confusion matrix, precision, recall and F1
  • Receiver Operating Characteristic (ROC) and Area Under the ROC curve (AUROC)

Whenever using a machine learning algorithm, evaluation metrics for the model have to be chosen cautiously. We must use the metrics that gives us the best overview of how well our model is doing with regards to our goals.

Well balanced article with many charts and supporting mathematical reasoning. Links to further resources also included. Excellent!

[Read More]

Practical introduction to functional programming

Categories

Tags javascript programming web-development functional-programming

Mary Rose article focusing on practical aspects of functional programming. Many functional programming articles teach abstract functional techniques. That is, composition, pipelining, higher order functions. This one is different. It shows examples of imperative, unfunctional code that people write every day and translates these examples to a functional style.

The examples are in Python, because many people find Python easy to read. A number of the examples eschew pythonicity in order to demonstrate functional techniques common to many languages: map, reduce, pipeline.

Functional code is characterised by one thing: the absence of side effects.

name_lengths = map(len, ["Mary", "Isla", "Sam"])

print name_lengths
# => [4, 4, 3]

The first section of the article takes short, data transforming loops and translates them into functional maps and reduces.

The second section takes longer loops, breaks them up into units and makes each unit functional.

The third section takes a loop that is a long series of successive data transformations and decomposes it into a functional pipeline. Nicely written!

[Read More]

Structurae: Data structures for high performance JavaScript

Categories

Tags web-development programming javascript performance

Maga D. Zandaqo published an article about high performant data structures in JavaScript. After author’s last attempt to speed up a Node.js server by replacing some JavaScript with a native addon yielded less than exciting results, he has decided to collect and share some common structures he uses to optimize my JavaScript code: structurae.

The techniques aim at performance–sensitive applications such as games or real–time data processing. They are hardly applicable to most of our Todo apps and might do more harm than good if used indiscreetly.

We can help JavasScript engines by addressing the “weak points” of JavaScript when it comes to performance: dynamic typing and garbage collection.

Recommendations summarized:

  • Simplify and normalize data structures
  • Be consistent with the “shapes” of objects
  • Avoid creating garbage

Read more how structurae is focusing on the first item by providing a set of classes that aid in representing and operating on complex data structures using simple numbers and ArrayBuffers. Where possible, prefer simple types over objects, numbers over strings, small integers over other numbers, TypedArrays over Arrays, and dense Arrays over sparse Arrays. What a good read!

[Read More]