teleren/devto huggingface dataset:
We are Core!
Tags: webdev, hiring, programming, opensource
Published: 2022-07-06 19:16:50

**Hello!**
We are the **Core** project:
We build applications, frameworks and other stuff!
Lot of different projects ( 30+ ) and currently 4 people.
We want to get around 40 people, and build the next generation apps and frameworks.

**Freedom**
Our project will get open source soon, and we work on the open source platform Gitlab!

Freedom is not just about software freedom, also about developer freedom, that's why **you** as **developer** and **tester** can do what you want ( 99 % Rule, you can do what ever you want in 99 percent cases, like you can program and implement what you want, no restrictions )


**Our mission**
Our mission is **Freedom** as in code and developers
Our mission is to push **Open source**
Our mission is to create an **Open platform** for everything

**Core project examples**
We work on Corefx, a fork of Javafx, that tries to improve it a lot

We work on Core license, our own license

We work on CorePad, a text editor in Swing

We work on CoreCalculator, a calculator written in Tornadofx

We work on CoreWeb, a Chromium fork web browser

We work on CoreClient, a Minecraft client

And a on a lot more projects!

**How to join?**
Join the Discord server: [https://discord.gg/jdkzEtmwDV] (https://discord.gg/jdkzEtmwDV)
Contact me on Discord: BenHerbst#1522
Or via E-Mail: ben.herbst@web.de
Or via Github issue: [https://github.com/BenHerbst](https://github.com/BenHerbst)
How to generate the tree path of your directory
Tags: tooling, programming
Published: 2022-07-06 19:15:55

The Tree is a cool tool to exemplify project directories, whether for tutorials, doubts, explanations for your team, etc.

Precisely because it's a cool feature, I'll be showing you how to easily install it on macOS and generate the directory of a GraphQL API as an example.

## How to Install macOS
make sure you have brew installed on your pc and run the command below:

```bash
daniloab$ brew install tree
```

Once installed test the command with **which tree**. The result should be like:
```bash
daniloab:graphql-real-world-server daniloassis$ which tree
/opt/homebrew/bin/tree
```

Once having Tree installed successfully, type in your terminal `tree` to get you directory path:

```bash
daniloab:graphql-real-world-server daniloassis$ tree
.
├── README.md
├── babel.config.js
├── package.json
├── schema.graphql
├── src
│   ├── app.ts
│   ├── config.ts
│   ├── index.ts
│   ├── modules
│   │   ├── LikeNewSubscription.ts
│   │   ├── LikeType.ts
│   │   ├── TalkType.ts
│   │   └── UserType.ts
│   ├── pubSub.ts
│   └── schema
│       ├── MutationType.ts
│       ├── QueryType.ts
│       ├── SubscriptionType.ts
│       └── schema.ts
├── tsconfig.json
├── webpack
│   └── ReloadServerPlugin.js
├── webpack.js
└── yarn.lock

4 directories, 20 files
```

> For other ways of installing in macOS take a look at this link 
> 
> https://superuser.com/questions/359723/mac-os-x-equivalent-of-the-ubuntu-tree-command

## How to Install Ubuntu
through apt-get you can do the installation easily. In your terminal run:

```bash
$ sudo apt-get install tree
```

Installing Tree successfully star to use it to list your directories.


## Automate
By being simple and fast, the tree starts to help you daily in tasks that previously could take more operational time from your routine.

Always seek to automate all those manual tasks that take up your time and don't leave you free to direct your focus to what is most important.

The repo used as example is a result from a talk of mine about GraphQL. Feel free to enjoy slides clicking here [GraphQL Real World](https://daniloab.github.io/graphql-real-world/#0)

Links:
Slides https://github.com/daniloab/graphql-real-world-server
Repo with a real GraphQL Server https://github.com/daniloab/graphql-real-world-server
References
- https://linuxhint.com/tree-command-in-ubuntu/
- https://superuser.com/questions/359723/mac-os-x-equivalent-of-the-ubuntu-tree-command

Photo by <a href="https://unsplash.com/@theforestbirds?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Joel & Jasmin Førestbird</a> on <a href="https://unsplash.com/s/photos/tree?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Unsplash</a>
Back to Basics With Rust: Part 1
Tags: rust, learning
Published: 2022-07-06 18:55:57

---
title: Back to Basics With Rust: Part 1
published: true
description: 
tags: Rust, learning
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wx97cwqur8z48mqxmt0z.jpg
 
---

The first few lines of code are usually declaration. `let num = 0`. Most of the time you don't put too much thought on which integer type to choose or indicate, it's like you are on autopilot. When declaring a variable `let num = 0;`, you expect the compiler to add the type, and also indicate that the variable is immutable. Lets switch off auto pilot and understand what `let num: i32 = 1;` mean.

By default as stated in the book, variables are immutable. 
 - Immutable means can not be changed (`Read-Only`). 
 - Mutable, can change (`Read` and `Write`).

Coming from other languages if a variable can't change, you might think of a constant (const). The difference between constant and immutable variable:

```rust
    const SEVEN: i32 = 7; // constant
    let seven = 7; // immutable variable
    let mut six = 6; // mutable variable
```
####Constant
1. const needs to have an SNAKE_CASE uppercase name, else you get a warning ```constant `seven` should have an upper case name```.
2. const needs you to specify the type(see error below).
3. const will never be mutable, meaning you can't add the `mut` keyword.

```Rust
error: missing type for `const` item
 --> src/main.rs:1:7
  |
1 | const SEVEN = 7;
  |       ^^^^^ help: provide a type for the constant: `SEVEN: i32`

```

####Immutable
1. You are not forced to specify the type, if you omit the type the compiler will assist.
2. immutable can be converted to mutable by adding the `mut` keyword.
3. Looking at the rust [naming conversion](https://rust-lang.github.io/api-guidelines/naming.html), the variable is always snake_case lowercase.

A constant needs you to always specify a type, be it integers or tuples even arrays.  Looking at integers, there are multiple types, such as `i8`, `u32`, etc. 

Before choosing an integer, you need to understand that Rust has signed `i` and unsigned `u` types.
- Signed `i` types accept both positive(+) and negative(-) values, depending on the bits you selected. 
- Unsigned `u` only accepts positive(+) values.

Next to `i` or `u` are the bits, so `8-bits`, `32-bits`, and etc. The bits indicate the storage capacity e.g `u8` stores values from 0 to 255, above that results to the error below.

```rust
error: literal out of range for `u8`
 --> src/main.rs:3:17
  |
3 |     let x: u8 = 256;
  |                 ^^^
  |
  = note: `#[deny(overflowing_literals)]` on by default
  = note: the literal `256` does not fit into the type `u8` whose range is `0..=255`
```
There's also `usize` and `isize`, which is dependent on the size of your machine architecture. So if running a `32-bit` machine, `usize` can be u32 (32-bits). There are other types such as floats(`f32` and `f64`), boolean(`bool`), arrays(`[1, 2, 3]`), and more.
Best Netlify forms alternative on Vercel! 🔥
Tags: nextjs, react, jamstack, vercel
Published: 2022-07-06 17:28:47

After migrating from Netlify to Vercel, I do miss Netlify Forms... A lot!

With Netlify Forms I could add a simple form to a website in couple of seconds, without having to worry about backend implementation.

Simply, add a snippet to your project and you are ready to go. 

```html
<form name="contact" method="POST" data-netlify="true">
  <label>Your Name: <input type="text" name="name" />
  <button type="submit">Send</button>
</form>
```

It was what I call "A form bootstrap heaven". 🙏

## The move 🚚💔
After a while, I have stopped working with Netlify due to my relocation to Vercel. I was heartbroken for a while, yet got over it.

## Dating Formspree 🌹
At some point I have met Formspree. The implementation is quite close to Netlify.

```html
<form action="https://formspree.io/f/{form_id}" method="post">
  <label for="email">Your name: <input name="Name" id="name" type="name"></label>
  <button type="submit">Submit</button>
</form>
```

At first sight things looked very promising. Yet, you have to do a bit more extra work to get started.

- 1. Install a npm package `yarn add @formspree/react`
- 2. Generate `form-id` [here](https://formspree.io/register).
- 3. And a react hook. 

```jsx
import { useForm } from '@formspree/react';

function MyForm() {
  const [state, handleSubmit] = useForm('{form-id}');
  if (state.succeeded) {
    return <div>Thank you for signing up!</div>;
  }
  return (
    <form onSubmit={handleSubmit}>
      <label for="email">Your name: <input name="Name" id="name" type="name"></label>
      <button type="submit" disabled={state.submitting}>Sign up</button>
    </form>
  )
}
```

To be honest, I a quite happy with Formspree, yet the experience that I would have with Netlify Forms is not the same.

## Love of my life Web3Forms ❤️
Recently, I have a met the love of my life. We are engaged and soon are getting married.

The cool thing about Web3Forms is that it is slightly easier to get started.

1. Go to [web3forms.com](https://web3forms.com)
2. Click on `Create your Access Key`
3. Enter your email address

And voila you have generated `access_key`!

```jsx
<form action="https://api.web3forms.com/submit" method="POST">
    <input type="hidden" name="access_key" value="YOUR_ACCESS_KEY_HERE">
    <label for="email">Your name: <input type="text" name="name" required></label>
    <input type="hidden" name="redirect" value="https://web3forms.com/success">
    <button type="submit">Submit Form</button>
</form>
```

Copy the forms with the `access_key` into your project and be happily married for the rest of your life. 💒

PS: If you are using `gmail` and not getting any emails, check the promotions tab.
npm run build fails for create react app with dynamic imports and external modules
Published: 2022-07-06 18:43:22

I have a few dynamic imports and external js called in the javascript create react app.

It works fine when I use npm run start
When I try to create a build using npm run build, i get the following error and the build fails.

The target environment doesn't support dynamic import() syntax so it's not possible to use external type 'module' within a script.

I am still trying to figure out the webpack's, the babel's and the right way to deploy. In case you have any resources that can help me get away this error and understand the basics I would be happy.
Brown Bag Session – Platform Roadmap Reflections by Ivan Shumkov
Tags: web3, opensource, blockchain, programming
Published: 2022-07-06 18:39:42

Ivan Shumkov, the Dash Core Group Principal Engineer, recently shared his insights on the vision for Dash Platform. Here are highlights of what he discussed.
{% embed https://www.youtube.com/watch?v=xUTzxzHigqo %}

Ivan stated that the ultimate goal was to create a sleek and intuitive user experience. We will focus on a great user experience for both users and developers. To ensure developers have an easy time creating apps for Dash Platform, they have come up with an excellent service stack which allows developers to build using familiar tools, languages and concepts. Finally, our plan to implement full decentralization as the final goal.

## Implementation of Data Contracts
To integrate applications with the platform, developers will have to create data contracts to describe the data structures for their application. Its analog is the use of database schema for document-based databases.

Data generated by users of an app will be validated against these contracts. Once validated, the app data will be committed to a database, where it will be stored within the masternode network. Masternodes will receive fees charged to users as compensation for hosting this data.

Data contracts are designed to accommodate as many use cases as possible. Work will also continue on making it easier to onboard developers.

Additionally, devs will work on smart contracts for Ethereum Virtual Machine, which is vital for interoperability with Ethereum, even after the MVP rollout.

## Smart Contract Development
We also discussed our vision when it comes to smart contract development. Smart contracts will be used for logic, while data contracts will be used for data storage. Enabling smart contract functionality ensures that any DApps or video hosting sites can be designed using the platform. Developers can monetize their DApps and receive fees for contract execution. Its analog would be AWS hosting fees instead of a subscription-based model.

## How We Will Achieve Full Decentralization
So how do we achieve full decentralization? Well, full decentralization would not be fulfilled immediately, but it is the eventual one of the goals of the platform.

To achieve full decentralization, a few key features are required. These are the decentralized API, called DAPI, the username layer called Dash Platform Name Service (DPNS), decentralized CDN (dCDN), data contracts, and wallet logins. The dCDN is particularly important for decentralized storage. This is because storing data on a data contract is quite expensive.

We believe that human-readable usernames, instead of a string of numbers and letters, are the future of wallet addresses. To this end, we plan to make improvements to DPNS, allowing users to use usernames to transact and accept friend requests.

Original post: https://www.dash.org/blog/roadmap-reflections/
How is javascript code executed?
Tags: javascript, tutorial, career, webdev
Published: 2022-07-06 18:36:06

As mentioned earlier, a javascript code is executed in two phases, first is **memory allocation** phase and second is **code execution** phase. 

So we are going to look into both phases step by step. Let's take an example:

```
function incre(k){
  int ans=k+1;
  return ans;
}
var i=0;

var first=incre(2);
var second=incre(i);
```

### 🔴 Memory Allocation

In this phase, the code will be parsed line by line, allocating memory. In first line when `function incre` is encountered the whole function snippet is saved in the memory. Next `var i` is stored with a value `undefined`. Same happens for both `first` and `second`.

Once this is done, the next part of the execution is started.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fo5esko94vs12zccsyv2.png)
 
### 🟢 Code Execution

The program is executed, starting from the first line. As in the above example, it moves to executable code, moving forward from function definition. As soon as it finds `var i`, it changes it's value to 0, as indicated.

Next it goes to `var first` where there is **function invocation**. This is where things get interesting. 

> Before we understand this, You should know that this whole box, whatever is happening is happening in **Global Execution context**. A function makes it's own execution context whenever it is invoked.
> All these contexts are saved in a stack.

So, it goes the `func incre` and executes it line by line, in a similar fashion (Two phases). First the memory is allocated and then the code is executed. In the function invocation by `first`, it first allocates ans memory and a value `undefined`. Then, it is executed and value `k+1` is put. As soon as the return statement is encountered the execution context for this invocation is popped out of the stack.

We do the same thing with invocation 2 in `second`.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wq18j85uvpey7ippozyv.png)

At the end, even the global execution context is popped, hence indication the complete execution of js code.
Vim to neovim migration helper
Tags: neovim, vim
Published: 2022-07-06 18:28:28


When migrating your config, it's super boring to check:

- if values are already defaults
- is it vim.opt or vim.g ? 

## So I made this script

```
local opts = {
	ai = true, -- Auto indent
	autoindent = true, -- Auto indent
	autoread = true, -- Detect changes
        ..... your options here .....	
}

local function checkopts()
	print("Options you can discard because they're default:")
	for k, v in pairs(opts) do
		if vim.opt[k]:get() == v then
			print(k, v)
		end
	end
end
checkopts()
```

just paste your options and `:source %` the file

## Want to make options permanent?

this would be the same as doing `vim.opt.youroption = yourvalue` on each value


```
-- set options
for k, v in pairs(opts) do	
	vim.opt[k] = v
end
```

## Full example: 

This also includes globals like colorscheme

{% embed https://gist.github.com/eduardoarandah/e26f7c0acd2e2d6e9a974402cce2ee1f.js %}
Counting Duplicates
Tags: beginners, programming, python, codewars
Published: 2022-07-06 18:21:51

DESCRIPTION:
Count the number of Duplicates
Write a function that will return the count of distinct case-insensitive alphabetic characters and numeric digits that occur more than once in the input string. The input string can be assumed to contain only alphabets (both uppercase and lowercase) and numeric digits.

Example:

```
"abcde" -> 0 # no characters repeats more than once
"aabbcde" -> 2 # 'a' and 'b'
"aabBcde" -> 2 # 'a' occurs twice and 'b' twice (`b` and `B`)
"indivisibility" -> 1 # 'i' occurs six times
"Indivisibilities" -> 2 # 'i' occurs seven times and 's' occurs twice
"aA11" -> 2 # 'a' and '1'
"ABBA" -> 2 # 'A' and 'B' each occur twice
```
Solution- ###Python

```
def duplicate_count(text):
    if len(text) == 0:
        return 0
    text=text.lower()
    count=0
    for i in set(text):
        if text.count(i)>1:
            count +=1
    return count
```
Welcome Thread - v181
Tags: welcome
Published: 2022-07-06 17:30:59

---
title: Welcome Thread - v181
published: true
description: Welcome to DEV! A thread of hellos and intros.
tags: welcome
canonical_url: 
---

![cartoon with headphones saying hi](https://media.giphy.com/media/cyyHl0sGIDq3uJrlif/giphy.gif)

### Welcome to DEV!

1. Leave a comment below to introduce yourself! You can talk about what brought you here, what you're learning, or just a fun fact about yourself.

2. Reply to someone's comment, either with a question or just a hello. 👋 

**Great to have you in the community!**
API Security Testing Report
Published: 2022-07-06 17:29:22

I'm very anxious to show you this gadget I have been working on. This gadget depends on top of Apisec.ai, an API security stage.
This help is for individuals with adaptable/web applications with backend REST APIs. It performs free and second entry testing/security assessment for the REST APIs.
Just point towards your live OpenAPI assurance record and get a PDF penetration test report soon.
Benevolently endeavor and let me in on what is your take?
Here is the immediate connection
https://www.ethicalcheck.dev
DevTools-like JavaScript Object Viewer
Tags: showdev, webdev, javascript
Published: 2022-07-06 17:29:03

Hello everyone 🙌 I just want to share my project. 

I made a javascript object viewer like in devtools because I was curious 😆. 


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

- live demo: [github pages](https://mcanam.github.io/object-viewer/)   
- source code: [github repo](https://github.com/mcanam/object-viewer)

I'm sorry if my code looks bad or not clean I'll fix it again. thanks 🍎
I'm Building a Shopping Cart with Symfony
Tags: antoinechatry, quentinferrer
Published: 2022-07-06 17:22:57

Then I got this error : Cannot resolve argument $carte of "App\Controller\CarteController::add()": Cannot autowire service "App\Classe\Carte": argument "$session" of method "__construct()" references interface "Symfony\Component\HttpFoundation\Session\SessionInterface" but no such service exists. Did you create a class that implements this interface?

**CarteController.php**
```
<?php

namespace App\Controller;

use App\Entity\Car;
use App\Classe\Carte;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;

class CarteController extends AbstractController
{
    private $entityManager;

    public function __construct(EntityManagerInterface $entityManager)
    {
        $this->entityManager = $entityManager;
    }


   /**
    * @Route("/mon-panier", name="carte")
    */
    public function index(Carte $carte)
    {
        $carteComplete = [];

        foreach($carte->get() as $id => $quantity){
            $carteComplete[] = [
                'car' => $this->entityManager->getRepository(Car::class)->findOneById($id),
                'quantity' => $quantity
            ];
        }
       
        return $this->render('carte/index.html.twig', [
            'carte' => $carteComplete
        ]);
    }


    /**
     * @Route("/carte/add/{id}", name="add_to_carte")
     */
    public function add(Carte $carte, $id)
    {
        $carte->add($id);

        return $this->redirectToRoute("carte") ;
    }

    /**
     * @Route("/carte/remove", name="remove_my_carte")
     */
    public function remove(Carte $carte)
    {
        $carte->remove();

        return $this->redirectToRoute("app_car");
    } 
}

```
**Carte.php**

```
<?php

namespace App\Classe;

use Symfony\Component\HttpFoundation\Session\SessionInterface;


class Carte
{
    private $session;

    public function __construct(SessionInterface $session){
        $this->session = $session;
    }

    public function add($id)
    {
        $carte = $this->session->get('carte', []);

        if(!empty($carte[$id])){
            $carte[$id]++;
        }else{
            $carte[$id] = 1;
        }

        $this->session->set('carte', $carte);
    }
    

    
    public function get()
    {
        return $this->session->get('carte');
    }

    public function remove()
    {
        return $this->session->remove('carte');
    }
}
```
**Please help me solve this problem**
Installing Unity Hub on Ubuntu 22.04
Tags: gamedev, unity3d, ubuntu, linux
Published: 2022-07-06 17:08:00

## Introduction

There are two problems in the Unity Hub installation tutorial ([Installing the Unity Hub on Linux](https://docs.unity3d.com/hub/manual/InstallHub.html#install-hub-linux)):
1. Ubuntu 22.04 uses OpenSSL 3 while Unity Editors use OpenSSL 1.0 ([Workaround for libssl issue on Ubuntu 22.04](https://forum.unity.com/threads/workaround-for-libssl-issue-on-ubuntu-22-04.1271405/));
2. The second instruction uses the `apt-key` command, which is deprecated on Ubuntu 22.04 ([apt-key Is Deprecated. How To Add OpenPGP Repository Signing Keys Without It](https://www.linuxuprising.com/2021/01/apt-key-is-deprecated-how-to-add.html)).

Thus, I decided to provide this brief tutorial with the appropriate commands.

## Tutorial

Downloading OpenSSL 1.0:

- Download libssl1.0.0_1.0.2n-1ubuntu5.10_amd64.deb from http://archive.ubuntu.com/ubuntu/pool/main/o/openssl1.0/.

Installing OpenSSL 1.0:
```
sudo dpkg -i libssl1.0.0_1.0.2n-1ubuntu5.10_amd64.deb
```

Adding the Unity3D repository:
```
sudo sh -c 'echo "deb https://hub.unity3d.com/linux/repos/deb stable main" > /etc/apt/sources.list.d/unityhub.list'
```

Adding the public signing key:
```
wget -qO - https://hub.unity3d.com/linux/keys/public | sudo tee /etc/apt/trusted.gpg.d/unityhub.asc
```

Installing the Unity Hub:
```
sudo apt update
sudo apt install unityhub
```

Uninstalling the Unity Hub:
```
sudo apt remove unityhub
```