teleren/devto huggingface dataset:
Hash Functions in Solidity
Tags: solidity, ethereum, web3, blockchain
Published: 2023-03-08 17:15:50

>In Solidity, hash functions are used to convert arbitrary-length data into fixed-size values. 

A hash function is a mathematical algorithm that takes any input, such as text or numbers, and produces a unique output known as the "hash". The main purpose of hashing is to ensure data integrity. It can be used to verify whether two pieces of data are identical without actually revealing what they contain. This makes it useful for encrypting passwords and verifying digital signatures.

The most commonly used hash function in Solidity is Keccak-256, which was developed by the Ethereum Foundation specifically for use with their blockchain technology. Keccak-256 produces 256 bits (32 bytes) of output when given any input up to 512 bits (64 bytes). It has been designed so that even small changes in the input will produce completely different outputs, making it difficult for attackers to guess or manipulate inputs based on their knowledge of previous hashes created from similar inputs.

In addition to providing security benefits through its cryptographic properties, Hash functions also make code more efficient by allowing developers to store only one version (the hash) instead of multiple versions if using traditional methods like arrays or objects would require more storage space than necessary due do redundant information being stored multiple times unnecessarily. As such, hash functions have become an essential tool when developing applications on blockchains like Ethereum since they provide both security and efficiency benefits at once

Despite their simplicity, hash functions are incredibly valuable and may be found in nearly all information security applications. A hash function is a mathematical function that turns a numerical input value into another numerical input value that has been compressed. When using the hash function, the input can be of any length, but the result is always of a set length. The values provided by a hash function are referred to as message digests, or simply hash values, in some circles. 

The hash function is represented in the following diagram.

![Hash](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x4jelsfb1t98adq3da0s.jpg)

For more content, follow me at - https://linktr.ee/shlokkumar2303
OmniStudio DataRaptors
Tags: salesforce, omnistudio, lowcode, nocode
Published: 2023-03-08 17:15:39

Nesse artigo, vamos aprender sobre um dos componentes da camada _Service Management_ do _OmniStudio_. O _DataRaptor_ é uma ferramenta de mapeamento de dados que nos permite ler, transformar e escrever dados no _Salesforce_. Este componente pode enviar e receber dados de outros componentes do _OmniStudio_, como _FlexCards_, _OmniScripts_ e _Integration Procedures_, além de aplicativos e _APIs_ externas. Também pode acessar objetos externos, metadados customizados e objetos _Salesforce_.

Podemos pensar: mas podemos fazer a mesma coisa utilizando classes _Apex_. Porque eu deveria utilizar um _DataRaptor_?

> Utilizar o DataRaptor torna o desenvolvimento mais rápido, além de facilitar as futuras manutenções em sua Organização.

Por ser uma ferramenta de desenvolvimento declarativo, sem a necessidade de código, o desenvolvimento e manutenção se tornam mais rápidos do que o desenvolvimento de uma classe _Apex_.

## Tipos de DataRaptor
- **DataRaptor Turbo Extract**
    - Capaz de fazer a leitura de apenas um objeto Salesforce;
    - Capaz de fazer a leitura de campos de objeto relacionado;
    - Podemos filtrar quais registros queremos exibir baseados em critérios de campos;
    - Não suporta a utilização de fórmulas ou dados de saída complexos;
    - Os dados de entrada (_input_) são sempre um _sObject_ (objeto _Salesforce_) e os dados de saída (_output_) podem ter o formato _JSON_ ou customizado;
- **DataRaptor Extract**
    - Capaz de fazer a leitura de um ou mais objetos Salesforce, não importa se são objetos relacionados;
    - Capaz de extrair dados de até três objetos relacionados;
    - Os dados de entrada (_input_) e os dados de saída (_output_) podem ser em formato JSON, XML ou customizado;
    - Capaz de organizar os dados através de paginação, utilizando o _offset_. Com esse recurso, podemos recuperar os dados da requisição a cada vez, baseados em valores de campos ou outros critérios;
- **DataRaptor Load**
    - Capaz de criar e/ou atualizar registros para um ou mais objetos _Salesforce_;
    - Os dados de entrada (_input_) podem estar no formato JSON, XML ou customizado, e os dados de saída (_output_) são sempre um _sObject_;
- **DataRaptor Transform**
    - Capaz de manipular dados internos ou externos ao _Salesforce_;
    - Capaz de dividir, reestruturar e transformar dados nos formatos _JSON_, _XML_ ou _schemas_ customizados;
    - Capaz de renomear nomes de campos;
    - Podemos usar fórmulas e funções para a transformação dos dados;
    - Podemos preencher modelos de documentos para o _Docusign_ ou PDF.
Building an API using FastAPI and Uvicorn
Tags: python, api, beginners, tutorial
Published: 2023-03-08 17:14:44

Building APIs is a crucial aspect of modern software development, and FastAPI is a popular Python web framework that makes it easier than ever to build high-performance APIs. With its automatic data validation, serialization, and documentation, FastAPI can help developers save time and build robust APIs. In addition, Uvicorn, a lightning-fast ASGI server, can provide high concurrency and great performance for running Python web applications.

###Install Required Libraries

To start building our API, we'll need to install FastAPI and Uvicorn using the pip install command.

```
pip install fastapi uvicorn
```

### Define the API Endpoints
FastAPI provides a simple and intuitive syntax for defining API endpoints. We can define our endpoints in a single Python file using FastAPI's 'FastAPI' class and decorators for HTTP methods. Here's an example:

```
from fastapi import FastAPI

app = FastAPI()

@app.get("/hello")
def hello(name: str = ""):
    return {"message": f"Hello {name}"}
```
This code defines endpoint '/hello' that responds to GET requests with JSON data that has a 'message' key.

###Run the API
To run the API, we can use Uvicorn to start a development server:

```
import uvicorn

if __name__ == "__main__":
    uvicorn.run(app, host="0.0.0.0", port=8000)
```
This code starts a development server on port 8000 that listens for incoming requests. You can the server by running the Python file.

###Test the API
We can test the API using any HTTP client, such as 'curl', 'request', or a web browser. For example, to test the '/hello' endpoint, we can use our command line and run:

```
curl http://localhost:8000/hello?name=john
```
This will return the JSON object we defined earlier, It will look like this: {"message": "Hello john"}.

And that's it! You have successfully built your first running endpoint on your API using Python, now all that is left is to add as many endpoints as you want. 
You can define endpoints for different types of requests such as GET, POST, PUT, DELETE, etc. each with its own set of functionalities.


Join the discussion in our [Discord channel](https://bit.ly/3HQtlYo)
Test your API for free now at [BLST](https://www.blstsecurity.com)!
O'zgaruvchilar
Tags: cpp, programming
Published: 2023-03-08 17:13:47

Ozgaruvchilar:

O'zgaruvchilar bular nima degan sovol tug'uladi. O'zgaruvchilarni biz ichi pustoy stakan deb tassavur qilamiz va bu stakanga biz qiymat kiritamiz. C++ da o'zgaruvchilar turli hil bo'ladi. 

Bular:
 O'zgaruvchilar - xotiraning nomlangan qismi bo'lib, o'zida ma'lum bir toifadagi qiymatlarni saqlaydi. O'zgaruvchining nomi va qiymatlari bo'ladi. O'zgaruvchining nomi orqali qiymat saqlanayotgan xotira qismiga murojaat qilamiz. Programma ishlashi jarayonida o'zgaruvchining qiymatini o'zgartirish mumkin. Har qanday o'zgaruvchini ishlatimizdan oldin, uni e'lon qilishimiz kerak.

int - integer - butun sonlar uchun "123"
float - kasr sonlar uchun "15.55"
double - bu ham kasr sonlar uchun faqat o'nli sonlari uchun"19.55"
string - faqat tekst uchun "Hello world"
bool - boolien - shartni to'g'ri toki noto'g'ri ekanligini aniqlab beradi "True" bo'lsa 1 "False" bo'lsa 0 chiqarib beradi


O'zgaruvchidan oldin raqam qoyib bo'lmaydi bunda eror chiqadi

Ozgaruvchiga qisqa nom qo'ysa bo'ladi va uzun nom qo'ysa boladi bu nom ko'dimizga hech halaqt berib qo'ymasi va eror chiqazib bermaydi
Misol uchun:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/763y0tnv8ab14tvgyce6.png)
Natija: 15 Nuriddin


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

Natija: 15
15
30
45
Update All NPM Dependencies
Tags: npm, node, react, webdev
Published: 2023-03-08 16:47:21

Dependencies and packages are getting updates and as a developer, it's important for you to keep your dependencies up-to-date. Today you will meet an amazing tool to keep your applications dependencies up-to-date.

Before getting started I always recommend you create a new branch before updating dependencies and test your application after updating dependencies. Then merge the branch with main branch.

## Installing npm-check-updates
First, you need to install `npm-check-updates` in your machine globally. You can do this by running the following command in your terminal:

```bash
npm install -g npm-check-updates
```

## Using npm-check-updates
Now that you have `npm-check-updates` installed. To get started open your terminal and navigate to your project directory and run the following command. 

```bash
ncu -u
```

This will check for the latest versions of all your project's dependencies and then update your dependencies from `package.json` file with the latest version numbers. It will just replace the numbers not actually install the new versions.

## Updated dependencies
Now just run the command `npm install` to install the updated dependencies. That's it! You have now successfully updated your npm dependencies using `npm-check-updates`.

Keeping your dependencies up-to-date is important for the security and functionality of your code. With `npm-check-updates`, this task becomes much easier and faster.

Thanks for reading!
Yangi qator
Published: 2023-03-08 16:37:54

Yangi qator:

1: #Yangi qatorga otkazish uchun biz "\n" yoki "endl" ni ishlatamiz

Farqi: \n string tipida yani tekst tipi uchun ishlatiladi va ko'dimizni ohirida ham qo'ysak bo'ladi va boshida.
Misol uchun:

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

Natija: Hello world
Natija: I sleap

endl prosta ko'dimizni tugatmoqchi bo'lib boshqa qatordan yozmoqchi bolsa ishlatamiz.
Misol uchun:

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

Natija: Hello world
Natija: I sleap
c++ da o'zgaruvchilarni turlari.
Published: 2023-03-08 16:37:26


Assalomu alaykum azizlar biz sizlar bilan bugun **c++** dagi funksiyalarni ko'rib chiqamiz.

```cpp
#include <iostream>
#include <iomanip>
using namespace std;
int main() {
//double kasr sonlarni saqlaydi va xotiradan 8 byte ajratadi.
//nuqtadan keyin 15 tagacha son saqlaydi.
double son2 =3.5;
//string tekstlarni saqlaydi.
string text = "Text";
//char faqat belgilarni saqlaydi.
char belgi ='s';
//int butun sonlarni saqlaydi.
int son1;
//float kasr sonlarni saqlaydi.nuqtadan keyin 7tagacha son saqlaydi.
float son;
son1 =10/3.0;
son =10/3.0;
cout<<son1<<endl;
cout<<son;
// 2talik qo'shtirnoqni ichida 1talik qo'shtirnoq chiqarish uchun maxsus belgi shart emas.
//1talik qo'shtirnoq ichida 2 talik qo'shtirnoq chiqarish uchun maxsus belgi shart emas.
//1talikni ichida 1talik chiqarish uchun maxsus belgi kerak bo'ladi.
//2talikni ichida 2talik chiqarish uchunham maxsus belgi kerak.
return 0;
}
```
Bizga **setprecision** funksiyasini ishlatish uchun _iomanip_ kutubxonasini chaqirish kerak bo'ladi.

```cpp
#include <iostream>
#include <iomanip>
using namespace std;
int main() {
float son =40.0;
cout<<setprecision(2)<<son /3;
//1cout<<setprecision(2)<<fixed<<son/3;
//2cout<<setprecision(2)<<son/3;
/*1fixed bo'lmasa boshidagi butun sonniham qo'shib hisoblaydi.agar fixed bo'lsa nuqtadan keyingilarini hisoblaydi*/
//nuqtadan keyingi sonlarni nazorat qilish uchun kerak. setprecision


return 0;
}

```

Endi esa **setfill** va  **setw**  haqida tushuncha olamiz bu funksiyalarni ishlatish uchun ham _iomanip_ kutubxonasini chaqirishimiz kerak bo'ladi.

```cpp
#include
int main (){
int son;
cin>>son;
cout<<setfill('0') <<setw(2)<<son<<endl;
cout<<setfill('0')<<setw(5)<<3<<5;
  return 0;
  
}

```

Biz buguncha **round** uchun qasi kutubxonani chaqirishni o'rganib turamiz kelasi darslarda mustaxkamlab o'rganamiz bizga **round** uchun _cmath_ kutubxonasi kerak bo'ladi.

```cpp
#include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;
int main4 () {
float son =4.5;
cout<< round(son);
return 0;
 }
```
Technical debt
Published: 2023-03-08 16:35:14

We all fail to follow through on a long enough technical solution investigation up front. I’m sure there are people out there that are so well informed, so technically knowledgeable, so micro-macro-full-stack perceiving that they know the _perfect_ tool for ever problem. But I am not one of them. Given the chance I’ll waste **days** on an inadequate solution to a project. I’ll spend weeks in documentation just to discover that I’ve been using a screw driver as a hammer. It takes decades of experience and persistent research into _every_ new piece of technology in a field to confidently  suggest a solution that is spot on appropriate. That’s why it seems far easier to dedicate to one type of tech and just drill down. But that’s not really as interesting or innovative as jumping from one problem to another wildly different problem. They say you should find your forté during school or shortly after and drill down into it. Specialize and you’ll find work. That doesn’t sound very fun honestly. The most fun and engaging projects are when you jump into a tech that you are **entirely** **insecure** in. Piecing together solutions that each compiling feels more like a game of chance then an arm chair professors self assured solution. I know many people shudder at such luck of the draw antics. But I just don’t love the process of sticking with one thing forever. I love the feel of engaging with intuition on technical problems. It tells me I’m understanding something deeper and more inherent in the situation then just “_I googled it_”. Small team game dev is similarly invigorating because you have to jump from one software tool to the next. It is a full brain workout instead of just doing “leg day” for the next eternity. Hopping from one software you are somewhere between **amateur** to **proficient** with to another. There’s a lot of benefits to knowing what you’re doing, to most people the lack of _imposter syndrome_ alone is worth it. But there’s something to be said about the overlooked dynamic learner, someone that is intimately comfortable with failure. This isn’t an entry for everyone to live by, most companies are very likely turned off by the very idea of a “improv programming” attitude. But really the only difference between me and the people that think they know best is, _I already know_ my solution is in technical debt. They just have yet to find out. In the end I might not be the sharpest tool in the shed, but there’s plenty of tools that aren’t suppose to be.
Ruby: Building a Grocery List Program Using Arrays and Hashes
Published: 2023-03-08 16:25:35

```
def create_list
  # Prompts input from user
  print "What is the list name? "
  # Returns as value input to hash with key "name"
  name = gets.chomp
  # Creates hash assigned to variable hash
  # Variable "items" creates an array
  hash = { "name" => name, "items" => Array.new }
  return hash
end

def add_list_item
  # Prompts input from user
  print "What is the item called? "
  # Returns as value input to hash with key "item_name"
  item_name = gets.chomp
  
  print "How much? "
  # Returns as value input to hash with key "quantity"
  quantity = gets.chomp.to_i
  
  hash = { "name" => item_name, "quantity" => quantity }
  return hash
end

def print_separator(character= "-")
  puts character * 80
end

# To fancify the format of the printed list
def print_list(list)
  puts "List: #{list['name']}"
  print_separator()
  
  list["items"].each do |item|
    puts "\tItem: " + item['name'] + "\t\t\t" +
      "Quantity: " + item['quantity'].to_s
  end

  print_separator()
end

# Prints create_list
list = create_list()

puts "Great! Add some items to your list."
# Combines add_list_item hash to the 
# "items" array from create_list
# The three method calls also allows user to
# add items 3 times
list['items'].push(add_list_item())
list['items'].push(add_list_item())
list['items'].push(add_list_item())

puts "Here's your list:\n"
print_list(list)
```

Output

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gj0v3hcse7fjax04owga.png)
chiqarish operatorlari
Published: 2023-03-08 16:24:06

Chiqarish operatorlari:

1: #"cout" bu chiqarish va bu "cout" ni biz hohlaganimizcha yoza olamiz misol uchun

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

2: #"cout" dan keyin har doim << qo'yiladi agar qo'yilmasa ko'dimizni kompyuter qabul qilmaydi
Syntaksis
Tags: cpp, programming
Published: 2023-03-08 16:12:40

Syntaksis:

1: #Qanday qilib #include <iostream>va qanday ishlashini tushunmaymiz deb o'ylamaymiz "using namespace std". Buni shunchaki dasturimizda (deyarli) har doim paydo bo'ladigan narsa deb o'ylaymiz.

2"int main() {}" siz bizni kompyuterimiz ko'dni qabul qilmaydi va hatolik chiqarib beradi. Agar ko'dimiz "int main() {}" ni ichida bolsa ko'dni o'qiydi va chiqarib beradi. Agar "int main()" yozib figurniy qovus {} yozilmasa undaham hatolik chiqazib beradi chunki bu siz ham ko'dimiz ishlamaydi.

3: #include <iostream> bunda kutubxonani (#include) chaqirish amalga oshiriladi. "iostream" kutubxona kiritish va chiqarish ob'ektlar bilan ishlash imkoniyatini beradi.

4:using namespace std biz standart kutubxonadan obyektlar va o'zgaruvchilar uchun nomlardan foydalanishimiz mumkin.

5: #Bo'sh qatorga C++ ahamiyat bermasdan o'tib ketadi.

6: #cout (chiqarush deb talafuz qilinadi) cout ni biz.

7: #ko'dimiz tugagandan keyin har doim ; qoyiladi va bu majburiy agar qo'ymasak bu ko'dimizga ham hatolik beradi.
What is "Agens-Graph"?
Tags: apache, postgres, database, apacheage
Published: 2023-03-08 16:11:48

## Introduction:

Agens Graph is a multi-model graph database that is based on the PostgreSQL database management system. It is developed and maintained by [Bitnine Global Inc](https://bitnine.net/).


## Features:

It can store, manage, and query both structured and unstructured data in a single database system because it supports both relational and graph data models. Through the use of a graph data model, users can easily depict links and connections between data points while still storing data in an organized fashion similar to that of a conventional relational database. This facilitates the analysis of links and interconnections among data pieces, which is particularly advantageous in contexts like social networks, fraud detection, and recommendation systems.

Users can do difficult graph analysis jobs with Agens Graph's array of graph-oriented capabilities, which include graph traversals, pattern matching, and shortest path calculations. Moreover, it supports many query languages, such as Cypher and SQL, making it simpler for users to interact with graph data using a syntax they are already comfortable with.

Several capabilities offered by Agens Graph are designed exclusively for using graph data. For instance, it supports a number of graph algorithms that may be used to the data to carry out sophisticated queries and analytics. Calculations for the shortest path, linked component analysis, and PageRank computations are some examples of these methods. The process of travelling from one node to another in a graph along its edges is known as traversal and is supported by Agens Graph.


## Conclusion:

Agens Graph is an effective tool for handling graph data in general. With support for numerous query languages and graph algorithms, it offers a flexible and scalable solution for maintaining intricate graph data structures, making it an adaptable platform for a number of applications.
Basics of PostgreSQL (Part2)
Tags: apacheage, postgres, database
Published: 2023-03-08 16:06:38

In the previous post, we talked about PostgreSQL database and its unique features. In this blog I am going to talk about its advantages and uses. 

**Advantages:**

1.Open source and free to use, which makes it accessible to anyone who wants to use it for personal or commercial use
2.Offers a high degree of reliability, durability, and scalability
3.Supports a wide range of data types, including arrays, user-defined types, and custom types
4.Provides a variety of indexing options to optimize query performance
5.Supports full-text search, spatial data, and JSON/JSONB data types
6.Offers a high level of security, including encryption, authentication, and access control
7.Provides excellent support for concurrent transactions and multi-version concurrency control (MVCC)

**Uses:**

1.Web applications: PostgreSQL is an ideal choice for building web applications that require a robust and scalable database. It is often used with popular web frameworks such as Ruby on Rails and Django.
2.Data warehousing: PostgreSQL is also a good choice for data warehousing, where large amounts of data are stored and queried. It supports advanced data analytics and reporting, making it a popular choice for data analysts.
3.Geographic information systems: PostgreSQL provides excellent support for geographic information systems (GIS), including spatial data types and functions, making it an ideal choice for GIS applications.
4.E-commerce: PostgreSQL is a popular choice for e-commerce sites due to its reliability, scalability, and security features.

Overall, PostgreSQL is a powerful and flexible database system that can be used for a wide range of applications. Its open-source nature and strong community support make it an attractive option for both developers and businesses looking for a reliable and scalable database solution.


To know more about Apache Age, have a look at the Github Repository AGE Github Link: https://github.com/apache/age and https://age.apache.org
Basics of PostgreSQL (Part-1)
Tags: apacheage, postgres, database
Published: 2023-03-08 16:02:52

PostgreSQL is a powerful, open-source, object-relational database system that provides robust support for SQL (Structured Query Language) and allows for the efficient storage and retrieval of large amounts of structured data.
PostgreSQL supports a variety of programming languages, including SQL, Python, Java, and C++, making it a popular choice for many types of applications.
PostgreSQL is known for its adherence to SQL standards and its ability to handle complex queries and large volumes of data.

Some of the **_key features_** of PostgreSQL include:

**1.ACID Compliance**: PostgreSQL ensures data integrity by supporting ACID (Atomicity, Consistency, Isolation, Durability) properties.
**2.Extensibility:** PostgreSQL allows users to define their own data types, operators, and functions, making it easy to adapt to different use cases.
**3.Concurrency:** PostgreSQL provides efficient concurrency control, allowing multiple users to access the database simultaneously.
**4.Replication and Fault Tolerance:** PostgreSQL supports various replication and failover options to ensure high availability and fault tolerance.
**5.Cross-platform Support:** PostgreSQL runs on various operating systems, including Windows, Linux, and macOS.

Overall, PostgreSQL is a highly reliable and scalable database management system that can handle a wide range of applications. Its flexibility, extensibility, and adherence to SQL standards make it a popular choice among developers and enterprises. 

To know more about Apache Age, have a look at the Github Repository AGE Github Link: https://github.com/apache/age and https://age.apache.org