teleren/devto huggingface dataset:
ExoCoding is coming soon
Published: 2023-08-30 14:27:19

I invite all #SoftwareDevelopers to be among the first to experience ExoCoding, a code generation online platform that empowers software developers to build better software faster. It uses model-based AI-powered assistants to generate boilerplate code and streamline repetitive tasks. Developers can create apps containing modules with Database Management, Logic Building, and Interface Design.

There are also more features like sharing prototypes, task planning, and a marketplace with pre-built templates that enhance the developer’s experience. After generating code (backend and frontend), everything is business as usual with the same IDE and other dev tools, but with much work already accomplished.

And guess what? You can be a part of this journey right from the beginning. By signing up for launch notifications, you'll score exclusive early access to our beta version. 🚀🔐 Don't miss out on the opportunity to be a [[ExoCoding](https://exocoding.com) pioneer!
Depedency Injection Principle in JavaScript
Tags: designpatterns, javascript, webdev, tutorial
Published: 2023-08-30 14:25:00

[Dependency Injection Principle](https://www.oodesign.com/dependency-inversion-principle) (DI or DIP) is the most important of the SOLID design principles used in software development. It is used in many object oriented languages and we can use it in java JavaScript too, even if Javascript is not a purely object oriented design.

However, Dependency Injection principle is crucial to achieve loose coupling and improve the maintainability, testability, and flexibility of code. 

The main intent of the dependency injection patter is rather than a component creating its own dependencies directly, they are provided with dependencies created from the outside, making components more modular and easier to manage, as they don't need to know the intricate details of how their dependencies are created or obtained.

Let's see a few examples where Dependency Injection Pattern is used:

## Constructor Injection

The database is injected through the constructor:

```javascript
class UserService {
  constructor(database) {
    this.database = database;
  }

  getUser(id) {
    return this.database.query(`SELECT * FROM users WHERE id = ${id}`);
  }
}
```

## Method Injection

```javascript
class UserController {
  getUser(id, userService) {
    return userService.getUser(id);
  }
}

const userService = new UserService();
const userController = new UserController();

const user = userController.getUser(123, userService);

```

## Property Injection

```javascript
class OrderService {
  // No constructor injection, dependencies assigned directly
  productService;

  constructor() {
    // ...
  }

  setProductService(productService) {
    this.productService = productService;
  }

  // ...
}
```

## Using a Dependency Injection Container

A DI container manages the creation and injection of dependencies, centralizing the configuration and management of dependencies. Libraries like InversifyJS, Awilix, and Angular's built-in DI system provide containers.

```javascript
const { Container } = require('inversify');

const container = new Container();
container.bind('userService').to(UserService);

const userService = container.get('userService');
```

You can check more design patterns and design principles posts:
* How I [implemented a factory pattern in JavaScript](https://dev.to/teaganga/implementing-a-simple-factory-pattern-in-javascript-2ac).
* How I enhanced the above factory pattern by [implementing a decorator pattern](https://dev.to/teaganga/adding-a-decorator-pattern-in-javascript-to-existing-code-390o).
Learn C#: Handle Exceptions for More Reliable Code
Tags: learning, programming, coding, tutorial
Published: 2023-08-30 14:11:25


Exception handling is a critical skill for any developer aiming to write robust & reliable code, particularly in scenarios involving HTTP requests. Whether you're working on a .NET based project or any other type of C# application, understanding how to handle exceptions in the context of HTTP requests is essential. In this blog, we'll explore how to use the try-catch block to manage exceptions effectively when making an HTTP request using an example.

In the following example, we use the try-catch block to handle exceptions when making an HTTP request using the `HttpClient` class. The code attempts to send an HTTP GET request to an invalid URL. If the response status code indicates a failure, a `HttpRequestException` is thrown with a descriptive error message. Otherwise, if the response is successful, a success message is printed to the console.

```csharp
try
{
    using (HttpClient httpClient = new HttpClient())
    {
        string invalidUrl = "https://example.com/nonexistent-page";
        HttpResponseMessage response = await httpClient.GetAsync(invalidUrl);

        if (!response.IsSuccessStatusCode)
        {
            throw new HttpRequestException($"Failed to fetch data.\nStatus code: {response.StatusCode}");
        }
        else
        {
            Console.WriteLine("Request was successful!");
        }
    }
}
catch (HttpRequestException ex)
{
    Console.WriteLine($"Caught an HttpRequestException: {ex.Message}");
}
catch (Exception ex)
{
    Console.WriteLine($"Caught an unexpected exception: {ex.Message}");
}
```

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

I encourage you to replace the `invalidUrl` with a valid URL to witness a successful request. This will help you observe how the try-catch block manages exceptions & how the code behaves when dealing with different HTTP responses.

If you're looking to enhance your understanding of C# for other similar programming concepts, I invite you to explore my 'Learn C#' GitHub repository at: https://github.com/snrelghgub/LearnCSharp.
Best practices to become a job-ready developer in 2023
Tags: career, webdev, softwaredevelopment, coding
Published: 2023-08-30 14:06:40


**Introduction**:
Picking a skill to learn is quite easy but becoming job ready with that skill is quite hard because it requires dedication and diligence to perfect the skill, it also requires knowing how to look for job opportunities to land yourself a job. In this article, you'll learn how to become a job ready developer, no matter your tech career field.

**Prerequisite**: 
There is no requirement to reading this article.

**Table of contents**

- Pick the right career path
- Use online resources to get a learning roadmap
- Get online or offline learning resources
- Build projects
- Build problem solving skills
- Join tech communities
- Apply for jobs and internships
- Conclusion

**Pick the right career path**
This is the first step to become a professional in any field, pick a career path that suits what you want to achieve. There are numerous career paths in tech ranging from coding careers to no code careers. Search online to see what the job requirements for your chosen career is.

**Use online resources to get learning roadmap**
Use online resources like roadmap.sh, blog articles, YouTube videos, or ask professionals in the field to get a definite learning track for your chosen field.

**Get online or offline learning resources**
After getting a roadmap for your learning, next is to get the learning resources to teach you. There are online platforms both free and paid to access these materials like YouTube, Udemy, edx, Coursera, codecacemy, freecodecamp etc. Ensure you check the reviews of the course before learning from the material.

**Build projects**
The best way to get a hold of the knowledge you've learnt is by building projects. Build as many projects as possible and add them to an online portfolio such as GitHub, behance, netlify to enable potential employers see what you've done.

**Build problem solving skills**
Develop your problem solving skills by using online resources like leetcode and hackerrank. Employers look out for candidates with good problem solving skills.

**Join tech communities**
Joining and volunteering for tech communities is a good way to meet other professionals in your field and get help to land yourself a job.

**Apply for jobs and internships**
Apply to as many internship and job openings as possible, use platforms like LinkedIn, Twitter and job boards to know when there is a new job opportunity.

**Conclusion**
In conclusion, become familiar with the required skills needed to become a professional in your field and apply for as many job opportunities as possible.
How to convert images to PDF file using Python
Tags: python, coding, programming
Published: 2023-08-30 14:01:10

## Hi 🙂🖐

In this post, I will share with you how to convert images to PDF files using Python.

## step 1

You need to install Pillow liblary from here `pip install Pillow`


## step 2

You need to some images to convert them to PDF file

## step 3

Load all images and convert them.

```python
from PIL import Image
from os import listdir

def images_to_pdf():
    images = [Image.open(f'images/{i}') for i in listdir('images')]
    images[0].save('out.pdf', save_all=True, append_images = images)
    
images_to_pdf()

```


**Now we're done 🤗**

**Don't forget to like and follow 🙂**

**Support me on PayPal 🤗**
https://www.paypal.com/paypalme/amr396
Open Source ABCs: License
Tags: opensource, discuss, 100daysofoss
Published: 2023-08-30 13:32:55

---
title: Open Source ABCs: License
published: true
description: Join our #100DaysOfOSS blog series as we explore the world of Open Source Software (OSS) from A to Z! Every week, we'll discuss two new letters of the English alphabet. Share your thoughts, ideas, and favorite OSS projects for each letter. Let's celebrate the power of open source together! 
tags: opensource, discuss, 100DaysOfOSS
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fxwg4ygmybnni1tpwdx3.png
# Use a ratio of 100:42 for best results.
series: 100DaysOfOSS
---

Welcome to our [#100DaysOfOSS series](https://dev.to/opensauced/100daysofoss-growing-skills-and-real-world-experience-3o5k). Until October 31, we'll be doing  Open Source Software (OSS) terms from A to Z. We'll be diving into a different letter of the English alphabet, uncovering OSS concepts, and sharing our thoughts on them.

Today, we're covering the letter "L" for License. 

**License**: Open-source projects often operate under specific licenses, such as the GNU General Public License (GPL) or the MIT License. These licenses define the terms and conditions under which the software can be used, modified, and distributed. There are a lot of types of licenses out there, so if you want to learn more, check out [this resource](https://opensource.org/licenses/).

Now, we want to hear from you! What other OSS terms can you think of that start with the letter "L"? 

Remember to use the hashtag #100DaysOfOSS if you share on social media, and don't forget to tag us [@saucedopen](https://twitter.com/saucedopen) so we can follow along.
Day 36: Typescript Basics
Tags: javascript, typescript, 100daysofcode, day35
Published: 2023-08-30 13:30:00

## Type Annotations 📝

Type annotations to define explicit declarations of the data type for a variable, function parameter, or return value. By using type annotations, developers can ensure type safety and catch potential errors during development rather than at runtime.


```typescript
let age: number;
age = 25; // This is valid
age = "25"; // This will throw a compilation error
```

Type annotations shine when you need precise control over types and want to communicate that intention to other developers.

## Type Inference 🕵️‍♂️

TypeScript's type inference is ability to automatically conclude the type of a value based on its usage and context. This feature eliminates the need for explicit type annotations in many cases, making code more concise and readable.

```typescript
let username = "John Doe"; // TypeScript infers the type as string
```

Type inference shines in scenarios where the type is evident from the assignment, reducing redundancy and potential human errors 🧩.

## The `type` 🛠️

The `type` keyword allows developers to create custom types by combining existing types. This is especially useful when dealing with complex data structures or union types.

```typescript
type Point = {
  x: number;
  y: number;
};

function calculateDistance(point: Point) {
  // ...
}
```

The `type` keyword supports union types, intersections, and conditional types, enabling the creation of advanced type compositions.

## The `interface` 📜

The `interface` keyword is used to define contracts that describe the shape of objects. Interfaces can be implemented by classes and can also extend other interfaces.

```typescript
interface User {
  id: number;
  username: string;
}

class Admin implements User {
  // ...
}
```

Interfaces are particularly effective when defining object structures, as they provide a clear contract for expected properties and methods.

## `type` vs `interface`

The choice between `type` and `interface` often sparks debates among TypeScript developers. While both can achieve similar outcomes, there are some nuanced differences to consider 🤔.

- **Extending**:
  - Interfaces can extend other interfaces using the `extends` keyword, allowing for incremental building of complex structures.
  - Types can be combined using intersections (`&`) to achieve similar results.

- **Declaration Merging**:
  - Interfaces support declaration merging, where multiple interface declarations with the same name are automatically merged into one.
  - Types do not support declaration merging.

- **Compatibility with Primitives**:
  - Interfaces can't be directly used to describe primitive types like `string`, `number`, etc.
  - Types can easily represent primitive types.

Ultimately, the choice between `type` and `interface` depends on the specific use case and coding style preferences. It's recommended to use `interface` when defining contracts and object structures, and `type` when dealing with more complex and composed types.
How I can get products using multiple skus?
Tags: help, magento
Published: 2023-08-30 13:19:26

As I ask upon:
https://magento.stackexchange.com/q/369468/113388

I have a list of skus:

```
  $skus = ['24-MB01','24-MB04','24-UG01'];
```

And based on these I want to retrieve the products:

```php
/**
 * @var \Magento\Catalog\Model\ProductRepository
 */
private $productRepository
...
$this->productRepository->addFieldToFilter('sku',$skus);
```

But I cannot get them. Do you have any idea on how I can do this?
Optimising Git Usage: Essential Tips for Efficient Code Management from Local to Global
Tags: github, git, beginners, programming
Published: 2023-08-30 13:09:57

Hello aspiring developers!

Embarking on your software development journey means embracing tools like GitHub, a powerful platform that fosters collaboration and version control. This article is designed to guide beginners in the art of using GitHub commands effectively, ensuring smoother collaboration and better code management.

**1. Creating a New Branch for Development:**

When starting a new feature or addressing an issue, creating a new branch helps keep your work isolated from the main codebase. Use the following commands:

```bash
# Create a new branch and switch to it
git checkout -b new-feature

# Push the new branch to the remote repository
git push origin new-feature
```

**2. Always Pull from Origin:**

Before starting any development, ensure you're working with the latest code. Pulling from the remote repository prevents conflicts down the line:

```bash
# Switch to your development branch
git checkout new-feature

# Pull the latest changes from the remote repository
git pull origin new-feature
```

**3. Committing Only Necessary Files:**

Keep your commits focused and concise by only including relevant changes. Use `git status` to see modified files and `git add` to stage them:

```bash
# Stage specific files for commit
git add file1.js file2.css

# Commit the staged changes
git commit -m "Implemented feature X and updated styling"
```

**4. Adding a Proper Commit Message:**

Writing informative commit messages helps you and your collaborators understand the purpose of each change. Follow this format:

```bash
git commit -m "Short description of your changes

More detailed explanation, if needed.
Issue #123"
```

**5. Resolving Merge Conflicts via Terminal:**

Conflicts can arise when merging branches. To resolve them:

```bash
# Fetch the latest changes from the remote repository
git fetch origin

# Switch to your development branch
git checkout new-feature

# Merge the changes from the main branch
git merge origin/main

# Resolve any conflicts in your code files

# After resolving, commit the changes
git commit -m "Resolved merge conflicts"

# Push the resolved changes to the remote repository
git push origin new-feature
```

Remember, practice makes perfect. Embrace these GitHub commands in your workflow to streamline collaboration and manage your codebase effectively. As you become more comfortable, you'll find yourself contributing seamlessly to projects and collaborating with confidence.

Happy coding! 🚀👩‍💻👨‍💻
[recommend oneself for open source] an react web editor
Tags: javascript, react, programming, opensource
Published: 2023-08-30 12:29:22

I have developed a react based data visualization designer, if you are interested, please join it.

This is its open source address: https://github.com/xiaopujun/light-chaser

Currently you can experience its existing features online: https://xiaopujun.github.io/light-chaser-app/#/


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qjf6nkbxansukbbltip6.png)
Become a MERN Stack Developer!
Published: 2023-08-30 12:28:34

Dreaming of mastering the MERN stack? Embarking on the journey to become a MERN stack developer involves a blend of deep understanding and hands-on experience. Follow these steps to ascend the ranks:

##  1.Master the Fundamentals

Lay a solid foundation by grasping the core concepts:

- **MongoDB, Express.js, React, Node.js**: Understand each component's role in the stack.
- Dive into MongoDB's document-based NoSQL approach.
- Grasp Express.js for building robust server applications.
- Learn Reacts components, props, state, and virtual DOM.
- Embrace Node.js for server-side JavaScript.

## 2. Craft Small-scale MERN Projects

Practice breathes life into theory. Begin by building mini MERN projects:

- Create a personal blog site or a simple e-commerce platform.
- Apply MERN principles to your projects for hands-on experience.
- Experiment with different database schemas and front-end designs.

##  3. Harness the Power of Full Stack Integration

Unite the pieces to create seamless full stack applications:

- **Connecting Front-End and Back-End**: Employ Express.js routes to link React components.
- Understand RESTful API principles and HTTP methods.

## 4. Advanced Topics

Delve into the advanced aspects that distinguish a MERN Developer:
- **Authentication and Security**: Secure user data using techniques like JWT and OAuth.

##  5. Real-World Experience

Elevate your skills by venturing into real-world projects:

- Collaborate on open-source MERN projects.
- Contribute to GitHub repositories to expand your portfolio.
- Seek internships or freelance opportunities for hands-on experience.

## 6. Immerse Yourself in the MERN Community

**Participation fosters growth:**

- Attend MERN meetups, workshops, and conferences.
- Engage in online forums, discussion boards, and GitHub discussions.
Simplifying GitHub Actions Workflows Through Typescript
Tags: githubactions, github, typescript, cicd
Published: 2023-08-30 12:09:46

## Quick Summary

Harness the power of Typescript for designing your GitHub Actions Workflows. Check out [github-actions-workflow-ts](https://github.com/emmanuelnk/github-actions-workflow-ts)


![github-actions-workflow-ts logo](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4uk9k5r6jpefdnwdtk85.png)

## The Challenge with YAML

Despite its widespread use in DevOps and CI/CD pipelines—think Kubernetes, Jenkins, CircleCI, Bitbucket Pipelines, CloudFormation, and of course, GitHub Actions—YAML comes with its own set of complexities. Issues often arise from poor indentation, block referencing, and the tedious nature of code reuse.

## Why Not YAML for GitHub Actions?

While YAML is somewhat versatile, it's not the most readable or maintainable choice for composing GitHub Actions Workflows. Attempting to implement complex functionality can make your YAML files convoluted, making the process of maintaining, updating or even remembering their function painful.

## The Epiphany

Enter my introduction to AWS CDK a few years ago — a tool that lets you write infrastructure code in your preferred language and then compiles it into Cloudformation YAML. This sparked an idea: why not apply the same principle to GitHub Actions Workflows?

## The Inspiration

Initially, I stumbled upon [webiny/github-actions-wac](https://github.com/webiny/github-actions-wac), an incredible package that did exactly what I was envisioning. While it's a remarkable tool, I encountered some limitations concerning type exports, file naming, and directory placement. These led me down a path of extensive modifications and enhancements.

## Introducing github-actions-workflow-ts

Instead of merely tweaking the existing package, I found myself reimagining many of its core functionalities. Thus, I introduce [github-actions-workflow-ts](https://github.com/emmanuelnk/github-actions-workflow-ts) — a package heavily inspired by the original but with expanded capabilities. While it's still in its beta stage (version 0.X.X), I'm close to releasing a stable 1.0.0 version. However, the current API is robust and already implemented in several of my projects.

## Get Started Now

Curious to see it in action? Explore these Replit examples:
- [Simple Example](https://replit.com/@EmmanuelKyeyune/github-actions-workflow-ts-example#workflows/simple.example.wac.ts)
- [Advanced Example](https://replit.com/@EmmanuelKyeyune/github-actions-workflow-ts-example#src/workflows/advanced.example.wac.ts)

---

## About the Author

I'm [Emmanuel](https://emmanuelnk.com), passionate about software, AWS, and DevOps. If you found this article valuable, feel free to connect with me on [LinkedIn](https://www.linkedin.com/in/emmanuel-nsubuga-kyeyune/) or follow me on [Twitter](https://twitter.com/emmanuel_n_k).
La conferencia "Sustituyendo el plástico por bambú" se ha celebrado en Anji, provincia china de Zhejiang
Published: 2023-08-30 11:50:10

Anji Yucun pertenece a la ciudad de Huzhou, provincia de Zhejiang, que lleva el nombre de Yuling, situada en la veta restante de la montaña Tianmu, con una superficie de 4,86 kilómetros cuadrados. Aunque es pequeña, es famosa. Como cuna de "las aguas lúcidas y las montañas exuberantes son activos de valor [incalculable](https://extremadura24h.com/)". Yucun busca un desarrollo sostenible con belleza ecológica, prosperidad industrial y riqueza a lo largo de los diez años, siendo una valiosa muestra para la construcción de la civilización ecológica de [China](https://islascanarias-24h.com/).

Yucun combina la [ecoagricultura ](https://malaga-24h.com/)con el turismo, transforma minas abandonadas y cementeras en zonas turísticas, superpone el bambú, el té blanco y el turismo para crear productos agrícolas [característicos](https://larioja24h.com/), y convierte las granjas en granjas y casas de familia características. Como primer pueblo seleccionado como "Mejor Pueblo Turístico" por la Organización Mundial del Turismo de las Naciones Unidas, recibió 700.000 turistas en 2022.