teleren/devto huggingface dataset:
How to access a value defined in the application properties file in Spring Boot
Tags: spring, boot, springboot
Published: 2023-06-15 07:24:11

{% embed https://youtu.be/PgvTfTT2CQ8 %}

Directory structure

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


pom.xml

```
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<parent>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-parent</artifactId>
		<version>3.1.0</version>
		<relativePath/> <!-- lookup parent from repository -->
	</parent>
	<groupId>com.example</groupId>
	<artifactId>SpringBootApplicationProperties</artifactId>
	<version>0.0.1-SNAPSHOT</version>
	<name>SpringBootApplicationProperties</name>
	<description>Demo project for Spring Boot</description>
	<properties>
		<java.version>17</java.version>
	</properties>
	<dependencies>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter</artifactId>
		</dependency>

		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-test</artifactId>
			<scope>test</scope>
		</dependency>
	</dependencies>

	<build>
		<plugins>
			<plugin>
				<groupId>org.springframework.boot</groupId>
				<artifactId>spring-boot-maven-plugin</artifactId>
			</plugin>
		</plugins>
	</build>

</project>

```

application.properties

```
sid=2
sname=jhon
sadd=pune
```

TestRunner

```
package com.example.demo.runner;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

@Component
public class TestRunner implements CommandLineRunner {

	@Value("${sid}")
	private Integer sid;
	
	@Value("${sname}")
	private String sname;
	
	@Value("${sadd}")
	private String sadd;
	
	

	@Override
	public String toString() {
		return "TestRunner [sid=" + sid + ", sname=" + sname + ", sadd=" + sadd + "]";
	}



	@Override
	public void run(String... args) throws Exception {
		System.out.println(this.toString());
	}

}

```
Field Plugin SDK Beta Release
Tags: typescript, javascript, react, vue
Published: 2023-06-15 07:43:19

We are thrilled to announce the release of the Field Plugin Software Development Kit (SDK) Beta! This is a significant development that brings exciting opportunities for all of us.

[The Field Plugin SDK](https://github.com/storyblok/field-plugin) comprises three essential components:

## Library

The library empowers developers to create plugins using their preferred frontend framework. This flexibility allows you to leverage your existing skills and create custom plugins that perfectly align with your needs.

## Command Line Interface (CLI)

The CLI is designed to streamline your development experience. It offers multiple templates, making it easy for developers to get started quickly. Moreover, it promotes the adoption of Continuous Integration and Continuous Deployment (CI/CD) processes, enabling you to build robust and efficient workflows.

## Sandbox

To ensure a smooth and hassle-free experience, we have also developed a Sandbox environment. This Sandbox provides a dedicated space for testing and sharing your field plugins before they are ready for production. It offers a safe and controlled environment to fine-tune your plugins and gather valuable feedback from stakeholders.

## What’s next?

The Field Plugin SDK includes everything you need to kickstart your journey in creating your own field plugin within Storyblok. By leveraging this powerful toolkit, you can take your content creation to new heights, enabling richer and more dynamic user experiences.

To get a better understanding of how to use the SDK, you can follow these articles for more information:

1. [Introduction](https://www.storyblok.com/docs/plugins/field-plugins/introduction)
2. [Creation](https://www.storyblok.com/docs/plugins/field-plugins/create)
3. [Deployment](https://www.storyblok.com/docs/plugins/field-plugins/deploy)
4. [Distribution](https://www.storyblok.com/docs/plugins/field-plugins/distribute)
5. [Continuous Delivery](https://www.storyblok.com/docs/plugins/field-plugins/continuous-delivery)
6. [@storyblok/field-plugin](https://www.storyblok.com/docs/plugins/field-plugins/storyblok-field-plugin)

In case you encounter any issues or would like to submit a feature request, feel free to share them directly in the [GitHub repository](https://github.com/storyblok/field-plugin/issues). Our team will be happy to support you! 

We're excited to see what amazing plugins you'll create with the Field Plugin SDK! Let's unlock the full potential of Storyblok together.
RxJS Operators: takeUntil
Tags: rxjs, typescript, javascript, webdev
Published: 2023-06-15 05:30:00

RxJS is a JavaScript library that enables the creation of asynchronous and event-based programs. The main type is the `Observable` and a suite of functions and operators are provided to make it easier to work with the data coming through. This series will detail those operators (and a few stand-alone functions) and provide examples of their use.

In this post, we’re going to cover the `takeUntil` operator.

## What does it do?

The `takeUntil` operator gives us a way to cancel a subscription to an observable. We add the operator to our observable pipeline and provide it with a subject. Whenever that subject emits a value the subscription will be cancelled.

Without using this we would need to track all the subscriptions individually. When it came time to cancel them we would have to run through them all. This can be error-prone since it’s easy to miss one or incorrectly track a reference. Using `takeUntil` means we just need to add the method and make a single call to cancel all the subscriptions.

## Example

We’ll use `interval` as our observable:

```tsx
import { Subject, interval, takeUntil } from 'rxjs';

const unsubscribe$ = new Subject<void>();

interval(1000)
    .pipe(takeUntil(unsubscribe$))
    .subscribe(x => {
        console.log(x);
    });

setTimeout(() => {
    unsubscribe$.next();
}, 10000);
```

A few things are going on here. We’ll break it down and see what’s happening bit by bit.

```tsx
const unsubscribe$ = new Subject();
```

We create a new subject to pass to `takeUntil`. This is what we’ll be triggering later.

```tsx
interval(1000)
    .pipe(takeUntil(unsubscribe$))
    .subscribe(x => {
        console.log(x);
    });
```

Subscribe to the observable and include `takeUntil` in the pipeline. This will handle every value until it has been unsubscribed.

```tsx
setTimeout(() => {
    unsubscribe$.next(undefined);
}, 10000);
```

Use `setTimeout` to wait 10 seconds and send a value through the `unsubscribe$` subject. This will cancel the subscription of the above observable. If we run this we’re going to see values emitted for 10 seconds and then stop, since we’re emitting an incremented number every second we should see:

```bash
0
1
2
3
4
5
6
7
8
```

Since we’re using `interval` the subject will complete and the program will end at this point. If we were using a typical long-lived observable the values would continue being sent out, we’re just not subscribing to them anymore.

This is the operator I use most when working in Angular. Since Angular is a single-page application framework, observables will never unsubscribe unless explicitly told to do so. This means I can set up subscriptions in components, configure them with `takeUntil`, and make a `.next()` call in the destroy handling.

That’s just one use case. There are other scenarios where this can be useful. The point is `takeUntil` makes it easy to control the lifetime of our subscriptions.

The source code for this example is available on GitHub:
{% embed https://github.com/drownedintech/rxjs-operators %}
Building a winning marketing team starts with finding the right talent.
Tags: marketing, job, productivity
Published: 2023-06-15 07:20:19

[MarketPro ](https://marketproinc.com/)is the marketing recruitment partner you can count on to provide tailored solutions for your organization's unique needs. Our experienced recruiters use cutting-edge technology and innovative techniques to find the most qualified candidates for your team. With over 20 years of experience in executive search, MarketPro has earned a reputation for delivering outstanding results.
Git for All Developers: Essential or Optional?
Tags: discuss, git, github
Published: 2023-06-15 07:00:00

Hey fellow developers! Let's talk Git. Do you think all developers need to know it? Share your thoughts on the benefits of using version control in a collaborative coding environment. If you used Git, How has it transformed your development process? Join the discussion!

Follow the DEVteam for more discussions and online camaraderie!

{% embed [https://dev.to/devteam](https://dev.to/devteam) %}

[Image by pch.vector on Freepik](https://www.freepik.com/author/pch-vector)
How Do You Master New Tech? Any Hacks for Faster Language Learning?
Tags: discuss, beginners, codenewbie
Published: 2023-06-15 07:00:00

When it comes to learning new technologies or programming languages, we all have our own methods. So, how do you approach the challenge? Share your tried-and-true tips for mastering new languages at lightning speed. Whether it's helpful resources, practical exercises, or clever learning techniques, let's swap our best tricks and level up our tech skills together!

Follow the [CodeNewbie Org](https://dev.to/codenewbieteam) and [#codenewbie](https://dev.to/t/codenewbie) for more discussions and online camaraderie!

*{% embed* [https://dev.to/codenewbieteam](https://dev.to/codenewbieteam) *%}*
Sloan's Inbox: What Are Your Favorite Tags, Orgs, and Coding Challenges?
Tags: discuss, codenewbie, showdev, tutorial
Published: 2023-06-15 07:00:00

Hey there, fellow coding enthusiasts! It's me, Sloan, your friendly neighborhood sloth and Official DEV Moderator 

I'm back today with an intriguing question that has been anonymously submitted by one of our new members. So, let's dive right into it!

Today's query seeks your collective expertise on a matter that's close to every coder's heart: 

> Which are the top tags and organizations to follow on DEV for discovering awesome project suggestions and finding platforms to showcase your work? And where can I find coding challenges to put my skills to the test, get valuable advice on coding best practices, coding style, and more!?

So, my fellow coding enthusiasts, it's time to unite our slothful wisdom! Share your insights and recommendations on which tags and organizations have you found to be a treasure trove of project ideas and a welcoming community for showcasing your creations? 

Do you have any secret spots where you unearth coding challenges that have pushed your limits and sparked your creativity? 

And let's not forget about those invaluable nuggets of advice on coding best practices, style guidelines, and the ever-present coding patterns. 

Sloan's Inbox will be back next week for more friendly vibes. Stay tuned and stay slothy!

---


*Want to submit a question for discussion or ask for advice? [Visit Sloan's Inbox](https://docs.google.com/forms/d/e/1FAIpQLSc6wgzJ1hh2OR4WsWlJN9WHUJ8jV4dFkRDF2TUP32urHSAsQg/viewform)! You can choose to remain anonymous.*
How to Split a PDF Files into Multiple Files
Tags: pdf, programming, csharp
Published: 2023-06-15 06:55:04

In daily work or study, it's common to split a multi-page PDF document into several smaller files. For instance, dividing a large PDF document into separate files based on chapters can make it easier to manage and read. Users can choose their preferred page range, name, and save each generated PDF file as required. This process can be accomplished using professional PDF editing software or through programming. In this article, I will introduce how to split a PDF file in C# program.

## Step 1 Create a Project
Create a new project in Visual Studio

## Step 2 Import the DLL File into Project

- Download and install [Free Spire.PDF for .NET](https://www.e-iceblue.com/Download/download-pdf-for-net-free.html). 
- Open the new project. 
- Right-click "References" in the "Solution Explorer".
- Select "Add Reference" > "Browse". 
- Find the dll file in the BIN folder under the installation path, and click "OK".

## Step 3 Write code
Write code in your program 
or you can also copy the following code and paste it to program
```c#
using Spire.Pdf;
using System;

namespace SplitPdfByPageRanges
{
    class Program
    {
        static void Main(string[] args)
        {
            //Specify the input file path and output directory
            String inputFile = "sample.pdf";
            String outputDirectory = "C:\\Users\\Administrator\\Desktop\\Output\\";

            //Create a PdfDocument objects and load sample file
            PdfDocument sourceDoc = new PdfDocument(inputFile);

            //Create two additional PdfDocument objects
            PdfDocument newDoc_1 = new PdfDocument();
            PdfDocument newDoc_2 = new PdfDocument();

            //Insert the first page of source file to the first document
            newDoc_1.InsertPage(sourceDoc, 0);

            //Insert the rest pages of source file to the second document
            newDoc_2.InsertPageRange(sourceDoc, 1, sourceDoc.Pages.Count - 1);

            //Save the two documents 
            newDoc_1.SaveToFile(outputDirectory + "output1.pdf");
            newDoc_2.SaveToFile(outputDirectory + "output2.pdf");
        }
    }
}
```
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g2jfexfyx0mgq101v949.png)

Using the above code, you can split a multi-page PDF file into multiple individual files effortlessly. Additionally, [Free Spire.PDF for .NET](https://www.e-iceblue.com/Introduce/spire-office-for-net-free.html) supports a variety of other document operations and conversions, such as [merging PDFs](https://www.e-iceblue.com/Tutorials/Spire.PDF/Spire.PDF-Program-Guide/Merge-PDF-Files-with-New-Method-in-C.html) and [converting PDFs to images](https://www.e-iceblue.com/Tutorials/Spire.PDF/Spire.PDF-Program-Guide/Convert-PDF-Page-to-Image-with-C-code.html).
New LIAPP website is coming!
Published: 2023-06-15 06:46:47

Hello, LIAPP TEAM here!

LIAPP TEAM would like to inform you about the upcoming LIAPP update and the renewal of our website.
LIAPP is coming with updates and a new website in late June!

LIAPP Update Details:

- New Octopus GG detection feature.
- Strengthened Magisk detection capability.
- Enhanced Magisk Alpha detection.
- Enhanced Magisk Delta detection.
- Enhanced app tampering detection.
- Enhanced LDPlayer detection.
- Strengthened LIAPP compatibility.
- Strengthened BlueStacks compatibility.
- Strengthened app performance speed.
- Strengthened compatibility with operating systems and security folders.
- Strengthened compatibility when converting aab files to universal.apk.
- Strengthened compatibility with ONE GameLoop.
- Strengthened LIAPP initialization function (init) to prevent ANR.

Stay tuned with LIAPP!
LIAPP is coming for better service.
Do you want to know more about LIAPP and the update? 
Come and visit [LIAPP!](https://liapp.lockincomp.com/?utm_source=newsletter&utm_medium=email&utm_campaign=20230615-techcommunity_LIAPPupdate_en_dev)
State In React Js.
Tags: react, javascript, frontend, beginners
Published: 2023-06-14 22:34:48

### What is a State?
State is simply data that a component can hold over time, necessary for information that it needs to remember throughout the **app's** lifecycle.

- It can also be seen as a components memory.

**_NOTE_** When updating the components state, it triggers React to re-render the component 

### Two major things state allows deevelopers to do 👨‍💻🧑‍💻

1. To update the component's  view by re-rendering it.
2. To persist local variables between renders.

### How to create a state variable with useState().
In order to use state in practice in a component, we must do it in three steps:
1. Add a **useState()** variable
2. Use it in the code, usually in **JSX**
3. Update the piece of state in some **event handler**

Let's see this in action ✴️ 

- Adding a useState variable

![useState variable](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/t3dg475w6vaabxp1iak4.png)

- Using it in the code

![useState variable usage](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ln84tjxwolab96rv1wa1.png)

- Updating the piece of state in some event handler
Firstly, create a function that will carry out the update

![function for updating useState](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i5ee8u1fv9ty3wt0nf3u.png)

Now to use it, we simply write the code below

![useState variable usage](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ur5t0o3edkdmhka5b6x2.png)

**NOTE**
The useState function is what we call a **hook** in React and we can identify hooks in React by the word "**use**" before the name of the hook.
Also we are **not** to update state variable manually like the code below

![bad practice for useState updating](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j0cxa6o79upjabpjm2lv.png)
However, we are to always use the setCount method as in this example, outside this, React won't know that the state is updated and as a result, the supposed resulting UI doesn't change.
EC2 Instance Connect Endpoint
Tags: aws
Published: 2023-06-15 06:21:33

nice to meet you. This is my first post on dev.to.

On June 13, 2023, EC2 Instance Connect will be enabled for EC2 instances on private subnets.
EC2 Instance Connect is a function that enables SSH to EC2 instances from the management console.
With conventional EC2 Instance Connect, it was only possible to connect to EC2 on public subnets.
However, with the new EC2 Instance Connect endpoint, EC2 Instance Connect is now possible for EC2 instances on private subnets as well.
Regarding secure SSH to EC2 instances on private subnets, there have been methods such as using a bation server and session manager, but a new method called EC2 Instance Connect has been added.

I posted a video on youtube trying the EC2 Instance Connect Endpoint.

{% youtube Gg6x5wgYJGw%}

/* I like English and am learning it.I want to send it globally, so I'm posting it in English. I use Google Translate to create sentences, and Edge's reading function to read aloud. */
Debug: no languages configured error with Hugo
Tags: hugo, debug
Published: 2023-06-15 05:54:36

## Error Message

```shell
Error: command error: failed to create config from result: failed to decode "languages": no languages configured
```

## Cause
Your Hugo's config file (`config.yaml`) is missing a `languages` section.

https://gohugo.io/content-management/multilingual/#configure-languages

## Solution

Add the following line to your config file
```yaml
defaultContentLanguage: en
```

Of if you are supporting multiple languages:

```yaml
# Multi-lingual mode config
defaultContentLanguage: en
languages:
  en:
    languageName: English
    contentDir: content.en
    weight: 1
```

Resources:  
[Multilingual Mode - Hugo](https://gohugo.io/content-management/multilingual/)
Best Call Center Software For Small Business
Tags: community, discuss, news, watercooler
Published: 2023-06-15 05:45:08

When it comes to the **[best call center software for small businesses](https://callcenter.aavaz.biz/)**, there are a few key factors to consider. A top choice is software that offers robust features like automatic call distribution, interactive voice response, call recording, and analytics. It should also be scalable and cost-effective. Some popular options for small businesses include Aavaz, Freshcaller, Talkdesk, and Zendesk. These solutions provide intuitive interfaces, seamless integration with other business tools, and excellent customer support. Ultimately, the best call center software for small businesses is one that meets their specific needs, budget, and growth plans.
Need assistance with deploying Vite.js application on AWS Beanstalk
Published: 2023-06-15 05:41:11

I'm currently facing some difficulties in uploading the Vite.js application on AWS Beanstalk, as the deployment process is failing. I was wondering if anyone with experience in this area could kindly assist me by providing the necessary steps to ensure a successful deployment.

I would greatly appreciate any guidance or advice you can offer. Thank you in advance for your support.

Attaching my package.json 


```
{
  "name": "marketing",
  "private": true,
  "version": "0.0.0",
  "type": "module",
  "scripts": {
    "dev": "vite",
    "start": "vite",
    "build": "tsc && vite build",
    "lint": "eslint src --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
    "preview": "vite preview"
  },
  "dependencies": {
    "@hookform/resolvers": "^3.1.0",
    "apexcharts": "^3.40.0",
    "axios": "^1.4.0",
    "dayjs": "^1.11.7",
    "react": "^18.2.0",
    "react-apexcharts": "^1.4.0",
    "react-dom": "^18.2.0",
    "react-email-editor": "^1.7.8",
    "react-fast-marquee": "^1.6.0",
    "react-hash": "^0.1.1",
    "react-hook-form": "^7.43.9",
    "react-icons": "^4.8.0",
    "react-redux": "^8.0.5",
    "react-router-dom": "^6.11.1",
    "react-select": "^5.7.3",
    "react-toastify": "^9.1.3",
    "redux": "^4.2.1",
    "redux-saga": "^1.2.3",
    "yup": "^1.1.1",
    "vite": "^4.3.2"
  },
  "devDependencies": {
    "@hookform/devtools": "^4.3.1",
    "@types/react": "^18.0.28",
    "@types/react-dom": "^18.0.11",
    "@typescript-eslint/eslint-plugin": "^5.57.1",
    "@typescript-eslint/parser": "^5.57.1",
    "@vitejs/plugin-react": "^4.0.0",
    "autoprefixer": "^10.4.14",
    "eslint": "^8.38.0",
    "eslint-plugin-react-hooks": "^4.6.0",
    "eslint-plugin-react-refresh": "^0.3.4",
    "postcss": "^8.4.23",
    "tailwind-scrollbar": "^3.0.4",
    "tailwindcss": "^3.3.2",
    "typescript": "^5.0.2"
  }
}

```
"Unlock the Power of AEM: How Custom Coding Can Transform Your Digital Experiences" | Emmanuel Katto Uganda.
Tags: aem, coding, transform, adobe
Published: 2023-06-15 05:32:01

Hello Folks Myself **Emka Emmanuel Katto From Uganda** I Just Wanted To Share About The Custom Coding (AEM). Adobe Experience Manager (AEM) is a powerful content management system that allows businesses to create and manage digital experiences across multiple channels. However, sometimes the out-of-the-box features of AEM may not be enough to meet the specific needs of a business. This is where AEM coding comes in.

AEM coding refers to the process of developing custom code using AEM to extend its functionality or customize its features. This can involve using various programming languages such as Java, JavaScript, and HTML/CSS. With AEM coding, businesses can create custom components, templates, workflows, and services that meet their unique needs.

One of the key benefits of AEM coding is that it allows businesses to create highly customized digital experiences that are tailored to their specific audience. For example, a business may want to create a custom component that displays personalized content based on a user's browsing history. With AEM coding, this is possible.

Another benefit of AEM coding is that it allows businesses to integrate AEM with other systems and applications. For example, a business may want to integrate AEM with a customer relationship management (CRM) system to provide a more personalized experience for their customers. With AEM coding, this integration can be achieved.

However, AEM coding can be a complex process that requires specialized skills and expertise. Businesses may need to hire experienced developers or work with a development agency to ensure that their AEM coding projects are successful.

In conclusion, AEM coding is a powerful tool that allows businesses to extend the functionality of AEM and create highly customized digital experiences. While it may require additional resources and expertise, the benefits of AEM coding can be significant for businesses looking to differentiate themselves in the digital marketplace.