teleren/devto huggingface dataset:
6 Key Coding Principles
Tags: azure, coding, webdev, programming
Published: 2023-05-17 09:56:54

Here are six fundamental coding principles every programmer must adhere to -

1️⃣ DRY (Don't Repeat Yourself): This principle emphasizes minimizing redundancy in our code. If you find yourself writing the same code more than once, consider a function or a class instead.

2️⃣ YAGNI (You Aren't Gonna Need It): The YAGNI principle tells us not to add functionality until deemed necessary. It's a practical approach that helps us avoid wasting time on features that might never be used.

3️⃣ SOC (Separation of Concerns): This principle encourages dividing a program into distinct sections, each handling a specific aspect of the functionality. This separation results in better organized and easily maintainable code.

4️⃣ LOD (Law of Demeter): Also known as "principle of least knowledge," it promotes loose coupling between software components. It suggests that an object should only communicate with its immediate neighbors and not with the whole system.

5️⃣ KISS (Keep It Simple, Stupid): The KISS principle is all about simplicity. The simpler and more straightforward your code is, the easier it is to understand, maintain, and debug.

6️⃣ DYC (Document Your Code): While not a traditional acronym like the others, this principle is equally important. Your future self, and other developers who will work with your code, will thank you for clear, concise documentation.
What's the difference?
Tags: typescript, javascript, webdev, programming
Published: 2023-05-17 09:56:09

I found myself wrangling with what I thought was an odd TS issue yesterday afternoon. During a quick chat about it, my boss gave me this gem of an example and I had to share it.


**What's the difference between?**

```
someString && obj[someString] ? [obj[someString]] : []
```
and
```
const specificVal = someString && obj[someString];
const result = specificVal ? [specificVal] : [];
```

To break down the first statement, we're saying 
- If `someString` is truthy (not `null` or `undefined` etc.) **and** `obj` has a key `someString`, the ternary should return an array that holds the value of `someString`. 
- If the conditional is falsy, an empty array is returned.

The second statement breaks this into two steps, first by defining `specificVal`, and then using a ternary to return an array with that value or an empty array.

Just looking at them, they're pretty similar statements, _so what's the difference between them?_

**A whole lot**. It might manifest itself as a TypeScript issue, but it's there for a reason.
 
Typescript can't infer and guarantee that `obj[someString]` in the conditional statement is going to be the same as `obj[someString]` in the return statement, so we split it in to two variables.

Here's a fun example of that - Proxies make objects that on access, can run code to return a result!

```
const map = new Proxy({}, {get(target, prop, receiver) {return Math.random(); }})
```
![A console.log of map[32] to show how it changes each time](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ztihtd4a1vmioo3xp1rr.png)

Consider doing something like:

```
const value = map[1] > 0.5 ? map[1] : 0
```

This won't be consistent with returning something higher than 0.5 or 0.

Splitting it up now fixes that problem.
```
const v = map[1]
if v > 0.5 ? v : 0
```
Essentially object and array access can be just as dynamic as functions (via Proxies, getters and other traps) and we need to treat them as such in places to make TypeScript happy.

Shoutout (and all credit) to James Canning for the example and explanation!
Stay Ahead of the Curve: ITIL-4-Foundation Exam Dumps for Exam Excellence
Published: 2023-05-17 09:52:53

What are the objectives of the ITIL-4-FOUNDATION exam?
The [ITIL-4-Foundation Exam Dumps](https://dumpsarena.com/itil-dumps/itil-4-foundation/) is designed to test a candidate's understanding of the ITIL 4 framework. This exam aims to validate that an individual has a general comprehension of the key concepts, terminology, and elements of the ITIL framework.

One primary objective of this certification is to provide candidates with foundational knowledge about service management practices, including their purpose and value in business operations. The exam assesses one's ability to identify and describe service management principles, such as continual improvement and customer focus.

Another objective of this certification is for candidates to understand how different components within the ITIL framework work together cohesively. Such components include but are not limited to; incident management, change control processes, problem-solving techniques and more.

Latest Exam Offer: https://dumpsarena.com/itil-dumps/itil-4-foundation/

The goal of passing this examination is for individuals seeking further career growth in information technology or aspiring professionals who want credibility on their resume when applying for jobs that require familiarity with modern-day tech services or methodologies.

What do the ITIL-4-FOUNDATION practice test questions cover?
The ITIL-4-FOUNDATION practice test questions are designed to cover a wide range of topics related to the ITIL framework. These include understanding the key concepts and principles of service management, the four dimensions of service management, the value system, and how these apply in various scenarios.

The practice test questions may also cover specific processes such as incident management, problem management, change control, and release management. It is important to note that while some questions may be straightforward knowledge-based queries, others require critical thinking skills and practical application.

In addition to testing your knowledge on theoretical concepts and methodologies within the ITIL framework, **ITIL-4-Foundation Dumps** practice tests may also assess your ability to identify areas for improvement in existing processes or suggest new approaches altogether.

To excel in an ITIL-4-FOUNDATION exam or its associated practice tests it's crucial you have a deep understanding of each concept covered by each question. Practicing sample exams will allow you not only to deepen your comprehension but also improve time-management skills so that come exam day you feel confident answering all types of questions covering different aspects of Service Management.
Akeneo: The Complete Solution for Managing Product Data
Published: 2023-05-17 09:47:00


Akeneo is a product information management (PIM) platform that helps businesses centralize, manage, and enrich their product data. Akeneo is a cloud-based solution that is scalable, flexible, and easy to use. It can be used by businesses of all sizes, in any industry.

### Here are some of the benefits of using Akeneo:

- **Centralization of product data:** Akeneo allows businesses to centralize all of their product data in one place. This makes it easy to find and manage product information, and it also helps to improve data quality.


- **Enrichment of product data:** It allows businesses to enrich their product data with additional information, such as images, translations, and technical specifications. It helps businesses to provide their customers with a more complete and accurate view of their products.


- **Improved data quality:** [Akeneo](https://webkul.com/akeneo/) helps businesses to improve the quality of their product data by providing features such as data validation, duplicate detection, and data enrichment. This helps to ensure that businesses are working with accurate and up-to-date product information.



- **Increased productivity:** Akeneo can help businesses to increase their productivity by automating many of the tasks involved in managing product data. This frees up employees to focus on other tasks, such as marketing and sales.



- **Improved customer experience:** Akeneo can help businesses to improve the customer experience by providing them with a more complete and accurate view of their products. This can lead to increased sales and customer satisfaction.

### Conclusion:
Overall, Akeneo is a powerful PIM platform that can help businesses to improve their product data management. If you are looking for a way to centralize, manage, and enrich your product data, then [Akeneo PIM](https://store.webkul.com/Akeneo.html) is a great option.
Scaffolding a Vue 3 project using create-vue ⚡️
Tags: vue, javascript, frontend, webdev
Published: 2023-05-17 09:40:00

#Overview

Vue.js the progressive JavaScript framework, one of three modern frontend framework with Angular and React.
What is the reasons why many developers choose this framework?

**1.** Vue is very simple to learn, also for beginner, thanks to its simple and declarative syntax.
**2.** You decide when to increase the difficulty: Vue is great for small or large projects such as enterprise software.
**3.** It's compose by a large ecosystem maintened by a community of insider and passionate people.

This article will show you how to scaffolding a Vue.js application with `create-vue`, the official scaffolding method.


#Prerequisites

- Have [Node >= 16](https://nodejs.dev/en/) installed on your machine
- Familiarity with the command line

#Installation
`create-vue` is the official method to create a Vue.js Single Page Application (SPA). It's based on [Vite](https://vitejs.dev/) a frontend tool for developing modern web applications.

First, run the following command in your command line:

```
npm init vue@latest
```
The first time, this command will ask you to install `create-vue` and once installed, the project creation procedure will start.
You will be presented with prompts for several optional features:

```
√ Project name: ... <your-project-name>
√ Add TypeScript? ... No / Yes
√ Add JSX Support? ... No / Yes
√ Add Vue Router for Single Page Application development? ... No / Yes
√ Add Pinia for state management? ... No / Yes
√ Add Vitest for Unit Testing? ... No / Yes
√ Add an End-to-End Testing Solution? » No
√ Add ESLint for code quality? ... No / Yes
```
It possible customize the scaffolding of the app adding TypeScript or JSX support, add Pinia or Vue Router, ESLint, Vitest.
At the end of the process, follow these commands for install the dependencies:

```
cd <your-project-name>
npm install
```
Congratulations! You have created your first Vue app! 🎊


#Run your app
Now, you have just created your first app.
The folder structure is similar to this:

```
├── public
├── node_modules
├── src
│   ├── assets
│   ├── components
│   ├── App.vue
│   └── main.js
├── index.html
├── package-lock.json
├── package.json
└── README.md
```

Open the terminal and run the following command:

```
npm run dev
```
Follow the url on the console (for example http://localhost:5173) and you will see this:


![First page Vue app](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hjy4c54m865lq9cy9dw3.JPG)

#Conclusion
Vue is a powerful and lightweight framework for creating interactive user interfaces and now you can scaffolding a project to create any applications you would like.
Happy coding!✨

---




Hi👋🏻
My name is Domenico, software developer passionate of Vue.js framework, I write article about it for share my knowledge and experience.
Don't forget to visit my Linktree to discover my projects 🫰🏻

Linktree: https://linktr.ee/domenicotenace

Follow me on dev.to for other articles 👇🏻

{% embed https://dev.to/dvalin99 %}
Design nice SwiftUI views and automatically get the code (Kolibri for SwiftUI)
Tags: swiftui, ios, mac, ipad
Published: 2023-05-17 09:20:20

Hi! I built the app Kolibri for iOS, iPadOS and macOS. As the title says you can design in it like in a "normal" vector design tool (e.g. Sketch for macOS) and then Kolibri automatically generates the SwiftUI code for your designs. 

It's a first version so I'm sure there's a lot missing. That's why I would love to hear from developers and designers what's missing for you, what's not working and in general your feedback. Thanks so much.

It's in the App Store to try for free here
[App Store Link](https://apps.apple.com/us/app/kolibri-for-swiftui/id6447380792)

Here are some screenshots:

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

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kh0r58rd1kwb9t6ez2fj.png)
Explain like I'm 5: (ARIA) Landmarks
Tags: a11y, webdev, help, explainlikeimfive
Published: 2023-05-17 09:18:44

I'm very confused about (ARIA) landmarks and the terminology used around them. Would really appreciate an explanation 🙏

## Here is what I know

- We should provide landmarks as context for screen readers, to provide page structure and organise our content
- This can be done by using semantic HTML, e.g. `<main>` for most important content, `<h1>` - `<h6>` for headline hierarchies,`<a>` for links etc.  

I found this super useful article by @yuridevat about [The Importance of Landmarks](https://dev.to/yuridevat/importance-of-landmarks-5d5k) explaining how ARIA roles should only be used when improving legacy code or if it's not possible to provide enough context through HTML elements. 

## Here is where I'm confused: 

I guess my biggest issue is the wording: this article refers to [ARIA Landmark Examples](https://www.w3.org/WAI/ARIA/apg/patterns/landmarks/examples/general-principles.html) and lists `banner`, `main`, `complementary` and `contentinfo` as landmarks. But if I inspect the code, these roles do not show up. 

Are the ARIA roles just different names for the native HTML elements (e.g. `complementary`= `<aside>`)? 
When talking about "ARIA landmark roles" do we actually also mean semantic HTML elements? 
Is there a good example of (ARIA) landmark roles in practise? 

Thanks a lot in advance 🙌
How to manage a remote development team?
Tags: remote, hiring, development, team
Published: 2023-05-17 09:17:57

Managing a #remote #development #team can be a daunting task, but it doesn't have to be! Stay ahead of the game with our latest article on the [5 Best Practices for Managing a Remote Development Team](https://devler.io/blog/5-best-practices-for-managing-a-remote-development-team)
University Management System in Apache AGE - Part-2
Tags: apacheage, graphdatabase, database, postgres
Published: 2023-05-17 09:16:20

Here is a sample database documentation that includes the necessary Nodes and their attributes:

**Student**
id: unique identifier for the student
name: name of the student
email: email address of the student

**Teacher**
id: unique identifier for the professor
name: name of the professor
email: email address of the professor

**Course**
id: unique identifier for the course
name: name of the course
credits: number of credits assigned to the course

**Department**
id: unique identifier for the department
name: name of the department

Let's now create some dummy data to see how our system will work.

**Department**
`SELECT * FROM cypher('university', $$
create(:Department{name:'Computer Science', rooms:30})
$$) as (v agtype);`

**Student**
`SELECT * FROM cypher('university', $$
create(:student{name:'std1', rollNo:1})
$$) as (v agtype);
`

`SELECT * FROM cypher('university', $$
create(:student{name:'std2', rollNo:2})
$$) as (v agtype);
`

`SELECT * FROM cypher('university', $$
create(:student{name:'std3', rollNo:3})
$$) as (v agtype);`


`SELECT * FROM cypher('university', $$
create(:student{name:'std4', rollNo:4})
$$) as (v agtype);`


`SELECT * FROM cypher('university', $$
create(:student{name:'std5', rollNo:5})
$$) as (v agtype);`

**Teacher**
`SELECT * FROM cypher('university', $$
create(:teacher{name:'Micheal', role:'Assistant Prof'})
$$) as (v agtype);
`
`SELECT * FROM cypher('university', $$
create(:teacher{name:'Muneeb', role:'Professor'})
$$) as (v agtype);`

**Course**
`SELECT * FROM cypher('university', $$
create(:course{name:'Programming', creditHours:3})
$$) as (v agtype);
`
`SELECT * FROM cypher('university', $$
create(:course{name:'Database', creditHours:3})
$$) as (v agtype);`



For more details visit: https://age.apache.org/overview/

**AGE Github Link:** https://github.com/apache/age

**AGE Viewer Github Link:** https://github.com/apache/age-viewer
Face Detection
Published: 2023-05-17 09:12:48

Good Day, 
Hoping someone can direct me. I've written this code in React to identify faces using the webcam from set images stored a the labels folder and also to identify emotions from the faces detected. 

I need guidance on how i can rewrite the function in react (at the moment in JS) The faces cannot be identified, not sure where i am going wrong but it cannot match the faces from the labels folder to identify which face is which. I'm new to React. I

I also getting emotions from the face to working and it shows up but not he identification. Below is part of the code which needs to be rewritten in React which i'm not sure how to do:

```
useEffect(() => {
    startVideo();
    videoRef && loadModels();
    getLabeledFaceDescriptions();
  }, []);

 
  
  function getLabeledFaceDescriptions() {
    
    const labels = [
      "Bibinur",
      "Emunrich",
      "Mukthar",
      "Nursultan Ahmetsha",
      "Mahmud",
      "Kayrbek",
      "Saltanat",
      "Ablay",
      "Makkabhat",
      "Sandugash_8B",
      "Makhabbat_Zharimbetova",
      "Kamilya_Nuryshova",
    ];
    return Promise.all(
      labels.map(async (label) => {
        const descriptions = [];
        //const expression = [];
        for (let i = 1; i <= 2; i++) {
          const img = await faceapi.fetchImage(`/labels/${label}/${i}.png`);

          const labeledFaceDescriptors = await getLabeledFaceDescriptions();
          const faceMatcher = new faceapi.FaceMatcher(labeledFaceDescriptors);

          const detections = await faceapi
            .detectSingleFace(img)
            .withFaceLandmarks()
            .withFaceExpressions()
            .withFaceDescriptor();
          descriptions.push(detections.descriptor);
          
          console.log(detections.descriptor)
          
          
        }
        return new faceapi.LabeledFaceDescriptors(label, descriptions);
        
      })
      
    );
  
    }

  return (
    <div>
      <video crossOrigin="anonymous" ref={videoRef} autoPlay></video>
    </div>
  );
}

export default App;
```
University Management System in Apache AGE - Part-1
Tags: apacheage, graphdatabase, database, postgres
Published: 2023-05-17 09:08:46

First, let's define the entities involved in the university management system. Some of the entities that come to mind are:

**Entities:**
`Students`
`Teachers`
`Courses`
`Departments`

Next, we need to define the relationships between these entities. Here are some of the relationships that exist in a university management system:

**Relations:**
A student can enroll in multiple courses.
A course can have multiple students enrolled in it.
A course is taught by one or more teacher.
A teacher can teach one or more courses.
A course is offered by one department.
A department can offer multiple courses.
A department can have multiple teachers.
A teacher can be affiliated with one department.



Based on the above entities and relationships, we can create an ER diagram for the university management system using a graph database.
The ER diagram will have the following entities:
**Entities:**
`Student`
`Teacher`
`Course`
`Department`

The ER diagram will have the following relationships:
**Relations:**
`Enrolled in (Student -> Course)`
`Taught by (Course -> Teacher)`
`Offered by (Course -> Department)`
`Affiliated with (Teacher -> Department)`



Once the ER diagram is created, we can use it to create the necessary Nodes and Edges in the graph (Apache AGE) database.


![University Management System](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5bhqiyvht6kzjf8zgid2.png)

For more details visit: https://age.apache.org/overview/

**AGE Github Link:** https://github.com/apache/age

**AGE Viewer Github Link:** https://github.com/apache/age-viewer
Create a Machine Learning API with FastAPI
Published: 2023-05-23 07:16:09

---
title: Create a Machine Learning API with FastAPI
published: true
date: 2023-05-17 08:55:53 UTC
tags: 
canonical_url: https://www.anurag629.club/posts/create-a-machine-learning-api-with-fastapi/
---

Create a Machine Learning API with FastAPI. This tutorial will help you to create a machine learning API with FastAPI.

The post is originally published at [Link](https://www.anurag629.club/posts/create-a-machine-learning-api-with-fastapi/)
How to Check ABCD Index approved journals?
Tags: research, phd, journa, webdev
Published: 2023-05-17 08:50:07

The [ABCD Index Database](https://abcdindex.com/blogs/list-of-scopus-indexed-journals) uses a variety of factors to rank journals, including the quality of the research published in the journal, the impact of the journal, and the peer review process. The database also provides information on the journal's editorial board, its publication frequency, and its open access status.
Science Indexed Journals

[List of ABCD Journals without Publication fee
](https://abcdindex.com/)
The ABCD Index Database is a valuable resource for scholars who are looking for high-quality journals to publish their research in. It is also a useful tool for librarians and researchers who are trying to track the latest research in their field.

## Here are some of the benefits of using the ABCD Index Database:


- It is free and open access.
- It is peer-reviewed.
- It indexes over 10,000 journals from around the world.
- It uses a variety of factors to rank journals, including the quality of the research published in the journal, the impact of the journal, and the peer review process.
- It provides information on the journal's editorial board, its publication frequency, and its open access status.

If you are a scholar who is looking for a high-quality journal to publish your research in, or if you are a librarian or researcher who is trying to track the latest research in your field, then I encourage you to use the [ABCD Index Database](https://abcdindex.com/blogs/submit-a-conference-paper).