teleren/devto huggingface dataset:
Top 10 most common Programming And Coding Mistakes Data Scientists Make
Tags: developer, programmer
Published: 2023-01-23 13:50:53

There is high demand for quality data scientists in the market. Every business wants to integrate personalization, forecasting, clustering, and other similar processes using internal data. Such tasks are carried out by data scientists, who are extremely important to businesses.

Today, all companies have access to data, but only a select few have the best data scientists. Let's say you can come from a software engineering background. In that case, you already have an advantage over the majority of other data scientists who have backgrounds in math or statistics and are slowly learning data science.

**Top 10 Most Common Mistakes**

**1. Variable naming**
Naming variables is a hard thing for every developer. Writing code is easy, but finding appropriate variable names is hard for many, and that drags them into creating bad variable names. 

**2. Little to no Documentation**
Data science applications are complex, and not everyone can understand them completely, but you should not make them harder. Many data scientists do not understand the power of documentation and just keep on writing code for a long time. 

**3. Relying on Jupyter notebooks**
Jupyter notebooks are great, but they still lack many excellent features that can help you work faster and better. 

**4. Not backing up code**
Backups are the most important part of any data science project. Data scientists often forget to back up their code and then go on to write everything from scratch again if they lose the files.  

**5. Writing algorithms from scratch**
Many people think that the identity and competencies of a data scientist should be measured by the number of algorithms they can write from scratch. But it is a huge mistake that many data scientists make on a regular basis.

**6. Not hiding data & other things while sharing code**
Data science projects need to be shared with various people for validation and presentation purposes, and it is quite normal too.

**7. Relying only on one package or language**
Being too dependent on one thing surely has detrimental effects. As a data scientist, your goal is to achieve the outcomes that make business decision making or other important tasks easier, and not to preach a language or package.

**8. Not paying attention to warnings**
Language creators have placed warnings for a reason, and they should be taken seriously.

**9. Not using type annotation**
Python is not a statically typed language, and this means that type checking is done only at the run time.

**10. Not following PEP standards, and conventions**
Python was not invented as a language that was just there to do things in an easy way. It has a much larger objective than this, and there’s a bigger vision for the language from the creators.

If you are a beginner working on data science projects, [Read the full article](https://onlinebizbooster.net/programming-and-coding-mistakes-data-scientists-make/) to get the complete information related to their programming and coding mistakes.
Array destructuring: Explained
Published: 2023-01-23 13:42:31


Array destructuring is a feature in JavaScript that allows you to easily extract values from arrays and assign them to variables. In React, this feature can be used to simplify your code and make it more readable.

You can use array destructuring to extract multiple values from an array at once. For example, let's say you have an array with three items: a name, an age, and a location. Without array destructuring, you would access the values like this:


```
const data = ["Michael", 22, "Chicago"];
const name = data[0];
const age = data[1];
const location = data[2];

```

With array destructuring, you can extract the data from the props object with a single line of code:

```
const [name, age, location] = data;

```
Another example of this would be 

```
const meals= ['breakfast', 'lunch', 'dinner'];
const [morning, afternoon, night] = meals;
console.log(morning); // 'breakfast'
console.log(afternoon); // 'lunch'
console.log(night); // 'dinner'

```
In this example, we have an array of meals called meals. We use array destructuring to assign the first element of the array to the variable morning, the second element to the variable afternoon, and the third element to the variable afternoon. Then, we can use these variables to access the individual elements of the array.

Array destructuring is a helpful feature that can simplify your lines of code and make it more readable. It's a great tool to use when working with arrays and props in React, and can help you write more maintainable code.
Best practice for organizing Laravel's Blade File
Published: 2023-01-23 13:39:59

There are several best practices for organizing Blade templates in Laravel:

1.Use template inheritance to reduce code duplication and make it easier to maintain your views.

2.Use sections to break up your views into reusable components that can be included in other views.

3.Use partial views to break up complex views into smaller, more manageable pieces.

4.Use view composers to share data between views and keep your controllers lean.

5.Organize your views into a clear directory structure, grouping them by functionality or feature.

6.Use Blade's built-in directives, such as @if, @foreach, and @isset, to control the flow of your views and keep the logic out of your templates.

7.Use blade component and slots to make reusable components and pass data to them.

8.Keep your blade files as simple as possible and extract complex logic into controllers or service classes.

By following these best practices, you can make your views more organized, maintainable, and easy to understand.
在 Office VBA 使用 Open AI API
Tags: openai, vba
Published: 2023-01-23 12:46:48

之前介紹過[用 Python 串接 OpenAI 模擬 ChatGPT 聊天機器人](https://dev.to/codemee/yong-python-chuan-jie-openai-mo-ni-chatgpt-liao-tian-ji-qi-ren-2fh6), 既然它是走 HTTP POST, 如果你也想在 Office 中加入類似功能, 可以使用 Widnows 平台上的 [XmlHttpRequest](https://codingislove.com/http-requests-excel-vba/) 物件。以下就是一個簡單的範例：

```vb
Sub textcompletion()
    Dim prompt, url, body, api_key
    Dim xmlhttp As Object
    Set xmlhttp = CreateObject("MSXML2.serverXMLHTTP")
    api_key = "你的金鑰"
    url = "https://api.openai.com/v1/completions"
    prompt = InputBox("請輸入提示文字", "OpenAI Text Completion", "hello")
    body = "{""model"": ""text-davinci-003"",""prompt"":""" & prompt _
             & """,""temperature"":0.7,""max_tokens"":1000}"
    xmlhttp.Open "POST", url, False
    xmlhttp.setRequestHeader "Content-Type", "application/json"
    xmlhttp.setRequestHeader "Authorization", "Bearer " & api_key
    
    xmlhttp.Send body
    MsgBox (xmlhttp.responseText)
End Sub
```

其中, open 的第三個參數是是否要以非同步方式執行？false 表示不以非同步方式執行, 也就是會等到取得回應結果才返回。如果需要非同步執行 HTTP 請求, 可以參考[這一篇文章的教學](http://dailydoseofexcel.com/archives/2006/10/09/async-xmlhttp-calls/)。

這個測試程式執行結果如下：

![](https://i.imgur.com/WI5VIPm.png)

輸入提示文字後即可取得回應：

![](https://i.imgur.com/0OiVKRt.png)
#2.React Virtual DOM
Tags: javascript, beginners, react, tutorial
Published: 2023-01-23 13:16:32

## What is the DOM? 
The Document Object Model (DOM) is a programming interface for web documents. It represents the page so that programs can change the document structure, style, and content. The DOM represents the document as nodes and objects;
DOM specifies that `querySelector()` and it's return the element in the document.

```javascript
const div = document.querySelector("#div");
```
The Virtual DOM was not invented by React, but React uses it. It's a lightweight copy of actual DOM. Imagine a virtual DOM as a tree where each node represents a component. When we modify any component's state or data, a duplicate tree of that component and its children is regenerated, but other parent components are unchanged. React has two representations of virtual DOMs, which are the previous and new virtual DOMs. React simply compares these two and uses a diffing or reconciliation algorithm to determine their differences. After finding the change, React updates the specific DOM.
![React has two representations of virtual DOMs, which are the previous and new virtual DOMs. React simply compares these two and uses a diffing or reconciliation algorithm to determine their differences.](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/h0iwqqgumvo3pjip3a0l.PNG)
𝗔𝗯𝗼𝗿𝘁𝗶𝗻𝗴 𝗼𝗻𝗴𝗼𝗶𝗻𝗴 𝗮𝗰𝘁𝗶𝘃𝗶𝘁𝗶𝗲𝘀 𝘂𝘀𝗶𝗻𝗴 𝘁𝗵𝗲 𝗔𝗯𝗼𝗿𝘁𝗖𝗼𝗻𝘁𝗿𝗼𝗹𝗹𝗲𝗿 𝗶𝗻𝘁𝗲𝗿𝗳𝗮𝗰𝗲.
Tags: react, javascript, webdev, programming
Published: 2023-01-23 13:12:58

𝗔𝗯𝗼𝗿𝘁𝗶𝗻𝗴 𝗼𝗻𝗴𝗼𝗶𝗻𝗴 𝗮𝗰𝘁𝗶𝘃𝗶𝘁𝗶𝗲𝘀 𝘂𝘀𝗶𝗻𝗴 𝘁𝗵𝗲 𝗔𝗯𝗼𝗿𝘁𝗖𝗼𝗻𝘁𝗿𝗼𝗹𝗹𝗲𝗿 𝗶𝗻𝘁𝗲𝗿𝗳𝗮𝗰𝗲.

The [AbortSignal ](https://mzl.la/3zPY59F)interface represents a signal object that allows you to communicate with a DOM request (such as a fetch request) and abort it if required via an AbortController object.

𝗔. 𝗔𝘀𝘆𝗻𝗰 𝘄𝗼𝗿𝗸 𝗶𝗻 𝗥𝗲𝗮𝗰𝘁:
Let's take the example of data fetching placed inside a useEffect hook.
If this effect doesn't finish before it's fired again (re-render), we may have two requests running in parallel.
To make things better, we can create an AbortController instance that will be aborted whenever the next effect runs.
𝘞𝘩𝘦𝘯 𝘢𝘣𝘰𝘳𝘵() 𝘪𝘴 𝘤𝘢𝘭𝘭𝘦𝘥, 𝘵𝘩𝘦 𝘧𝘦𝘵𝘤𝘩() 𝘱𝘳𝘰𝘮𝘪𝘴𝘦 𝘳𝘦𝘫𝘦𝘤𝘵𝘴 𝘸𝘪𝘵𝘩 𝘋𝘖𝘔𝘌𝘹𝘤𝘦𝘱𝘵𝘪𝘰𝘯 𝘯𝘢𝘮𝘦𝘥 𝘈𝘣𝘰𝘳𝘵𝘌𝘳𝘳𝘰𝘳.

𝗕. 𝗥𝗲𝗺𝗼𝘃𝗶𝗻𝗴 𝗘𝘃𝗲𝗻𝘁 𝗛𝗮𝗻𝗱𝗹𝗲𝗿𝘀:
To remove an event handler, you have to keep hold of the original reference.
Using AbortSignal, you can get the signal to remove it for you.

Promise-based APIs wishing to support aborting can accept an AbortSignal object, and use its state to determine how to proceed (https://bit.ly/3HB3hjQ).

![code snippet](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gfogjqh9jlh5dlafwryf.png)
NeuroTonix - Brain Booster Benefits, Pros, Cons, Uses & Price?
Tags: webdev, javascript, beginners, programming
Published: 2023-01-23 13:09:02

NeuroTonix The scientists have already done several researches additionally they have proven beyond reasonable doubts that the human mental abilities are far much malleable pc was known in past days. The planet of your living area can mend or improve your brain to behave in these a manner that serious supper advanced functionality.
https://www.outlookindia.com/outlook-spotlight/neurotonix-reviews-neuro-tonix-negative-effects-and-health-risks-exposed-here--news-255891
https://neurotonixbenefits.blogspot.com/
https://playpass.com/neurotonix22-O9Nn1iH/neurotonix-brain-booster-benefits-pros-cons-uses-price-T5ov716
https://warengo.com/stories/268636-neurotonix-brain-booster-solution-price-benefits-results
https://neurotonixfact.wixsite.com/neurotonix
https://ydsakhnwa.podbean.com/
https://soundcloud.com/neurotonix-994416629/neurotonixinfo
https://www.pinterest.com/pin/990158668052651154/
https://www.instagram.com/neurotonixresult/
https://www.scoop.it/topic/neurotonix-price-by-neurotonix-info
https://twitter.com/neurotonixinfo
https://www.sportsblog.com/neurotonixinfo/
https://tautaruna.nra.lv/forums/tema/49412-neurotonix-brain-booster-solution-price-benefits-results/
https://www.launchora.com/story/neurotonix-brain-booster-supplement-uses-price
React's Fiber Reconciliation Algorithm
Tags: webdev, react, javascript, typescript
Published: 2023-01-23 13:05:05

Fiber is the name given to the new reconciliation algorithm introduced in React 16. 

It was a major rewrite of React's core algorithm, and it was designed to improve the performance of the library, especially when dealing with large lists of elements or complex user interactions.

The main concept behind Fiber is the ability to split the work of reconciliation into smaller chunks, which can be spread out over multiple frames. This allows React to better utilize the browser's main thread, and also to more efficiently manage and prioritize the different updates that need to be made to the UI.

Fiber also introduced new concepts such as "priority" and "expiration times" that allow React to control the order and timing of updates, so that critical updates can be processed first and less critical updates can be delayed or batched together to improve performance.

Fiber also introduced the concept of "Suspense" which allows developers to write code that can "suspend" the rendering of a component until certain data is available, this improves the user experience in case of slow network, by showing loading spinner or fallback content.

Overall, the Fiber algorithm provides a more efficient and flexible way for React to update the UI and should lead to better performance and a more responsive user experience.
Unit Test in Python automation
Tags: webdev, programming, python, django
Published: 2023-01-23 12:59:16

Unit Test will enable you to quickly insert small units of code in your program. 

The use case of Unit Test is:

def get_data(source):
    data = load_data(source)
    data = data(data)
    return data

The above is an snippet and there's also another example of unit Test code attached to this article.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ep5ypkff7dizn82cjiw0.jpg)
What is the HTTP protocol? Explained simply for noob web developers 😁
Published: 2023-01-23 12:57:22

#### The HTTP Protocol 🤔

It stands for Hypertext Transfer Protocol (HTTP) and it's the system that enables the transferring of data on the internet. A client, e.g. browser, connects to a web server that hosts the resources. Resources are documents such as HTML and PDF files that are identifiable by a unique identifier (URL). 

The HTTP protocol is a two-way communication protocol that sets up the client to make a Request and wait for the server to Respond. 

#### What are the most common Request Methods?

GET: the retrieving of information from a specified resource.

POST: sends a request to the specified resource.

PUT: changes the resource's representation with the payload.

DELETE: This command deletes the given resource.

![swagger-petstore-store-endpoints.png (775×319)](https://s3-us-west-2.amazonaws.com/assertible/blog/swagger-petstore-store-endpoints.png)

#### HTTP Messages consist of a Header & a Body
![https://images.zapier.com/storage/photos/4717d012f26dc6a4928e0d025102af7f.png?format=jpg](https://images.zapier.com/storage/photos/4717d012f26dc6a4928e0d025102af7f.png?format=jpg)


A header and body comprise the content of a request and response.

The header contains the necessary information about the request or response. Additional information might be supplied in the header to modify the request's processing.

The body of an HTTP message is optional, although it is the vehicle that transports the requested data (text, files, images, etc), also called payload.

#### Status Codes for HTTP

When a request is delivered to the web server, the web server responds with a response. A response will contain a status code as well as headers. The status code is a three-digit integer that indicates the outcome of the request. The status codes are listed below.

![https://www.infidigit.com/wp-content/uploads/2019/12/20191227_012601_0000.png](https://www.infidigit.com/wp-content/uploads/2019/12/20191227_012601_0000.png)

HTTP Protocol is Stateless

The HTTP protocol is stateless, which means that each transaction (request and response) is independent of the others. There may be use cases where state is necessary, where cookies and sessions are two methods through which a web application can preserve state.


Original:
https://dccyberclub.com/html/article.html?titleslug=what-is-the-http-protocol-explained-simply-for-noob-web-developers--

##### Sources:

Images are from
1. http://t3.gstatic.com/licensed-image?q=tbn:ANd9GcTCnE9BsTsJ5Cmc5upNpxuaq0CAWQJBYNcspGPTN5nm6QIHYUxuYabeIOQ9DegB8DGk
2. https://s3-us-west-2.amazonaws.com/assertible/blog/swagger-petstore-store-endpoints.png
3. https://images.zapier.com/storage/photos/4717d012f26dc6a4928e0d025102af7f.png?format=jpg
4. https://www.infidigit.com/wp-content/uploads/2019/12/20191227_012601_0000.png
Firebase V9 Firestore DELETE Document Field Using updateDoc()
Tags: webdev, javascript, beginners, programming
Published: 2023-01-23 12:45:00

---
canonical_url: https://softauthor.com/firebase-firestore-delete-document-field/
---

Using the **updateDoc()** method, you can **delete** one or more **document field(s)** in the Firebase **Firestore Database**.

- [Delete A Document from a collection](https://softauthor.com/firebase-firestore-delete-document-deletedoc/)
- **Delete A Field** from a document → _you’re here_

Let’s say you want to **delete** the field called **code** from a sample **Firestore** **document** like below.

![alt text](https://softauthor.com/wp-content/uploads/2022/06/Firebase-V9-Firestore-Delete-Document-Field-Using-updateDoc.png)

**Import** Firestore and d**e-structure** the **four methods** that we need to perform the delete operation to one or more document field(s).

- **getDatabase()**
- **doc()**
- **updateDoc()**
- **deleteField()**

```JavaScript
import { getFirestore, doc, updateDoc, deleteField } from "firebase/firestore";
```
Then, **initialize** the Firestore database.

```JavaScript
const db = getFirestore(app);
```

The **updateDoc()** method takes two arguments:

- doc()
- data {}

###Doc()

The first argument of the **updateDoc()** method is **doc()**.

The **doc()** method takes **three arguments**.

- database → **db**
- collection name → **cities**
- Document ID → **yftq9RGp4jWNSyBZ1D6L** (_see the sample document screenshot above_)

Call the **doc()** method with these arguments and assign it to a constant called **docRef**.

```JavaScript
const docRef = doc(db, "cities", "yftq9RGp4jWNSyBZ1D6L");
```

###Delete Field()

The second argument of the **updateDoc()** method is the **JavaScript object** with the **field name**(s) that you want to **delete**.

In this case: **code**

```JavaScript
const data = {
  code: deleteField()
}
```

To **delete** a field from a Firestore document, call the **deleteField()** method as a value of it.

###Call updateDoc() To Document Field

Invoke the **updateDoc()** method and pass **docRef** and **data** as arguments to it.

The **updateDoc()** method returns a **promise** so chain **.then()** and **.catch()** methods.

```JavaScript
import {getFirestore, doc, updateDoc, deleteField} from "firebase/firestore";

const db = getFirestore();

const docRef = doc(db, "cities", "yftq9RGp4jWNSyBZ1D6L");

const data = {
    code: deleteField()
};

updateDoc(docRef, data)
.then(() => {
    console.log("Code Field has been deleted successfully");
})
.catch(() => {
    console.log(error);
})
```

When you run the **updateDoc()** query, the field name **code **will be **removed** from the **Firestore document**.

![alt text](https://softauthor.com/wp-content/uploads/2022/06/Firebase-V9-Firestore-Delete-Document-Field-Using-updateDoc-Field-Removed.png)

One more things it’s worth pointing out here is when you delete all the fields from a document, the document ID remains available in the collection and you can add a new field to the document.
Extract raw text, table, and forms from scanned documents using Amazon Textract.
Tags: aws, cloud, awscommunity, 100daysofcloud
Published: 2023-01-23 12:38:20

[23/100] #100DaysOfCloud Today, I extracted raw text, table, and forms from scanned documents using Amazon Textract.

- Amazon Textract is a fully managed machine learning (ML) service that automatically extracts text, handwriting, and data from scanned documents. It goes beyond simple optical character recognition (OCR) to identify, understand, and extract data from forms and tables. 
- Today, many companies manually extract data from scanned documents such as PDFs, images, tables, and forms, or through simple OCR software that requires manual configuration (which often must be updated when the form changes). 
- To overcome these manual and expensive processes, Textract uses ML to read and process any type of document, accurately extracting text, handwriting, tables, and other data with no manual effort. - - You can quickly automate document processing and act on the information extracted, whether you’re automating loans processing or extracting information from invoices and receipts. 
- Textract can extract the data in minutes instead of hours or days. Additionally, you can add human reviews with Amazon Augmented AI to provide oversight of your models and check sensitive data.

<u>Use cases :</u>
- Financial services
 - Accurately extract critical business data such as mortgage rates, applicant names, and invoice totals across a variety of financial forms to process loan and mortgage applications in minutes.

- Healthcare and life sciences
 - Better serve your patients and insurers by extracting important patient data from health intake forms, insurance claims, and pre-authorization forms. Keep data organized and in its original context, and eliminate manual review of output.

- Public sector
 - Easily extract relevant data from government-related forms such as small business loans, federal tax forms, and business applications with a high degree of accuracy.


You can try do it by yourself by following the steps from the link below:
[GitHub](https://github.com/aaditunni/100DaysOfCloud/blob/main/Journey/023/Readme.md)
10 Things I Hate About Go
Tags: go, opinion, beginners
Published: 2023-01-23 12:34:23

I'm actually a big fan of Go. Last month I [talked about what I love about Go](https://dev.to/tinydevops/10-reason-i-like-the-go-programming-language-2eb3).  This time, I'm talking about the 10 things I don't like about Go.

{% youtube  https://youtu.be/zC5qBBK9ZaM %}
Techathon
Published: 2023-01-23 12:33:09

We cordially invite you to join @Techuplabs for our upcoming hackathon event, where you will have the opportunity to showcase your coding skills and collaborate with other talented programmers.

This event is open to all levels of experience, from beginners to experts, and offers a chance to learn, grow, and be challenged in a fun and engaging environment. Whether you're working on a new project or just looking to meet other coders, this is the event for you!

Details of the event are as follows: https://forms.gle/R2rxaQSD6kZpB1faA


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