teleren/devto huggingface dataset:
Centralization vs Decentralization
Tags: web3, javascript, webdev, beginners
Published: 2022-03-24 16:19:28


You have heard about **decentralization** a lot in Web 3.0 topic. Let's understand centralization and decentralization in deep 👇

### <mark>Decentralization is a core tenet of Web 3.0</mark>

## Centralization

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

Centralization is a form of organizational structure where the decision making capability rests with the top management

### Useful:

- Higher performance and easier to implement
- Single point of failure: malicious actors may be able to take down the network by targeting the central authority.
- Participation in the network is controlled by the central authority.

## Decentralization

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

Decentralization is another form of organizational structure that functions by delegating decision-making capabilities to multiple teams across geographies.

### Useful:

- Lower performance and more complex to implement
- No single point of failure: network can still function even if a large proportion of participants are attacked/taken out.
- Anyone can participate in the network; there are no “gatekeepers.” Ideally, the cost of participation is very low.

<a href="https://www.buymeacoffee.com/suprabhasupi" target="_blank"><img src="https://i.imgur.com/4t25pJE.png" alt="Buy Me A Coffee" /></a>

<table>
  <tbody>
    <tr>
      <td>
        🌟 <a href="https://twitter.com/suprabhasupi"> Twitter</a>
      </td>
      <td>
        📚 <a href="https://gum.co/css-pseudo-class-elements"> Ebooks</a>
      </td>
<td>
        🌟 <a href="https://www.instagram.com/suprabhasupi/"> Instagram</a>
      </td>
    </tr>
  </tbody>
</table>
¿Cómo aumentar la tasa de conversión de una tienda online?
Tags: posicionamiento, tiendasonline
Published: 2022-03-24 16:11:27

¿Tienes una tienda online? Pues seguro que uno de los datos que más te preocupa es la tasa de conversión. En digitalDot te vamos a contar algunos trucos que puedes utilizar para mejorarla y conseguir que tu ecommerce sea rentable. ¡Atento!
¿Qué es la tasa de conversión?

La tasa de conversión es el porcentaje de visitantes que llegan a tu tienda y que se convierten en compradores. Si bien es cierto que en un negocio online es más difícil cerrar la venta que en uno físico, hay ciertos aspectos que puedes optimizar en tu web para aumentar dicha tasa.

Según los últimos datos, la tasa de conversión media de las tiendas online españolas es del 1,11%. Es decir, necesitas una media de 100 visitas para cerrar una sola venta. ¡Pero que estos números no te desanimen! Con esfuerzo y saber hacer puedes destacar sobre el resto.
Cuando se trata de una tienda física se tiene muy claro que se debe crear un espacio «agradable» para el cliente potencial; se presta atención a la decoración, iluminación e incluso se utilizan perfumes para crear un entorno perfecto en donde el cliente se sienta cómodo y termine comprando.

Pues bien, en una tienda online también necesitas hacer lo mismo, es decir, persuadir, enamorar a tu visitante a través, entre otras cosas, del **[diseño web](https://www.digitaldot.es/diseno-web/)**. La experiencia de usuario es uno de los factores clave para mejorar la tasa de conversión.

Si cuentas con un buen diseñador web éste elaborará una interfaz atractiva y práctica (UI, User Interface) que mejorará la experiencia de usuario (UX, User Experience).
Seguir leyendo en: **[¿Cómo aumentar la tasa de conversión de una tienda online?](https://www.digitaldot.es/como-aumentar-tasa-de-conversion-tienda-online/)**

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cvgnt0o8fy63ktl3989q.jpg)
Why we need LISP machines
Tags: programming, lisp, unix
Published: 2022-03-24 16:09:28

UNIX is a mess and it's getting worse, maybe it's time for something that was a little ahead of its time. [Why we need lisp machines, on substack](https://fultonsramblings.substack.com/p/why-we-need-lisp-machines?r=1dlesj&s=w&utm_campaign=post&utm_medium=web)
Documenting
Published: 2022-03-24 16:05:22

A mentor recently advised that o document my journey, for the benefit of future employers, partners, investors, and even myself. I'm mostly a shy person, who doesn't like putting her business out there. I love to write, but I make sure my write-ups never make it out of my local storage.
This is a new dimension for me, one that I'm not yet comfortable with, but I will start here, and build up with each post.
I created rattle 🐍 🐍 🐍
Tags: webdev, showdev, productivity, cybersecurity
Published: 2022-03-24 16:03:17

Rattle is a open-source project which provides you with more security and prevent from cyber attacks the main update is a new password checker which checks your password is breakable with a cyber attack you need to do is download the zip file of rattle password_checker from official website rattleofficial.github.io
Download it and extract it and click on password_checker.exe and write your password your password isn't stolen.

Official website-https://rattleofficial.github.io
How to create a list of random articles in Hubspot
Tags: hubspot, tutorial, html, webdev
Published: 2022-03-24 15:53:10

If you are developing a new Blog using Hubspot CMS, you will probably need to create a blog listing page. While the "default" behaviour of these listing pages is to display the latest articles in order, you can actually play around and create different listing "logic". 

In this article I would like to show you how to create a listing of random articles in Hubspot. This could be useful if you want to have some kind of blog collection somewhere in your page to display different articles for each page visit. 

First of all, we need to get our blog posts. To achieve this, we could use the following two functions:

- [blog_recent_posts()](https://developers.hubspot.com/docs/cms/hubl/functions#blog-recent-posts)
- [blog_popular_posts()](https://developers.hubspot.com/docs/cms/hubl/functions#blog-popular-posts)

To be honest, since we will be showing random posts, it doesn't really matter which function we use. Just keep in mind the difference between them in case you want to add some extra logic to this "randomness". Also, remember these functions will return maximum 200 articles.

Let's go ahead and set a variable **_articles_** that will include 30 blog posts.

```
{% set articles = blog_recent_posts("default", 30) %}
```

Now it's time to loop through our articles.
**But here's the catch!** Instead of looping through our article's array as it is, we will use the [**_shuffle_** filter](https://developers.hubspot.com/docs/cms/hubl/filters#shuffle) to randomize the order of iteration through the sequence.

```
{% set articles = blog_recent_posts("default", 30) %}

{% for article in articles|shuffle %}
    <a href="{{ article.absolute_url }}">{{ article.name }}</a>
{% endfor %}
```

The previous code will display all our 30 articles in random order, but what if we want to display only 5 articles for example?

In this case, we will use the variable **_loop.index_** to make sure we only display content during the 5 first loop iterations.

```
{% set articles = blog_recent_posts("default", 30) %}

{% for article in articles|shuffle %}
    {% if loop.index <= 5 %}
        <a href="{{ article.absolute_url }}">{{ article.name }}</a>
    {% endif %}
{% endfor %}
```

And that's it! Easy, right?

Here are some **takeaways** you should keep in mind:

- Always get more articles in your _articles_ variable than the number of articles you want to display. Otherwise you would always show the same content.
- If you want to use this random functionality in your main listing page, you can use the variable **_contents_** instead of getting articles using the two functions mentioned before.
- Remember to read [Hubspot's documentation](https://developers.hubspot.com/docs/cms/key-concepts) when using a function or filter as some of them have limitations.
- The filter **|shuffle** will affect your [prerendering](https://developers.hubspot.com/docs/cms/developer-reference/cdn/prerendering#hubl-filters). To avoid it, it's recommended to use Javascript.
React native App firebase email authentication signup
Tags: reactnative, firebase, androidapp, reactnativesignup
Published: 2022-03-24 15:44:52

`
function Login({ navigation }) {

    const [email, setEmail] = useState('');
    const [password, setPassword] = useState('');
    const [emailPlaceholder, setEmailPlaceholder]=useState('Email id');
    const [passworPlaceholder, setPasswordPlaceholder]=useState('Password');

    const signup = () => {
        if(email !='' && password !=''){
            auth().createUserWithEmailAndPassword(email, password).then((res)=>{
                navigation.navigate('Home')
                console.log('response', res)
            })
            .catch((error)=>{
                console.log('Error:', error);
                Alert.alert(error.message);
            })
        }else if(email == ''){
            // Alert.alert('email cannot be empty')
            setEmailPlaceholder('email cannot be empty')
        }else if(password == ''){
            setPasswordPlaceholder('password cannot be empty')
        }
    }

    const login = () => {
        auth().signInWithEmailAndPassword(email,password).then((res)=>{
            navigation.navigate('Home')
            console.log('response', res)
        }).catch((error)=>{
            console.log('error',error)
        })
    }

    return (
        <View style={styles.container}>
            <TextInput style={styles.userInput} placeholder={emailPlaceholder}
                placeholderTextColor={'#3e4f6b'} value={email}
                onChangeText={setEmail} keyboardType='email-address' />

            <TextInput style={styles.userInput} placeholder={passworPlaceholder}
                placeholderTextColor={'#3e4f6b'} value={password}
                onChangeText={setPassword} secureTextEntry={true} />

            <View style={styles.buttonView}>
                <TouchableHighlight style={styles.button}
                    onPress={signup} >
                    <Text style={styles.buttonText}>Sign up</Text>
                </TouchableHighlight>
                <TouchableHighlight style={styles.button}
                    onPress={login}>
                    <Text style={styles.buttonText}>Login</Text>
                </TouchableHighlight>
            </View>

        </View>
    )
}
`
TexCreate Beta 2 Released!
Tags: rust, programming
Published: 2022-03-24 15:29:06

TexCreate v2.0.0-beta.2 is released with the following changes: 

- Removed support for Multi-Configs 
  - Complicated support for other commands 
  - Allows for easier development 
- Added `edit` command 
- Added `zip` command to zip projects instead of building 


New Library Versions 
- `tex-rs`: `0.2.3` 
- `texc-config`: `0.1.1`
- `texc-latex`: `0.1.1`
- `texc-utils`: `0.1.1`
- `texc-web`: `0.1.0`


## Beta 3? 
Beta 3 will most likely be the last beta before the stable release, this involves the following: 

- Releasing `texcreate.mkproj.com` 
- Added doc command 
- Writing all documentation for every library
- Adding `web` command
I customized my NeoVim with autocompletion an here is how I did it🤩😎 ️😉
Published: 2022-03-24 13:24:46

Ladies and Gentlemen, Here is how I customized my NeoVim text editor. But before we start some people don't know what NeoVim is. 

NeoVim is a terminal text editor which is used to write codes in terminal.

It has some problems. It is not that user-friendly and doesn't have any autocompletion. After a long time, I've finally customized it. Here is how! -

Ingredients -

1. NeoVim
2. A PC with OS installed
3. A stable internet Connection
4. Node JS
5. Yarn
6. Vim-Plug
7. Curl
8. Git

First you want to go to `.config/`directory and You will see many folders. In that directory, Find `NVIM` directory in it. If you did not find the folder in `.config/` directory then create  a folder with the name `nvim` in small letters. Then In that directory create a file called `init.vim`. 

Then go to [](https://https://github.com/junegunn/vim-plug) and Install Vim-Plug as shown in the Post.

Open the `init.vim` in NeoVim and type the code below in the `init.vim` file. For inserting the file in NeoVim, open terminal and type `nvim init.vim` in the `.config` directory. 
For those who are new to NeoVim watch the video given below.

LINK - [Get Nvim tutorial on how to use](https://www.youtube.com/watch?v=ggSyF1SVFr4)

> You cannot use any other editor!

[Source code to my Nvim config file ](https://github.com/Gauthamsudo/My-Nvim-Config)

Now save the file and quit. Reopen the file and type `PlugInstall`. It will automatically starts to download the plugins. After that again save and quit.

Type Nvim and enjoy!
Python Tricks 🐍
Tags: python, beginners, tutorial, programming
Published: 2022-03-24 15:14:56

What’s a Python Trick?

Python Trick: A short Python code snippet meant as a
teaching tool.

A Python Trick either teaches an aspect of
Python with a simple illustration, or it serves as a motivating
example, enabling you to dig deeper and develop
an intuitive understanding.
 
Download book: https://bit.ly/3qzxet4

All the best.

### Connect with Me 😊
- [LinkedIn](https://www.linkedin.com/in/mahmoud-el-kariouny-822719149/)
- [Twitter](https://twitter.com/Mahmoud42275)
Send notifications from Laravel to Mobile in FMC
Published: 2022-03-24 15:13:57

First create a new laravel project and add this var to .env file in your project 
`FCM_SERVER_KEY=FIRE_BASE_SERVER_KEY`

create a new controller `NotificationController`



```
  public function send_message(Request $request)
   {
     // Call Your FCM Service Class
   }
```

now create a new service in laravel at `app/Services/FCMService.php`

create a new function  :

```
 <?php
 namespace App\Services;

 use App\Models\User;

 class FCMService
 {

    // send notification to user using firebase cloud messaging
    public static function send_notification($user, $title, $body)
    {
        $user = User::where('id', $user)->first();
        $url = "https://fcm.googleapis.com/fcm/send";
        $server_key = env('FCM_SERVER_KEY');
        $headers = [
            'Authorization' => 'key=' . $server_key,
            'Content-Type' => 'application/json',
        ];
        if (!$user) {
            return response()->json([
                'status' => 'error',
                'message' => 'User not found',
            ], 404);
        }

        // send via GuzzleHttp
        $client = new \GuzzleHttp\Client();
        $response = $client->post($url, [
            'headers' => $headers,
            'json' => [
                'to' => $user->device_token, // user's device token for fcm
                'data' => [
                    'title' => $title,
                    'body' => $body,
                ],
            ],
        ]);

        return $response->getBody();

    }

}
```

add new column to users table called `device_token` store any new device token when user create a new account from mobile and use it to send notifications to user device from users table.

**Now we can send request to the FCMService**


```
public function send_message(Request $request)
{
  // Call Your FCM Service Class
  \App\Services\FCMService::send_notification($request->user_id, $request->title, $request->body);

return redirect()->back();
}
```
Random Ideas for Front-end Projects In HTML, CSS and JS by shriekdj
Tags: shriekdj, html, css, javascript
Published: 2022-03-24 15:13:49

These Are My Random Suggestions which I am also planning to do, maybe some this project ideas help you or not for Creating under frontend Using HTML, CSS and JS ( JavaScript)
> Note : All Ideas Are random ideas of me (shriekdj) and I did not make them as what is best or not choose whatever you like and also add links of them in comments
>> Bookmark and Share this Post Link to Help This Post Get Next Part

> I am On GitHub [shriekdj](https://github.com/shriekdj) and on Twitter [shriekdj](https://twitter.com/shriekdj)

1. Product Landing Page
2. Color Flipper
3. Infinite Scroller (Similar to Facebook without any end or youtube mobile)
4. Personal Portfolio Web Page
5. Documentation of Some Technical Product or Software
6. Admin Dashboard Design
7. Music Player Site (Like Spotify)
8. Video Player Site
9. GitHub's Mermaid Project Integration
10. Blog
11. How to survive in Aliens Attack Webpage
12. Beautiful Contact Form
13. Comic Book Advertisement On Website
14. School Website
15. File Manager Like Website
16. Random Name Generator
17. Coin Flipper
18. Dog Flipper
19. Custom Twitter Embed
20. Contact Us Form
21. About Us Form
22. Medical Advertisement
23. Hospital or Clinic Website or Webpage
24. Tuition Classes Advertisement
25. Product Pros and Cons Type Site
26. Wikipedia Similar Site ( but with more CSS )
27. What is Current Time and Date In Country ( You Are Allowed to use any API )
28. An Page for Paying Someone Like PayPal have paypal.me link
29. JavaScript Calculator
30. Privacy Policy Page
31. Cockie Consent Policy
32. Terms and Conditions
33. API Documentation
34. What Is Site Status or An Server Status
35. What is My IP Address
36. Shop Site or E-commerce Site
37. Page With Topic "My Annoying Neighbor and His Family"
38. Page With Topic "My Life as A Fan Of Marvel or DC"
39. Page With Topic "Monk With Dragon Tattoo"
40. Animated Time-lapse site of some plant, place or person
41. Check are you Colorblind Type Sites
42. Page With Topic "Haunted House from an Ant's Point of View"
43. Tinder Like Page Swipe ( Use of API Allowed )
44. TikTok Like Homepage
45. Instagram Like Homepage
46. How Will Instagram and Facebook Look if Merged In One Site Like Instabook
47. Sudoku Solver
48. Weather Temperature Now
49. Email Dashboard
50. Site Like Sticky Notes With Unique URL ( Concept is Site With Twitter Like Embed With Text Limit and We can Make that link public or not published )

If Someone Wants to Did i Completed any project Above You Can check at my GitHub Profile
https://github.com/shriekdj

Next Part Added Below Via Editing the Post or In Pinned Comment

Bye 👋.
[ Database ] - Session Object of SQLAlchemy
Tags: sql, database, sqlalchemy, python
Published: 2022-03-24 14:59:30

# Session Object of SQLALchmey
SQLAlchemy에 Query Object를 다루는 Session Object가 있다.

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

쉽게 보자면 다음과 같다.

Session 객체에는 쉽게는 add와 commit, 사실 flush라는 함수도 존재한다.

그림을 보면 알겠지만, add를 한다고 해서 DB에 실제로 영향이 가진 않는다.

정확히는 commit이 일어나야 실제로 DB에 변화가 일어나고,
기본적으로 옵션을 주지 않으면, commit만 해도 flush는 commit과 함께 일어난다.

**Editing now**
Paracetamol.js💊| #85: Explica este código JavaScript
Tags: javascript, spanish, webdev, beginners
Published: 2022-03-24 14:51:08

## **Explica este código JavaScript**

```js
const test = {
  if:"Es un condicional",
  let: "Es una manera de declarar variables",
  for: "Es un bucle",
};
console.log(test.for); //??
```

A. `SyntaxError: unexpected token: keyword 'for'`
B. Es un bucle
C. `ReferenceError`
D. Ninguna de las anteriores

Respuesta en el primer comentario.

---
#66 Days of Data
Tags: python, datascience, 100daysofcode, ankitgupta
Published: 2022-03-24 14:42:35

## **Learning Python**  👨‍💻

D 40 of #66daysofdata 📈

Today I have learnt OOPs Concept in Python - Inheritance & its types

Checkout 👉 [My #66 Days of Data timeline on Github](https://github.com/mrankitgupta/66DaysOfData)

Say me Hi! 
I'll be glad to connect on 
👇

**Twitter** @ [Mr_AnkitGupta01](https://twitter.com/Mr_AnkitGupta01)

**Github** @ [MrAnkitGupta](https://github.com/mrankitgupta)
How to create a new blockchain from source code Waves or Cardano?
Published: 2022-03-24 14:23:43

Hello. I need to create a separate blockchain with your name, logo and the ability (at least through the API) to create tokens in this blockchain.
I looked at the sources of the Waves and Cardano projects, but to be honest, I didn’t understand in which file to change the name, logo, port, etc., just to change the brand.

To be honest, I'm not just a beginner, I'm in the :smiling_face: infant stage when it comes to installing ports or dependencies, and although I understand the logic of the code, I don't know the programming language many blockchains are written in. Therefore, I beg you to give at least an understandable source of documentation on creating a blockchain, from an existing source.

I understand that everyone is very busy, and no one has the right to ask someone just to help in this matter. Especially when many make a living providing such services. But I don't just start from zero, but from the negative range. To start the path of positive infinity, I need a blockchain with our brand. In which you can create tokens, online or through the API.

I ask you to at least help me find the project and the file in which you need to change the parameters. It's not about many of those files that the program needs to change, I can)

Sorry for writing so much and thanks in advance for any help.


#waves, #cardano #blockchain, #eth, #ethereum, #javascript, #purescript ,#haskell, #rust #go, #Scala, #api, #github.
Getting Started with Mocha | JavaScript Test Automation Tutorial | Part IV
Published: 2022-03-24 14:23:00

This video explains how to write and run your first test cases in mocha. [Start FREE Testing](https://accounts.lambdatest.com/register?utm_source=devto&utm_medium=organic&utm_campaign=mar_24&utm_term=sb&utm_content=tutorial_video)

It is Part IV of the JavaScript Test Automation LambdaTest Tutorial series. In this video, Ryan Howard (@ryantestsstuff), an engineer, explains how we can use mocha JS, and run tests in mocha. You will also gain insights into how mocha testing works?  

This video answers 🚩 
 
◼ How do you write test cases in mocha?
◼ How do I run a specific test in mocha?
◼ How do you test a mocha function?
◼ How do you write unit test cases with mocha?
◼ How do you assert in mocha?
◼ Do mocha tests run in order?
React - How to give a focus to a list item?
Tags: webdev
Published: 2022-03-24 14:16:50

This topic is related to Menu on the website.

For example,
If you visit a website and click a menu item then you will move to other path showing different page.
But the menu item has a background color (focus).

I am going to show you how to implement that feature.

```js
import {useLocation} from 'react-router-dom'
```
We do this with react-router-dom library. It has a hook called `useLocation`.

```js
const location = useLocation();

const styles = {
  active: {
    background: '#f4f4f4'
  }
}

return (
  <List>
    {menuItems.map(item => (
      <ListItem sx={location.pathname === item.path ? styles.active : null}>
        <ListItemIcon>{item.icon}</ListItemIcon>
        <ListItemText primary={item.text}/>
      </ListItem>
    ))}
  </List>
)
```
important part
```js
<ListItem sx={location.pathname === item.path ? styles.active : null}>
```
Reading key and value from a map field in protobuf message using c++ API call
Tags: cpp, protobuf, proto3
Published: 2022-03-24 14:15:17

I have a proto3 file. There is a message in the proto file that contains a map field.

proto3
package abc.xyz.testproto
message abc
{
    map <string, int32> mapfield = 1;
}
Suppose as a c++ consumer i want to read this map field, what would be the api call necessary for me to read these key and value from this map field into a string and int field in c++ ?

I tried to look for it here : https://developers.google.com/protocol-buffers/docs/reference/cpp-generated#map-fields but could not find how the code on how to consume the map fields. Can someone help me with it ?
Install Podman on Fedora Linux
Tags: docker, podman, fedora
Published: 2022-03-24 14:10:33

[Podman](https://podman.io/) is a daemonless container engine for developing, managing, and running OCI Containers on your Linux System.

Podman is installed by default in Fedora Linux and Fedora Silverblue. If not, use this command:

`sudo dnf install podman`

First example:

`podman pull hello-world 
podman run hello-world`