teleren/devto huggingface dataset:
The Nuance of Code Style: Emphasizing Return Value Significance in Python
Tags: python, codestyle, programming
Published: 2023-05-31 12:18:34

In the world of programming, code style plays a crucial role in making code readable, maintainable, and understandable for developers. While adhering to established coding conventions is essential, there are often nuanced decisions that arise when it comes to certain aspects of code, such as return statements. In this blog post, we'll explore an interesting code style nuance related to return statements and discuss when it might be better to use the bare return as opposed to explicitly returning a value.

Consider the following code snippet:

```py
def odd_or_none(value: int) -> int | None:
    if value % 2 == 0:
        return None
    return value
```

In this example, the function `odd_or_none` takes an integer value as input and determines if it's odd or even. If the value is even, the function explicitly returns `None`, indicating that the resulting value is meaningful within the context of the program's logic. However, if the value is odd, it returns the value itself.

The rationale behind this approach is to differentiate between scenarios where the return value has no particular meaning versus cases where the return value holds significance for downstream logic.

Using `return None` explicitly in the case of an even value signifies that the resulting None will be used in subsequent code, conveying a specific intention. On the other hand, in methods like `__init__` or any other method that always returns `None` by convention, the bare `return` statement emphasizes the fact that the result is not going to be used.

Upon reflection, following a consistent code style policy can enhance code readability and clarity. One such policy, which can be employed for functions that have a return type of `None`, is as follows:

> For functions that return `None`, use the bare `return` statement. This indicates that the function does not return anything and that the resulting value is of no particular significance.

> For functions that return either `None` or another value (`None | Some`), use an explicit `return None` statement. This signifies that the function's return value will be utilized in subsequent code, conveying its relevance.

By adhering to this policy, the codebase becomes more consistent, enabling developers to easily grasp the intent behind different return statements and their implications.
Top SEO-Friendly Technologies To Build Responsive Websites in 2023
Tags: seo, technology, website
Published: 2023-05-31 12:18:16

Digital marketing is a crucial component of developing an online presence, and SEO offers the company the online push it needs. According to a study, SEO generates over 1000% more traffic than natural social media marketing. Online business marketing now heavily relies on SEO (search engine optimization). By ranking in search engines and increasing online presence, it aids businesses in reaching thousands of customers.

**What is a responsive website?**

A responsive website design is one that adjusts to different screen sizes and devices. It gives your visitors the best possible experience on your website, from browsing to making purchases. The screen of the user's device, such as a desktop computer, laptop, tablet, or smartphone, will be automatically adjusted by your website if it is responsive.

**From Hidden Gem to Top of the Search Results: Here are popular SEO techniques to help you create responsive websites**

To succeed in the market, you must keep up with the most recent SEO trends. Professionals that stay up with the most recent trends and strategies, such as site designers or SEO managers, can help your firm remain effective.

1. HTML and CSS
2. Web development frameworks
3. Media Queries
4. Responsive Images
5. Don’t Get Lost in the Crowd: Use The Above SEO Technologies To Make Your Website Responsive

Your website must be responsive if you want to succeed as a business in the modern digital era. Your website serves as your online identity and leaves a lasting impression on visitors. In addition, many users don't specifically try to open websites from their PCs. They use mobile devices to conduct keyword searches and contact brands in order to use their services and goods. To succeed in the market, you must keep up with the most recent SEO trends. Professionals that stay up with the most recent trends and practices, such as web designers or SEO managers, can help your organization remain effective.

As a result, you should make sure that your website is compatible with all types of screens, including iPads and Android phones. Your website becomes responsive by utilizing the finest [SEO technologies](https://thedigitaltechnology.com/seo-technologies-responsive-websites/), such as image optimization, HTML and CSS optimization, establishing simple navigation, HTTPS usage, and more.
How to Install Magento 2 on Nginx Server
Tags: magento, magento2, magento2tutorial
Published: 2023-05-31 12:18:06

If you're in need of a detailed guide on **_How to Install Magento 2 on Nginx Server_**, you've come to the right place. Despite the initial daunting appearance of the process, it can be achieved by following the correct steps. This blog post will provide you with a comprehensive, step-by-step tutorial for installing Magento 2 on an Nginx server. We will cover everything from downloading Magento 2 to setting up a database and configuring Nginx to handle Magento 2 URLs. By the end of this tutorial, your Nginx server will have a fully functional Magento 2 installation running smoothly.

When creating instructional content, it is vital to prioritize writing that is both contextually relevant and coherent. Equally important are two factors known as "perplexity" and "burstiness." Perplexity refers to the level of complexity in the text, which can make it more challenging to understand. On the other hand, burstiness involves a mix of shorter and longer, complex sentences, adding an engaging aspect for the reader.

For more information , please visit this :- **_[https://webguru.dev/step-by-step-guide-on-how-to-install-magento-2-on-nginx-server/](https://webguru.dev/step-by-step-guide-on-how-to-install-magento-2-on-nginx-server/)_**
How to build a scalable high-load AdTech application without spending a fortune on infrastructure
Published: 2023-05-31 12:08:40

Imagine setting up a test project with a billing budget of $7, a free database plan on the Google Cloud Platform and spending $72,000 overnight. A startup founder received a massive bill due to a mistake in configuring the Firestore NoSQL database deployment: The database made 116 billion reads and 33 million writes to Firestore. The project team was on the edge of bankruptcy without even going live with their MVP.

Luckily, after reviewing the incident, Google didn’t charge the startup for the services. But happy endings such as this are exceptions. Wrong tech stack or architecture choices lead to unbearably high costs of technology that can even burn the business to the ground.

In this article, we’ll talk about:

- 
Common mistakes teams make when selecting tech stack and an architectural approach for data-intensive AdTech applications
How to avoid them and design a scalable and cost-effective system

- 
To better understand how a suboptimal tech stack and a system architecture lead to scalability limitations and a high infrastructure bill, we’ll explore how Xenoss redeveloped a client’s product to lower operational costs.

Short videos from the joint webinar with Xenoss CTO Vova Kyrychenko and Aerospike’s Global Director of AdTech and Gaming Daniel Landsman will give more context to our discussion.

Vladyslav Kushka, Delivery Manager at Xenoss, also joined the conversation. Relying on his two-decade experience in software engineering and technical management, Vlad shared tips on selecting an appropriate tech stack for data-intensive AdTech solutions, particularly a codebase and a database. So let’s begin.

Read the full article [here](https://xenoss.io/blog/infrastructure-optimization).
mongoose v7 pre hook error
Tags: mongoose, javascript
Published: 2023-05-31 12:03:09

i am using Mongoose v7.x in my nestJS projec, i want to use pre hook with where condition like this:

```
const schema = JsonSchemaSchema;
      //Pre middleware will apply on any Query middleware that start with find or update or delete)
      schema.pre(new RegExp('(find|update|delete)'), function () {
        this.where({
          ...buildNotDeletedCondition(),
          ...authorizationService.buildEntitiesAuthCondition(),
        });
      });
```

but i am geeting the following error:
` Property 'where' does not exist on type '(Document<unknown, {}, FlatRecord<JsonSchema>> & Omit<FlatRecord<JsonSchema> & Required<{ _id: ObjectId; }>, never>) | Query<...>'. Did you mean '$where'?
  Property 'where' does not exist on type 'Document<unknown, {}, FlatRecord<JsonSchema>> & Omit<FlatRecord<JsonSchema> & Required<{ _id: ObjectId; }>, never>'.

12         this.where({
                ~~~~~

`

my code work fine in mongoose v6. anyone know how i could solve this?
I made CSS Pro - A re-imagined Devtools for web design
Tags: showdev, css, webdev
Published: 2023-05-31 12:01:28

---
title: I made CSS Pro - A re-imagined Devtools for web design
published: true
description: With CSS Pro you can easily make changes to any website's design and try your ideas in seconds with a visual editor that generates code for you. Say goodbye to coding and hello to speed, joy, and stunning designs in just a few clicks.
cover_image: https://csspro.com/og-image.jpg
tags: showdev, css, webdev
---

👋 Hi everyone! :)

Imagine if you could make **quick changes** to any website’s design **without writing CSS code**.

You change things to your taste with **a few clicks**, and a tool generates a CSS code for you that’s ready-to-use.

You copy the code and use it, or you share it with your team (via URL) to show the changes that need to be made.

Beautiful, right?

It's the browser's "Devtools" **re-imagined for web design**.

[![Video showing how CSS Pro's Visual Editor works](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/12ov7gyijtn1t73ags3v.gif)](https://csspro.com)

This is [CSS Pro](https://csspro.com).

Best thing about it? **It's a browser extension**.

It's **not** a framework, a library, a plug-in, a CMS, etc.﻿ It's a browser extension.

No plugin, code change, or dashboard is required. It works like a charm.

It **runs wherever** and **whenever** you want to.

Well, **you can even edit websites that are not yours**! Edit any website, anytime.

It's like having Wordpress-like theme builders, **but for the whole internet**.

It works offline, and it works on any kind of website: WordPress, Shopify, React, Wix, all themes, anything.

﻿﻿﻿﻿**It's the new way to work with CSS**.

Goodbye to clunky Devtools. Hello to speed, joy, and stunning designs in just a few clicks.

﻿﻿﻿﻿**Experiment** with CSS in a **visual way** and **test your ideas in seconds**, without even writing code.

🎁 **[Try the free demo on our website!](https://csspro.com)**


{% youtube jKvOfrqtILY %}

🙏 I worked hard on this one so I’m excited to share with you and genuinely interested in hearing what you think about it.

💌 Thanks to everyone that already bought it and supported my work!
If you have any ideas or suggestions, I'm all ears.
Sitecore Architect’s Guide to SaaS Migration – Classic XP with Simple Personalization
Tags: architecture, sitecore, dxp
Published: 2023-06-05 13:45:23

---
title: Sitecore Architect’s Guide to SaaS Migration – Classic XP with Simple Personalization
published: true
date: 2023-05-31 11:55:00 UTC
tags: architecture,Sitecore,dxp
canonical_url: https://jasonstcyr.com/2023/05/31/sitecore-architects-guide-to-saas-migration-classic-xp-with-simple-personalization/
cover_image: https://theagilecoder.files.wordpress.com/2022/05/pexels-photo-691637.jpeg
---

In this part of the [migration series](https://jasonstcyr.com/tag/sitecore-guide-to-saas-migration/), I am going to look at migrating an existing Sitecore Experience Platform (XP) solution that has been built as a classic Sitecore MVC implementation with simple personalization implemented. 

**The scenario breakdown:** 
* Single MVC site built on Sitecore XP 8.2
* Basic session-based personalization in use, primarily using Geo IP to determine user location and campaign IDs in the URL
* No SXA or Sitecore JSS in use
* No custom site search, using third party search engine for site search
* Development team is all .NET developers, no desire to move to a JavaScript framework

Follow the series to look at different Sitecore XM and XP scenarios and how you can gradually migrate your Sitecore platform solution over to a [composable DXP architecture](https://developers.sitecore.com/learn/getting-started/introduction-to-composable-dxp).

The goal is to walk through the example migration and highlight for you:

* What challenges will you face along the way?
* What options are available and when do they make sense?
* What are the benefits of making certain changes to your architecture?

Every project is a little different, so hopefully this series can help you understand some of the questions to ask, and what options you have, to guide you in the right direction.

[Continue reading "Sitecore Architect’s Guide to SaaS Migration – Classic XP with Simple Personalization"](https://jasonstcyr.com/2023/05/31/sitecore-architects-guide-to-saas-migration-classic-xp-with-simple-personalization/)
Wednesday Links - Edition 2023-05-31
Tags: java, jvm, http, tooling
Published: 2023-05-31 11:51:25

Proposed Ergonomics Profiles (2 min)🦌  
https://mail.openjdk.org/pipermail/hotspot-dev/2023-May/074325.html

Tools that can speed up your programming work (6 min)⚒️  
https://blog.softwaremill.com/tools-that-can-speed-up-your-programming-work-91822076ba48

Health Check Response Format for HTTP APIs (2 min)❤️  
https://blog.frankel.ch/healthcheck-http-apis/

Cancelling HTTP requests on the JVM (8 min)❌   
https://blog.softwaremill.com/cancelling-http-requests-on-the-jvm-871033450ee

New playground: memory spy (3 min)🕵️  
https://jvns.ca/blog/2023/05/25/new-playground--memory-spy/
Observability in Kong API Gateway
Tags: monitoring, kong, apigateway
Published: 2023-05-31 11:03:30

This article explains some points about monitoring and observability of the Kong API Gateway system through the three pillars of observability: metrics, trace, and logs.

## Metrics

Kong has the Prometheus plugin, which exports service metrics through the endpoint http://endpoint-kong:8001/metrics. These metrics provide insight into the performance of the service.

To configure metric collection: https://docs.konghq.com/hub/kong-inc/prometheus/


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y2c1xhsfo0fo60bkkecn.png)

## Trace

Kong has the OpenTelemetry plugin, which sends trace and spans generated by the service to an HTTP or gRPC endpoint of the OpenTelemetry collector. The OpenTelemetry collector receives this data, processes it, and sends it to the vendor for observability.

It is necessary to declare the environment variable KONG_OPENTELEMETRY_TRACING: all, to enable OTEL tracing on Kong, another imported variable is KONG_OPENTELEMETRY_TRACING_SAMPLING_RATE: 1.0, which defines the proportion of traces sample collected and sent to the vendor of observability.

To configure trace collection: https://docs.konghq.com/hub/kong-inc/opentelemetry/


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6k3o33w5tzp0xc1e9ine.jpg)

## Logs

Kong offers many plugins for collecting, processing, and sending logs. I can recommend using a Fluentbit sidecar for collecting these logs and send to an observability provider.

It is possible to use the NGINX HTTP logs module to help us define which attributes will be added to the logs.

Module ngx_http_log_module: http://nginx.org/en/docs/http/ngx_http_log_module.html

To configure logs collection: https://docs.konghq.com/hub/?category=logging

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/deg4gvs2q9b2ei4nfqx3.jpg)
My solution to LeetCodes 1768. Merge Strings Alternately
Tags: javascript, programming, tutorial, beginners
Published: 2023-05-31 11:40:29

In this post I talk about my solution to LeetCodes Easy Problem #1768 Merge Strings Alternately.

In the problems description, we are given two strings **word1** and **word2**. We need to merge the strings by taking each letter and form a new string. If one of strings is longer than the other, we add it to the end of the result string.

**Example 1**
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/di6g04elds4b0k5mmrcc.png)

**Example 2**
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8te7pykqx38goraze7pg.png)

To solve this problem we can use a two pointer. The first pointer will go through word1 and the second pointer will go through word2. If one of the strings is longer than the other, we will append the strings letters at the end of the result string.

**Step By Step Instructions**

- We initialize variables i, and j to have the value 0 to represent word1 and word2 indexes. We create variables m,n to store word1 and word 2 lengths.
- while i is less than m or j is less than n
   - If i is less than m
       - We append the letters from word1 to the result string and we increase i value by 1
   - Similar to the loop above, if j is less than n 
      - We append the letters from word2 to the result string and we increase j value by 1

we return the result string

**Code Solution**
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b0gnwzsljbh2a51r6xkp.png)

If you liked this leetcode post make sure to follow me on here and on Instagram for more.

Instagram: TreNyce.Codes
GitHub: TreNyceCodes
Windows vs Linux
Tags: linux, windows, spanish, learning
Published: 2023-05-31 11:37:04


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ljl7ml6w5mfzcnqlxmew.jpg)
Primero, el contendiente de Redmond, Washington: Windows. El querido niño mimado del mundo de los sistemas operativos, al menos en términos de usuarios de PC de escritorio. Su interfaz de usuario brillante y familiar ha conquistado los corazones (y los escritorios) de mucha gente alrededor del mundo. Su gran ventaja es la compatibilidad y facilidad de uso. Puedes instalar casi cualquier cosa en Windows. ¡Si tiene un microchip y una conexión USB, hay un 99% de probabilidades de que puedas conectarlo a una máquina con Windows! Y luego, está el universo de videojuegos, donde Windows tiene una clara ventaja con su amplia variedad de títulos.

Pero, no te dejes engañar por su apariencia amigable. Windows puede ser un poco exigente a veces. No estamos hablando de diva de Hollywood, pero sin duda necesita un poco más de mantenimiento. Actualizaciones que parecen tomar una eternidad, amenazas de seguridad ocasionales... ya sabes, las típicas cosas de Windows.

Ahora, veamos a nuestro segundo contendiente, [el guerrero silencioso](https://yourgeekweb.com/es/2023/05/31/la-importancia-de-linux-por-que-es-importante/): Linux. Linux es como ese héroe de acción de las películas, rudo por fuera, pero con un corazón de oro por dentro. ¿Por qué? Bueno, para empezar, Linux es de código abierto, lo que significa que cualquiera puede ver, modificar y mejorar su código. ¡Habla de democracia en acción!

Linux es amado por los desarrolladores y los aficionados a la tecnología por su flexibilidad, seguridad y rendimiento. Y no te preocupes si piensas que Linux es solo para nerds de computadoras. Hay muchas distribuciones de Linux (piensa en ellas como "sabores" de Linux) que son tan fáciles de usar como Windows. Ubuntu, por ejemplo, es bastante amigable para el usuario.

Pero claro, Linux no es perfecto. La compatibilidad de software y hardware puede ser un poco más limitada en comparación con Windows. Si bien existen alternativas de código abierto para casi cualquier software que puedas necesitar, es posible que encuentres problemas si necesitas usar un software específico que solo se encuentra en Windows.

En resumen, ¿quién gana en el enfrentamiento Windows vs. Linux? Como en muchos aspectos de la vida, depende de tus necesidades y preferencias. Si valoras la comodidad y la compatibilidad sobre todo lo demás, probablemente te inclines hacia Windows. Pero si valoras la flexibilidad, la seguridad y el espíritu de código abierto, es posible que encuentres un nuevo mejor amigo en Linux.

Así que, querido lector, ¿estás listo para tomar tu decisión en este gran duelo de los sistemas operativos?
Create Chrome Extension Using Vue The Easiest Way
Tags: vue, javascript, webdev, tutorial
Published: 2023-05-31 11:34:27

In this article, Let us look at how easy it is to create a Chrome extension using VueJS. Google Chrome extensions are programs you can install in your Chrome browser to help you automate certain functions in your browser, modify existing behaviors, and improve your software's convenience.

If your interested in reading the full Article Here You Go: https://brojenuel.com/blog/Create-Chrome-Extension-Using-Vue-The-Easiest-Way

Or, do you just want to see a source code, here is a sample source code: https://github.com/BroJenuel/BroJenuelBlogChromeExtension

Cheers! 🍻😁✊
Managing Complexity: The Role of the Engineer
Tags: softwareengineering, productivity, career, architecture
Published: 2023-05-31 11:24:30

Software development dynamic recognizes that the evolution of software is often confined by two key factors: organizational stability and the understanding of the developers working within a system. 

1. What this means is that the growth of a software system cannot outpace the ability of its developers to comprehend its intricacies or the organization's capacity to accommodate this evolution. When either factor lags, it creates a constraint, halting the progress of software evolution. 

2. Hence, software evolution becomes less about pure technological advancements and more about the people fueling those advancements and the environment in which they operate.

3. When it comes to the complexity of software systems, an inherent truth is that they tend to increase over time and becomes an obstacle, hampering the smooth functioning of the software.

4. However, one must recognize that managing this complexity does not necessitate a thorough understanding of the entire organization. Instead, it's about having trust in the system, believing that it's functioning as intended. Rather than attempting to comprehend the organization as a whole, focus should be placed on improving the system iteratively. It's about making incremental adjustments that elevate the system without undermining any of its core characteristics. This approach reduces complexity while ensuring the system remains effective.

> This leads us to the critical role of an engineer in the system. As an engineer, your task is to identify the key characteristics of the system and understand the factors influencing them.

This is essentially mapping the project, creating a comprehensive understanding of how the software system functions. With this map, an engineer can make calculated decisions to navigate the increasing complexity of the system, identifying areas for improvement while ensuring the core functionalities are preserved.

> The best engineers are the ones who have the most accurate map of the project. 

They are the ones who can navigate the complexities of the evolving system while maintaining its critical aspects. They are the ones who can effectively guide the evolution of software within the constraints of organizational stability and the collective understanding of the developers. These engineers are the true drivers of effective software evolution, skillfully balancing growth and complexity in a constant dance of innovation.

Read More:
[Who is Force multiplier software engineer](https://mitrapunk.com/software-engineer-as-a-force-multiplier/)

If you feel that's too complicated you can first try this in [form of game about software development organizations](https://store.steampowered.com/app/2436030?utm_campaign=dev_mc)