teleren/devto huggingface dataset:
Mentor Coze AI
Tags: cozechallenge, devchallenge, ai, machinelearning
Published: 2024-04-20 01:55:13

*This is a submission for the [Coze AI Bot Challenge](https://dev.to/devteam/join-us-for-the-coze-ai-bot-challenge-3000-in-prizes-4dp7): Bot Innovator.*

## What I Built
<!-- Tell us what your bot does, who it's for, and what problem it solves -->

I built Mentor, your AI Guide to Self-Discovery, Career & Personality. It's also a great resource for those who want to learn the Science of Psychology. 
**Disclaimer: This is not a diagnosis tool! 
If you are struggling with your mental health, it is important to seek professional help. A mental health professional can assess your condition, develop a treatment plan, and provide you with the support you need to feel better**.

## Demo

<!-- Share a link to your bot in the Coze Bot Store and include screenshots or recordings showcasing a user's chat interface with your bot. -->

Curious? This is [Mentor](https://www.coze.com/store/bot/7359716137040756742?bot_id=true): 


![Flavour1](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nkufgmjm2l7997hpsws0.png)


![Flavour2](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/82i4qkd8re2885lbswuf.png)



![GABA](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hkwmcrqkwmybh0eyd3nz.png)

## Your Configuration

<!-- Screenshot or record your bot's configuration, including prompts and skills used.  -->


_Persona & Prompt_

![c1](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wfwzu3yexk12t98oeqy2.png)
![c2](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fidg0d90sbxnro6xmyvs.png)

_Skills_




![skills](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/egrj2kxzobmso6sj3c1d.png)




## Journey

<!-- Tell us about your process, what you learned, anything you are particularly proud of, what you hope to do next, etc. -->

It is the first time I create an AI Bot. I really enjoyed the experience and although at first I thought it would be difficult, I am really proud that I managed to accomplish this. Thank you for the challenge, I am really grateful! 🧡
I hope that Mentor will be a great use of everyone who wants to explore Psychology, as an educational aspect of their life. This includes both self and academic development, each of them in equal measure.


<!-- Team Submissions: Please pick one member to publish the submission and credit teammates by listing their DEV usernames directly in the body of the post. -->


<!-- Don't forget to add a cover image (if you want). -->

<!-- Thanks for participating! -->
#1992. Find All Groups of Farmland
Published: 2024-04-20 01:37:07

https://leetcode.com/problems/find-all-groups-of-farmland/submissions/1236977483/?envType=daily-question&envId=2024-04-20

```javascript

/**
 * @param {number[][]} land
 * @return {number[][]}
 */
var findFarmland = function(land) {
    let m = land.length;
    let n = land[0].length;
    let visited = new Array(m);
    for(let i = 0; i < m; i++)
        visited[i] = new Array(n).fill(false);
    let start = [];
    let end = [];
    function dfs(i,j){
        if(i < 0 || i === m || j < 0 || j === n)
            return;
        if(visited[i][j] === true || land[i][j] === 0)
            return;
        if(end[0] + end[1] < i + j)
            end = [i,j];
        visited[i][j] = true;
        dfs(i+1,j);
        dfs(i,j+1);
    }
    let ans = [];
    for(let i = 0; i < m; i++){
        for(let j = 0; j < n; j++){
            if(visited[i][j] === false && land[i][j] === 1){
                start = [i,j];
                end = [i,j];
                dfs(i,j);
                ans.push([...start,...end]);
            }
        }
    }
    return ans;
};

```
I am trying to become a dotnet developer
Published: 2024-04-20 01:27:45

---
title: I am trying to become a dotnet developer 
published: true
description: I want to learn .net

tags: 
# cover_image: https://direct_url_to_image.jpg
# Use a ratio of 100:42 for best results.
# published_at: 2024-04-20 01:26 +0000
---
Bot C
Tags: cozechallenge, devechallenge, ai, machinelearning
Published: 2024-04-20 01:21:03

*This is a submission for the [Coze AI Bot Challenge](https://dev.to/devteam/join-us-for-the-coze-ai-bot-challenge-3000-in-prizes-4dp): Trailblazer.*

## What I Built
<!-- Tell us what your plugin or workflow does and what problem it solves -->

## Demo

<!-- If submitting a plugin, share a link to your plugin in the Coze Plugin Store -->

<!-- Screenshot or record your plugin/workflow setup and show us what it can do.  -->

## Journey

<!-- Tell us about your process, what you learned, anything you are particularly proud of, what you hope to do next, etc. -->

<!-- Team Submissions: Please pick one member to publish the submission and credit teammates by listing their DEV usernames directly in the body of the post. -->

<!-- Don't forget to add a cover image (if you want). -->

<!-- Thanks for participating! -->
Shiny for python
Published: 2024-04-20 01:06:27

Shiny is an interactive web application development framework specifically built for the R programming language. It allows users to create interactive web applications directly from R without the need for deep knowledge of web technologies such as HTML, CSS, or JavaScript. Shiny is based on the shiny package from RStudio.
What is Shiny used for?
Interactive data visualization: Shiny is useful for creating interactive and dynamic data visualizations, enabling users to explore and analyze datasets in a more intuitive manner.
Real-time data analysis: It allows for real-time data analysis and presenting results interactively, facilitating data understanding and informed decision-making.
Hassle-free web application development: Shiny simplifies the web application development process, allowing users to focus on application logic and data analysis without worrying about web implementation details.
Sharing data analysis results: With Shiny, data analysts can easily create web applications to share their results and visualizations with colleagues, clients, or the general public.
In summary, Shiny is a powerful tool for creating interactive web applications and data visualizations using R, helping users effectively communicate their data findings and analyses.
Sure, let's continue with an exercise:

1.We import and install all the libraries that we see at the beginning and that they ask us to then load the data set that we will use. in this case, "titanic." Later we will make a graph that is modified using a drop-down menu with a table next to it.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7r6giyhufe72ht5ooiet.png)
2.We complete the code with two more graphics with their drop-down menu and at the end a map that contains 3 cities with their coordinates
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/goe5xrv9k07qj2k9m2hx.png)
3.We visualize the first part of the code when executing our app.py
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wj83srnmflujxf19pzie.png)
Here we can see the graph with its drop-down menu and its table

4.Now we see the two corresponding graphs
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vbuk1va33h4dyofnx8yk.png) 

5.Finally we see the map we created

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/21ccoh8esj8g4zomdmjr.png)
Advanced SQL Techniques: Take Next Level with CTE and SubQueries
Tags: sql, datascience, database, beginners
Published: 2024-04-20 00:54:05

Congratulations on [mastering the basics of SQL](https://dev.to/tinapyp/mastering-sql-queries-a-comprehensive-guide-for-beginners-410m)! Now it's time to elevate your data skills with advanced SQL techniques that will enable you to tackle more complex data challenges. In this guide, we'll explore advanced SQL concepts and techniques that go beyond the basics, empowering you to unleash the full potential of SQL for data manipulation and analysis.

## Common Table Expressions (CTEs):

Common Table Expressions, or CTEs, provide a powerful way to create temporary result sets that can be referenced within a query. They are particularly useful for breaking down complex queries into smaller, more manageable parts, improving readability and maintainability. Here's an example of how to use a CTE to calculate employee salaries:

```
WITH SalaryCTE AS (
    SELECT employee_id, base_salary, bonus,
           (base_salary + bonus) AS total_salary
    FROM employees
)
SELECT employee_id, base_salary, bonus, total_salary
FROM SalaryCTE
WHERE total_salary > 50000;
```

## Window Functions:

Window functions enable you to perform calculations across a set of rows related to the current row within a query result. They are commonly used for tasks such as ranking, aggregating, and performing moving averages. Here's an example of how to use a window function to calculate the average salary by department:

```
SELECT department_id, employee_id, salary,
       AVG(salary) OVER (PARTITION BY department_id) AS avg_salary_by_dept
FROM employees;
```

## Recursive Queries:

Recursive queries allow you to query hierarchical data structures, such as organizational charts or bill of materials, by defining a query that refers to its own output. This feature is particularly useful for traversing tree-like structures and generating recursive sequences. Here's an example of how to use a recursive query to generate a Fibonacci sequence:

```
WITH RECURSIVE Fibonacci(n, a, b) AS (
    SELECT 1, 0, 1
    UNION ALL
    SELECT n + 1, b, a + b FROM Fibonacci WHERE n < 10
)
SELECT a FROM Fibonacci;
```

## Advanced Joins:

In addition to basic joins (INNER, LEFT, RIGHT, FULL), there are other types of joins that can be used to solve specific data challenges. For example, CROSS JOIN produces a Cartesian product of two tables, while SELF JOIN joins a table to itself. Understanding these advanced join techniques can help you design more efficient and expressive queries.

## Conclusion:

By mastering advanced SQL techniques such as Common Table Expressions, Window Functions, Recursive Queries, and Advanced Joins, you'll be able to tackle even the most complex data challenges with ease. Remember to practice regularly and experiment with different SQL features to expand your repertoire of data manipulation and analysis tools. With these advanced SQL skills in your toolkit, you'll be well-equipped to take your data skills to the next level and drive impactful insights from your datasets.
Fim do Suporte do Microsoft SQL Server 2014
Tags: sql2014, sqlserver, sqlserver2014
Published: 2024-04-20 00:47:23

Fim do Suporte do Microsoft SQL Server 2014 (EOS) em 09/07/2024, mantenha seus clientes seguros.  

([Microsoft SQL Server 2014 Fim Suporte Técnico](https://www.microsoft.com/en-us/americas-partner-blog/2024/03/28/sql-server-2014-end-of-support-keep-your-customers-secure/))
Introduction to WebAssembly
Tags: webdev, beginners, programming, tutorial
Published: 2024-04-20 00:29:40

## Introduction

WebAssembly (Wasm) is a new and innovative technology that has taken the world of web development by storm. It is a low-level language that allows developers to compile high-level languages such as C, C++, and Rust into a binary format, making them executable on the web. This groundbreaking technology has opened up a world of possibilities for web developers, allowing them to create more efficient and powerful web applications. In this article, we will take a closer look at WebAssembly and discuss its advantages, disadvantages, and features.

## Advantages of WebAssembly

One of the major advantages of WebAssembly is its ability to improve the performance of web applications. By compiling high-level languages into a binary format, it can execute them much faster than traditional JavaScript, resulting in a significant boost in performance. Additionally, WebAssembly is extremely portable and can be run on any platform with a Wasm-compatible browser, making it accessible to a wider range of users.

## Disadvantages of WebAssembly

While WebAssembly has many advantages, it also has a few drawbacks. One of the main disadvantages is the lack of support for some web technologies, such as DOM manipulation, which is crucial for creating interactive web applications. It also requires developers to have a strong understanding of low-level languages, which can be a hurdle for those who are not familiar with them.

## Features of WebAssembly

WebAssembly offers some unique features that make it stand out from traditional web development technologies. It provides a sandbox environment for executing code, ensuring security and preventing malicious attacks. It also supports multithreading, which allows for more efficient and responsive web applications. Additionally, WebAssembly is designed to be backwards compatible, meaning it can be used alongside JavaScript, making it a versatile tool for developers.

### Example of Using WebAssembly in a Web Application

```javascript
// Load and run a WebAssembly module
WebAssembly.instantiateStreaming(fetch('example.wasm'), {})
  .then(obj => {
      console.log(obj.instance.exports.exportedFunction());
  });
```

This example demonstrates how to load and run a WebAssembly module in a browser. The `instantiateStreaming` method is used to fetch the `.wasm` file and instantiate it directly, allowing the exported function to be called.

## Conclusion

In conclusion, WebAssembly is a revolutionary technology that has the potential to change the way we develop web applications. Its ability to improve performance, cross-platform compatibility, and unique features make it a desirable tool for developers. While it has its limitations, its advantages far outweigh the disadvantages. As more and more browsers start to support WebAssembly, we can expect to see a significant shift towards its adoption in web development.
Caption This! 🤔💭
Tags: watercooler, discuss
Published: 2024-04-20 00:00:00

---
published_at : 2024-04-20 00:00 +0000
---
Think you've got what it takes to whip up the cleverest caption for this image? Give it a shot!

![Fisheye photo of a french bulldog and its owner both wearing sunglasses](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/39mhmsqdrnjyappciebv.jpg)

Follow the DEVteam for more discussions and online camaraderie!

{% embed [https://dev.to/devteam](https://dev.to/devteam) %}
Redux + Zustand
Published: 2024-04-19 23:49:58

Finalizei mais um projeto da rocketseat, só para aprimorar mais com o **redux** e o famoso **zustand**.

Nesse projeto você vai encontrar os fundamentos do redux basicamente, criei um store do redux para gerenciar os estados da aplicação, criei reducers, slice, hook global e claro não poderia faltar os **testes unitários** deles também.

Foi criado essa interface UI simples de um player comum de aulas.

Conectando à API utilizando o "**Async Thunks**", tem também um loading enquanto carrega os dados dessa API.

E finalmente fiz a migração do redux para o zustand e mais novos teste unitários no zustand.

**Projeto** - [Github](https://github.com/DevTeles/react-redux-zustand)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7ebi3xbu3k27t0cthz2y.png)
How to make a good looking UI
Tags: help, webdev, css
Published: 2024-04-19 23:36:39

I made a website recently, and I'm reallising that it looks a little odd. I've only been coding for about 6 months, so I'm not great at styling. Here's a screenshot.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qurxfn7c2j3ax8y92t5r.png)
And here's a link if you want to try the other pages.
[https://script-robot.tiiny.co](https://script-robot.tiiny.co)
I feel like it looks really weird compared to other sites. Any ideas to help it look better?
dict.setdefault() method in Python
Published: 2024-04-19 23:11:10

---
title: dict.setdefault() method in Python
published: true
date: 
tags: 
canonical_url: https://www.pynerds.com/dict-setdefault-method-in-python/
---


The `setdefault() `method is used to retrieve a value from a dictionary given its key. If an item with the given key does not exist in the dictionary, it adds it and sets a given value for it.

The syntax is as shown below:

```

d.setdefault(key, value = None)
```

| `key` | The key whose associated value is to be retrieved |
| `value` | The value to be set if the item with the given key does not exist. It defaults to None. |

If an item of the given key exists, its value is returned. Otherwise, the key with the specified value is added to the dictionary and the value is returned.  

```

d = {
     'Tokyo': 'Japan',
     'Ottawa': 'Canada',
     'Kigali': 'Rwanda'
    }

value = d.setdefault('Kigali')
print(value)
```

In the above example, we used the `setdefault() `method with a key that exist in the dictionary, **'Kigali'**. The value associated with the key is returned which is 'Rwanda'.

Consider the following example:

```

d = {
     'Tokyo': 'Japan',
     'Ottawa': 'Canada',
     'Kigali': 'Rwanda'
    }

value = d.setdefault('Manilla')
print(value)

print(d)
```

In the above example, the given key, **'Manilla'** does not exist in the dictionary. The` setdefault()` method adds an item with the key and sets a default value of `None `to it because we did not specify another value.

with a default value given

```

d = {
     'Tokyo': 'Japan',
     'Ottawa': 'Canada',
     'Kigali': 'Rwanda'
    }

value = d.setdefault('Manilla', 'Philippines')
print(value)

print(d)
```

<div class="related"><h3>Related articles</h3><hr><ul><li><p><a class="text-success" href="https://www.pynerds.com/dictionary-in-python/">Dictionary in Python</a><li><p><a class="text-success" href="https://www.pynerds.com/python-dict-function/">Python dict() Function</a><li><p><a class="text-success" href="https://www.pynerds.com/dict-get-method-in-python/">dict.get() method in Python</a><li><p><a class="text-success" href="https://www.pynerds.com/dict-update-method-in-python/">dict.update() method in Python</a><li><p><a class="text-success" href="https://www.pynerds.com/items-keys-and-values-methods-in-python-dictionary/">items(), keys() and values() methods in Python dictionary</a><li><p><a class="text-success" href="https://www.pynerds.com/dict-pop-in-python/">dict.pop() in Python</a><li><p><a class="text-success" href="https://www.pynerds.com/dict-clear-method-in-python/">dict.clear() method in Python</a><li><p><a class="text-success" href="https://www.pynerds.com/dict-fromkeys-method-in-python/">dict.fromkeys() method in Python</a><li><p><a class="text-success" href="https://www.pynerds.com/dict-popitem-method-in-python/">dict.popitem() method in Python</a><li><p><a class="text-success" href="https://www.pynerds.com/dict-copy-method-in-python/">dict.copy() method in Python</a></ul></div>
Var, Let and Const
Tags: javascript, programming, tutorial, beginners
Published: 2024-04-19 20:51:25

**var**, **let**, and **const** are all used to declare variables in JavaScript, but they have some differences in terms of scope, reassignment, and initialization:

## var

- **var** declarations are globally scoped or function scoped.
- They can be reassigned and re-declared within their scope.
- **var** variables are hoisted to the top of their scope and initialized with **undefined**.

```Javascript
var x = 10;
console.log(x); // Output: 10

{
    var x = 20;
    console.log(x); // Output: 20
}

console.log(x); // Output: 20

```

## let

- **let** declarations are block scoped.
- They can be reassigned but not re-declared within their scope.
- **let** variables are **not hoisted**; they are only accessible after they are declared.

```Javascript
let y = 10;
console.log(y); // Output: 10

{
    let y = 20;
    console.log(y); // Output: 20
}

console.log(y); // Output: 10

```

## const

- **const** declarations are block scoped.
- They **cannot** be **reassigned** or **re-declared** within their scope.
- const variables must be initialized during declaration and cannot be left uninitialized.

```javascript
const z = 10;
console.log(z); // Output: 10

{
    const z = 20;
    console.log(z); // Output: 20
}

console.log(z); // Output: 10

```
In summary, **var** has function scope, **let** and **const** have block scope. let allows reassignment, while const does not. const requires initialization and cannot be re-declared or reassigned.

[Explore more on my Youtube channel](https://www.youtube.com/channel/UCeGzR-6TI58skwlha6JNhDw)
[Follow me on Linkedln](https://www.linkedin.com/in/ticha-godwill-nji-206563228/)
Algorithm and Pseudocode
Tags: algorithms, codenewbie, pseudocode, programming
Published: 2024-04-19 22:56:47

## Algorithm and Pseudocode
[**Algorithm**](https://edu.gcfglobal.org/en/computer-science/algorithms/1/) is a set of rules to follow to solve a mathematical or computing problem.
[**Pseudocode**](https://www.techtarget.com/whatis/definition/pseudocode#:~:text=Pseudocode%20is%20a%20detailed%20yet,involved%20in%20the%20development%20process.), on the other hand, is way of descriping algorithm in a less formal way. **Pseudocode** uses more informal-like english expression to express algorithm so that programmers can implement the algorithm in any programming language.

Unlike programming language, pseudocode does not follow any particular rule. You can come up with any standard for your pseudocode representation.

In this article, we are going to see how we can express algorithm in pseudocode.

### Expresssing Algorithm in Pseudocode
Assumed you are ask to give algorithm to add two numbers (2 + 3) together. You can give the algorithm in either low level or high level. In low level, you can express the algorithm as below;
```
LOAD 2 AS $a
LOAD 3 AS $b
ADD $a AND $b AS $c
RETURN $c
```

while in  high level, you can express the algorithm as below;
```
sum = 2 + 3
```

As you can see from the example, you can be as low level as possible or as high level as possible in your pseudocode. What matters most is that your audience can undestand your algorithm from the pseudocode.

Let's take one more example pseudocode. Imagine you are given three numbers; a, b and c. To write and algorithm in pseudocode to sort those numbers in ascending order, your pseudocode can be as below;
```
Algorithm to sort three numbers (a, b, c) in ascending order

FOR EACH number IN (a, b, c) BEGIN
    FOR EACH number_again IN (a, b, c) BEGIN
      IF number > number_again BEGIN
        SWAP INDEX OF number WITH INDEX OF number_again
      ENDIF
    ENDFOR
ENDFOR
```

Pseudocode helps you to express your algorithm clearly and also spot correct errors in your algorithm before you even start to code. Pseudocode also helps you communicate effectively with other programmers.

In our next article we will look at some important building blocks in pseudocode to prepare us so that we can be able to express our algorithm effectively before we start our coding journey. See you in the next article.