teleren/devto huggingface dataset:
How to Convert PDF to Word with Fixed Layout on .NET Platforms
Tags: csharp, programming, beginners, pdf
Published: 2023-07-05 08:14:54

In today's digital world, PDF files have become a standard format for document sharing and distribution. However, there are times when we need to convert a PDF file into a Word document with a fixed layout, preserving the original formatting, images, and design. This article will guide you through the process of converting PDF to Word with a fixed layout, allowing you to maintain the integrity of your documents while gaining the flexibility and editing capabilities of Microsoft Word. 

### Step 1 Download 
Download **Free Spire.PDF for .NET** from [this link](https://www.e-iceblue.com/Download/download-pdf-for-net-free.html) and install it to local.
This free library not only supports converting PDF to Word, but also [compressing](https://www.e-iceblue.com/Tutorials/Spire.PDF/Spire.PDF-Program-Guide/Document-Operation/How-to-Compress-PDF-Document-in-C-VB.NET.html) and converting PDF, including [images](https://www.e-iceblue.com/Tutorials/Spire.PDF/Spire.PDF-Program-Guide/Convert-PDF-Page-to-Image-with-C-code.html) and [Excel](https://www.e-iceblue.com/Tutorials/Spire.PDF/Program-Guide/Conversion/Convert-PDF-to-Excel-in-C-VB.NET.html). 

### Step 2 Import the DLL File into Project
Take Visual Studio 2022 for example.
* Create a new C# project and open it.
* Right-click " References " in the " Solution Explorer ", and then select " Add Reference " > " Browse ". 
* Find the DLL file in the BIN folder under the installation path and click " OK " to add it as a reference to the program.

### Step 3 Write code
C#:
```c#
using Spire.Pdf;

namespace ConvertPdfToFixedLayoutWord
{
    class Program
    {
        static void Main(string[] args)
        {
            //Create a PdfDocument object
            PdfDocument doc = new PdfDocument();

            //Load a PDF document
            doc.LoadFromFile("sample.pdf");

            //Convert PDF to Doc and save it to a specified path
            doc.SaveToFile("output/ToDoc.doc", FileFormat.DOC);

            //Convert PDF to Docx and save it to a specified path
            doc.SaveToFile("output/ToDocx.docx", FileFormat.DOCX);
            doc.Close();
        }
    }
}
```
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4vm4q6xhd66w8zsngquf.png)
The following explanation can help you understand this code easily.
Firstly, create a “**PdfDocument**” object. And then load your PDF file using “**PdfDocument.LoadFromFile()**” method.  Finally, Convert the PDF document to a Doc or Docx format file using “**PdfDocument.SaveToFile(String fileName, FileFormat fileFormat)**”method.
Two ways to install Jenkins
Tags: jenkins, devops, webdev, beginners
Published: 2023-07-05 08:13:06

Step to install jenkins on AWS
How can you easly setup jenkins on AWS ec2 instance(Ubuntu)

**Step 1**
Install java

Update your system
sudo apt update

Install java
`sudo apt install openjdk-11-jre`

Validate Installation
`java –version`

It should look something like this
openjdk 11.0.17 2022-10-18
OpenJDK Runtime Environment (build 11.0.17+8-post-Ubuntu-1ubuntu222.04)
OpenJDK 64-Bit Server VM (build 11.0.17+8-post-Ubuntu-1ubuntu222.04, mixed mode, sharing)

**Step 2** 
Install Jenkins
Just copy these commands and paste them onto your terminal.
`curl -fsSL https://pkg.jenkins.io/debian/jenkins.io.key | sudo tee \   /usr/share/keyrings/jenkins-keyring.asc > /dev/null echo deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc] \   https://pkg.jenkins.io/debian binary/ | sudo tee \   /etc/apt/sources.list.d/jenkins.list > /dev/null`


Add Repository Key
You have to add Jenkins repository into Ubuntu server, use below command for that.
`wget -q -O - https://pkg.jenkins.io/debian-stable/jenkins.io.key | sudo apt-key add -
`Add Package Repository
Use below command to add package repository
`sudo sh -c 'echo deb http://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list'`
Now, to update the server you have to use below command;
sudo apt update

Now, you can use below command to install Jenkins
`sudo apt install jenkins -y`
Once jenkins installation completed you have to start Jenkins service for that use below command
`sudo systemctl start jenkins
sudo systemctl status jenkins`

Unlock jenkins
`sudo cat /var/lib/jenkins/secrets/initialAdminPassword`
 And get the password.


**Install jenkins using Docker**
First of all stop all the running jenkins

Check the status of running jenkins

`sudo systemctl status jenkins`

Install docker first.

Command to install docker

`sudo apt install docker.io Y` 

Command to install jenkins using docker

`sudo docker pull jenkins/jenkins`

`sudo docker run -d -p 8080:8080 docker.io/jenkins/jenkins:latest`

Now you can access jenkins with port 8080
Ip address of your instance:8080(http://54.178.81.5:8080/)

Now we have to unlock jenkins first

How to get the password

`sudo docker exec -it <container_id> bash` //come inside the container

cd /var/jenkins_home/secrets 
cat initialAdminPassword 

And get the password and copy paste into jenkins and install all the suggested password.
پیش بینی فوتبال
Tags: football, sport
Published: 2023-07-05 08:08:30


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ty59yz8e49ctw50b2q54.jpg)
پیش‌بینی فوتبال یک فعالیت محبوب در شرط بندی ورزشی است که شامل پیش‌بینی نتیجه یک مسابقه فوتبال می‌شود. در این فعالیت، شما قبل از برگزاری مسابقه می‌توانید پیش‌بینی کنید که کدام تیم برنده می‌شود یا مسابقه با تساوی به پایان می‌رسد. پیش‌بینی فوتبال شامل بررسی تیم‌ها، بازیکنان، آمارها، فرم تیم‌ها و عوامل دیگر است.
در پیش‌بینی فوتبال، می‌توانید به انواع مختلف پیش‌بینی‌ها پرداخته و شرط بندی کنید، از جمله:
•	نتیجه مسابقه
شما می‌توانید پیش‌بینی کنید که کدام تیم برنده می‌شود یا آیا مسابقه با تساوی به پایان می‌رسد یا خیر.
•	تعداد گل‌ها
می‌توانید پیش‌بینی کنید که تعداد کل گل‌ها در مسابقه بیشتر یا کمتر از یک مقدار خاصی است.
•	تعداد کارت‌ها
می‌توانید پیش‌بینی کنید که تعداد کارت‌های زرد یا قرمز در مسابقه بیشتر یا کمتر از یک عدد مشخص است.
•	عملکرد بازیکنان
می‌توانید پیش‌بینی کنید که کدام بازیکنان گل می‌زنند، پاس گل دهند یا کارت زرد/قرمز بگیرند.
•	نتیجه نیمه اول/نتیجه نهایی
می‌توانید پیش‌بینی کنید که نتیجه نیمه اول مسابقه چه خواهد بود و آیا نتیجه نهایی باقی می‌ماند یا تغییر می‌کند.
در ضمن، [سایت‌ پیش بینی فوتبا](https://tinibt.com/)ل معمولاً امکاناتی مانند آمار و اطلاعات تیم‌ها و بازیکنان، نمودارها و گزارش‌ها، نمایش نرخ شرط بندی و امکانات مشابه را فراهم می‌کنند تا به شما در انجام پیش‌بینی‌های بهتر کمک کنند.
OnePub Dart Community Choice Awards - $500 grand prize
Tags: dart, flutter, opensource
Published: 2023-07-05 07:50:20

OnePub is running a competition to find the most loved open-source Dart/Flutter package.To the winner goes $500.

If you are an open-source maintainer you are welcome to nominate your own package.At the same time, OnePub is announcing a Dart Package review/rating system along with per Package discussion threads. OnePub holds a fully synced copy of pub.dev.

[example discussion](https://onepub.dev/packages/dcli/discussions/show)

To bootstrap the review system, if you vote in the awards and leave a review, you will go into the draw to win a $100 prize.

It's early days, but we can already see the value that the review system is adding to the ecosystem. Just take a look at the 'get' package, 99% popularity, 12,000 likes but:

[get review](https://onepub.dev/packages/get/reviews/show)

If the competition goes well, we are hoping to run it at least annually and offer larger prizes.

So [come and vote](https://onepub.dev/show/31f3541c-e9aa-45c7-b9e7-50784275bbeb) to show your support for your favorite Dart/Flutter package.
4 Best Face Swap Apps for Videos
Tags: face, ai
Published: 2023-07-05 07:27:51

Looking for a face swap video editor? There are a number of great options available online, each with its own strengths and weaknesses. Here are four of the best:

**[Deepswap](https://www.popwebtools.com/deepswap):** This AI-powered app allows you to create face swap videos, photos, and GIFs. It's easy to use and offers a variety of features, including gender swaps, movie role refacing, and face memes.

**[HeyGen](https://www.popwebtools.com/heygen):** This video editing platform uses AI technology to specialize in face swapping. It offers users the option to upload image files or use custom AI avatar templates to create high-quality 1080p videos with multi-language support, text-to-speech, and talking photos.

**[Reface](https://www.popwebtools.com/reface):** This mobile app allows you to replace a celebrity's face in any video clip with any other face or look. It's easy to use and offers a large library of videos to choose from.

**Deepfakesweb:** This online tool uses AI to replace faces in videos. It's easy to use and offers a variety of features, including the ability to create deepfake videos in just three clicks.

Which face swap video editor is right for you will depend on your specific needs and preferences. If you're looking for a simple and easy-to-use option, Deepswap or Reface are good choices. If you're looking for a more powerful and versatile option, HeyGen or Deepfakesweb are better options.

No matter which face swap video editor you choose, you're sure to have a lot of fun creating hilarious and creative videos. So what are you waiting for? Start swapping faces today!

Here are some additional tips for creating great face swap videos:

- Use high-quality source videos. The better the quality of your source videos, the better your face swap videos will be.

- Choose the right face swap app or tool for your needs. There are a number of great options available, so take some time to compare them before you choose one.

- Experiment with different settings. Most face swap apps and tools offer a variety of settings that you can adjust to get the best results.

- Have fun! Face swap videos are meant to be fun, so don't take them too seriously. Just relax, experiment, and see what you can create.
Association, Composition and Aggregation in Java
Tags: java, programming
Published: 2023-07-05 07:20:59

In Object Oriented Programming, there can be broadly two types of relationships **"IS-A"** and **"HAS-A"** relationships.
We can achieve an **"IS-A"** relationship using **Inheritance**.
Whereas we can achieve a **"HAS-A"** relationship using **Association**.

**Composition** and **Aggregation** are two forms of Association.

## Association.

**Association** represents a relationship between two separate classes where objects of one class are related to objects of another class. It is a **loosely** coupled relationship, meaning that the **associated objects** can exist **independently**. 

The association can be one-to-one, one-to-many, many-to-one or many-to-many.

### Example

Let's take an example of the Car and Engine class. In this example, Both car and engine classes can exist independently. The lifecycle of the Engine class object does not depend on the Car class object.

```
class Car {
    private Engine engine;

    public Car(Engine engine) {
        this.engine = engine;
    }
}

class Engine {
    // Engine class implementation
}
```

## Composition.
**Composition** represents a strong form of association where on class is composed of one or more object of another class. The **composed object** cannot exist **without the existence** of **parent** class.

When the parent object is **destroyed** all the composed objects are also destroyed.

### Example.
In this example, the life cycle of the Engine object is completely dependent on the Car object. Once the Car object is destroyed, the associated Engine object will also be destroyed. 
In this example, instead of passing an Engine object through the constructor, we are creating an Engine object inside the Car constructor. Hence, Engine and Car objects are tightly coupled with each other.

```
class Car {
    private Engine engine;

    public Car() {
        this.engine = new Engine();
    }
}

class Engine {
    // Engine class implementation
}
```

## Aggregation.

**Aggregation** is a specialized form of **association** where one class has a reference to another class, but the object can exist **independently**. It represents a **“has-a”** relationship, where the associated object can be shared among **multiple objects**.

### Example

In this example, Department class contains a list of employee objects.
Each employee object can exist independently and their life cycle does not depend on the Employee object. Also multiple departments can share the same Employee object.

```
class Department {
    private List<Employee> employees;

    public Department() {
        employees = new ArrayList<>();
    }

    public void addEmployee(Employee employee) {
        employees.add(employee);
    }
}

class Employee {
    // Employee class implementation
}
```

## Conclusion
Aggregation and association are two forms of composition, where aggregation defines a **'HAS-A'** relationship with a **weak association**, while composition represents a **'BELONGS-TO'** relationship with a **strong association**.
Clone record with overrides
Tags: ruby, rails
Published: 2023-07-05 07:15:40

The clone_with_overrides function duplicates the original record using the dup method, assigns the overridden fields from the overrides hash, saves the new record, and returns it.

```
class Person < ApplicationRecord
  def clone_with_overrides(overrides = {})
    # Create a new instance of the model
    new_record = self.dup

    # Assign the overridden fields to the new instance
    overrides.each do |field, value|
      new_record[field] = value
    end

    # Save the new record
    new_record.save

    # Return the cloned record with overrides
    new_record
  end
end
```

To use this function, you can call it on an instance of the model and pass a hash of field-value pairs to override. Here's an example usage:

```
# Assuming you have an existing record with ID 1
original_record = Person.find(1)

# Clone the record and override some fields
cloned_record = original_record.clone_with_overrides(
  name: 'John',
  age: 42
)

# The cloned record is saved and ready to use
puts cloned_record.inspect

```
Make sure to adjust the field names and their types according to your model's attributes.
Re-creating a Japanese Fireworks Catalog from 1883 in CSS
Tags: css, codepen, webdev, showdev
Published: 2023-07-05 07:08:21

The other day I received a newsletter from the author Robin Sloan, containing samples of some beautiful old pages from a Japanese fireworks catalog from 1883:

![Fireworks Catalog](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ev0rvl7m9gyz48aankak.jpg)

This coincided with Codepen's weekly challenge being "Fireworks" — so I just **had** to try to re-create these beauties.

This is what I ended up with — my own interpretation of a mix between item № 66 and item № 67:

![Fireworks](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/514u96ekvx2lvquzy7ru.png)

It involves a lot of small, interesting stuff, that I'd like to share!

---

## Grainy Overlay
To get that rough, grainy look, I added an overlay covering the whole page — it's on `::after` on the `<body>`-tag, and was made using [Grainy Gradients Playground](https://grainy-gradients.vercel.app/).

---

## Small Stars/Explosions
The smaller stars/explosions are using `clip-path`, made with my own tool, "Polygon to clip-path and SVG" — you can find it on Codepen:

{% codepen https://codepen.io/stoumann/pen/MWjBRJv %}

> This tool has a lot of sentimental value to me, as the original algorithm was coded by a dear friend of mine, who sadly passed away in 2020.

---

## Large Star/Explosion
The main explosion consists of a `grid` with all items being placed center, using `grid-column: 1/-1` and `grid-row: 1/-1`. It's the new `position: absolute` for me, but with added flexibility. Each `<b>`-sub-node has it's own `--deg`(degree)-property, a total of 36 with a 10 degree between them.

On top of these, I've placed a mask with a `repeating-conic-gradient` to "cut out" the inner stacks of `<b>`s:

```css
--mask: repeating-conic-gradient(
  from 45deg at 50% 50%,
  var(--red) 0deg 7.5deg,
  transparent 7.5deg 10deg);
```

---

## Google Fonts API
I'm using two fonts, one for the numbers and one for the ampersand. It would be a complete waste of bandwidth to load the entire character-sets, so luckily Google Fonts support specifying only the characters you need, using the `text`-parameter in the URL:

```css
/* Numero Sign and Numbers */
@import url('fonts.googleapis.com ... &text=№67');
/* Other font, Ampersand */
@import url('fonts.googleapis.com ... &text=%26');
```

---

## Masks and other stuff
- On the black background *and* on the box with numbers, I use a mask, I found on [Open Props](https://open-props.style/).

- I'm using `cqi`-units (container-queries), so it's fully responsive.

- I'm using native CSS nesting, so don't preview in Firefox ;-)

---

You can see the final result here:

{% codepen https://codepen.io/stoumann/pen/MWzvYeX %}

---

## Animated version

{% codepen https://codepen.io/stoumann/pen/LYXjqNZ %}
Coding 101: How Do You Say SQL and What Is Its Role?
Tags: codenewbie, beginners, discuss
Published: 2023-07-05 07:00:00

_This week's discussion series is dedicated to helping beginners on their coding journey by addressing common doubts and misconceptions. We will delve into fundamental concepts, explore essential tools, and shed light on industry practices, providing clarity and guidance to those who are new to coding. If you're an experienced developer, your valuable insights, explanations, and best practices are highly encouraged and appreciated to support and mentor aspiring coders!_

> How do you pronounce "SQL," and what exactly does it do in the world of databases? Share your pronunciation preferences, explore its significance in managing data, and discuss your experiences working with SQL.

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 *%}*
Cutting-Edge or Stable: Which Technology Journey Would You Embark On?
Tags: discuss
Published: 2023-07-05 07:00:00

Delve into the choices between working with cutting-edge technologies that may become obsolete quickly or established technologies that offer stability. Which approach aligns better with your career goals, and why?

Follow the DEVteam for more discussions and online camaraderie!

{% embed [https://dev.to/devteam](https://dev.to/devteam) %}
C++, try catch , custom exception
Tags: try, catch, customexception
Published: 2023-07-05 06:58:09

Due to performance considerations, I have rarely used try-catch in my works. However, I recently encountered an easy problem on HackerRank about try catch that I couldn't solve.
--> I think we still need some basic about try-cacth^^ 

```cpp
//define my own exception class
class mException {
    int val;
public:
    mException(int n = 0) {
        val = n;
    }
    string what() {
        string str = "(mException) error at size = ";
        str.append(to_string(val));
        return str;
    }
};
// just thow some exceptions
bool isValid(string str) {
    size_t size = str.length();
    if (size == 1) throw invalid_argument("invalid argument...length = 1 ");
    if (size < 4) throw mException(size);// thow my custom exception
    if (str[0] == 'A') return true;
    else return false;
}
void test_try_catch(string str) {
    try {
        bool ret = isValid(str);
        if (ret) cout << "Valid..." << endl;
        else cout << "Invalid String" << endl;
    }
    catch (invalid_argument& ex) {
        cout << ex.what() << endl;
    }
    catch (mException& mex) {
        cout << mex.what() << endl;
    }
    catch (...) {
        cout << "other exception..." << endl;
    }
}
```
Innovative Accounting Solutions Offered By K M GATECHA & CO LLP
Published: 2023-07-05 06:49:21

K M GATECHA & CO LLP, a leading Accounting Firm in Ahmedabad, is pleased to announce their innovative accounting solutions and services, catering to the diverse needs of businesses in the region. With a team of highly skilled and experienced Chartered Accountants in Ahmedabad, the firm is committed to providing comprehensive and tailored financial solutions to help businesses thrive in today's dynamic market.

As businesses face ever-evolving challenges in the financial landscape, K M GATECHA & CO LLP understands the importance of staying ahead. Their website, https://kmgcollp.com/, serves as a platform to showcase the firm's expertise and highlights the array of accounting services available to clients.

The website provides a comprehensive overview of the firm's services, including auditing, tax planning, financial consulting, and assurance services. With a strong emphasis on client satisfaction, K M GATECHA & CO LLP prides itself on its ability to develop customized accounting solutions that align with each client's unique requirements. The firm's team of **[Chartered Accountants in Ahmedabad](https://kmgcollp.com/1-top-chartered-accountant-in-ahmedabad/
)** possesses deep industry knowledge and stays up-to-date with the latest regulatory changes, ensuring compliance and optimized financial strategies.

Additionally, the website offers a blog section that covers various accounting and financial topics, providing valuable insights and practical advice to businesses. The blog showcases the firm's thought leadership and demonstrates their dedication to keeping clients informed about industry trends and best practices.

K M GATECHA & CO LLP understands the significance of technology in streamlining accounting processes. Through their website, clients can access cloud-based accounting solutions, enabling them to efficiently manage their financial data and have real-time insights into their business's financial health.

With their innovative approach, K M GATECHA & CO LLP aims to empower businesses with accurate financial information, enabling them to make informed decisions, optimize operations, and achieve long-term growth.

For more information about K M GATECHA & CO LLP and their comprehensive accounting solutions, visit their website at https://kmgcollp.com/. The firm's team is readily available to assist businesses in Ahmedabad and beyond with their accounting needs.

About K M GATECHA & CO LLP:

K M GATECHA & CO LLP is a leading **[Accounting Firm in Ahmedabad](https://kmgcollp.com/best-accounting-firm-in-ahmedabad/)**, providing a wide range of accounting services to businesses. With a team of experienced Chartered Accountants, the firm offers tailored financial solutions and strives to deliver exceptional service to their clients.