teleren/devto huggingface dataset:
Prioritizing Self, Team, or Job: Trends in Sincerity in Cooperative Polls
Tags: research, python, lifestory, reflect
Published: 2023-05-28 19:38:02

Hi everyone! I want to get more used to sharing news about my life and what I have been working on as an undergraduate college student!

At the end of my first year (2022), I was given a fantastic opportunity where I was able to collaborate on academic research under one of the professors at my university. I was unsure of what to expect, and I was a little nervous. I remember thinking, "How could I possibly contribute to the world of academia?" 

Thankfully, I persevered through the experience and was able to meaningfully contribute to this research. This was my very first publication, and I also had the honor of being the solo presenter at the 2022 International Conference on Cooperative Design, Visualization and Engineering.  

This single experience was life changing. I met many professors who were well regarded in the academic setting, I had my eyes opened to the world of research, and most importantly, I found out this is something I have genuine interest in. Today, I have co-authored another published paper, and I am working on two more. 

I hope this is an inspiring story for any fellow students who are unsure of what they want to do with their undergrad years. If there is something that even slightly interests you, go for it. Chances are, you will end up surprising yourself like I did. The same is true for everyone. It is never too late to discover things you are passionate about! 

In case anyone is interested in giving it a read I will put some information about it below!

**Title:** [Prioritizing Self, Team, or Job: Trends in Sincerity in Cooperative Polls](https://link.springer.com/chapter/10.1007/978-3-031-16538-2_4)

**Abstract:** As automated tools become commonplace for coordinating meeting times and other forms of decentralized cooperative decision-making, it is important to understand the behavior of people using those tools. Even when a tool or online platform is simply a form of approval voting, the specifics of the voting scenario need to be considered. Approval voting often assumes that voters are sincere, never voting yes to an option that is less desirable than one for which they have voted no. A small study suggested that the assumption of sincerity among users in cooperative polls should not be taken for granted. This work expands the study to a larger sample of college students at multiple institutions, showing that people responding to polls may aim to be sincere, but are influenced by various factors, including the nature of the meeting.
`<code>Testing</code>` - React to this post in the interest ov DEV.
Tags: webdev, watercooler, dev
Published: 2023-05-28 19:14:04

This is random, and if any mods see this, do not remove the tags, they are indeed relevant (you will see this in the [forem/forem repo](https://github.com/forem/forem) later).
I require at least one person to react to this, and at least one person to leave a comment, to test something related to the notification menu.

<center><b>Thanks!<br/>Cheers!</b></center>
How to Install dbForge Studio for Oracle on MacOS
Tags: oracle, macos, dbforgestudio, database
Published: 2023-05-28 19:09:37

In this video you will learn how to install and run dbForge Studio for Oracle on your Linux machine using CrossOver - https://youtu.be/_IZB8GBw4co

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lx7eyt2fxunj1yye1rxv.png)
CSS Colours for beginners
Tags: beginners, css, codenewbie, html
Published: 2023-05-28 18:57:14

Let's talk about using colours in CSS!!

It is very easy to use colours in CSS, in this blog I will tell you how to use them. 

CSS uses Hexadecimal colours to get the precise colour you want. I use something called a colour picker extension, or I will use a website called **colorhunt.co**, and this is full of colour palettes that you can copy and paste into your CSS. I also use a chrome extension called **ColarZilla** and it is fantastic! It is easy to download and once it is in your chrome bar, you're able to use it whenever you see a specific colour you like. Just copy it to your clipboard, then paste it into CSS, but how do you use colours in CSS....well now I'm going to tell you.

Here we have the body of a HTML document in CSS (in CSS we use the curly brackets):

```
body {


}
```
I want to now add a specific colour for my background...so this is what I will do:

```
body {
background: #ffc106;
}
```
Now the colour will be a very specific shade of yellow. Now I want to change the colour of the font to purple...

```
body {
background: #ffc106;
color: purple;
}
```
Firstly, to change the colour of the font you have to use **color**. Secondly, as you can see, I didn't use a specific hexadecimal colour for the purple I chose. I have used CSS's version of purple. CSS has all the general colours going from a black to a light blue, I'll show you...

```
body {
background: darkgreen;
}
h1 {
color: lightorange;
background: black;
}
```
You see, it is that easy to apply whatever colour you want. I will show you now using hexadecimal examples:

```
body {
background: #003001;
}
h1 {
color: #f96c00;
background: #000000;
}
```
EASY!!!

I hope that this has helped you with understanding colours in CSS. Thank you for reading and I'll see you in the next blog!!

In the meantime....**KEEP CODING!**
How to Install dbForge Studio for Oracle on Linux
Tags: database, oracle, linux, dbforgestudio
Published: 2023-05-28 18:54:55

In this video you will learn how to install and run dbForge Studio for Oracle on your Linux machine using CrossOver - https://youtu.be/uEsChhz5SRQ

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wevvrhv1qx3u0lfz534i.png)
Creating New Function in Apache AGE
Tags: apacheage, postgres
Published: 2023-05-28 18:49:50

We can add new functions in Apache age. To do this we will have to modify a few files and compile the Apache AGE code.
To demonstrate this we'll create a gcd function which is not available in apache age.
### `age--1.1.0.sql`

```
CREATE FUNCTION ag_catalog.age_gcd(agtype, agtype)
RETURNS agtype
LANGUAGE c
PARALLEL SAFE
AS 'MODULE_PATHNAME';
```
This declares the function we are creating. Here we have two arguments  of type `agetype` because apache age only supports `agetype` as arguments. 

### `src/backend/utils/adt/agtype.c`
We'll add our function in the above file. Just add the given code anywhere in the file. This is syntax of adding a function to apache age.

```

PG_FUNCTION_INFO_V1(age_gcd);

Datum age_gcd(PG_FUNCTION_ARGS)
{
    agtype *agt_arg0 = AG_GET_ARG_AGTYPE_P(0);
    agtype *agt_arg1 = AG_GET_ARG_AGTYPE_P(1);
    agtype_value *arg0;
    agtype_value *arg1;
    agtype_value agtv_result;

    /* gcd supports agtype integer as input */
    arg0 = get_ith_agtype_value_from_container(&agt_arg0->root, 0);
    arg1 = get_ith_agtype_value_from_container(&agt_arg1->root, 0);

    /* only integers are allowed */
    if (arg0->type != AGTV_INTEGER || arg1->type != AGTV_INTEGER )
        ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
                        errmsg("arguments must resolve to an integer")));

    /* check for agtype null */
    if (arg0->type == AGTV_NULL)
        PG_RETURN_POINTER(agt_arg1);
    if (arg1->type == AGTV_NULL)
        PG_RETURN_POINTER(agt_arg0);

    agtv_result.val.numeric = DatumGetNumeric(
                DirectFunctionCall2(numeric_gcd,
                                    DirectFunctionCall1(int8_numeric,
                                                        Int64GetDatum(arg0->val.int_value)),
                                    DirectFunctionCall1(int8_numeric,
                                                        Int64GetDatum(arg1->val.int_value))));
    agtv_result.type = AGTV_NUMERIC;

    PG_RETURN_POINTER(agtype_value_to_agtype(&agtv_result));
}
```
Here to calculate gcd, `numeric_gcd` is passed in the `DirectFunctionCall2`. It is a postgress function used to calculate gcd. Here we can directly utilize that to make our own gcd function of Apache AGE.

## Compilation

```
make uninstall
make clean
make PG_CONFIG=/home/abhis/age_installation/postgresql-14.7/bin/pg_config install
```

## Loading age extension

**Start Server:**
```
bin/pg_ctl -D demo -l logfile start
```
**Run psql**
```
bin/psql <dbname>
```
After the code is successfully compiled and psql command line is started we need to load the age extension.

```
CREATE EXTENSION age;
LOAD 'age';
SET search_path = ag_catalog, "$user", public;
```
This sometimes might not work. In that case, run the command given below and rerun the command to load extension.

```
DROP EXTENSION age CASCADE;
```

## Query
We can use any of the below syntax to run the query.

```
SELECT * FROM age_gcd('12', '9');

SELECT * FROM cypher('expr', $$
    RETURN gcd(15, 25)
$$) as (result agtype);
```
A ray of hope...
Tags: webdev, javascript, programming, development
Published: 2023-05-28 18:43:33

You are a ray of hope for me...
    you are a way of hope for me...

You are the master of the code for me...
    you are an artist of the code for me..

I have always dreamt about you...
   you are a ray of hope for me...

I am poor and an orphan looking for hope for me...
  you are a ray of hope for me...

I don't have anything of my own for me...
 you are a ray of hope for me...

I tried many times to code for me...
  you are a ray of hope for me...

I don't have gold, silver, or diamonds for me...
   you are the way of hope for me..

I need you to teach DSA to me...
  you are a ray of hope for me..

I want job in MAANG for me...
  you are a way of a job for me..

I am resting now to code for me..
come fast and teach me to code because

YOU ARE A RAY OF HOPE FOR ME


-Written by Yuvraj Pandya aka Shenlong
How to use slots in react elegantly
Tags: react, slot
Published: 2023-05-28 07:41:00

We all know, we can use props to implement component slots. This is a good way, but the props of the components will become more and more.
Also, you can filter the children by element's type, but it isn't a good idea.
And, you can use HOC to wrap the Component, and use Proxy to reduce the children. you can use the subComponent, like: 
```
<YouComponent.SubComponentA>a</YouComponent.SubComponentA>
```

And then, your Component's props will get:
```
slot: {
   SubComponentA: {children, props}
}
```

This is a good idea. But There is a better way.
We focus on children, children will be a array, or string, or a ReactElement, or undefined.
The ReactElement has type, you can check the child with the type's name.
You will use your Component like this:

```
<YouComponent>
    <Slot name="SubComponentA">a</Slot>
    b
</YouComponent>
```

`<Slot />` is a component that it render null. And it has a generator function, like this:

```
import {ReactElement} from 'react'
import {SlotProps} from './slot.interface';

function Slot(_: SlotProps): ReactElement {
  return null as unknown as ReactElement;
}

Slot.getSlot = function* getCollectionNode(props: SlotProps): any {
  yield props.children;
};

let _Slot = Slot as (props: SlotProps) => JSX.Element;
export default _Slot;
```

And then, In your component's code, you can use a hook to reduce the children. The hook like this:

```
import React from 'react';

export function useSlot(children: any) {
  const result: Record<string, any> = {
    children: []
  };
  React.Children.map(children, (child: React.ReactElement<any, React.JSXElementConstructor<any>>) => {
    if(React.isValidElement(child)){
      const type = child.type as any;
      const props = child.props;
      if(type.name === 'Slot') {
        const slot = type.getSlot(child.props);
        result[props.name] = slot.next().value;
      } else {
        result['children'].push(child);
      }
    } else {
      result['children'].push(child);
    }
  })
  return result;
}
```


the result of the useSlot(children), will be :

```
{
   SubComponentA: 'a',
   children: ['b']
}
```

That is my way to use slot in React. Do you have another way? Please tell me.
How is vue attaching v-model to child component?
Tags: vue, vuetify
Published: 2023-05-28 18:37:06

I'm currently using **vuetify 3** in my project, I separated the vuetify **v-text-field** into a different component (Input.vue). 


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

The code functions completely well, but I'm confused on how the v-model is being connected to the **v-text-field** in **Input.vue**. I'm passing the v-model as prop in Input component but I'm not connecting the v-model to the text-field in any way.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pqclcxhbrnxu10h77qxl.jpeg)


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4tmws3mvk4rowaqiu7nv.jpeg)

Is this behavior of **vuetify library** or **vue itself**? I normally pass my ref states to child component using provide/injects, but here I can't figure out how its possible.
What are i++ or ++i or i-- or --i in programming language?? Why you should use them?
Tags: programming, tutorial, java
Published: 2023-05-28 18:36:12

## In our programming learning, we frequently use the i++ or ++i, i-- or --i.

Sometimes, it is pretty tricky to understand why we use them and how they actually work in different perspective.

However, I have discussed everything in a video. 

### 📹 Make sure to watch it to understand better.

{% embed https://youtu.be/7d2pw0zEOxk %}

#### Let me also clarify what we call those 4 specific things:

* i++: Post increment
* ++i: Pre increment
* i--: Post decrement
* --i: Pre decrement

You can connect me via:

🎁 [LinkedIn](https://www.linkedin.com/in/fahimfba/), [Twitter](https://twitter.com/Fahim_FBA), [GitHub](https://github.com/FahimFBA), [English YouTube Channel](https://www.youtube.com/@FahimAmin), [Bengali YouTube Channel](https://www.youtube.com/@FahimBinAminBengali)

🖼️ Cover: Photo by <a href="https://unsplash.com/@nateggrant?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Nate Grant</a> on <a href="https://unsplash.com/s/photos/coding?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Unsplash</a>
Converting PDFs to DOCX Made Easy with Python
Tags: python, automation, pdftodoc, productivity
Published: 2023-05-28 18:26:32

Converting PDF files to DOCX format is a common task that many professionals and researchers encounter in their daily workflow. PDF files provide a convenient way to share and preserve document formatting, but sometimes it's necessary to convert them to a more editable format like DOCX. In this article, we will explore a Python code snippet that utilizes the pdf2docx library to seamlessly convert multiple PDF files to DOCX format.

```
from pdf2docx import Converter
import os

# Directory paths for input and output files
path_input = r'C:\Users\pdf'
path_output = r'C:\Users\docx'

for file in os.listdir(path_input):
    input_file = os.path.join(path_input, file)
    output_file = os.path.join(path_output, os.path.splitext(file)[0] + '.docx')

    cv = Converter(input_file)
    cv.convert(output_file, start=0, end=None)
    cv.close()
    print(file)

```

- The code begins by importing the necessary libraries: pdf2docx and os.
- The path_input variable stores the directory path where the PDF files are located. Replace the path with the actual location of your PDF files.
- Similarly, the path_output variable holds the directory path where the converted DOCX files will be saved. Adjust this path according to your desired output location.
- The os.listdir() function retrieves the list of files in the path_input directory.
- The code then iterates over each file in the directory using a for loop.
- Inside the loop, the full paths of the input and output files are created using os.path.join() to join the directory path and the file name.
- An instance of the Converter class is created with the input_file path.
- The convert() method of the Converter class is called, specifying the output file path (output_file). The start and end parameters can be adjusted to convert specific pages or the entire document.
- Finally, the cv.close() method is called to close the Converter instance.
- The file name is printed to the console, providing a progress update for each conversion.


By utilizing the pdf2docx library and the Python code snippet presented in this article, you can automate the conversion process for multiple PDF files effortlessly. Whether you're a professional, researcher, or simply someone in need of converting PDFs, this code will save you time and effort, enabling you to focus on more critical tasks in your workflow.
Introduction to dbForge Studio for PostgreSQL: Your Comprehensive Database Management Solution
Tags: postgres, postgressql, database, dbforgestudio
Published: 2023-05-28 18:26:02

This video tutorial provides a detailed overview of dbForge Studio for PostgreSQL, a powerful database management tool - https://youtu.be/HSrFdBaM4l0

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yqk0yb9j7q3itp6ly97i.png)
what is Ubiquitous Language
Tags: ddd, softwareengineering, architecture, programming
Published: 2023-05-28 18:24:44

Ubiquitous language is the term that eric evans uses in “domain driven design tackling complexity in the heart of software” to build a language shared by the team, developers, domain experts, and other participants. domain experts and software developers work together to build a common language for the business areas being developed. the effort involved in building the ubiquitous language helps spread deep domain insight among all team members. bounded context is a conceptual boundary around a system. the ubiquitous language inside a boundary has a specific contextual meaning. concepts outside of this context can have different meanings. its describe something in specific context.

so, how to find, explore and capture this very special language, we can follow this:
- identify key business processes, their inputs, and their outputs
- create a glossary of terms and definitions 
- capture important software concepts with some kind of documentation
- share and expand upon the collected knowledge with the rest of the team (developers and domain experts)

ubiquitous language used in discussion between developers and business people, it will appear in domain model , entity and value objects.
how to optimize search engine in next.js projects
Tags: seo, nextjs, react, productivity
Published: 2023-05-28 18:24:07

Optimizing search engine visibility in Next.js projects involves a combination of technical optimizations and content strategies. Here are some key steps you can take to optimize search engine performance in your Next.js projects:
For a software developer blogging website, here are some recommended meta tags to consider:

- `<title>` tag: The title tag is one of the most important meta tags for SEO. It should accurately describe the content of the page while incorporating relevant keywords. For example: "Software Development Tutorials and Tips | `YourWebsiteName`."

```
<title>iPhone 12 XS Max For Sale in Colorado - Big Discounts | Apple</title>
```
- `<meta description>` tag: The meta description provides a concise summary of the page's content. It should be compelling, informative, and include relevant keywords. For example: "Discover the latest software development tutorials, tips, and best practices. Learn programming languages, frameworks, and tools to level up your skills in software development."

```
<meta
  name="description"
  content="Check out iPhone 12 XR Pro and iPhone 12 Pro Max. Visit your local store and for expert advice."
/>
```
- <`meta keywords`> tag (optional): While not as influential as it used to be, you can include a list of relevant keywords in the meta keywords tag. However, search engines primarily focus on the content of the page rather than this tag.

```
 <meta
          property="keywords"
          content="software developer programming learning"
        />
```
- `<meta robots>` tag: Use the meta robots tag to specify instructions to search engine crawlers. For example, you can use <meta name="robots" content="index,follow"> to allow indexing and following of links on the page.

```
<meta name="robots" content="noindex,nofollow" />
```
- `<meta author>` tag: Include the author's name or the name of your software development blog in the meta author tag. This helps search engines and readers identify the source of the content.
- <`meta og:title`> tag (Open Graph): The Open Graph protocol is used by social media platforms to determine how your website's content is displayed when shared. Set the `og:title` tag to the same value as your <title> tag or customize it specifically for social sharing.
- <`meta og:description`> tag (Open Graph): Similar to the meta description tag, the `og:description` tag provides a summary of the page's content for social media sharing.
- <`meta og:image`> tag (Open Graph): Specify an image URL in the `og:image` tag to represent your content when shared on social media platforms. Choose an eye-catching and relevant image related to the blog post or the website's branding.

Remember to keep your meta tags concise, relevant, and descriptive. They should accurately represent the content of your blog posts and entice both search engines and users to click through to your website.
you can read more in [Mastering SEO in Next.js: Advanced Strategies](https://www.medcode.dev/blogs/mastering-seo-nextjs-advanced-strategies)
MongoDB, Generative AI, HuggingCast ++
Tags: resources
Published: 2023-05-28 18:14:54

Welcome to today's edition of "Today in X". In this, I thought of sharing some videos. So les go!

## **MongoDB for VS Code**

This informative video tutorial will teach you how to enhance your MongoDB experience in the VS Code editor. Discover the extensive features of the MongoDB for VS Code extension, including database navigation, schema overview, Playgrounds for scripting, and intelligent autocompletion. Additionally, explore the built-in MongoDB Shell, exporting queries.

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

## **A quick introduction to Generative AI**

In recent times, there has been a sudden surge in the use of the term "Generative AI". This can be observed from the significant increase in online searches related to it in the past year. The popularity of generative models like DALL-E 2, Imagen, and ChatGPT could be a contributing factor. However, the meaning of the term "Generative AI" is not clear. Check out this video!

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

## **HuggingCast v2 - StarCoder, Transformer Agents, AI news, and demos**

Check out HuggingCast, the new live show that covers the latest developments and practical demos. In the latest episode, the developers talked about Transformers, StarCoder, Transformers Agents, and more!

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

## MLOps

It's revolutionizing the way we deploy and manage machine learning models, bringing seamless collaboration between data scientists and operations teams. With MLOps, we can scale, monitor, and continuously improve ML workflows for maximum efficiency and impact. Watch this video to get a quick understanding of MLOps by an IBM Developer.

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

## Generative AI Spreading Fake News

Although AI tools can be entertaining, they have the potential to intensify false information when their filters are compromised. This is already happening, and we will explore the consequences of this and ways to combat it.

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

I guess these videos are enough for today's edition of X. If you have any interesting videos do share them in the comments. See you in the next edition of "Today in X". Thanks for the read and don't forget to subscribe to the [newsletter](https://todayinx.hashnode.dev/newsletter).