teleren/devto huggingface dataset:
Mastering Git Workflow A Comprehensive Guide to Merge and Rebase
Tags: programming, github, git, githubactions
Published: 2023-12-04 17:24:31


## Understanding Git Merge and Rebase

Git is a powerful version control system that allows developers to collaborate on projects effectively. Two common ways to integrate changes from one branch into another are through **merge** and **rebase**. Both methods achieve similar goals but follow different approaches, each with its advantages and considerations.

### Git Merge

**Merge** combines changes from different branches. When you merge one branch into another, Git creates a new commit that encompasses the changes from both branches.

#### Example:
Let's say you have two branches: `master` and `feature-branch`. To merge `feature-branch` into `master`, follow these steps:

1. **Checkout `master` branch:**
   ```
   git checkout master
   ```

2. **Merge `feature-branch` into `master`:**
   ```
   git merge feature-branch
   ```
   This command incorporates changes from `feature-branch` into `master`.

The merge commit will be created, preserving the commit history of both branches.

### Git Rebase

**Rebase**, on the other hand, rewrites commit history by moving the changes from one branch to another. Instead of creating a merge commit, it applies each commit in the feature branch onto the base branch individually.

#### Example:
To rebase `feature-branch` onto `master`:

1. **Checkout `feature-branch`:**
   ```
   git checkout feature-branch
   ```

2. **Rebase `feature-branch` onto `master`:**
   ```
   git rebase master
   ```
   This command reapplies each commit in `feature-branch` on top of the latest `master` commit.

### Choosing Between Merge and Rebase

#### Merge:
- **Preserves commit history:** The merge commit records the integration of changes.
- **Simpler to understand:** The commit history remains intact, showing the sequence of changes.

#### Rebase:
- **Linear history:** It creates a cleaner, linear history without additional merge commits.
- **Smoother integration:** Helps to resolve conflicts as they occur, reducing conflicts during the final merge.

### Considerations:

- **Shared branches:** For branches shared with others, prefer merge to maintain a clear history.
- **Private branches:** In personal branches, rebase can be useful to maintain a clean, linear history.

### Conclusion

Git merge and rebase offer distinct approaches for integrating changes in a repository. Choose the method that aligns with your project's workflow and collaboration needs. Whether you opt for merge's clear recording of changes or rebase cleaner history, both techniques contribute to efficient version control in Git.

Remember, the choice between merge and rebase largely depends on the project's context and collaboration style. Understanding these Git workflows empowers developers to manage changes effectively while maintaining a clean and organized repository.
A Big Thank You!
Tags: thankyou, 99followers, love
Published: 2023-12-04 17:22:46

I am gonna make my message short but crystal clear...

I absolutely LOVE you all... Yess! I am talking to you. Thank you for following me on DEV community as it just means so much to me. 

> I have a total of 99 followers! Way to go yayy!

I have just posted 2 articles and got some really good responses from you guys.

Love to see how this community is so supportive and motivating. That will push me to keep creating the BEST content for you all spanning various topics across web development, entrepreneurship, and my life as well.

Although I have quite some topics packed in my adventure bag, what topics would you like me to touch upon in future posts? What do you want me to write about?

Now with that said I want to know more about EACH one of you. So tell me about the latest projects you've been working on recently and we can have a lovely chat!

After all, that's what I love doing: Talking to new people every day.

PS: If you read till here then you HAVE TO either comment or like this post. Haha kidding, you can just completely ignore this no-value/no-content post and find something more useful :) 

See you in the comments!
SQL Commands that every Developer should know
Tags: tutorial, coding, programming, learning
Published: 2023-12-04 17:14:06

Here are some SQL commands that every developer should know:

- SELECT
- INSERT
- DROP TABLE
- UPDATE
- DELETE
- CREATE TABLE
- ALTER TABLE
- JOIN
- GROUP BY
- HAVING
- ORDER BY

Don't hesitate to add more commands in the comments if I have missed them out!
Ce que l'advent of code m'a appris en Python #1
Tags: python, adventofcode
Published: 2023-12-04 17:13:41

L'[advent of code](https://adventofcode.com/2023) est une compétition composée d'énigme à résoudre dans le langage que l'on souhaite. 

J'ai vraiment commencé à me pencher sur les énigmes que depuis l'année dernière en essayant autant que possible de faire les énigmes chaque jour en utilisant le langage Python que j'apprécie particulièrement.

Et chaque jour, je découvrais des subtilités du langage et j'ai décidé de compiler ce que j'ai appris dans des billets.

## Expression régulière : recherche gauche

Pour le premier jour, je voulais faire une recherche dans une chaîne de caractère, mais en récupérant la dernière occurrence dans une ligne (on appelle ça parfois faire une recherche gauche.) 

Pour cela, on utilise le _negative lookahead_ qui permet d'obtenir la dernière occurence.

`(Test)(?!Test)`

Bon, au final, j'ai utilisé une autre technique pour trouver ce dont j'avais besoin, mais j'étais content de découvrir cette fonctionnalité des regexp.

## Test Unitaire

Bien que j'utilise les TU au quotidien dans mon boulot, l'année dernière, je n'avais pas pris l'habitude d'écrire les tests avant d'écrire mon code et comme les énigmes d'Advent of Code sont toujours fourni avec un jeu de données de test et leur résultat, il est très facile d'écrire un test pour s'assurer que le code est bon (au moins sur le jeu de test) pour l’exécuter ensuite sur notre entrée principal de l'énigme.

A bientôt pour les découvertes des autres jours.
Never ship on Fridays: The meme legend and my take #3 on popular developer dogma
Tags: programming, softwaredevelopment
Published: 2023-12-04 17:13:40

There is a strong opinion in software development about _**NOT**_ releasing on Fridays. Friday deadlines (often the end of the work week or sprint) are pushing developers to rush to finish tasks. The temptation to push deployments through without adequate checks is high. What can go wrong?

- **Compromised quality** : A tendency to bypass proper testing or ignore test failures leads to unstable releases.

- **Weekend recovery**: If something goes wrong, devs have to give up their weekend to fix the issues, leading to burnout and dissatisfaction.

- **Lost context**: Developers who have shifted focus may not recall all the details. Troubleshooting gets more difficult.

![homer deploying on a Friday programmer meme](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kwovm4edmrnqzj9jj986.png)

[Allen Holub](https://twitter.com/allenholub/status/1640059900528328704) stands firmly on the other side of the argument.
‍
![Allen Holub tweet screenshot 1](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/008uj10v9g9imkvdkw92.png)

Allen goes on to say that your code quality [must be inadequate if you refuse to release on Fridays](https://twitter.com/allenholub/status/1189584085338882048). While I generally hold Allen's opinions in high regard, the statement is quite bold.

![Allen Holub tweet screenshot 2](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/oy5o1xeckt7e0ihvx8i3.png)

Being completely averse to Friday releases can come across as dogmatic. Yet, I disagree with Alan on ‘no Friday releases’ being a sign of inadequate quality.

**I have released on a Friday**. Bugs can occur any time or weekday and Fridays are no different. It's fundamentally about setting expectations with your team. If there's an opportunity, however small, to reduce the likelihood of a weekend rollback or hotfix, I’m taking those odds any time. Because I value my own and my fellow engineers' weekends.

Sure, bugs **should ABSOLUTELY** be found before ever reaching production, but that’s not a 100%. I don’t see the issue with pushing a bigger release to Monday, if there’s no business need to get it out on Friday.



**Daniel Draper**
Lead engineer at Octomind
Understanding JavaScript's Object-String Comparison
Tags: webdev, javascript, programming, beginners
Published: 2023-12-04 16:55:49

JavaScript's loose equality operator (==) often leads to intriguing comparisons due to its type coercion. One such comparison involves an empty object and a string. Let's delve into this scenario to understand the underlying principles.

Consider the code snippet:


```
const x = {};
console.log(x == "1");
```

One might intuitively expect this to output true. However, in JavaScript, this results in false. Why does this happen?

## Type Coercion in JavaScript
JavaScript employs type coercion when using the loose equality operator (==). It attempts to convert operands to a common type for comparison.

In this case, the empty object x and the string "1" are inherently of different types. JavaScript attempts to coerce these values to a common type for comparison but fails to equate them.

## Understanding the Comparison
An empty object, {}, doesn’t naturally convert into a string resembling "1". Therefore, the comparison using == returns false.

However, we can explore other ways to achieve a true comparison.

## String Conversion and Equality
To explicitly convert an object to a string for comparison, you can use the toString method or the String() function:

```
console.log(String(x) === "1"); // Outputs: false
```

This will return false because an empty object converted to a string results in "[object Object]", not "1".

## Overriding toString Method
To make the comparison x == "1" evaluate to true, we can override the toString method of the object:

```
const x = {
  toString: function() {
    return "1";
  }
};

console.log(x == "1"); // Outputs: true
```

Here, the toString method explicitly returns "1", causing the comparison to yield true.

## Conclusion
JavaScript's loose equality operator can produce unexpected results, especially when comparing different data types. Understanding type coercion and the behavior of specific data types is crucial to anticipate and manage these scenarios effectively.

While an empty object and the string "1" are inherently dissimilar, explicit type conversion or method overriding can alter how these values are compared.

By grasping these intricacies, developers can write more predictable and robust JavaScript code.

JavaScript's type coercion is a powerful feature but requires careful handling to ensure accurate comparisons and operations.

Understanding these nuances enables developers to navigate JavaScript's quirks and write more reliable and maintainable code.
Programming paths for different kinds of people
Tags: discuss, coding, programming, learning
Published: 2023-12-04 16:50:22

Many people don't know where to start while learning to code. So I want to help those people, so in this post I am going to recommend programming paths for different types of people.

## Visual learner

- Start with something like **Scratch** which is a block based programming language.
- Next move on with **HTML** because that will let you see results instantly
- To make your HTML code pretty, learn **CSS**
- To make your HTML code work, learn **JavaScript**
- Then probably learn **SQL**, so that you can perform database operations in your webapp
- Finally, now you can learn web frontend frameworks like **React**, **Vue**, **Angular**, etc 

## Math Whiz

- If you like mathematics, start with something like **SQL**
- Then maybe try some **Python**
- Now learn Python libraries like **panda**,**numpy**, etc deeply.
- Get started with **R**
- Learn **Tableau** or **PowerBI**
- You are now on a path to be a great data analyst!

## Always on your phone?

- Start with basic **Java**
- Then learn Java for **Android**
- Next learn **XML**
- Move on to learning **SQL**
- Then learn some **Kotlin**
- Finally finish off with **Firebase**

## Rich kid?

- You probably have a Mac and an iPhone. So get started with **Swift**
- Become familiar with **Xcode**
- Learn **Objective-C**

## Gamers

- Get started by learning **C#**
- Get familiar with **Unity**
- Learn to create voxel art using **MagicaVoxel**
- Learn to create pixel art using **Aseprite**
- Move on to learning how to use **Blender** for creating 3D models
- Learn **C++**
- Become familiar with **Unreal Engine**

What are your suggestions as to what programming paths people should take based on their interests/learning type/resources/skills?
SQL - Query Optimization
Published: 2023-12-04 16:45:57

**_<u>Rewriting Queries</u>_**

```
SELECT * 
FROM Customers 
WHERE state = 'New York' AND city = 'New York';
```

```

SELECT * 
FROM Customers 
WHERE state = 'New York' 
AND city IN (SELECT city 
              FROM Customers 
              WHERE city = 'New York');
```

**_<u>Choosing the right index</u>_**

```
CREATE INDEX index_name
ON table_name (column1, column2, ...);
```

**_<u>Fine-tuning Database Design</u>_**
🚀 Desafio React Native: Resolvendo Problemas com o Teclado no Android 🚀
Published: 2023-12-04 16:32:04

> 💡 Problema Comum: Teclado que Não Fecha em Dispositivos Android


![Image description](https://media.tenor.com/YRzeUmYfWrQAAAAd/jim2.gif)

Se você já enfrentou a situação em que o teclado não fecha automaticamente após a interação em um aplicativo React Native no Android, você não está sozinho! Esse é um problema comum que pode causar frustração.

**🛠️ Solução: Utilizando 'react-native-keyboard-aware-scroll-view'**

Uma maneira eficaz de lidar com esse problema é integrar a biblioteca **react-native-keyboard-aware-scroll-view**. Essa biblioteca ajusta automaticamente o layout quando o teclado é exibido, garantindo uma experiência suave para o usuário.

**Passos Rápidos:**

1️⃣ Instale a biblioteca usando o comando:

```
npm install react-native-keyboard-aware-scroll-view
```


2️⃣ Importe-a no seu componente:

```
import { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view';
```

3️⃣ Substitua o componente **ScrollView** por **KeyboardAwareScrollView** e pronto! O teclado agora deve se comportar conforme o esperado.

```
<KeyboardAwareScrollView>
  {/* Seu conteúdo aqui */}
</KeyboardAwareScrollView>
```

Espero que essa dica ajude a tornar sua experiência com o React Native no Android mais tranquila! Compartilhe suas próprias soluções ou problemas que você enfrentou nos comentários. Juntos, construímos uma comunidade mais forte! 💪🚀


#reactnative #mobiledevelopment #techtips #androiddevelopment #programming #codesolutions #developercommunity #softwaredevelopment #techsolutions #android #ios
Tech-related goals for 2024
Tags: discuss, coding, programming, career
Published: 2023-12-04 16:28:47

So, everyone has many goals for each year. Some goals are related to health and fitness, some are related to relationships, some are related to career and so on. Since I'm in the tech industry, some of my learning and career goals are tech-related. So some of my tech-related goals for 2024 are:
- To learn web development
- To learn data analytics
- To learn UI/UX designing
- To get promoted at my tech job
- To complete 50 online courses (most of them will be tech courses)

What are your tech related goals for 2024? Let us know in the comments!
Paracetamol.js💊| #222: Explica este código JavaScript
Tags: javascript, spanish, webdev, programming
Published: 2023-12-04 16:26:29

## **<center>Explica este código JavaScript</center>**
#### <center>**Dificultad:** <mark>Intermedio</mark></center>

```js
const sum = (num1) => {
    return (num2) => {
        return num1 + num2
    }
}
console.log(sum(1)(2)) // 🤔🤔
```

- A. `SyntaxError`
- B. `2`
- C. `3`
- D. `1`

---

Respuesta en el primer comentario.
Marvel API App | JavaScript Tutorial With Source Code
Tags: webdev, javascript, programming, opensource
Published: 2023-12-04 16:15:14

{% embed https://www.youtube.com/embed/5aG5oMqfc5U?si=Mlk9KcP6aO2wTIIr %}

Certainly! The text outlines the content and objectives of a tutorial or project that teaches users how to create a superhero search app using the [Marvel API](https://developer.marvel.com/) with [HTML, CSS, and JavaScript.](https://www.youtube.com/@learnwithdanial417) Let's break down the key points:

## Objective:

- The main goal is to guide learners in creating an impressive superhero search app using the Marvel API.

## Technologies Used:

- [HTML, CSS, and JavaScript:](https://www.youtube.com/@learnwithdanial417) These are the core technologies used to build the superhero search app.

## API Integration:

- The Marvel API is employed to fetch superhero-related data, indicating that the app dynamically retrieves information from the Marvel database.

## Intermediate Level Project:

- The project is described as intermediate level, suggesting that it requires a foundational understanding of JavaScript concepts, particularly the usage of fetch and await. Learners are expected to have basic knowledge of asynchronous operations in JavaScript.

## Skill Level Required:

- The tutorial assumes that users have basic knowledge of fetch and await, indicating that it is suitable for individuals who have some familiarity with asynchronous programming in JavaScript.

## Practical Application:

- By creating a superhero search app, the tutorial likely provides practical experience in building interactive web applications that interact with external APIs.

## Hands-on Learning:

- The use of [HTML, CSS, and JavaScript](https://www.youtube.com/@learnwithdanial417) suggests a hands-on learning experience, with a focus on applying these technologies to create a functional and visually appealing superhero search app.

In summary, this tutorial or project is designed for individuals with an intermediate level of JavaScript knowledge. It guides learners in creating a superhero search app that utilizes the [Marvel API](https://developer.marvel.com/), providing practical experience in fetching and displaying superhero-related data dynamically on a webpage.
🚀 Exciting Update: 'Exploring Palindromes with LeetCode 234 - 'Palindrome Linked List'!' 🎥
Tags: programming, tutorial, productivity, algorithms
Published: 2023-12-04 16:12:24


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

Hello, tech enthusiasts! I'm thrilled to share my latest video where I tackle the challenge of LeetCode problem 234 - 'Palindrome Linked List.' Join me as we explore an efficient way to determine whether a linked list is a palindrome using Fast and Slow Pointers.

🎥 Watch the video here: https://youtu.be/F35vw3rCsEA?si=YK7P5TaeT6BXs_Ux
🔗 Access the code on GitHub: https://github.com/Vinay352/Leetcode/tree/main/0234-palindrome-linked-list
🔗 Explore the LeetCode question: https://leetcode.com/problems/palindrome-linked-list/

Your thoughts and comments are highly appreciated, so feel free to share your insights below. Let's continue our shared journey of learning and coding! 💡👨‍💻

Stay connected:
🎥 YouTube: https://www.youtube.com/@VinayJainDev3097
📚 Medium: https://medium.com/@vinay.j3097
📝 Dev.to: https://dev.to/vinay_jain_dev
🔗 GitHub: https://github.com/Vinay352
🐦 Twitter: https://twitter.com/vinayj3097
📸 Instagram: https://www.instagram.com/vinay_jain_dev/
📘 Facebook: https://www.facebook.com/vinayj3097/
hgh
Tags: hgh
Published: 2023-12-04 16:07:17

Navigating the process of getting HGH prescribed online can be daunting. The article at [hgh results after 1 month](https://hghtherapydoc.com/hgh-therapy/hgh-therapy-results/) offers clear guidance. It details the steps and requirements for obtaining an HGH prescription online, strictly for adults in the USA. This resource is invaluable for ensuring a safe, legal, and informed approach to HGH therapy.
Santa hat christmas button using html, css
Tags: freecodez, react, html, blog
Published: 2023-12-04 16:03:50

Hey there, You are most welcome to this article. I hope you will enjoy this article. If you like this article then please share this article with your friends and colleagues. If you have any questions or suggestions regarding this article then please comment down below.

**Santa hat christmas button using html, css**

![Santa hat christmas button using html, css](https://res.cloudinary.com/freecodez/image/upload/v1701705825/images/iqkiyvbvnvt7koef1kde.webp)

For full source code visit : [https://freecodez.com/post/bhbcmqq](https://freecodez.com/post/bhbcmqq)


```html
<!-- https://freecodez.com -->
<button class="button" type="button">
  Christmas button
  <img class="button-hat" src="https://res.cloudinary.com/freecodez/image/upload/v1701705719/images/guidvrtf8kre7pc3jdk5.webp" alt="">
</button>
<canvas class="canvas"></canvas>

```

Source Code : [https://freecodez.com/post/bhbcmqq](https://freecodez.com/post/bhbcmqq)

For more such articles visit : [https://freecodez.com](https://freecodez.com/all)
DataSource issue in spring Batch 5 - mongodb
Tags: springboot, springbatch, mongodb, excel
Published: 2023-12-04 15:51:42

Hey, I am trying to implement spring batch 5 with mongodb

```@Autowired
SodRepository sodRepository;

@Bean
public ItemReader<Sod> csvFileReader() {
  FlatFileItemReader<Sod> reader = new FlatFileItemReader<>();
  reader.setResource(new ClassPathResource(file)); // Specify your CSV file
  reader.setLineMapper(new DefaultLineMapper<Sod>() {{
    setLineTokenizer(new DelimitedLineTokenizer() {{
      setNames(new String[]{"groupCode","original", "conflictsWith", "level", "relationship", "validFrom", "validTo"});
    }});
    setFieldSetMapper(new BeanWrapperFieldSetMapper<Sod>() {{
      setTargetType(Sod.class);
    }});
  }});
  return reader;
}


@Bean
public ItemWriter<Sod> mongoItemWriter() {
  return items -> sodRepository.saveAll(items);
}

@Bean
public Job job(JobRepository jobRepository, PlatformTransactionManager transactionManager) {
  return new JobBuilder("myJob",jobRepository)
          .start(step1(jobRepository,transactionManager))
          .build();
}

@Bean
public Step step1(JobRepository jobRepository, PlatformTransactionManager transactionManager) {
  return new StepBuilder("myStep",jobRepository)
          .<Sod, Sod>chunk(100)
          .reader(csvFileReader())
          .writer(mongoItemWriter())
          .transactionManager(transactionManager)
          .build();
}

and mongo config:
@Configuration
@EnableConfigurationProperties
@EnableMongoRepositories(
        basePackages = {"com.airtel.africa.ums.client.config"},
        mongoTemplateRef = "mongoTemplate"
)
@EnableTransactionManagement
public class MongoConfig extends AbstractMongoClientConfiguration{

    @Value("${spring.data.mongodb.database}")
    private String databaseName;

    @Value("${spring.data.mongodb.uri}")
    private String mongoUrl;

    @Bean
    MongoTransactionManager transactionManager(MongoDatabaseFactory dbFactory) {
        return new MongoTransactionManager(dbFactory);
    }

    @Override
    protected String getDatabaseName() {
        return databaseName;
    }

    @Override
    public MongoClient mongoClient() {
        final ConnectionString connectionString = new ConnectionString(mongoUrl);
        final MongoClientSettings mongoClientSettings = MongoClientSettings.builder()
                .applyConnectionString(connectionString).build();
        return MongoClients.create(mongoClientSettings);

    }

    @Bean(name = "mongoTemplate")
    public MongoTemplate mongoTemplate(MongoDatabaseFactory mongoDatabaseFactory) {
        return new MongoTemplate(mongoDatabaseFactory);
    }

}
```

am getting error - Parameter 0 of method csvProcessingStep in com.airtel.africa.ums.client.excel.ExcelUploadConfig required a bean named 'dataSource' that could not be found.