teleren/devto huggingface dataset:
Unlock the Secrets of Automating DaVinci Resolve with Python - Free Version Edition
Tags: davinciresolve, python
Published: 2023-05-02 18:47:38

DaVinci Resolve is one of the most widely used video editing software in the world. Its free version is already very powerful, but often lacks advanced features found in the paid version. However, using Python, it is possible to automate some editing operations even in the free version.

Unfortunately, the official DaVinci Resolve documentation is not very clear on how to use Python. In addition, much of the information available online only applies to the paid version. In this article, we will show you a way to use Python in the free version of DaVinci Resolve.

Secret 1: Putting the Python script in the right folder

The free version does not allow standalone python scripts to interact with DaVinci Resolve as shown in many tutorials. Even the built in python console did not work well for me. The way I found to use Python in DaVinci Resolve is to put a Python file in the `~/Library/Application Support/Blackmagic Design/DaVinci Resolve/Fusion/Scripts/Edit` folder. This will cause the file to appear in the "Workspace/Scripts" menu in DaVinci Resolve. To run the file, simply click on it in the "Scripts" menu. It is also possible to assign a shortcut for running the file, although sometimes this option doesn't work.

Secret 2: The global variables

When the script is run from the DaVinci Resolve menu, three variables will be available in your script: `resolve`, `fusion` and `bmd`. This is the basis for interacting with the DaVinci Resolve program and it is possible to access many DaVinci Resolve functions and automate some editing operations.

Secret 3: Documentation and sample files

The `/Library/Application Support/Blackmagic Design/DaVinci Resolve/Developer/Scripting` folder contains a documentation file with the main functions and some sample files. More sample files can be found in the Scripts folder where close to where you put your script in secret 1. This documentation file is essential for using Python in DaVinci Resolve. The sample files are useful for understanding how to use the functions.

A basic script could be something like this

```python
    projectManager = resolve.GetProjectManager()
    project = projectManager.GetCurrentProject()
    timeline = project.GetCurrentTimeline()
    videoitem = timeline.GetCurrentVideoItem()
    ... do something with timeline or video item
```

In conclusion, we have revealed the three secrets to automating DaVinci Resolve using Python in the free version.
While the official documentation for Python in DaVinci Resolve may be lacking, with these three secrets, you can now begin automating editing operations and streamlining your workflow in the free version of this powerful video editing software.
"Axios" vs "Fetch" !depth
Tags: javascript, webdev, beginners, tutorial
Published: 2023-05-02 18:19:43

## Post
I will start this post saying that this is just a simple and easy example of how to use it, but there is a lot more options and functionalities for each one.

## What are they for?
Axios and fetch are widely used to make http requests in javascript and javascript frameworks.

## Axios
Axios is a javascript library used to make http requests from nodeJS or XMLHttpRequests from browsers, with the support of the Promise API which is native to JS ES6.
Since it is a library we will have to install before using it.
Here we can see some of the things it is able to do:

- Make XMLHttpRequests from the browser

- Make HTTP requests from nodeJS

- Support Promise API

- Intercept request and response

- Transform request and response data

- Cancel Requests

- Automatic transforms for JSON data

- Client-side support for protecting agains XSRF

## Fetch API
The Fetch API privides an interface for fetching resources.
It provides a generic definition of objects for requests and response. It also uses Promises and provides a global fetch() method.
This method only ask for one mandatory argument. It return a promise that resolves the response for this request, whether successful or not.
We will have to transform the data received into a json which is something that in axios will not be needed.

## Security
We could say that Axios is less vulnerable since it has client-side protection against XSRF (Cross site Request Forgery).

## Syntax
Axios and Fetch have a really similar syntax in general with just a couple of differences. Let`s see an example

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

## Error Handling
When using Axios handling errors gets much easier since bad responses are automatically rejected, unlike Fetch, which even 404 or 500 errors, for example are still resolved. If let's say the backend return a "500 internal Server Error" code, Fetch will handle in the same way that it handles the code "200 Ok". To deal with this in Fetch, we can use the "ok" flag:


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

Axios error handling can be seen below:

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

## Conclusion
I usually use axios when doing big projects so i have less code in my project and have a cleaner project.
Although lately i have been using fetch custom hook in my project to experiment a little bit more with it.
I encourage you to try both of them and make your own decision.

I hope someone found this post useFul and if you want to understand more about it you can read their respective documentation.

Lautaro.
Migrating from Spring Boot 2 to Spring Boot 3: Logging Traces and Spans with Micrometer and Sleuth
Published: 2023-05-06 09:22:07

---
title: Migrating from Spring Boot 2 to Spring Boot 3: Logging Traces and Spans with Micrometer and Sleuth
published: true
date: 2023-05-02 18:18:49 UTC
tags: 
canonical_url: https://ajaysingh.hashnode.dev/migrating-from-spring-boot-2-to-spring-boot-3-logging-traces-and-spans-with-micrometer-and-sleuth
---

## Introduction

When upgrading from Spring Boot 2 to Spring Boot 3, you may encounter issues with logging trace and span information using Spring Cloud Sleuth. This is because, in Spring Boot 3, Sleuth has been merged with Micrometer, a powerful metrics library. In this article, we will explore how to migrate to Micrometer to enable trace and span logging in Spring Boot 3.

## Dependencies

To enable trace and span logging with Micrometer in Spring Boot 3, we need to add the following dependencies to our pom.xml file:

```
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
    <groupId>io.micrometer</groupId>
    <artifactId>micrometer-tracing</artifactId>
</dependency>
<dependency>
    <groupId>io.micrometer</groupId>
    <artifactId>micrometer-tracing-bridge-brave</artifactId>
</dependency>

```

## Configuration

After adding the dependencies, we need to configure our application to use Micrometer for trace and span logging. If you have a log pattern configured anywhere such as logback.xml, you can add the following pattern to log trace and span id: `%X{traceId}` and `%X{spanId}`

After adding these it would look similar to this:

> %d{yyyy-MM-dd HH:mm:ss.SSS} [%X{traceId},%X{spanId}] [%thread] ${LOG\_LEVEL\_PATTERN:-%5p} ${PID:- } %logger{36} - %msg%n

## Testing

To ensure that the configuration is working as expected, we can test by sending a request to our application and verifying that the trace and span information is logged correctly.

## Conclusion

Migrating from Spring Boot 2 to Spring Boot 3 can be a challenging task, but with the right approach, it can be made easier. By following the steps outlined in this article, you can enable trace and span ID logging with Micrometer and ensure that your logs include the necessary information.
What Are Artifacts in Programming?"
Tags: artifacts, development, distribution, versioning
Published: 2023-05-02 18:03:18

Artifacts are an essential part of the software development process, but what exactly are they and why are they important? In this guide, we'll explore what artifacts are, how they're used in programming, and why they're crucial for delivering quality software.

**What Are Artifacts in Programming?**
In programming, an artifact is a file or set of files generated as a result of the software development process. Artifacts can take many forms, including executable files, libraries, configuration files, documentation, and test reports.

**Why Are Artifacts Important?**
Artifacts play a critical role in the software development process, as they provide a way to distribute, deploy, and test software across different environments and platforms. They also allow developers to version and track changes to the software project, collaborate with other team members, and maintain a history of the project.

**Types of Artifacts**
The exact nature and content of artifacts depend on the programming language, development tools, and build system used in the project. For example, in a Java project, the artifact may be a JAR (Java Archive) file containing the compiled bytecode, along with any necessary libraries and resources. In a web application, the artifact may be a WAR (Web Archive) file containing the application code, web pages, and configuration files.

**Benefits of Using Artifacts**
Using artifacts in software development has several benefits, including:

    

- Increased productivity: Artifacts can automate many tasks in the development process, such as compiling, packaging, and deploying code, which can save time and effort for developers.
-     Consistency: Artifacts provide a consistent way to package and distribute software, which can reduce errors and ensure that the software works as intended across different environments.
-     Reproducibility: Artifacts can be versioned and tracked using a version control system, which allows developers to reproduce previous builds of the software and maintain a history of changes.
-     Collaboration: Artifacts can be shared among team members, which facilitates collaboration and helps to ensure that everyone is working with the same version of the software.

**Conclusion:**
Artifacts are a critical component of the software development process, providing a way to package, distribute, and test software across different environments and platforms. By using artifacts, developers can increase productivity, ensure consistency, and maintain a history of changes to the software project. Understanding how artifacts work and how to use them effectively is essential for delivering quality software that meets the needs of end-users.
How to Flatten an Object in Javascript ?
Tags: javascript, interview, react, node
Published: 2023-05-02 18:02:34

**Interviewer :**
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vkle54k7z45oqdrllvju.jpg) Can you flatten an object, Please take below as input

```
const obj = {
    name: "test",
    address: {
        personal: "abc",
        office: {
            building: 'random',
            street: 'some street'
        }
    }
}
```

and produce output like below

```
{
    name : "test",
    address_personal: "abc"
    address_office_building: "random"
    address_office_street: "some street"
}
```


Here is the solution.

```
const flattenObject = (obj, parentKey = '') => {
    if (parentKey !== '')
        parentKey = parentKey + '_';

    let flattened = {};
    console.log(flattened)
    Object.keys(obj).forEach((key) => {
        if (typeof obj[key] === 'object' && obj[key] !== null) {
            Object.assign(flattened, flattenObject(obj[key], parentKey + key))
        } else {
            flattened[parentKey + key] = obj[key]
        }
    })
    return flattened;
}


const obj = {
    name: "test",
    address: {
        personal: "abc",
        office: {
            building: 'random',
            street: 'some street'
        }
    }
}

let flat = flattenObject(obj);
console.log(flat);
```

If you want to see more interview questions please reach out my GitHub profile

Github: https://github.com/imran-mind/javascript-notes/blob/master/JS-Interview-coding-ques/objectFlatten.js

Linkedin: https://www.linkedin.com/in/imran-mind

Twitter: https://twitter.com/imran1mind

My Blogs: https://imranshaikh.co.in/

If you find this blog helpful, please like and comment and don't forget to share this.
Translate Speech Into Japanese (open source web app)
Tags: chatgpt, whisper, webdev, tutorial
Published: 2023-05-02 17:53:01

{% youtube NY4h3nJq4ns %}

This web application translates speech into Japanese speech, try it at [voicefu.com](https://voicefu.com/)

Techs:

1. Speech to text: [Whisper](https://platform.openai.com/docs/guides/speech-to-text)
2. Translation: [GPT](https://platform.openai.com/docs/guides/chat)
3. Japanese Voice Synthesis: [Voicevox](https://github.com/VOICEVOX/voicevox_engine)

you can get the source source code here: https://github.com/tylim88/Voicefu

Responsive design, you can view it on phone
<img src="https://dev-to-uploads.s3.amazonaws.com/uploads/articles/iqop7mzvx1r054561wfk.jpg" width="200" height="400" />
How to upgrade npm in Laravel Sail ?
Tags: webdev, npm, laravel, sail
Published: 2023-05-02 17:46:44

When I stop the vite live server `sail npm run dev` of Laravel 10 by `ctrl + c`, the CLI tells me to upgrade npm with this message.

```
npm notice 
npm notice New patch version of npm available! 9.6.4 -> 9.6.5
npm notice Changelog: https://github.com/npm/cli/releases/tag/v9.6.5
npm notice Run npm install -g npm@9.6.5 to update!
npm notice 
```

Here is a screenshot of the npm upgrade notice.

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

## Upgrade npm inside Laravel Sail Docker environment

You can not just run `npm install -g npm@9.6.5` and upgrade. This is not your docker-contained npm! and if your wanna upgrade by `sail npm install -g npm@9.6.5`, you don’t have the permissions to upgrade npm like that.

**What should I do?**

I use `sail root-shell` to get the Docker environment root shell. Then I use `npm install -g npm@9.6.5`. And voila, it works.

Here is a screenshot of steps and commands I used.


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

I hope this helps. Share if you care.

Follow me to get notified of new posts I create. Follow me on [Twitter @abanoubha](https://twitter.com/abanoubha). Follow me on [LinkedIn](https://www.linkedin.com/in/abanoub-hanna/). Join my [Telegram channel @softwarepharaoh](https://t.me/softwarepharaoh). Follow my [Facebook page @softwarepharaoh](https://www.facebook.com/SoftwarePharaoh).
Announcement Leak - First-Ever full mapping of global AI industry, done itself by AI, launching soon
Published: 2023-05-02 17:37:47

Dear AI community,

After some deliberation, I have decided that it is OK to risk breaching my NDA by disclosing this, but I am working with a company whose new AI assets will very possibly become more powerful than Open AI or DeepMind. I shouldn’t disclose the name of the company, but I can share that they are using the most advanced AI techniques by some truly brilliant maverick underdogs for airtight aggregation of ethical data, but also very diligent structuring and training. For anyone willing to do a bit of digging, I’ll just say that it is a Deep Knowledge Group project known as AIIA for now.

What's even more exciting is that they will be unveiling a mindmap in the coming weeks that profiles both the whole AI and whole philanthropy ecosystem - which has always been close to my heart as an immigrant and member of the LGBT community, who has benefited on multiple occasions from grants, community projects, educational initiatives and other philanthropic activities. This mindmap has been created using unbiased mathematical techniques (as far as practicable), so that you can see in a balanced way who is doing what - and who is doing what better. This level of transparency is essential to both AI-based tools and the ways we as humans choose to use them.

I was asked to conduct an independent review because of my background in ethics, and during this time it became clear that this approach is comprehensive and genuinely built from the ground up with ethics in mind, unlike other systems. As someone who has worked on Longevity and AssistiveTech ethics/policy for DKG, I have seen and have come to appreciate just how complex these domains can be. However, what I have seen from this new company is on a new level of commitment and responsibility, so I hope it succeeds.

As someone who is deeply committed to AI ethics, I believe that this new company has the potential to make a significant impact on the AI industry. I am incredibly impressed with what they are doing and I cannot wait to see what they will achieve in the future.

I hope that this post will spark some discussion about the potential impact of this new company on the AI industry, and encourage others to think deeply about the ethics of AI.

Best regards,
Anonymous AI ethics and policy worker.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vn5m686e13ax7o46f6bl.jpg)
A fun content censoring web extension!
Tags: webdev, javascript, typescript, programming
Published: 2023-05-02 17:31:30

Here's something I built in the past week! A **swear word censoring** chrome extension with some very **fun options** such as censoring with emojis, and fun word insertion!


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

I would urge you all to try and give me some feedback on the same! Criticism is welcome! Please leave me a rating and feedback if possible and don't forget to star the Github Repo! ⭐

- [Chrome Extension](https://chrome.google.com/webstore/detail/censorify/efchgkadcglilfcdbgpolinhieeabjlc?hl=en&authuser=0)
- [Home Page](https://censorify.netlify.app)
- [Github Repo](https://github.com/ninadsutrave/censorify)

Thank you!
Top 10+ most innovative AI tools to try in 2023
Published: 2023-05-02 17:22:55

AI Tool to Create an Online Store
―reetail.store

Best AI Writing and Grammar Tool
―aiseo.ai

AI Tool for Note-Taking & Study
―notelierai.com

AI Meeting Summarizer
―tldv.io

AI Email Writing Tool
―emailmagic.ai

ChatGPT for Finance
―finchat.io

ChatGPT for Teams
―chatabc.ai

Sales AI Assistant Tool
―orimon.ai
AI Second Brain for Your Team
―taskade.com

Convert Document to Chat
―thedocgpt.com

Coding AI Assistant
―useblackbox.io

AI Tweet Writer
―tweetmonk.com
Funciones puras - Javascript
Tags: javascript, beginners
Published: 2023-05-02 14:55:00


**Funciones puras**
Son funciones que producen un mismo output para un mismo input. Serán aquellas retornan un resultado predecible en base a los parametros que nosotros le pasemos.

Estas deben cumplir con dos requisitos basicos:

- Dado unos parámetros de entrada de idéntico valor, la función siempre devolverá el mismo resultado.

- El cómputo de la función, su lógica, no implica ningún efecto observable colateral fuera de ella (inmutabilidad de los parametros).

La funcion sayGreeting() es una funcion pura ya que solo con leerla sabemos que va a retornar "Hello" seguido del nombre que le pasemos por parámetro.

```
function sayGreeting(name) {
  return `Hello ${name}`;
}
```

Pero si revisamos el siguiente ejemplo

```
function whatTimeIsIt(name: string) : string {
  const time = new Date().toLocaleTimeString();
  
  return "Hello" + name + ", it's" + time ;
}
```
Ya no seria una funcion pura, puesto que requiere de un elemento externo ademas de sus parametro para devolver el resultado, el cual  _NO devuelve el mismo output para un mismo input y por consecuencia NO es predecible_.

Otro ejemplo muy común de una funcion pura son los action creators (acciones despachadas que son interceptadas por redux para realizar una acción en el store).
  
Supongamos que queremos crear una tarea de un to do list

```
interface Task { 
    title: string;
    description: string
}

const addTaskAction = (payload: Task) => ({
   type: "addTask",
   payload
 })
```

La funcion addTaskAction() es una funcion pura ya que retorna un objeto que describe algo especifico que va suceder y es predecible.
Writing Effective User Guides for Your Software Products
Tags: webdev, documentation, tutorial, productivity
Published: 2023-05-02 17:12:46

Writing effective user guides for your software products is a critical element in providing a positive user experience. A well-crafted user guide can help users learn how to use your software more efficiently, increase their confidence in using your product, and reduce support calls. Here are some tips to help you write effective user guides for your software products.

**Understand Your Audience**

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

Before you start writing a user guide, you need to understand your audience. Who is using your software? What are their skill levels? What are their goals? Knowing your audience will help you create a user guide that meets their specific needs.

**Use Clear, Concise Language**

When writing a user guide, it's important to use clear, concise language. Avoid technical jargon and explain terms in a way that users can understand. Use short sentences and paragraphs and break up information into sections and sub-sections to make it easier to read and follow.

**Provide Step-by-Step Instructions**


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/74kcme8drlqksdq2r73r.jpg)

When explaining how to use your software, provide step-by-step instructions that users can follow. Use screenshots or videos to demonstrate how to perform tasks. When writing instructions, focus on the task at hand and avoid unnecessary information.

**Organize Information Effectively**

Organizing information is critical for user guides. Divide information into sections and sub-sections, and use headings and bullet points to make it easier to read. Avoid including too much information in one place, and use a table of contents and index to help users find information quickly.

**Include Visuals**


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



Visuals are an essential element of user guides. Use screenshots, diagrams, and videos to help users understand the information in your guide. Visuals can help users learn how to use your software faster and reduce support calls.

**Test Your User Guide**

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

Before finalizing your user guide, test it with users. Have them use your software while following the user guide and provide feedback. Use their feedback to improve your user guide and make it more effective.

**Conclusion**

Writing effective user guides for your software products is critical to providing a positive user experience. By understanding your audience, using clear, concise language, providing step-by-step instructions, organizing information effectively, including visuals, and testing your user guide, you can create a user guide that users will find helpful and easy to use.

Follow me on Twitter: @CodezMikazuki

Thanks for reading, Malcz/Mika