teleren/devto huggingface dataset:
C++ Levitation: Looking for contributors
Tags: clang, modules, llvm, cpp
Published: 2020-11-12 23:41:04

Hi guys! I'm working on kind of alternative C++. Namely I developed alternative modularity for C++.

YouTube demo:
{% youtube ru5P6ivVLqE %}

# About project

Main idea is to extend existing namespaces (instead of inventing alternative namespace concept, like in C++20 modules).

Another idea is to combine file system scope and module path, just like in Python, and very similar to Java.

There is a well detailed [Readme.md](https://github.com/kaomoneus/cppl/blob/levitation-master/README.md), so you can learn details there.

Currently I have implemented the compiler (customized clang + own meta driver). I have covered it with tests, and even tried some small apps with STL, and it works! I have tested it on Linux and on Mac OS.

I understand that it's kind of crazy to go against mainstream, I also understand, that even though I have tried to do my best and complete compiler itself, it is still merely a toy, just a pet project.

And yet sometimes I can't stand and return to it again and again.

Surprisingly, I found that indeed, it's easy to implement some small projects with my extension.

# Why and how it was started?

When you develop on C++ it's always about some bicycle invention, we create some harness, some sort of dynamic cast and so on.

One day it struck me: dude, you have some experience in compiler development, why can't you bring all that "harness" into compiler AST level? Why not to make own syntax extension?

That was started for fun, and for fun it is. Though, there were periods, when I was working full time, full of ambitions! So I started to love that thing after all, haha!

Perhaps some of you guys would be interested to review or contribute, may be just for fun ;-)

Feel free to ask questions!

P.S.: Now it's good to create plugins for popular IDEs (CLion, Eclispe, etc). So this is my next step.

Github:
{% github kaomoneus/cppl %}

Thanks!
Day 255: Look In The Sky
Tags: hiphop, code, coding, lifelongdev
Published: 2020-11-12 22:45:02

_liner notes_:
- Professional : Another pretty chill day. Had a team meeting. Team member got to demo what we've been working on. Worked with no problem. Spent the rest of the day working on documentation. It was pretty grey and rainy all day because of the Tropical Storm passing through, but it's a lot better now. It was wild, when I look in the sky, I could see the clouds race across the sky.

- Personal : Last night, I went through some tracks for the radio show, edited the recording from the last show and sent it to the station to be played this week. Did a little work on my new side project.

![Sunset on the Brecon, United Kingdom mountain range](https://dev-to-uploads.s3.amazonaws.com/i/tvxleeugnsqikk42jbmg.jpg)

Spoke to a few more meetup organizers about using my site to host and stream their events. Signed up a couple so we'll see how the demo walk through goes. I'll probably go through more submitted tracks and work on my side project some more.

Have a great night!

peace piece
Dwane / conshus
https://dwane.io / https://HIPHOPandCODE.com
{% youtube Q5VYGdibxH4 %}
Swell - Streaming API tests, right from your Desktop
Tags: graphql, testing, showdev, firstpost
Published: 2020-11-12 22:36:00

![Swell logo](https://github.com/garyslootskiy/Swell/blob/master/src/assets/img/horizontal-logo-lockup.png?raw=true)

We all know how important **endpoint testing** is. Whether it's a simple fetch request on a static site, or a multi-platform containerized application using gRPC to communicate between backend architecture, we want to make sure all requests are healthy and generating the sort of responses we expect.

For a long time, **Postman** has reigned supreme over the API-testing world. And for good reason! There's simply no match for their industry market share, team management tools, customizable options, and reliability. 

There's one major feature that Postman doesn't support - **testing modern streaming protocols**. If your project incorporates connection types like WebSockets or gRPC, you'll need a separate application to test those connections and verify their health.

This is not a new issue - just take a look at this [open Github issue](https://github.com/postmanlabs/postman-app-support/issues/5194) (from 2018!).

We at [Swell](https://getswell.io) wanted to create an all-in-one application that tests not only traditional API calls like RESTful routes and GraphQL, but also WebSockets, gRPC, SSEs, and HTTP2 connections.

![An example of swell at work](https://github.com/garyslootskiy/Swell/blob/master/ReadMeGifs/Gifs/ConcurrentStreams.gif?raw=true)

Swell has many of the well-loved features of API testing applications like Insomnia or Postman - saved collections/history, GraphQL schema introspection, and an intuitive, responsive UI design.

![Swell testing websockets](https://github.com/garyslootskiy/Swell/blob/master/ReadMeGifs/Gifs/WebSockets.gif?raw=true)

It's worth noting that Swell is a **relatively new** product. Although our offerings are substantial, Swell hasn't been tested and vetted in an enterprise situation as of yet.

![Swell example REST](https://github.com/garyslootskiy/Swell/blob/master/ReadMeGifs/Gifs/GRPCResponses.gif?raw=true)

Our open-source team is small, but incredibly responsive and open to any feedback. Please feel free to explore and offer any feedback at [our GitHub repo](https://github.com/open-source-labs/Swell)


Swell is open-source and free to use. [You can download it here.](https://www.getswell.io) Let us know what you think. :)

![Swell logo](https://github.com/garyslootskiy/Swell/blob/master/src/assets/img/horizontal-logo-lockup.png?raw=true)
Finally Completed!!!
Tags: hacktoberfest
Published: 2020-11-12 22:35:21

<!-- ✨This template is only meant to get your ideas going, so please feel free to write your own title, structure, and words! ✨ -->


### Hello!!!
 I am Satyam Shekhar, a Computer science professional. I joined Hactoberfest to learn about open source and its benefits and here I am, established my goal!!! 
### Background

I am pursuing B.Tech in Computer Science and technology from the Vellore Institute of Technology, Bhopal. Ability to work with C, C++, Java, and Python. I am a budding web and app developer with interests in data analytics too.

### Progress

I got my all 4 pull requests merged and it did pass a 14 day trial period too and ordered a cool t-shirt too.

### Contributions

1. I submitted New user to Skywalkers-24/Hactoberfest-2020-native. I was just trying out.

2. I submitted a visualization of how the split screen works and can be used to abhimaninnovations/Hactoberfest_2020. this is where my true contribution to open-source began.

3. I submitted a basic website creation to abhimaninnovations/Hactoberfest_2020. This was a quick guide on how to create a basic website for begineers.

4. I submitted code in c++ for friend_class_and_friend_function to rituburman/hacktoberfest2020. This was something that was missing in this repo and this can be useful to others around the globe.


### Reflections
It was a great experience, which taught me a lot of positive things that will help me as a professional. Trying out your hand at something you know and contribute it to the world was great and thanks to the Hactoberfest team for events like this.
Getting Tailwind CSS and Svelte working together
Tags: svelte, tailwindcss, 100daystooffload
Published: 2020-11-12 22:22:19

Following my last post I had to do some further work to get a Svelte and Tailwind CSS development environment up and running. I used this post (and its comments) as a guide: {% post inalbant/a-simpler-way-to-add-tailwindcss-to-your-svelte-project-11ja %}

To process the CSS when running the dev server, an additional npm package was required. I also forgot to install the prettier code formatter so I grabbed that too:

```sh
npm i npm-run-all prettier prettier-plugin-svelte --save-dev
```

The following scripts then needed to be added to `package.json` to enable reloading to occur properly when running `npm run dev`:

```json
"scripts": {
  "autobuild": "rollup -c -w",
  "watch:tailwind": "postcss public/tailwind.css -o public/index.css -w",
  "dev": "run-p autobuild watch:tailwind"
}
```
This is just another reminder for myself to eventually gather all the steps in one place. Check out the post above for more guidance about the setup.

_I'm publishing this as part of 100 Days To Offload. You can join in yourself by visiting [https://100daystooffload.com.](https://100daystooffload.com)_
In react.js calling an API within another API based on the data fetched by the first API
Published: 2020-11-12 21:26:57

Very new in the world of react.js, building my pilot project to learn CRUD operations on mongoDB collections using GO APIs and React.js. 

Here is my code for a view page (picture attached)

import React, { useState, useEffect } from "react";
import axios from "axios";
import { Link } from "react-router-dom";
import Time from 'react-time';
import Moment from 'moment';

const Borrow = () => {
  let wasDate = new Date("Wed Nov 11 2020 15:48:59 GMT+0400")
  let now = new Date()
  let another = new Date("2020-11-10T00:00:00.000+00:00")
  const [borrows, setBorrow] = useState([]);
  const [books, setBook] = useState([]);

  useEffect(() => {
    getBorrows();
  }, []);

  const getBorrows = async () => {
    const result = await axios.get("http://localhost:8080/getborrowall");
    //setBook(result.data.reverse()); // reverse order
    setBorrow(result.data);
  };

  const deleteBook = async id => {
    await axios.delete(`http://localhost:8080/delete?id=${id}`);
    getBorrows();
  };

  const loadBook = async id => {
    const resultB = await axios.get(`http://localhost:8080/getbook?id=${id}`);
    setBook(resultB.data);
  };

  return (
      
    <div className="container">
      <div className="py-4">
        <h1>Books Borrowed </h1>
          <table class="table border shadow">
          <thead class="thead-dark">
            <tr>
              <th scope="col">Srl No#</th>
              <th scope="col">Book Id</th>
              <th scope="col">Name</th>
              <th scope="col">Author</th>
              <th scope="col">Member Id</th>
              <th scope="col">Borrowed On</th>
              <th scope="col">Due Date</th>
              <th scope="col">Date of Return</th>
              <th>Action</th>
              <th></th>
              <th></th>
            </tr>
          </thead>
          <tbody>
            {borrows.map((borrow, index) => (
              <tr>  
                <th scope="row">{index + 1}</th>
                <td>{borrow.bookid}</td>
                <td>---</td>
                <td>----</td>
                <td>{borrow.memberid}</td>
                <td>{Moment(borrow.borrowdate).format('MM/DD/YYYY')}</td>
                <td>{Moment(borrow.duedate).format('MM/DD/YYYY')}</td>
                <td>{Moment(borrow.returndate).format('MM/DD/YYYY')}</td>
               </tr>
            ))}
          </tbody>
        </table>
      </div>
    </div>
  );
};

export default Borrow;


Two things I am looking for help:
1. I have 2nd API to bring bookname and authorname based on bookid in each row. How to execute second query within map function of first query? What is the best practice to bring data from base collection and getting related data from dependent collections?
2. "Moment" is formatting dates perfectly, but like to use that method only when value exists. How to put if-else in my code base?

Thanks in advance for your guidance.
Hacktoberfest-accepted
Tags: hacktoberfest
Published: 2020-11-12 22:04:48

### Intro Heading
I don't know why you should read it but, if you are reading it let me tell you if you are looking forward to being an SDE or a great programmer in general, you should be aware of Open-Source and should contribute to open-source projects, if now then Hacktoberfest is a great place to start your Open-source journey.
### Background
At the beginning of my coding journey, I was using git and GitHub, but I did not know that I am doing some OS(open-source) contributions. But later on GSoC, MLH came into the picture and those things got my interest, after that I started searching for that, and later on, I got introduced to Hacktoberfest by a random YT recommendation, which got me started with OS.
### Progress
I have completed HF and but sadly there is one extra contribution.

### Contributions

I mainly contributed to one of the repositories of our DSC's, Built a Streamlit based app there, made an ML model for Forest fire prediction, did some EDA on the data, it was pretty basic, and yes! yes! I did deploy that app too.
These are my first 4 contributions,
1. https://github.com/dsc-iem/AI-Hacktoberfest/pull/9
2. https://github.com/dsc-iem/AI-Hacktoberfest/pull/13
3. https://github.com/larissalages/code_problems/pull/87
4. https://github.com/dsc-iem/AI-Hacktoberfest/pull/17

### Reflections
1st, legends say, "one can't simply learn Git", and this is true.
HF helps you to dive deep into git, introduce to bash which is a Linux-based CLI.
2nd, after doing HF now, I have so much respect for OS contributors, I can't even explain to you just by telling, Its really tough, but you need to have patience and should communicate every time with your maintainer about the changes you are making in the code base, and sometimes if the PR  is related to UI and web dev stuff then it really gets difficult to merge a PR. 

AND AT THE END ALL THIS HARD WORK IS NOT FOR WAST, you get real-world experience with git and GitHub, explore a new field, become a good communicator and the list goes on and on.


Don't wanna stretch things rn, but thanks for reading this non-sense, BP, and wasting your time.
Thank you 🙏 and have a great day.


PS. don't make any comment if you find any typo or grammatical misstate, I am posting this without even reviewing the write-up.
Is this a type error? (2)
Tags: programming, computerscience, typesystem, function
Published: 2020-11-12 23:21:47

---
title: Is this a type error? (2)
published: true
date: 2020-11-12 21:20:40 UTC
tags: programming,computerscience,typesystem,function
canonical_url: https://stereobooster.com/posts/is-this-a-type-error-2/
cover_image: https://stereobooster.com/posts/is-this-a-type-error/is-this-a-pigeon_hu3d03a01dcc18bc5be0e67db3d8d209a6_60430_600x0_resize_q75_box.jpg
---

Continuation of previous post: [Is this a type error?](https://dev.to/stereobooster/is-this-a-type-error-3p0p).

[I wrote a small lisp-like language](https://dev.to/stereobooster/demystify-variables-3f6c). To create a variable in this language you would write:

```lisp
(define x 1)
```

in JavaScript, you would write:

```js
const x = 1;
```

Because `define` is structurally similar to a function, language handles it in the same manner (but it doesn't evaluate the first argument).

It is possible to write, for example:

```lisp
(define 1 1)
```

But this is an error, first argument suppose to be "symbol", not a number. So I added following check:

```js
if (typeof first !== "string") {
  throw new TypeError(
    `"${name}" expects symbol as the first argument, instead got "${first}"`
  );
}
```

In this language, this considered to be a type error, but in many other languages it would be a syntax error, for example, in JS:

```js
const 1 = 1
// SyntaxError: missing variable name
```

I can change the code - move this check to the parser, then an error will become syntax error. On the other side if I will add `quote` and `eval` to the language I still can get this error (at eval stage):

```lisp
(eval (quote (define 1 1)))
```

Just another interesting case of how the same error can be interpreted as a type error or not depending on the point of view.
Do you Git it now?
Published: 2020-11-12 21:18:35

My mental model for how Git works: [watch](https://youtu.be/EuYmY3CSkFc)

1. User creates a remote repository

2. User clones the remote repo to their computer

3. The user’s work is a copy called the working directory

4. The user accomplishes something they want to commit

5. The user’s changes are staged for commit in an Index

6. Upon commit, the changes are made to the Head

7. Upon push, the Remote branch is updated!
100 days of code — Dia 4
Tags: python, programming, productivity, 100daysofcode
Published: 2020-11-12 21:14:24

(12/11/2020)
[Lista completa]

- A lista de tarefas basicas do sistema esta concluida, agora é só voltar aplicando as regras de negocio e alterações pontuais que forem solicitadas.

![36e12c5c-0bac-442a-9393-4a66424ffc59](https://dev-to-uploads.s3.amazonaws.com/i/04glw274vsh5h1r7k78z.jpeg)

> Hoje também terminei de montar os nichos e a mesa de trabalho que comprei;<br>
> Esqueci de mencionar que estou lendo o livro __Sapiens - uma breve história da humanidade__, estou na pagina 196/428;<br>
> Ao total ja li 8 livros esse ano.
<br>
 
*Se hidratem, comam frutas, leiam bastante, a terra não é plana, vacinas salvam vidas e bolsonaro vai tomar no cu.*
Two Factor Authentication using NodeJs
Tags: node, javascript, authentication, express
Published: 2020-11-12 21:14:18

If you have ever dealt with authentication in your application then you must have seen two factor authentication where you have to give a token or code that might be send to you by SMS or email. So lets build something like that and learn two factor authentication.
Before learning two factor authentication lets understand pros and cons of 2FA(2 Factor Authentication)
## Pros of 2FA
1. Provides Security to application.
2. Easy to setup

## Cons of 2FA
1. Involves sharing of Email or Phone number
2. Prone to MIM attack

# Let's Get Started

=> Create a node project 

      __ npm init -y __
=> Lets install some dependencies

      __ npm install express node-json-db uuid speakeasy __
=> Create a simple Express app

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/frw50wlm8xq9xplwvftv.png)
=> Firstly create database here I am Node JSON database you can use any database that you want.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/pqvm2ijo1ndc4vdpq2yx.png)
=> Now register the user and create a temporary secret for him.
 ![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/1skbrs3uuh8uugmzixxs.png)
=> When you will register the user you will get a secret key and token
that will look like this in base32
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/1yv09vhrmxk1163iobqo.png)
But you can also go with simple key and it will look like this
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/tq3dlsshujps8pqmtv17.png)
=> Now lets verify the user for that you need things one is the userId the user who is trying to login and one is the token this is token is generated in many ways you can use chrome extension that taken secret key from the register process and gives you a token or you can also use mobile apps I am using extension to generate token.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/g4twn2flvstrdl65owjw.png)

if it return verified true then you are good to go otherwise no.

you can also go one step further to validate the token.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/oyy37xhhxnruzfxgvrek.png)

if it return validate true then you are good to go otherwise no.


Github repo of above  is:

[https://github.com/akarshbarar/TwoFactorAuthentication)

-----------------------------------------------------

Follow me on [Github](https://github.com/akarshbarar)
Follow me on [Instagram](https://www.instagram.com/mycodecave/)
Follow me on [Twitter](https://twitter.com/CodeCave2)

-----------------------------------------------------

--------------------THANK YOU------------------------
Amazon S3 Buckets and Objects
Tags: amazon, s3, cloud
Published: 2020-11-12 20:55:01

Amazon S3 is one of the larger sections for the Certified Cloud Practitioner exam, which made me decide to break up the blog posts about it into a few different sections.

S3 stands for Simple Storage Service. It is designed to make web-scale computing easier for developers. According to the Amazon AWS docs, Amazon S3 gives any developer access to the same highly scalable, reliable, fast, inexpensive data storage infrastructure that Amazon uses to run its own global network of websites. Some use cases for S3 are: 
- Backup and Storage
- Disaster recovery
- Archive
- Hybrid Cloud Storage
- Application hosting
- Media hosting 
- Data lakes and big data analytics
- Software delivery 
- Static website

S3 Buckets allow people to store objects (files) in “buckets’ (directories). Even though buckets are required to have a globally unique name (across all regions on all accounts), they are still defined at a regional level! The common naming convention for buckets is: 
- No uppercase
- No underscore
- 3-63 characters long
- Not an Ip
- Must start with lowercase letter or number

In S3, data is stored as objects within buckets.  An object is a file and any optional metadata that describes the file. Objects have a key that is of a prefix plus the object name. For example, 
s3://my-bucket/my_folder1/another_folder/myfile.txt
The max size of an object is 5 terabytes and if uploading more than 5 GB you must use “multi-part upload”.

This pretty much sums up S3 objects and buckets I hope you learned a little! On my next blog post I will dive into S3 security, version control and access logging. Thanks for stopping by!
100 days of code - Dia 3
Tags: programming, productivity, python, 100daysofcode
Published: 2020-11-12 20:51:22

<h2>(11/11/2020)</h2>
[Artigo atrasado]

- O atraso é devido a demanda de trabalho que recebi esses dias e não consegui parar para escrever o artigo do dia 11 no mesmo dia. Mas, ainda sim, fiz muita coisa e venho passar para vocês.

- Na parte da manhã, trabalhei em algumas modificações pontuais na interface do sistema de ponto eletrônico (o cliente não se decide nunca...);
- Na parte da tarde, fiz toda a parte de cadastro e login do usuário, adicionando as regras de negocio que o cliente me passou.

- Comecei a trabalhar as 8hrs da manhã e parei só 22hs da noite e fui dormir.

*Se hidratem, comam frutas, leiam bastante, a terra não é plana, vacinas salvam vidas e bolsonaro vai tomar no cu.*
Visual Studio Code : Auto Save, Auto Reload
Tags: angular, typescript, visualstudiocode
Published: 2020-11-12 20:40:18

- View Command Palette
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/z10rl1y3gwy26rd80ea7.png)
- Open UI Settings:
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/z5z2512ef3r587hchxdd.png)
- Alter these Values:
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/a2i6oc9c6r50abszr7t8.png)

Result:
AutoSave every three seconds, followed by File Watcher for Angular 10 apps. means your browser is ready before you can switch screens. Nice!

Angular 11
Hot Module Replacement is a feature of Webpack. The HMR updates your Angular browser instance with just changed content.  This will replace the filewatcher method.