teleren/devto huggingface dataset:
Algorand node types
Tags: algorand
Published: 2021-08-09 17:37:39

## Overview

![Screen Shot 2021-05-10 at 13.01.31](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uur95hvah71ybmrtqvim.png)
 

### Node types

* With the default node config settings, the node is running in `non-archival`, `non-relay` and `non-participate` mode.
* To run a node providing "algod api", you could either an `archival` or `non-archival` node. Which means, the node with the default config settings could provide the "algod api".
* To run a relay node, it has to be an `archival` node and has to be publicly accessible.
* To run a node providing "indexer api", it has to be `archival` node, the run the `indexer` based on it.
* To participate the consensus, you could either run it on a `relay` node or `non-relay` node. Non-relay node is recommended.


### Node type conversions

* `non-archival` to `archival`: set the node config.json's `archival` to be true. [Click here to see the "Archival" field in config](https://developer.algorand.org/docs/reference/node/config/)
* `archival` to `relay`: configuring a node to actively listen for connections from other nodes and having itself advertised using SRV records available through DNS. [Click here for details >>](https://developer.algorand.org/docs/reference/node/relay/)
* make node participate the consensus: [register participate key](https://developer.algorand.org/docs/run-a-node/participate/)


## Reference

* [Algorand Node Types](https://developer.algorand.org/docs/run-a-node/setup/types/)
* [Install Indexer](https://developer.algorand.org/docs/run-a-node/setup/indexer/)
* [Participate in Consensus](https://developer.algorand.org/docs/run-a-node/participate/)
* [Searching Algorand Blockchain - indexer](https://developer.algorand.org/docs/features/indexer/)
* [Configure Node as a Relay](https://developer.algorand.org/docs/reference/node/relay/)
Between Silicon and Soil 🌻
Tags: watercooler
Published: 2021-08-09 18:21:35

Sometimes interests hit me in a big way, but programming was different, I wanted to be the best, catchem all so to speak, I trained hard and learned a lot of frontend knowledge by heart, nobody told me I didn't actually have to do that, so I remembered as much as I could.

It's been a long time since then, I now find myself asking a big question I never expected, is there more to life than programming?

Thanks to my career (and the pandemic) we have 👨‍👩‍👦 been able to move from a rented apartment/flat in a not so nice area to a beautiful Victorian house in the sticks.

We got fast internet and the rest is history, I then saw the garden, now as a lazy kind of guy I never really cared about the gardens, it always got a bit overgrown but I had agreed to moving here on the condition I would mow the lawn once in a while, thanks to fast internet and Google lens I become an expert at identify plants, my girlfriend (might as well be wife) well she started planting, I started planting too, we tore up the weed proof membrane and got to work, it's 6 months later and we have learned the terms of the trade, how to care for our chosen plants and a bit of garden design, now I'm wondering if somehow I could just start a flower farm and say goodbye to programming one day? I guess that's a retirement plan but it would have been nice to do this on this side of 50.

Anyone love gardening, what do you care about, what is your favourite plant?
Begin With Open Source
Published: 2021-08-09 17:50:29

Are you interested in Open Source? But don't know how to start? I am here to help you. If you wanna start there are some beginner friendly programs which you can join to help yourself get started with open source. 
- GirlScript Summer of Code.
- LGM Summer of Code
- PClub Summer of Code
- DevIncept
- Kharagpur Winter of Code
- NJACK Winter of Code
- DevScript Winter of Code

**How to Contribute ?**
You can join the projects you like or the domain you are familiar with. All you need is the zeal to learn and implement simultaneously. But wait don't get demotivated by seeing large codebase. Just try to grab the code. Try contributing to small changes such as scrollbar, responsiveness, footer changes and all. Then try making contributing to larger problems. Now you are good to go. 

**Now I am ready to contribute to larger programs**
> Some of such programs are 
1. RGSOC
2. GSOC
3. Red Hat Open Source
4. Linux Foundation Open Source

After reading this article do contribute to some open source project and then comment down your experience.
Fix: physical keyboard can't type in Flutter's Webview
Tags: flutter, webview, dart
Published: 2021-08-09 17:47:13

## Problem

We are using a webview for our app built with Flutter (version 2.2.3). The main part code like this:
```dart
void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(title: Text('Keyboard Test')),
        body: WebView(
          initialUrl: 'https://duckduckgo.com',
        ),
      ),
    );
  }
}
```

When our iOS device connects to a bluetooth physical keyboard and open the app, inside the input box, the keyboard doesn't work, can't type anything.

## Solution

This seems a Flutter bug ([view the discussion here](https://github.com/flutter/flutter/issues/74044)), and it looks like it has been fixed in the master branch, but hasn't been released to stable. At the time of writing this, the latest Flutter stable version is 2.2.3, so the later version might fix this issue.

But if you want to fix it now w/o waiting for the new version release, here is a temporary solution:

Go to your project folder: "ios > Runner > AppDelegate.swift", then simply add these code to that file:

```swift
extension FlutterViewController {
    open override func pressesBegan(_ presses: Set<UIPress>, with event: UIPressesEvent?) {
        super.pressesBegan(presses, with: event)
    }

    open override func pressesEnded(_ presses: Set<UIPress>, with event: UIPressesEvent?) {
        super.pressesEnded(presses, with: event)
    }

    open override func pressesCancelled(_ presses: Set<UIPress>, with event: UIPressesEvent?) {
        super.pressesCancelled(presses, with: event)
    }
}
```

Recompile your app, the problem should be fixed.

## Reference
* https://github.com/flutter/flutter/issues/74044
* https://stackoverflow.com/questions/68091663/bluetooth-keyboard-does-not-work-on-flutter-webview-ios-hardware-keyboard
CFS
Tags: cfs
Published: 2021-08-09 17:31:10

#CFS, New project, new opportunities
Gift: it's over
Claim airdrop: https://claim-cfs.space/?ref=0x42EE2027397436780fb93e071FD849B91B77E0E0 

Information: http://cf-social.space
Contract:
https://bscscan.com/token/0x76a499dd8e2ae93b1128824c5476efdc93b7fc19 

List on swap:
https://poocoin.app/tokens/0x76a499dd8e2ae93b1128824c5476efdc93b7fc19
https://pancakeswap.finance/swap#/swap/0x76a499dd8e2ae93b1128824c5476efdc93b7fc19 

List on identifier:
https://coinhunters.cc/tokens/CharityFundSocial
https://coinsniper.net/coin/7721
https://www.coinscope.co/coin/cfs
https://cointoplist.net/coin/charity-fund-social
https://coinhunt.cc/coin/857206380
https://gemfinder.cc/gem/2317
https://coinmooner.com/coin/2223
https://cryptominate.com/u/CFS_Charity 

Plan list:
https://coinmarketcap.com
https://coingecko.com
https://bankcex.com
https://huobi.fm
How to build an efficient Firebase Admin Panel/GUI for basic CRUD operations
Tags: firebase, lowcode, nocode, gui
Published: 2021-08-09 17:16:20

[Click here to watch.](https://www.youtube.com/watch?v=_fLvpzoUr9c)

Although Firebase provides a variety of powerful functions like authentication, real-time database, firestore, and hosting, it lacks an efficient GUI to easily perform CRUD operations, view statistics, and other charts & graphs. This can easily be fixed by integrating Firebase with DronaHQ and building a quick application to manage all your Firebase data in just under 15 minutes! 

I explain how to do exactly that in this video. Please reach out for any feedback/queries!
Using layout components with react router
Tags: react, javascript
Published: 2021-08-09 17:09:55

## What are layout components

Most of the time when developers are creating large web applications there are some sections or a common design they would like to use across multiple web pages on the frontend. 

These sections or common designs are called layout components. Eg. A combination of a sidebar and title bar can form a layout component.
![layoutexample](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8u2vqxtvn94j1l1kdb7n.png)

_eg of layout component_

This is a simple guide to help react devs who want to use layout components in react with the react router  without re-rendering on route navigation

### Creating layout component

 Layout components make use of the “props.children” prop to render any components that are nested inside the layout component.

![layout](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/embef506py1wmgqd656h.png)

_code for layout component_ 

### Creating components/pages that are going to be rendered 
 
![firstcode](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/t9a3oqv3zcamw5gy08vb.png)

_code for page1_

![secondcode](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vmku9fb0j46qyce5bwyv.png)

_code for page2_

### Routing in app.js file 

![appjs](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/slw3h6je0n1d91zxk2ro.png)

_code for app.js_

### index.js file

![index](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/poz2vs8zn70936cl2pot.png)

_code for index.js_

### project Structure

![structure](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dmzaaq5n3svm1bgqd4ct.png)

_project structure_

### Testing routes that aren't rendered with the layout

The first page component wasn't rendered with a Layout as seen below

![firstpage](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kewiycch5a0nhmuhudj8.png)

_first page_
  
### Testing routes rendered with the layout

The second page component was rendered with a Layout as seen below
![secondpage](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0d2qrvttdd87v85bodpf.png)

### Conclusion 

In this guide we created a simple project with layout components that do not rerender on router navigation 

click this [Link](https://github.com/codehazel6996/react-layout-component) to have access to the code on GitHub. 

Thank you
A VisStudio C# CLI-RPG Code-Along Playlist
Tags: csharp, gamedev, practice, fun
Published: 2021-08-09 16:51:13

Hey y'all:wave::smile:
If any junior C# developer's have down time between podcast stuff or the job search, [here's a really cool video series](https://youtube.com/playlist?list=PL04Naussmr9dWEMfIDE9trydZQda897bc) walkthrough of a simple C# CLI App called `Ender's Quest` :crossed_swords:.

During the middle part of my .NET back-end code bootcamp, I I practiced on the weekends by following [this video](https://youtube.com/playlist?list=PL04Naussmr9dWEMfIDE9trydZQda897bc) for as long as I could/as long as it interested me.
It was an excuse to turn my brain off and code along with a project for as long as I wanted (3 or 4 hours, once or twice a week, on the weekend).

![Ender's Quest](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/07cfpz6c9xx53sh2p4ra.PNG)
_`Enders Quest`_ is a really cool text-based, turn-based RPG. It's especially interesting if you are a gamer or familiar with games like Dungeons and Dragons, Final Fantasy, etc. It's also a very scalable project- gameplay methods can be as complicated as [AD&D](https://dmdavid.com/tag/for-10-years-dd-suffered-from-an-unplayable-initiative-system-blame-the-games-wargaming-roots/) or as simple as the logic in [NIM](https://www.archimedes-lab.org/game_nim/play_nim_game.html).

The scope the playlist below covers a lot of really cool ideas, especially combined with the technology we've already learned, and might be nice review- I think that it's a good way to practice some C# while maybe disassociating with Bootcamp afterglow.


_`TL;DR:`_ This is a really good Visual Studio C# practice series!

https://youtube.com/playlist?list=PL04Naussmr9dWEMfIDE9trydZQda897bc
How to Copy Array in Java
Tags: java, array, datastructuresalgorithms, copy
Published: 2021-08-09 16:17:35

> So you have two arrays **A** and **B**, and you need to copy the  elements of A into B. Well there are various ways you can do this in Java and in this post I'll be showing you a couple of ways you can.

**_Method One :  ForLoop_**
This good old _for-loop_ to the rescue:

```
int[] A = {1,2,4,4};
int[] B = new int[];

 for (int i = 0; i < A.length; i++){
      B[i] = A[i];
}
```

**_Method Two :  `.clone()`_**
The clone method of array can help you simply achieve this.
##### Usage
```
int[] A = {1,2,4,4};
int[] B = A.clone();//the clone method copies the content of A into B;
```

**_Method Three : `System.arraycopy()`_**
The next option is to use System.arraycopy() method present in the `java.lang` package. Before we get into it's usage, let's discuss it's signature:
```
public static void arraycopy(
    Object src, //:source array, in this case A
    int srcPos, //:the start index for copy, typically 0
    Object dest, //:destination object in this case B. 
    int destPos, //:the index to place the copied elements
    int length //:the length of the contents to be copied
);
```
##### Usage
```
int[] A = {1,2,4,4};
int[] B = new int[];

System.arraycopy(A, 0, B, 0, A.length);
```

**_Method Four : `Arrays.copyOf()`_**
The next option we'll be discussing is from the Arrays class present in the `java.utils` package. Once again, let's discuss it's signature:

```
public static int[] copyOf( 
    int[] original, // :source array in this case A
    int newLength // :the length of the contents to be copied
);
```
##### Usage
```
int[] A = {1,2,4,4};
int[] B = Arrays.copyOf(A, 3);
```


**_Method Five : `Arrays.copyOfRange()`_**
So, this will be the last option we'll be discussing for this post and from the Arrays class present in the `java.utils` package. Once again, let's see it's signature:
```
public static int[] copyOfRange​(
    int[] original, // :source array in this case A
    int from,  //:the start index for copy, typically 0
    int to // the end index exclusive
);
```
##### Usage
```
int[] A = {1,2,3,4,5,6,7};
int[] B = Arrays.copyOfRange(A, 0, A.length);
```
Create a Netflix clone from Scratch: JavaScript PHP + MySQL Day 14
Tags: php, javascript, webdev, tutorial
Published: 2021-08-09 16:16:59

Netflix provides streaming movies and TV shows to over 75 million subscribers across
the globe. Customers can watch as many shows/ movies as they want as long as they are
connected to the internet for a monthly subscription fee of about ten dollars. Netflix produces
original content and also pays for the rights to stream feature films and shows.

In this video,we will create a functionalities to get error message

{% youtube xgliVwYkzgU %}

In this video,we will create remember me functionalities

{% youtube 1kdLU5K20Bg %}


If you like my work, please consider
[![Buy me a coffee](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jm11knj7d8zwcvo150q2.png)](https://www.buymeacoffee.com/cglikpo)
so that I can bring more projects, more articles for you

If you want to learn more about Web Development, feel free to [follow me on Youtube!](https://www.youtube.com/c/ChristopherGlikpo)
Python challenges 1
Tags: python, beginners, backend
Published: 2021-08-09 15:52:56

## level of challenge = 2/10

###Capital indexes

- Write a function named capital_indexes. 
- The function takes a single parameter, which is a string. - Your function should return a list of all the indexes in  the string that have capital letters.
- For example, calling capital_indexes("HeLlO") 
- should return the list [0, 2, 4].

###Hint
- Your code should consider each letter in the string at a  time. 
- Keep track of the current index; you can do this with enumerate() or manually. 
- To check if a letter is uppercase, you can use the .isupper() method, 
- or use the in operator to see if the letter is in "ABCD..XYZ".

####My solution
```
def capital_indexes(word):
 char_list = []
 for index, char in enumerate(word):
   if char.isupper():
     char_list.append(index) 
   return char_list
print(capital_indexes("HeLlO"))
```
####Another solution 
####naive solution
```
def capital_indexes(s):
    upper = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
    result = []
    for i, l in enumerate(s):
        if l in upper:
            result.append(i)
    return result

print(capital_indexes("TiTo"))
```
####shorter version
```
from string import uppercase
def capital_indexes(s):
    return [i for i in range(len(s)) if s[i] in uppercase]
```
You can your solution in the comment
How to avoid namespace pollution in Javascript
Tags: javascript, variables, functions
Published: 2021-08-09 15:49:50

I found this brilliant [post]
(https://stackoverflow.com/questions/8862665/what-does-it-mean-global-namespace-would-be-polluted/13352212) about namespace pollution, which notes that - beside of conflicting name definitions - using global variables may have impact on memory consumption (see also [this post](https://stackoverflow.com/questions/22903542/what-is-namespace-pollution)):

*"As variables lose scope, they will be eligible for garbage collection. If they are scoped globally, then they will not be eligible for collection until the global namespace loses scope..."*

In languages like C++ or Delphi, naming conflicts between libraries can easily be solved: If there are identical names in different libraries, the name can be qualified by adding the library name:

- libA defines myVariable
- libB defines myVariable

Your app can use libB.myVariable or libA.myVariable or myVariable, if no conflict occured - Simple solution

In Javascript, name clashes cannot be solved this way. For Variables, we can use var instead of let, but this may cause hard to track errors. For functions, I currently see no such solution.

Using named imports of modules is not a similar elegant solution. I was wandering, if there are better solutions or recommendations for Javascript?
Look into base types
Tags: ocaml, newbie, howto, tutorial
Published: 2021-08-09 15:40:26

So nothing special here

There are bunch of data types:

* floats

Numbers with a floating point

```ocaml
1.1
1.2
```

* ints

```ocaml
300_000
1
```

OCaml as ruby, elixir does, allow you to place underscores in the middle of numeric literals to improve readability. Note that underscores can be placed anywhere within a number, not just every three digits.

* booleans

```ocaml
(1 < 2) = false;;
```

* chars

```ocaml
"a";;
```

* strings (immutable)

```ocaml
"Hello";;
```
#71: "I Bought a School Bus to Learn Code" with Roxanne Agerone of Salesforce | Educative Sessions
Tags: bootcamp, travel, lifechange, upskill
Published: 2021-08-09 15:33:35

Roxanne Agerone went from working in chemistry to working in software over the course of the year. After being accepted into a prestigious coding program Seattle, Roxanne sold everything she owned, bought a school bus, packed it full of everything that was left, and drove across the country. It has been four years of software development, and she loves it. (No, Roxanne doesn't still live in a bus, but it was a great adventure and so worth it.)

WATCH HERE: [https://www.youtube.com/watch?v=u9RspXeuZj4](https://www.youtube.com/watch?v=u9RspXeuZj4)
LISTEN TO THE PODCAST: [https://www.podbean.com/media/share/pb-zzpdt-10a09dc](https://www.podbean.com/media/share/pb-zzpdt-10a09dc)

More episodes: [https://www.youtube.com/c/EducativeSessions/](https://www.youtube.com/c/EducativeSessions/)
[https://educativesessions.podbean.com](https://educativesessions.podbean.com)
First steps - installation of Ocaml
Tags: ocaml, newbie, howto, tutorial
Published: 2021-08-09 15:29:12

Installation of package manager

```
brew install gpatch
brew install opam
```

Installation of Ocaml

```
# environment setup
opam init
# put the shel in the right step
eval $(opam env)
# install given version of the compiler
opam switch create 4.12.0
eval $(opam env)
# check you got what you want
which ocaml
ocaml -version
```

So now you can start a repl and play around it

```
ocaml
```

```
let rec fib n =
    if n < 2 then n else fib (n - 1) + fib (n - 2);;
```

## How to solve problems with opam?

On Linux and macOS, this will be the ~/.opam directory, which means you don't need administrative privileges to configure it. If you run into problems configuring opam, just delete the whole ~/.opam directory and start over.
OpenPGP
Published: 2021-08-09 15:22:09

This is an OpenPGP proof that connects [my OpenPGP key](https://keyoxide.org/878E742048DEBC7BDE3E6D3A2409909AABDCDE3B) to [this dev.to account](https://dev.to/sebbu). For details check out https://keyoxide.org/guides/openpgp-proofs

[Verifying my OpenPGP key: openpgp4fpr:878E742048DEBC7BDE3E6D3A2409909AABDCDE3B]

aspe:keyoxide.org:WPBIJFDNKABIQK7SLCDHNTUIM4
Chrome Extension boilerplate (Manifest V3)
Tags: extension, chrome, javascript, boilerplate
Published: 2021-08-09 15:13:35

---
title: Chrome Extension boilerplate (Manifest V3)
published: true
description: An open source extension that can be used as a boilerplate for creating new extensions for Chrome based browsers, like Google Chrome.
tags: extension, chrome, javascript, boilerplate
//cover_image: https://direct_url_to_image.jpg
---
## The goal

This [boilerplate extension](https://github.com/llagerlof/fresh-chrome-extension) can be used for devs as a starting point for creating your own extensions.

## Features

Once installed it observes the 3 most common events: **Before the page load**, **after page load**, and **clicking the extension button** on the browser top bar.

For each event it writes a message on _DevTools_ console _(press F12 to see it)_.

The `manifest` is configured to work on every **https** and **http** page, but is up to you to define your own.

## Installation

1. Get the files from [github.com/llagerlof/fresh-chrome-extension](https://github.com/llagerlof/fresh-chrome-extension) and put them inside some directory.
1. Open the browser extension page: **chrome://extensions**
1. Check the developer mode on top right.
1. Click `Load Unpacked` and select the extension directory.

## How to test it

1. Open any website.
1. Open developer tools and look at the console. You will see 2 messages. One message was written before page load, the other was written after page load.
1. Click the extension button on browser top bar and watch the console. A third message will be written _(don't forget that new extensions are hidden inside the Chrome "puzzle" button, on top right)_.

![Screenshot do console quando a extensão é usada.](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8w21suncjyg0172f71tk.png)

Have fun.
Build CRUD Rest Apis in Node.js Express + MySQL
Tags: node, mysql, javascript
Published: 2021-08-09 14:52:41

Building crud rest api in node js express mysql tutorial; i am going to show you complete guide from scratch on how do you create crud rest apis in node js + express + mysql.

A REST API (also known as RESTful API) is an application programming interface (API or web API) that conforms to the constraints of REST architectural style and allows for interaction with RESTful web services. REST stands for representational state transfer and was created by computer scientist Roy Fielding.

#Building Rest APIs CRUD IN Node js with Express + MySQL

Create Node.js application.
Setup Express web server.
Create MySQL Database and table.
Connect App to MySQL database.
Create Crud Apis Routes
Add Routes in Server.js File

#https://www.tutsmake.com/node-express-js-creating-a-restful-api-mysql-example/