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 ]

Object Oriented Programming in Python

Categories

Tags oop python programming

You can see Object Oriented Programming (OOP) somewhat as a more advanced topic in Python where Python does implement it pretty well. Even though, Python does not require an OOP approach for making complex programs, it sometimes makes life easier while sometimes it doesn’t. Published on Dave’s RoboShack.

While Python scripts work pretty well without any implementation of Object Oriented Programming, it allows you to keep your code even more structured in form of Classes, Attributes and Methods.

In simple terms, a Class is a group of related variables and functions, all bound to a so called Object. Except, in the scope of OOP, you call the variables Attributes and the functions are called Methods. These objects are meant to behave similar to real-world objects with individual properties and things that can be done with them. The syntax of creating a class is fairly easy:

The article then describes and provides code examples for:

  • Classes
  • Attributes
  • Methods

By convention, class names are written with the first letter as a capital letter, the remaining lowercase. If the class name is a compound word such as “Car Battery”, you would write each word starting with a capital letter: CarBattery. To learn more follow the link to the full article. Nice one!

[Read More]

How to use Azure Durable Entities to see who's the strongest Avenger

Categories

Tags serverless cloud azure machine-learning

In the movies, Thor keeps saying that he “is the strongest Avenger”. Some people say that it’s actually Hulk, but I guess it’s a matter of perspective. How can we find a solution to this riddle? By using Azure Durable Entities of course! By Davide Guida.

Azure Durable Functions have been a very nice addition to the Azure ecosystem. They basically let you write stateful functions and run them serverless. There’s as usual a whole plethora of patterns you can apply with them, like Function Chaining.

Durable Functions currently come in four different types: Activity, Orchestrator, Entity, and Client. Author has done a bit of work with all of them and this tutorial he is going to talk a bit about Entity Functions.

It is also very important to note that Entity Functions focus on reliability more than performance, by using reliable queues to handle messaging.

Entity Functions are basically another form of the Actor Model and share a lot of similarities with Project Orleans, although with some interesting differences.

To showcase how they work, author prepared a super-duper example, WhoIsTheStrongest 😀 It’s a distribute voting platform, aimed to decide who’s the strongest Avenger! The code is available on GitHub, feel free to wander around. The UI is written in Blazor. Nice read!

[Read More]

Developing on Windows with WSL2

Categories

Tags how-to linux software programming

Since a new build of Windows with WSL2 (Windows Subsystem for Linux) just got out, author took the chances and tried out a whole new developer experience: Doing web development in Windows! And by web development author means fullstack. By Sebastian Deutsch.

The article deals with:

  • Meet the Windows Subsystem for Linux (WSL)
  • Getting WSL2 up & running
  • Installing Rails & Friends
  • Tools that make me happy

We liked the list of tools which will improve developer’s productivity including: Hain (quick launcher for windows), Fast Node Manager (fnm), conda – Package, dependency and environment management for any language—Python, R, Ruby, Lua, Scala, Java, JavaScript, C/ C++, FORTRAN. Would the author switch to Windows/WSL2 for development? Follow the link to full article to get answer. Great read!

[Read More]

Handling slow queries in MongoDB: Investigation

Categories

Tags nosql miscellaneous performance devops software-architecture

Article by Justin Liu about one of the most essential factors of performance in any application – latency. Faster application response times have been proven to increase user interaction and engagement as systems appear more natural and fluid with lower latencies.

In this blog, we’ll explore a few key ways to understand and address slow queries in MongoDB. We’ll also take a look at some strategies on how to mitigate issues like these from arising in the future.

The MongoDB Database Profiler is a built-in profiler which collects detailed information (including all CRUD operations and configuration changes) about what operations the database took while executing each your queries and why it chose them. It then stores all of this information inside a capped system collection in the admin database which you can query at anytime.

The article then describes in some detail:

  • Identifying Slow Queries using the Database Profiler
  • Configuring the Database Profiler
  • Analyzing Performance Using the Database Profiler
  • Breaking Down & Understanding Slow Queries
  • Understanding and Evaluating Query Execution Plans

Often times, the only way to tackle bottlenecks is by helping “hint” the database into selecting a better query execution strategy or covering index by rewriting your queries (e.g. using derived tables instead of subqueries or replacing costly window functions). Great read!

[Read More]

Working with an internet connection on iOS with Swift: Best practices

Categories

Tags swiftlang web-development app-development how-to

Networking is an integral part of most iOS applications. A common network-related task is Internet connectivity detection. Written by Vadim Bulavin.

The most popular answers on how to detect network connectivity status on iOS suggest using SCNetworkReachability. In this article, let’s discuss why this solution is less than optimal, and lay out best practices of working with the Internet connection recommended by Apple. Apple says that we should not check Internet connection before firing an HTTP request.

The article’s content is split into this parts:

  • Checking connectivity before firing an HTTP request
  • Disabling or enabling app features based on network connectivity status
  • Attaching constraints to network operations, e.g., disabling large file download via cellular

We liked: Do not enable or disable app features based on an Internet connection. Instead, indicate connectivity status on UI, and diagnose network errors. Great read!

[Read More]

Generating TypeScript types and React Hooks based on GraphQL endpoint

Categories

Tags react web-development javascript app-development

Autogenerate Typescript types and custom React hooks in React applications with GraphQL Code Generator. Danilo Woznica.

Developing ReactJS with TypeScript, it still requires a considerable effort to write types and keep them maintainable. Moreover, when the data provider is a GraphQL server, it makes you feel like you’re doing a useless job, given the server already has its own schemas for types. Seems redundant, right?

GraphQL Code Generator gives us the ability to generate TypesScript typing out of GraphQL schemas. Beyond that, it gives us a couple of plugins to create custom React hooks that don’t require any kind of maintenance or workaround to fit into your application.

Among many others, some of the benefits of using this tool:

  • Codeless: forget about creating the interfaces/types for every GraphQL endpoints; save time and spend effort on what matters
  • Development experience: as a result of having the types always available, your editor will provide meaningful autocomplete and error checking
  • Types always up-to-date: if your GraphQL endpoint schemas change, your application will be updated and typescript will help you make sure you make the necessary changes

For learning more follow the link to the full article. You will also get code explanation and link to the code repository. Nice one!

[Read More]

What GoogleBot is doing to shopping carts... and why

Categories

Tags search web-development miscellaneous servers google

GoogleBot can add products to shopping carts. But it’s only happening to these specific merchants. By Roger Montti.

Contrary to common impressions about this topic, Google isn’t crawling and adding products to random shopping carts. What’s really going on is that merchants who participate in Google Shopping (or Google’s back-end for sellers the Merchant Center and Shopping ads) agree to have their sites crawled, including their shopping cart.

Examples of issues Google is checking for are:

  • Failure to clearly and conspicuously disclose the payment model and full expense that a user will bear before and after purchase
  • Failure to clearly and conspicuously disclose all related conditions before and after purchase
  • Promising products or promotional offers that aren’t available for users
  • Making false statements about your identity, qualifications, or the promoted product (such as falsely claiming to be a certified reseller or using a brand name to promote another product)
  • Using false claims or claims that entice the user with an improbable result (even if this result is possible) as the likely outcome that a user can expect
  • Falsely implying affiliation with, or endorsement by, another individual, organization, product, or service

Very insightful for anybody working in e-commerce. Recommended read!

[Read More]

Symfony messenger with SQS and SNS aws-services

Categories

Tags queues php distributed miscellaneous performance streaming

Let’ checkout how to connect Symfony with Amazon SQS and SNS Services by using a Symfony component. By Stefan Pöltl.

We are going to use a Command-Bus pattern that separates the description, what needs to be done, from where it’s going to happen. It’s like getting an order in a restaurant that gets prepared in the kitchen. In our case we will create a TestMessage object, that gets send and consumed by a handler.

What is the Symfony Messenger? It’s a Message-Bus that can be used for the following design patterns:

  • Command-Bus
  • Query-Bus
  • Event-Bus

The article then describes in great detail and provides code plus screen shots for:

  • Setup the Symfony project
  • Create a SQS queue in your AWS account
  • How to create the queue
  • Configure the Symfony project
  • Build a command to send data to the SQS queue
  • Debug Messages in SQS
  • Consume Queue Messages and send notifications with SNS

… and much more. The article also explains many concpets, i.e.what is SnsClient, what is SQS, message limitations etc. Good read!

[Read More]

Here's how to use Istio with other Nginx ingress proxies

Categories

Tags kubernetes containers devops performance nginx

It’s been a common problem that we’ve been asked to address, and something that pops up frequently. Can I use Istio with other ingress proxies? In a word? Yes. Written by Tetrate.

A persistent issue for many engineers wanting to adopt Istio has been that they want to make use of the numerous benefits that it can provide, including its ability to solve telemetry issues, security and transport problems, as well as policy concerns all in one place, but redesigning their entire service to fit with their hopes for the mesh, they need aspects of the mesh to fit in with them.

Ingress outside of application namespace

Source: https://www.tetrate.io/blog/using-istio-with-other-ingress-proxies/

The common method has been to run the ingress proxy with an Istio sidecar, which can handle certificates/identity from Citadel and perform mTLS into the mesh.

The article then contains information about how to configure this in three simple ways. You will get all the code required with detailed explanation how to do it. Nice one!

[Read More]

Beyond the Sandbox: Signing and distributing macOS apps outside of the Mac App Store

Categories

Tags swiftlang app-development web-development learning how-to

Since the advent of OS X Mojave and especially Catalina and the requirement for app notarization, some of us old-time macOS developers are concerned that Apple will pull the plug on the apps that we distribute ourselves. Many of you have downloaded and installed macOS software directly from websites, i.e., not from the Mac App Store. Have you ever really considered it? By Andrew Jaffee.

This is the first part in a three-part series of tutorials on sandboxing, signing, notarizing, and and distributing macOS apps outside of the Mac App Store. In this tutorial, we’ll build a non-sandboxed app, talk about certificates, sign the app, notarize it, briefly talk about building an installer, sign and notarize the installer, and finally cover distribution. In the second tutorial in this series, we’ll turn the sandboxing capability and entitlement on in my sample app and explore ways that users can still gain access to files and folders outside of the app’s container.

The article is split into:

  • A series of tutorials
  • Advantages of staying out of the Mac App Store
  • What is Gatekeeper and notarization?
  • My sample code
  • App signing and notarization
  • Creating an installer to distribute the app

… and more. This one rich source of informationo for anybody interested in mobile application development. Great resource!

[Read More]