teleren/devto huggingface dataset:
How to Create a Docker Asset Image for Your Sitecore Module: A Detailed Tutorial
Tags: docker, sitecore, containers
Published: 2023-07-10 11:55:55

Embarking on a journey with Docker and Sitecore can be an exciting venture, especially given the fascinating complexity and efficiency of Docker images. If you're intrigued by questions such as 'How are Docker images constructed?' or 'How can I integrate custom or hotfix packages into Sitecore?', then you're in the right place. This guide will help you leverage the power of Docker's containerization capabilities, focusing on creating a customized Docker image for your Sitecore module.

## Understanding the Docker and Sitecore Environment
Contrary to the process on a traditional on-premises Sitecore setup, installing packages in a Sitecore Docker environment requires a unique approach. The key distinction stems from the inherent design of Docker itself. Docker images are crafted to be unchangeable, and instances are created with disposability in mind.


## The Challenge with Docker Packages Installation
Sitecore has put stringent restrictions on runtime application access. For instance, the 'bin' folder (and potentially other folders) has been designated as read-only for the runtime user. This fundamental characteristic of Docker containers within Sitecore underscores the importance of adopting a tailored approach for package installation.


## The Solution: Creating a Customized Image for Your Package
Wondering how to install packages for Docker or Kubernetes? The simple answer is to create a customized image for your package. In this blog, we will learn how to do it. I'll be using one of my custom packages for containerizing it.

[Read more](https://www.sitecoreknowledgebase.com/post/create-docker-images-sitecore-modules-guide)
02 - Process and Memory Architecture
Tags: tutorial, programming, beginners, apacheag
Published: 2023-07-10 11:55:26

This chapter delves into the PostgreSQL process and memory architecture, illuminating the complex workings of this potent relational database management system. It's essential to comprehend the architecture of the underlying processes if you want to manage database clusters and optimize performance. 

## Process Architecture

PostgreSQL has a multi-process architecture and a client/server operating system, running on a single host. The PostgreSQL server is made up of various sorts of processes that collaborate to effectively administer a database cluster. Let's examine these procedures in more detail:

![process-image](https://res.cloudinary.com/practicaldev/image/fetch/s--pQU5WBi7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/27apxsy1dmg2s1huslwb.png)

## Memory Architecture

Local memory and shared memory are the two fundamental components of PostgreSQL's memory architecture. These regions have specific functions and are essential to the effective running of the database system.

![Image-memory](https://res.cloudinary.com/practicaldev/image/fetch/s--2SyieCH0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lgwj6ta0tculvvjo5snb.png)

## Closing Remarks

It's crucial to comprehend PostgreSQL's process and memory architecture if you want to manage database clusters, optimize performance, and make sure your PostgreSQL-powered applications run without a hitch. You may understand how queries are handled and resources are managed by understanding the functions and interactions of the postgres server process, backend processes, and background processes. Additionally, being familiar with the memory architecture enables you to adjust memory settings, enhancing the efficiency of query execution and system performance as a whole.
Raku Blog Posts 2023.28
Tags: programming, rakulang, summary
Published: 2023-07-10 11:51:28

- [Type And Object Composition](https://vrurg.github.io/arfb-publication/09-type-and-object-composition/)

*Vadim Belman* dives deep into the way types and objects are implemented in Rakudo using the Metamodel Object Protocol.  In the series "Advanced Raku for Beginners".

- [Graph representation of grammars](https://rakuforprediction.wordpress.com/2023/07/06/graph-representation-of-grammars/)

*Anton Antonov* shows a way to represent Raku grammars as graphs using Mermaid-JS and Wolfram Language.

- [Raku NativeCall Notes](https://khalidelborai.github.io/posts/raku-nativecall)

*Khalid Elborai* elaborates on their experiences integrating the [SOD](https://sod.pixlab.io) library into a Raku module.

- [Rakudo Weekly News 2023.28](https://rakudoweekly.blog/2023/07/10/2023-28-composition/)

*Elizabeth Mattijsen* reports on all recent developments around Rakudo, an implementation of the [Raku Programming Language](https://raku.org).
Navigating Strong Consistency and Weak Concurrency in PostgreSQL
Published: 2023-07-10 11:48:53




## Introduction:
In the realm of databases, finding the delicate equilibrium between strong consistency and efficient concurrency is a technical art form. In this blog post, we embark on a exploration of strong consistency and weak concurrency within the PostgreSQL ecosystem. We delve into the intricacies of these concepts, uncovering their impact on data integrity, performance, and application requirements. 

## Understanding Strong Consistency:
Strong consistency is a fundamental property in PostgreSQL, ensuring that every read operation receives the latest committed value. Under the ACID principles, PostgreSQL transactions guarantee atomicity, consistency, isolation, and durability. By adhering to this strict level of consistency, PostgreSQL provides a solid foundation for data accuracy and reliability amidst concurrent operations.

## Exploring Weak Concurrency:
While strong consistency is desirable, it can come at the expense of performance and scalability. Weak concurrency techniques, such as multiversion concurrency control (MVCC), alleviate this challenge. In PostgreSQL, MVCC allows concurrent transactions to operate on separate snapshots of the database, enabling efficient parallelism and reduced contention. This relaxed consistency model enhances scalability while maintaining a reasonable level of data integrity.

## Trade-offs and Considerations:
Achieving the optimal balance between strong consistency and weak concurrency involves weighing various factors. Performance requirements, scalability goals, and application characteristics heavily influence the decision-making process. While strong consistency ensures predictable data state, it may limit concurrency. Conversely, weak concurrency can boost performance but might introduce phenomena like non-repeatable reads or lost updates if not managed appropriately.

## Isolation Levels in PostgreSQL:
PostgreSQL offers a range of isolation levels, each with its own consistency and concurrency trade-offs. From the stringent Serializable level to the more permissive Read Committed level, developers can fine-tune the balance based on their application's needs. Isolation levels dictate the visibility of concurrent transactions' modifications, providing granular control over the consistency-concurrency spectrum.

## Applying the Right Approach:
Designing robust database systems in PostgreSQL necessitates aligning consistency and concurrency with application requirements. Critical systems may prioritize strong consistency to ensure data accuracy and reliability. Meanwhile, high-concurrency environments may favor weaker consistency to maximize throughput. Understanding the nature of the application, workload characteristics, and user expectations is vital in selecting the appropriate approach.

## Conclusion:
Seeing the recent disaster of the Gitlab version control system, it begs for the realization that these design decisions are very important. Somewhere down the line these decisions do make the difference between a smooth running software or a billion-dollar mess up.
How to send email from my Node JS app using my Gmail account?
Tags: gmail, javascript, node
Published: 2023-07-10 11:26:14

**First**, 3 methods exist in 2023:-
1. Using the Less Secure App Option: (it was shutdown themselves by Google recently) _**Not Recommended**_
2. Using App Passwords: In 2023, you can not use nodemailer with simple configuration since Google does not allow doing so and the smalll caveat of App passwords is not recommended either by me. Access it by clicking https://myaccount.google.com/u/2/apppasswords _**Not Recommended**_
3. Using OAuth _**Recommended**_

**Secondly**, I will show the Google-recommended way of sending from you Node JS app an email using your Gmail account.

Step 1. Create a project in Google Cloud console
Step 2. Turn on Gmail API in "APIs and Services"
Step 3. Configure the "OAuth Consent Screen"
Step 4. 

(still writing)
Building a Real-Time Project with LWC OSS and LWR
Tags: salesforce, lwc, javascript
Published: 2023-07-10 11:24:24

---
title: Building a Real-Time Project with LWC OSS and LWR
published: true
description: Take your Lightning Web Component skills to the next level with this comprehensive course.
tags: #salesforce #lwc #javascript
# cover_image: https://direct_url_to_image.jpg
# Use a ratio of 100:42 for best results.
# published_at: 2023-07-10 11:19 +0000
---

## Building a Real-Time Project with LWC OSS and LWR

Are you ready to take your Lightning Web Component skills to the next level? Look no further! Salesforcetroop is thrilled to announce the launch of our brand new course, "Building a Real-Time Project with LWC OSS and LWR." In this comprehensive course, we will dive deep into the world of Lightning Web Components (LWC) and explore how LWC OSS extends their capabilities beyond Salesforce.

## Unleash the Power of LWC OSS

LWC OSS opens up a world of possibilities for developers by enabling them to create standalone web applications and integrate with other platforms. With this course, you'll discover how to leverage the full potential of LWC OSS and build real-time projects that will impress both your clients and peers.

## What You'll Learn

Our course is designed to provide you with a hands-on learning experience, equipping you with the knowledge and skills necessary to build powerful web applications. Here are some key topics we'll cover:

1. Introduction to LWC OSS and its benefits
2. Setting up your development environment
3. Building reusable Lightning Web Components
4. Integrating LWC OSS with salesforce lead form
5. Implementing real-time functionality with Lightning Web Runtime (LWR)
6. Deploying and hosting your LWC OSS application

## Exclusive Discount for Early Birds

To celebrate the launch of our course, we're offering an exclusive discount for the first 5 days! Use coupon code "LWCOSS" during checkout to unlock this limited-time offer. Don't miss out on this opportunity to enhance your web development skills and stay ahead of the curve.

Enroll now: [Building a Real-Time Project with LWC OSS and LWR](https://www.udemy.com/course/building-a-real-time-project-with-lwc-oss-and-lwr/?couponCode=LWCOSS)

## Join Us on this Learning Journey

We understand the importance of continuous learning and staying updated with the latest technologies. By joining our course, you'll be part of a supportive community of like-minded developers, all eager to grow their expertise in Lightning Web Components.

Hurry! The discount is only available for a limited time. Don't miss your chance to boost your skills and unlock exciting opportunities in web development. Enroll now and embark on this exciting learning journey with Salesforcetroop.

Let's build real-time projects with LWC OSS and take your web development skills to new heights! 💪
How to Set HTTP Error Responses in MUnit Testing
Tags: mulesoft, anypoint
Published: 2023-07-10 11:18:08

The development of efficient and robust MuleSoft applications requires comprehensive unit testing, and MUnit is an invaluable tool for this purpose. In this blog post, we'll delve into some tips for handling error status returned from the 'HTTP Request' backend during unit testing.

When we have logic that branches based on the contents of the response, the unit testing approach becomes a bit more intricate. The response body of the error status returned from the backend is stored in 'error.errorMessage.payload'. In typical situations, you might want to directly assign a value to this field using 'Mock when'. However, 'Mock when' doesn't allow you to set a value to 'error.errorMessage.payload'.


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


So, how do we work around this limitation? Here comes the 'Then Call' to the rescue. In the subflow called by 'Then Call', you can use the 'Set Event' to establish an exception. This way, you're able to mimic the desired behavior by setting the 'error.errorMessage.payload' as part of the flow.

The type of exception you're looking to set here should be an instance of the 'ResponseValidatorTypedException' class from Java. It accurately represents the sort of exception that would occur in a live environment when an error status is returned from the backend.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/krio96aq5hq46dki85yb.png)
```
%dw 2.0
output application/java

var detailMessage = 'Internal server error'
var errorType = java!org::mule::extension::http::api::error::HttpError::INTERNAL_SERVER_ERROR
---
java!org::mule::extension::http::api::request::validator::ResponseValidatorTypedException::new(detailMessage, errorType, message)

```


By leveraging this technique, you can achieve a more accurate and efficient unit testing process for your MuleSoft applications. It allows you to replicate the behavior of the 'HTTP Request' backend error status more accurately in your tests, ensuring that your code is capable of handling such scenarios in real-world operations.

Remember, comprehensive unit testing is a crucial aspect of creating reliable and robust MuleSoft applications. Therefore, understanding how to handle and mimic different error statuses during testing can significantly enhance your application's quality and reliability.

In conclusion, unit testing with MUnit in MuleSoft Applications might appear challenging, but with the right approach and understanding, it can be manageable and effective. Hopefully, this post has offered you some useful insights into this topic. Happy testing!
Build a product with defensive mechanism.
Tags: softwareengineering, databreach, cybersecurity, programming
Published: 2023-07-10 11:04:43

Over 5 crore Bangladeshi citizens' personal data 'exposed' online which is actually a big concern for country. Citizens' personal information, including their full names, phone numbers, email addresses and National Identification (NID) numbers, has been exposed from a Bangladesh government website according to local news paper 
[The Business Standard](https://www.tbsnews.net/bangladesh/millions-bangladeshi-citizens-data-exposed-online-661958).

It's sad to see that our personal data has been exposed online. That's why we should not only focus on development rather focus on everything that is a part of a software. We should follow best practices during software development, Code review, proper testing of software, network level security, protection from any malware attack, vulnerability check, Database protection, user roles, user activity track, API Security and so on. There are some companies prove vulnerability check and security related services in this regard.

We need to understand that the cost of a data breach is fatal than not giving extra time to perform these actions during software development. A great product requires periodically maintaining and upgrading the system after a software release. Let's build a product with a defensive mechanism.

----------------------------------------

Thank you for reading my article. You can join [code with rubab](https://www.facebook.com/groups/codewithrubab) for web development-related queries & discussions.

Also, you can find me on:

[Linkedin For Regular Posts](https://www.linkedin.com/in/imran-hossain-rubab/)

[My website](https://codewithrubab.com/)

[My Facebook Page](https://www.facebook.com/codewithrubab)

[My Youtube Channel](https://www.youtube.com/@codeWithRubab)
Django Dev Journey
Tags: python, django, webdev
Published: 2023-07-10 10:46:48


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/59wr5ezkm7z58ogm5bop.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6yv9kh4udjifcld74q1m.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7034d5pojez1cnsr2nlg.jpg)

Hello there, I'm Jawdat(pronounced: JHao-Da-T), a self-taught backend programmer. 
I have been into programming for the last three years but rarely committed seriously until the start of this very year. 
For the last three years, I have made 5 Games using Godot Engine and posted all of them on my itch.io Page (https://lnkd.in/dB98ktmb).
I have also worked for a friend of mine on the server side of a tourism service application using Java and Firebase - although I was new to both of them back then - but we, unfortunately, dropped the project before it was complete. Anyways, I'm not here to talk about my past experiences and what I have created, But I wanted to give you all a brief intro before I dive right into my main topic. 
I just finished reading "Django for Beginners: Build Websites with Python and Django" by William S. Vincent. I have to say that it's such a brilliant book that expresses many complicated things in the simplest of ways. I would recommend this book to anyone that is just starting with Django and wants to figure out how the majority of the fundamental things in Django framework work.
I want to make it clear that:
1- I'm not paid to promote this book. 
2- I'm just speaking my mind on it.

After I understood the projects that the book uses to explain many functionalities, I decided to start working on my own first project.
Today I started planning my models and the work flow of my web app 
and I will be posting weekly about the progress of developing my firts complete -decent sized - web app. 
The thought of posting daily here is like a motivation for me to keep going and never drop the project. 
I'm planning to land my first Job as soon as possible since I'm starting college this fall semester. I read many articles that the LinkedIn Dev community is wholesome and supporting more than any other platform.
I thought that people who are more experienced than me can provide some valuable advice after reading my posts and I can keep earning and sharing knowledge through these series of posts.
Tasks that I finished today:
- Designed the user model for the app
The book that I mentioned above : 
- https://lnkd.in/dV-gjExN
My Github:
- https://lnkd.in/dpY__47J

#python #work #job #linkedin #community #people #programming #motivation #planning #java #projects #github #project #tourism
Simple way to make i18n support with FastAPI
Tags: fastapi, python, tutorial, webdev
Published: 2023-07-10 10:37:20

When dealing with i18n, the most common way is to add middleware to detect the specific locale in the input request. Fortunately, FastAPI supports middleware, making it pretty simple to do.

* i18n_middleware.py
```py
from starlette.middleware.base import BaseHTTPMiddleware, RequestResponseEndpoint
from starlette.requests import Request


class I18nMiddleware(BaseHTTPMiddleware):
    WHITE_LIST = ['en', 'ja', 'zh-TW']

    async def dispatch(  # type: ignore
            self, request: Request, call_next: RequestResponseEndpoint):
        # 1. headers 2. path 3. query string
        locale = request.headers.get('locale', None) or \
                 request.path_params.get('locale', None) or \
                 request.query_params.get('locale', None) or \
                 'zh-TW'
          
        if locale not in self.WHITE_LIST:
            locale = 'zh-TW'
        request.state.locale = locale

        return await call_next(request)
```

You can add the middleware to your application in main.py:

* main.py
```py
app = FastAPI()
app.add_middleware(I18nMiddleware)
```

Then you can use it in your router:

```py
@router.get('/my-resource')
def get_my_resource(request: Request): 
    print(request.state.locale)
```

However, there is no global helper like **Laravel**'s `__` or **RoR**'s `I18n.t`, so we need to create our own.

The idea is pretty simple: put translation scripts in Python and write your own importer using `importlib`. Here's how you can do it:
1. Write your translation scripts
```py
locale = {
  'greeting': 'Hi, {user_name}',
  'title': 'hello world',
}
```

2. Put your translation scripts in the following structure
```
app/lang
├── en
│   └── messages.py
├── ja
│   └── messages.py
└── zh-TW
    └── messages.py
```

3. Write a class to handle translation
```py
import importlib
from typing import Any, Dict


class Translator:
    _instances: Dict[str, 'Translator'] = {}

    def __new__(cls, lang: str) -> 'Translator':
        if lang not in cls._instances:
            cls._instances[lang] = super(Translator, cls).__new__(cls)
        return cls._instances[lang]

    def __init__(self, lang: str):
        self.lang = lang

    def t(self, key: str, **kwargs: Dict[str, Any]) -> str:
        file_key, *translation_keys = key.split('.')

        locale_module = importlib.import_module(f'app.lang.{self.lang}.{file_key}')

        translation = locale_module.locale
        for translation_key in translation_keys:
            translation = translation.get(translation_key, None)
            if translation is None:
                return f'Key {key} not found in {self.lang} locale'
        if kwargs.keys():
            translation = translation.format(**kwargs)
        return translation

```

Then you can use it in your router
```py
@router.get('/my-resource')
def get_my_resource(request: Request): 
    translator = Translator(request.state.locale)
    # 'hello world'
    print(translator.t('messages.title'))
    # 'Hi, Jon Doe'
    print(translator.t('messages.greeting'), user_name='Jon Doe')
```

That is, pretty easy.