teleren/devto huggingface dataset:
O que é C# e quais suas funções na programação?
Published: 2023-03-30 04:46:46

C# (pronuncia-se "C Sharp") é uma linguagem de programação moderna, orientada a objetos e fortemente tipada criada pela Microsoft em 2000. C# foi projetada para ser simples, segura e eficiente, sendo usada para desenvolver aplicativos de desktop, aplicativos web, jogos, aplicativos móveis e muito mais.

Uma das principais características do C# é a sua interoperabilidade com outras linguagens de programação, como C++, Java e Python. Além disso, o C# foi projetado para ser fácil de aprender para aqueles que já têm experiência com outras linguagens orientadas a objetos, como Java ou C++.

C# é uma linguagem de programação orientada a objetos. Isso permite que os desenvolvedores criem programas mais estruturados e fáceis de entender e manter. O C# também suporta programação genérica, o que permite criar classes e métodos que podem ser usados com qualquer tipo de dado.

Uma das principais funções do C# é a criação de aplicativos de desktop para o Windows. O C# é usado para criar programas que rodam no sistema operacional Windows e podem acessar recursos do sistema, como a interface de usuário, arquivos e bancos de dados. O C# também é frequentemente usado para desenvolver jogos para PC e consoles.

Além disso, o C# é usado para criar aplicativos da Web com o ASP.NET.

O ASP.NET é um framework da Microsoft para a criação de aplicativos da Web e o C# é a linguagem de programação usada para escrever o código dos aplicativos. Com o ASP.NET e o C#, os desenvolvedores podem criar aplicativos da Web que podem se comunicar com bancos de dados, enviar e receber dados do usuário e muito mais.

O C# também é usado para desenvolver aplicativos móveis para o sistema operacional Android e iOS. Com o framework Xamarin da Microsoft, os desenvolvedores podem criar aplicativos móveis compilados em código nativo para Android e iOS, usando o C# como linguagem de programação.

Outra função do C# é o desenvolvimento de jogos, através da engine Unity. A engine Unity é uma das mais populares para o desenvolvimento de jogos e suporta a linguagem de programação C# para a criação de jogos para desktop, web e mobile.

Resumindo, o C# é uma linguagem de programação moderna, orientada a objetos e fortemente tipada, usada para desenvolver uma ampla variedade de aplicativos, desde aplicativos de desktop a jogos e aplicativos móveis. Com o C#, os desenvolvedores podem criar programas mais estruturados, fáceis de entender e manter, e podem aproveitar a interoperabilidade com outras linguagens de programação para integrar seus aplicativos com outras tecnologias.
How do I get tesseract python to read these numbers?
Tags: tesseract, python
Published: 2023-03-30 04:37:42

I have cropped just the area where the price tag is. I did this on the input side, even with that cropped it still has trouble reading the numbers. This is the code I've tried. In the last photo, I"m trying to read the part that says ISBN: numbers and letters. I wont always be able to get the price tag perfectly cropped, so I know I may need a way to isolate the price tag, it is mostly white. Even with this cropped though, I'm having hard time getting tesseract to read the price in the right square.

```
from PIL import Image, ImageOps
import pytesseract as tt
import numpy as np
import cv2

#tt.tesseract_cmd = '/usr/bin/tesseract'

filename = 'tbar.jpg'
#img1 = np.array(Image.open(filename))

img1 = cv2.imread(filename, cv2.IMREAD_GRAYSCALE)


#img1 = cv2.GaussianBlur(img1,(2,2), 1)

#img = cv2.GaussianBlur(img, (5, 5), 0)

text = tt.image_to_string(img1, lang='eng',  \
           config='--psm 10 --oem 3 -c tessedit_char_whitelist=0123456789')



#text = tt.image_to_string(img1)


print(text)
```

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ebzxp4g5ck9chdkc0qh6.jpg)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kzyn5t56wpat4851dk16.jpg)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1836alqiri1hrbs4fkgk.jpg)
My First react webpage
Tags: html, frontend, javascript, help
Published: 2023-03-30 04:32:57

I'm new to web development. This is my first sample project created by react js. Is this good enough to add into my portfolio / resume.
please give your ideas..

use below link to check my webpage
https://searchz.netlify.app/


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vs94wibjf6hm2dor7vfn.png)
Everything you need to start working with Qdrant
Tags: qdrant, blogsvietnamese, quadrant, tutorial
Published: 2023-03-30 04:03:38

**1. Introduction**
**Qdrant** (quadrant) is a vector similarity search engine. Nó cung cấp một dịch vụ production-ready với API thuận tiện để lưu trữ, tìm kiếm và quản lý points-vectors có additional payload.
**Qdrant** được điều chỉnh để hỗ trợ lọc mở rộng. It makes it useful for all sorts of neural network or semantic-based matching, faceted search, and other applications.

**2. Installation**

Cách dễ nhất để sử dụng Qdrant là run một pre-built image bằng docker. Download image from [DockerHub](https://hub.docker.com/r/qdrant/qdrant): 

`docker pull qdrant/qdrant`

And run the service inside the docker: 
`docker run -p 6333:6333 \ -v $(pwd)/qdrant_storage:/qdrant/storage \ qdrant/qdrant`

Trong trường hợp này, Qdrant sẽ sử dụng cấu hình mặc định và lưu trữ tất cả dữ liệu trong thư mục `./qdrant_storage`

Và bây giờ Qdrant có thể truy cập được tại `localhost:6333`


**3. Collections**


**4. Payload**


**5. Points**


**6. Search**


**7. Filtering**


**8. Optimizer**


**9. Storage**


**10. Indexing**


**11. Distributed deployment**


**12. Snapshots**


**13. Quantization**


**14. Integraions**


**15. Telemetry**


**16. Configuration**


[Ref.](https://qdrant.tech/documentation/)


**Conclusion**
Thank you very much for taking time to read this. I would really appreciate any comment in the comment section.
Enjoy🎉
How to Create Module in Magento 2
Tags: magento, programming
Published: 2023-03-30 04:00:40

We will discuss the topic of how to create simple module called **Kyle Wiley **in Magento 2

There are 2 things must have when create Magento module: module.xml, registration.php

## Step 1: Create the folder of Kyle Wiley module

```
 app/code/Kyle/Wiley
```
So it's gonna be like Kyle_Wiley, Kyle_Wiley it's module name

## Step 2: Create etc/module.xml file.

```
app/code/Kyle/Wiley/etc/module.xml
```

Content would be:

```
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
    <module name="Kyle_Wiley">
    </module>
</config>
```

## Step 3: Create registration.php file

`app/code/Kyle/Wiley/registration.xml`

Content would be:

```
<?php
\Magento\Framework\Component\ComponentRegistrar::register(
	\Magento\Framework\Component\ComponentRegistrar::MODULE,
	'Kyle_Wiley',
	__DIR__
);
```

## Step 4: Enable our new module


Finish the step 3, we have already created the Kyle_Wiley module. And we will enable this module in this step

After create the module if you run the command as:

```
bin/magento module:enable Kyle_Wiley
```

And for sure you should run

```
bin/magento setup:upgrade
```
C#: Pass Lambda Expression to Select LINQ at Runtime
Published: 2023-03-29 08:24:28

In [the previous article](https://dev.to/kenakamu/c-pass-lambda-expression-to-where-linq-at-runtime-1ma4), I explain how to pass the lambda string to ``Where`` clause. In this article, I do pass it to the ``Select`` extension method.

## Create Classes

I used ``List<string>`` before, but let's create the class to test several different scenario.

```csharp
public class MyClass
public class MyClass
{
    public int Id { get; set; }
    public string Name { get; set; } = string.Empty;
    public int Age { get; set; }
    public string Country { get; set; } = string.Empty;
}
```

## Select LINQ for string

The ``Select`` method takes ``Func<TSource, TResult>`` delegate. I create ``List<MyClass>`` as an input, so the ``TSource`` is ``MyClass`` this time. 

Then how about ``TResult``? It's depends if I want to select a string property of an int property.

```csharp
ParameterExpression param = Expression.Parameter(typeof(MyClass), "x");
Expression expression = new ExpressionParser(
    new ParameterExpression[] { param },
    "x.name", 
    null, 
    new ParsingConfig())
    .Parse(typeof(string));

Expression<Func<MyClass, string>> lambda = 
    Expression.Lambda<Func<MyClass, string>>(expression, param);
```
The input parameter is ``MyClass`` and I name it as ``x``. Then the query is ``x.name`` to return name. Of course, the return type is string type.

Let's create a list and try the code.

```csharp
List<MyClass> inputs = new() 
{
    new () { Id = 1, Name = "1" },
    new () { Id = 2, Name = "2" }
};

List<string> result = inputs.AsQueryable().Select(lambda).ToList();
```
The results is:

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

## Select LINQ for object

If we don't know which property to select yet, we can specify ``object``.

```csharp
string query = Console.ReadLine();

ParameterExpression param = Expression.Parameter(typeof(MyClass), "x");
Expression expression = new ExpressionParser(
    new ParameterExpression[] { param },
    query, 
    null, 
    new ParsingConfig())
    .Parse(typeof(object));

Expression<Func<MyClass, object>> lambda = 
    Expression.Lambda<Func<MyClass, object>>(expression, param);

//List<string> inputs = new() { "1", "2" };
//var result = inputs.AsQueryable().Where(lambda).ToList();


List<MyClass> inputs = new() 
{
    new () { Id = 1, Name = "1" },
    new () { Id = 2, Name = "2" }
};

List<object> result = inputs.AsQueryable().Select(lambda).ToList();
```

Then we can run the application to test.

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

## Summary

It's easy to create a lambda expression object based on input, output and its types.
Javascript Object #2
Tags: javascript, webdev, beginners, object
Published: 2023-03-30 03:57:02

From the last post we've seen what is Object in Javascript and how it is created using the Object literal Notation and how strong object is,what he is capable of,that's fine.

Have you ever had a thought,Yeah wow! How Good we created a Object but wonder how can we use those Properties inside the Object and Can we delete or replace those property value.Yes we can Do that,and we are going to see that in this Post.

To access the Object properties we do have two Global methods,

1. Dot notation

2. Array like notation


**Dot notation**

The following illustrates how to use the dot notation to access a property of an object:

```
`objectName.propertyName`
```

for Example 

```
`let objectName = {
firstName: 'SAM',
lastName: 'r',
}`
```

here we can access the firstName property by,

```
objectName.firstName
objectName.lastName

```
**Array like notation**

The following illustrates how to access the value of an object’s property via the array-like notation:

```
`objectName['propertyName']`
```

here we can access object items by,

```
`objectName['firstName']`
`objectName['lastName']`
```

as for now we have seen two methods,which is the best method to access those property is,i would say array like notation.And i have a major reason for this,which we will discuss now.

From the above two methods Dot looks very simple but there is big drawback in this method,and i will explain it with an example,

Consider an Object we have with a property name 'The Object',while we try to access this property value using dot notation.we will get an error 'undefined'.Javascript will take the property name as 'The' and search for it,and thus it results in undefined.

So the Best way is to use the Array like Notation.That's it for now.We will learn more about Object in Upcoming Posts

Many thanks ...
Sam
Building An Arch Linux Repository with GitHub Actions
Tags: archlinux, github, githubactions, automation
Published: 2023-03-30 03:29:03

## Introduction
Arch Linux is a popular rolling-release Linux distribution that is known for its simplicity, flexibility, and bleeding-edge packages. Building AUR packages for Arch Linux can be a time-consuming and tedious process, even with AUR Helpers. In this post, I will show you the tool I created to use GitHub Actions to automate the process of building Arch Linux packages and how to create your own aur repository.

## Fork your own

I have created a GitHub repository that builds AUR packages and creates a Arch Linux repository using GitHub Releases.
In this tutorial, I will show you how to use it to automate the process of building an Arch Linux packages.

### Step 1: Setting up your environment

Before we start, you will need to have a few things set up:

- A GitHub account
- A fork of my GitHub repository (https://github.com/jckimble/pkgbuilds)
- A text editor (I will be using Visual Studio Code)

### Step 2: Customizing your fork

In your fork of my repository, do the following:

- Remove any packages you do not want to build
- Remove or rename the keyring package
- Delete key.gpg.enc
- Add Secrets (Pick one)
- - Set REPO_TOKEN with a private token
- - Set ENCRYPTION_KEY for actions and dependabot
- Update config.json
- Update README.md where others will know how to add your repository to their Arch Linux repository list

### Step 3: Committing and pushing your changes

Once you have completed the above steps, commit and push your changes to your fork of the repository. GitHub Actions will automatically start running your workflow and build your AUR packages.

### Step 4: Checking the build status

You can check the status of your build by going to the "Actions" tab on your GitHub repository. Here, you will see the status of your workflow and any logs or errors that occurred during the build.

## Can I just use yours?

Of course, I'm just not going to say for sure I will add the package you desire. I most likely will since it's pretty well automated where I do not personally have to do anything besides add a git submodule. If enough people want to add packages to my repository I may revisit using GitHub Actions using GitHub Issue Forms, to automate the process any further. Just create an issue using the package request issue form and I'll look into the package.


## Conclusion

In this post, I showed you how to use GitHub Actions to automate the process of building an Arch Linux repository. By using GitHub Actions, you can save time and increase productivity by automating repetitive tasks. If you have any questions or comments, feel free to leave them in the comments section below.

Repository: https://github.com/jckimble/pkgbuilds

Note: This project is an active work in progress, I am always thinking of new ideas to remove as much manual work as possible. If you have any ideas or suggestions feel free to let me know here in the comments or in the issues section of the repository!
87. Leetcode Solution in Cpp
Tags: cpp
Published: 2023-03-30 03:24:28

```cpp
class Solution {
public:
    bool isScramble(string s1, string s2) {
        if (s1 == s2) {
            return true;
        }
        if (!is_permutation(s1.begin(), s1.end(), s2.begin())) {
            return false;
        }
        
        int n = s1.length();
        vector<vector<vector<bool>>> dp(n, vector<vector<bool>>(n, vector<bool>(n+1, false)));
        
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < n; j++) {
                dp[i][j][1] = (s1[i] == s2[j]);
            }
        }
        
        for (int length = 2; length <= n; length++) {
            for (int i = 0; i <= n-length; i++) {
                for (int j = 0; j <= n-length; j++) {
                    for (int k = 1; k < length; k++) {
                        if ((dp[i][j][k] && dp[i+k][j+k][length-k]) || (dp[i][j+length-k][k] && dp[i+k][j][length-k])) {
                            dp[i][j][length] = true;
                            break;
                        }
                    }
                }
            }
        }
        
        return dp[0][0][n];
    }
};
```
#leetcode
#challenge
Here is the link for the problem:
https://leetcode.com/problems/scramble-string/
What is the use of refs?
Published: 2023-03-30 03:13:57

The ref is used to return a reference to the element. They should be avoided in most cases, however, they can be useful when you need a direct access to the DOM element or an instance of a component.

**How to create refs?**

**There are two approaches**

i. This is a recently added approach. Refs are created using React.createRef() method and attached to React elements via the ref attribute. In order to use refs throughout the component, just assign the ref to the instance property within constructor.

```
 class MyComponent extends React.Component {
            constructor(props) {

super(props)
              this.myRef = React.createRef()
            }
            render() {
              return <div ref={this.myRef} />
}

 }
```

You can also use ref callbacks approach regardless of React version. For example, the search bar component's input element is accessed as follows,

```
class SearchBar extends Component {
             constructor(props) {
                super(props);
                this.txtSearch = null;
                this.state = { term: '' };
                this.setInputSearchRef = e => {
                   this.txtSearch = e;
                }
             }
             onInputChange(event) {
                this.setState({ term: this.txtSearch.value });
             }
             render() {
                return (
                   <input
                      value={this.state.term}
                      onChange={this.onInputChange.bind(this)}
                      ref={this.setInputSearchRef} />
); 
}
```

You can also use refs in function components using closures. Note: You can also use inline ref callbacks even though it is not a recommended approach.

Happy Learning!!!
Introducing Datawiza ChatGPT for Business: A Secure and Reliable ChatGPT Platform
Tags: blog, industry
Published: 2023-03-30 15:26:06

---
title: Introducing Datawiza ChatGPT for Business: A Secure and Reliable ChatGPT Platform
published: true
date: 2023-03-30 02:57:03 UTC
tags: Blog,Industry
canonical_url: https://www.datawiza.com/blog/industry/introducing-datawiza-chatgpt-for-business-a-secure-and-reliable-chatgpt-platform/
---

[Register for early access now](https://forms.gle/2xU5zjzkY2LKTahb6)

[Alternatively, schedule a brief meeting with us](https://calendly.com/datawiza/chatgpt-for-business)

Boost your organization’s productivity with Datawiza ChatGPT for Business, a secure and reliable ChatGPT platform designed to meet the needs of businesses and enterprises of all sizes. Powered by the same OpenAI API behind ChatGPT and developed by a leading cybersecurity company, our solution seamlessly integrates cutting-edge AI technology and robust security features to provide an unparalleled experience for your team, addressing the gap left by **_the absence of a business plan for ChatGPT itself_**.

**Easy User Onboarding:** Simplify team access with unified business accounts, eliminating the need for individual registrations and credit card requirements.

**Boosted Security with SSO and MFA:** Integrate with identity providers such as Azure AD, Okta, and Google Workspace, enabling efficient user management and bolstering security through your existing Single Sign-On (SSO) and Multi-Factor Authentication (MFA).

**Compliance & Auditing:** Ensure regulatory compliance and effectively track usage with our comprehensive auditing tools specifically designed for businesses.

The post [Introducing Datawiza ChatGPT for Business: A Secure and Reliable ChatGPT Platform](https://www.datawiza.com/blog/industry/introducing-datawiza-chatgpt-for-business-a-secure-and-reliable-chatgpt-platform/) appeared first on [Datawiza](https://www.datawiza.com).
6 differences you must know between a Good Pull Request (PR) Vs a Bad Pull Request (PR)
Tags: coding, programming, devjournal, developers
Published: 2023-03-30 02:32:00

Are you tired of submitting pull requests that never get merged or receiving pull requests that are difficult to review?

Pull Requests (PRs) are an integral part of the collaborative process in software development. They enable developers to submit their changes to a codebase for review and feedback and to merge those changes into the main codebase. However, not all PRs are created equal. Some are well-crafted, well-organized, and easy to review, while others are confusing, poorly formatted, and frustrating to work with.

Here are 6 differences you must know between Good Pull Request Vs Bad Pull Request:

## Difference 1
Good Pull Request is well written and clearly explains the changes being proposed. Vs Bad PR is poorly written or vague about the changes being made.

## Difference 2
Good PR includes how the changes have been tested makes us go faster in the long run. Vs Bad PR may not be tested or may include inadequate testing information.

## Difference 3
Good PR is focused and addresses a single issue. Vs Bad PR addresses multiple issues at once.

## Difference 4
Good PR is based on the latest version of the codebase. Vs Bad PR is based on an outdated version of the codebase.

## Difference 5
Good PR has a faster review and approval cycle. Vs In Bad PR, review or approval takes a longer time.

## Difference 6
Good PR is easy to merge and does not cause conflicts with other changes. Bad PR causes conflicts or is difficult to merge due to a lack of attention to detail.


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

Thanks for reading this.

If you have an idea and want to build your product around it, schedule a call with me.

If you want to learn more about DevOps and Backend space, follow me.

If you want to connect, reach out to me on Twitter and LinkedIn.