teleren/devto huggingface dataset:
flat.social new beta release - looking for feedback :)
Published: 2022-03-19 15:08:20

Hey everyone!

I just released a new version of [flat.social ](https://flat.social) - would love to hear what you think about it! It's a solo project that took me a couple months to build. 

The frontend is built using [Next.js](https://nextjs.org/) + [Pixi.js](https://pixijs.com/) and the backend audio and video is powered mostly by [Mediasoup](https://mediasoup.org/) with physics done with [Matter.js](https://brm.io/matter-js/). 

[flat.social](https://flat.social) is a playful video conferencing app where all guests can move around and talk with others who are in their [proximity](https://flat.social/spatial-chatting). Think [remote socials](https://flat.social/spatial-virtual-office), parties, permanent spaces and any online happenings where creating connections and networking is the main part of the agenda.  Some beta testers have also used it for [remote education](https://flat.social/remote-teaching-learning-software) purposes.

Here is a demo: [https://www.youtube.com/watch?v=UO3rN7sVn_A](https://www.youtube.com/watch?v=UO3rN7sVn_A) for the lazy ones :)

Landing page: [https://flat.social](https://flat.social)

Features: [https://flat.social/online-meeting-features](https://flat.social/online-meeting-features)


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hx3t2nvatgjqylz754iu.png)
Issues Occured While Running Python Project On Replit
Tags: python, replit, shriekdj, programming
Published: 2022-03-19 15:03:48

So After Long Time Using the Website `replit.com` I Had Learned How to Use it and Configure it as per My Requirement.

### For Those Who Don't Know Replit
It's an IDE Similar to VSCode But It's Online In A Website at <https://replit.com/> which can be used for running any programming projects and most of the programming languages already installed there.

### Problem
> Unable to Run Projects Under localhost or `127.0.0.1` domain.

### Details
> `replit.com` is an website running on server and our project also run there so localhost or 127.0.0.1 obviously never run

### First Solution
> Change address from, `localhost:8000` or `127.0.0.1` to `0.0.0.0:8000`
>> Example Given Below **Also Watch the Second Linked Solution**

```python
# from this
python main.py runserver

# to this
python main.py runserver 0.0.0.0:8000
# or this
python main.py --host 0.0.0.0 --port 8000
```

### Second Solution Linked to First Solution
> Mostly You Will Get Issues Because Most Python Web Frameworks Have an Global Value `ALLOWED_HOSTS` and it contains the list of domain names allowed by the given server

```python
# change allowed hosts from
ALLOWED_HOSTS = []

# To This Hosts
ALLOWED_HOSTS = ['*']
```

### Conclusion
> If Issue Still Occurred Directly related to **Virtual Environments**.
>> I Will Add That to Next Post and Add the Link To That Post Below Or in Pinned Comment

{% post https://dev.to/shriekdj/replit-was-unable-to-build-the-virtual-environment-for-python-project-14kk %}

Give a reaction if any one solutions helped you in any way.

Bye 👋.
Rule the JSON operations in Go 🧑‍⚖️
Tags: go, programming, tutorial, performance
Published: 2022-03-19 14:51:05

Have you ever wondered how much golang allows you to customize Json operations?

I searched about it and I found that we can declare our methods for json marshal/unmarshal operations. I can't guarantee this information is usable but I think it is nice to know. If you want to know how to do it please keep reading :)

## Toying with Json Interfaces
I will give direct code examples in here so firstly there is our code:

{% gist https://gist.github.com/yusufpapurcu/489d652f22fd90bea35c16bf8f908f52 %}

Scenario: We have an `exampleStruct` definition at line:33. This is our user model and it's contain some problematic information in it (Like credit card info). So we want to filter them in json marshal/unmarshal.

### Create new data layer
I created a type called `emailCover` at line:51. I need this layer because I don't want to create recursive marshaling loop in my method by using `json.Marshal()`. You don't need to do it but I think it is more safe for avoiding stack overflow.  

### Filter Coming Data in `json.Unmarshal()`
We implemented an `UnmarshalJSON` method to our cover at line:53. It basically just unmarshall all data and gives us necessary fields.

**Important:** Don't forget declare object as pointer in method definition.

### Don't Marshal Data in `json.Marshal()`
We implemented an `MarshalJSON` method to our cover at line:64. It basically just get default version of object and just sets necessary fields. And returns `json.Marshal()` again. Did you notice? We put `exampleStruct` insde return marshal. If you try to give `emailCover` you cause a recursion. And this causes an stack overflow error.

 **Important**: Don't forget declare object as value in method definition.

### Extra Point
Documentation says:

> Marshal traverses the value v recursively. If an encountered value implements the Marshaler interface and is not a nil pointer, Marshal calls its MarshalJSON method to produce JSON. If no MarshalJSON method is present but the value implements encoding.TextMarshaler instead, Marshal calls its MarshalText method and encodes the result as a JSON string. The nil pointer exception is not strictly necessary but mimics a similar, necessary exception in the behavior of UnmarshalJSON.

So this methods called in inheritor objects also.

### Referances
- `encoding/json document`: https://pkg.go.dev/encoding/json
The state of the Pragmatica (Feb 2022)
Tags: java, asynchronous, core
Published: 2022-02-23 11:01:46

---
title: The state of the Pragmatica (Feb 2022)
published: true
description: https://github.com/siy/pragmatica
tags: #java #asynchronous #core
//cover_image: https://direct_url_to_image.jpg
---

Since [last publication,](https://dev.to/siy/introduction-to-pragmatic-functional-java-142m) [Pragmatica](https://github.com/siy/pragmatica) changed significantly. It started as a minimal set of classes necessary for Pragmatic Functional Java coding style, but over the last few months it grew into the fast asynchronous I/O core with support for network _and file_ I/O (unlike, for example, Netty, which provides only network I/O).

### What's new

The main change is that Pragmatica now supports representation of all [special states](https://dev.to/siy/leveraging-java-type-system-to-represent-special-states-688):

- `Option<T>` for missing values
- `Result<T>` for "error or result" values
- `Promise<T>` for "not yet available" values

Along with `Promise<T>` a whole new asynchronous I/O subsystem was implemented. It is based on modern asynchronous API which was recently added to the Linux kernel - [io_uring](https://unixism.net/loti/what_is_io_uring.html). This enabled implementation of concurrency model which supports asynchronous operations for both, network and file I/O. 

The implementation requires small number of threads (~1 thread per CPU core) and minimal synchronization overhead, which results in good throughput and scalability. Preliminary benchmarks show that this implementation has better throughput (up to 30% at high and very high load) than Netty.

The next change is that Pragmatica now consists of few modules:
- __Core__, which contains base classes like `Option<T>`, `Result<T>`, etc.
- __Proactor__, which contains low-level part, implemented as a [Proactor](https://en.wikipedia.org/wiki/Proactor_pattern) pattern using Linux [io_uring](https://unixism.net/loti/what_is_io_uring.html) asynchronous API.
- __Async I/O__ - high level, Promise-based asynchronous API. It also contains (so far minimal) infrastructure for the implementation of various clients and servers (work in progress) as well as few file processing utilities (also WIP).
- __Examples__ (so far only one exists).

### What's next

Below listed things which will be implemented next (roughly in order of priorities, from highest to lowest).

- Support for remaining __io_uring__ APIs. Among notable ones - sending/receiving of datagram (UDP) packets.
- Run-time parameters configuration.
- Significant parts of the library require testing.
- Documentation and examples for existing code.
- Asynchronous DNS API. 
- Support for SSL/TLS.
- More file utilities.
- Higher level protocols, most likely HTTP/1.1 will be first.

As one can see, there is still a lot of work ahead. So, if anyone wants to join and help - feel free to contact me here or at GitHub.
Starting the development blog
Tags: beginners, firstpost, devjournal
Published: 2022-03-19 14:39:42

If you are a developer like me you probably had a thought similar to 'Hey I think i've done this before, how did I do that last time?'. Well I certainly do this.. like a lot.

And so I've had this idea for a really long time to start blogging about using certain code, packages, frameworks or solutions to problems I run into while at work. Primarily so that I have a nice backlog of solutions and small bits of code to look back at in case I need it again in the future. Maybe I'll even help some other developers along the way.

So here we are.. this is my first post. Maybe if this is something I want to do more often I'll move the blog to something custom built. 

My topics will mostly be C# and .NET related, as that's what I'm doing most and feel most comfortable working with. 

[My Twitter](https://twitter.com/netrule12)
[My Github](https://github.com/dotnetrule)
How to host a website on an ec2 server
Published: 2022-03-19 14:39:33


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5ybsok6cxdxqv468qvni.jpg)**STEP 1:
Create an s3 bucket and upload the zip folder or file containing the index.html. Note that all objects in an s3 bucket are private by default. Hence, it is important to make the file publicly accessible using the the bucket ACL. 
Two choice is available: Either create the bucket policy manually or use the AWS policy generator.

**STEP 2:
Launch an ec2 instance allowing internet access over port 80. SSH into the instance using PUTTY( for windows user). copy the ipv4 address of the instance and under the part labelled 'session' on PUTTY, insert 'ec2-user@theipyoucopied'. 

**STEP 3:
Install Apache by typing in 'yum install httpd -y' in the command line. change directory to the \var\www\html, the copy website on the s3 bucket into the ec2 instance. To do that, type in the command line 'wget 'add the object url'. Move the file to the var html directory.

**STEP 4:
start http using the command 'service httpd start'.

yehhhh!!!! website hosting successful!!
[Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/trwmg0i453wif4o9svqd.png)
References in javascript
Tags: javascript, react, productivity, node
Published: 2022-03-19 14:36:20


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

this is how references works in javascript if you change in one it will be reflected in other, in example you can see 


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ed9k3i5u9c8oras3jhpx.jpg)
Três formas de atribuir classes no angular utilizando ngClass
Tags: javascript, angular, typescript, ngclass
Published: 2022-03-19 14:34:20

O ngClass serve para que seja possível adicionar ou remover classes a um elemento HTML.

Essa diretiva ajuda muito, principalmente quando queremos adicionar ou remover uma classe devida a certa expressão ser verdadeira ou falsa.

Suponha que queremos adicionar cores diferentes a um paragrafo, caso um usuário esteja ativo ou não.
<br />
####Utilizando javascript puramente, fariamos da seguinte forma:
```javascript
const element = document.querySelector('div');

if (active) {
	element.classList.add("active");
} else {
	element.classList.add("inactive")
}
```
<br />
Com o ngClass do angular, podemos fazer essa mesma lógica, pelo próprio template.

Digamos que no nosso componente temos uma variável chamada ‘active’ que é um boolean, então no template podemos utiliza-la dentro do ngClass para adicionar a classe com base no valor dessa variável.
<br />
####Utilizando operador ternário, poderiamos fazer da seguinte forma: 
```html
<p [class]="active ? 'active' : 'inactive'">
	Hello World
</p>
```
<br />
####Ou ainda, poderiamos fazer utilizando [class.class-name]:
```html
<p [class.active]="active" [class.inactive]="!active">
	Hello World
</p>
```
<br />
####E também existe uma terceira opção que seria utilizar um objeto dentro do ngClass:
```html
<p [class]="{'active': active, 'inactive': !active}">
	Hello World
</p>
```

Minha opção favorita é utilizar o [class.class-name], dessa forma acredito que o template fica mais limpo e de fácil leitura 😃


Deixei alguns exemplos simples no stackblitz: [https://stackblitz.com/edit/angular-ivy-dmfbw2](https://stackblitz.com/edit/angular-ivy-dmfbw2)
reconcileChildrenArray
Tags: react
Published: 2022-03-19 14:27:31

 if (oldFiber.index > newIdx) {
        nextOldFiber = oldFiber;
        oldFiber = null;
      } 

what the meaning of the if branch above? Shouldn't it always be oldFiber.index === newIdx? 
So I think this branch should be deleting
Array : Different ways to Remove Duplicates
Published: 2022-03-19 14:20:25

This is a very short article which covers a common use case we come across in our day to day coding. We often want to remove duplicate values from an array. Let's see! 

## Examples 

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

Thank you for stopping by. Let me know any other way to deal with it. Let's connect on : [Linkedin](https://www.linkedin.com/in/swasdev4511)
Hi everyone 👋👋..
Published: 2022-03-19 14:02:04

Hi everyone..I joined here on today. I like to learn more about coding. Iam currently a degree student studying BCA degree . And I only have a small knowledge about coding.I don't know how to create a website and how to create an application or learning a data structure... But I need study all and I don't know how,if you can know then please let me know..I only know (HTML,CSS,SQL,PYTHON,AND C) these are the language I know and iam not a pro in these languages. Please any one tell me the way to become a good proggraamer.and one more thing that is I don't have a personal computer or a laptop. I use my phone to code html and c codes...****
Wil je mijn hele website op maat maken
Published: 2022-03-19 13:51:49

Hallo daar,

Ik wil mijn hele website met betrekking tot [esthetische behandelingen](https://vdl-a.nl/) die momenteel op wordress staat, verplaatsen naar custom php vanwege het snelheidsprobleem. Ik huur een ervaren WordPress-ontwikkelaar in om de laadsnelheid van de pagina te verlagen van 10 sec naar 3 sec, maar ze voldeden niet aan de volledige criteria. Hoeveel tijd zal nodig hebben?

Ik wil niet van thema veranderen, moet precies op maat zijn.
Wat vind je hiervan?
Want to shift my whole website into custom
Published: 2022-03-19 13:48:21

Hi there,

I want to shift my whole website related to [Gothic Pants Mens](https://www.d-store.co/gothic-pants.html) that is currently on wordress into custom php because of the speed issue. I hire experience wordpress developer top reduce page loading speed from 10 sec to 3 sec but they did not full criteria. How much time will require ?

I don't want to change in theme, need exactly on custom. 
What's your thought about this?
Tutorial to Build Live Streaming App - Twitch Clone
Tags: flutter, firebase, agora, tutorial
Published: 2022-03-19 13:44:33

Build a Live Streaming App - Twitch Clone using Flutter, Firebase, Agora & Golang for Android, iOS, Web and MacOS.

Link: https://youtu.be/U9YKZrDX0CQ 

Features: 
- Email & Password Authentication 
- Screensharing 
- Selecting Thumbnail 
- Going Live 
- Joining LiveStream 
- Switching Camera 
- Muting/Unmuting 
- Chatting 
- Cross Platform 
- Responsive UI 
- Token Generation using GO (Create Your API) 
- Deploy Server 
- Deploy Website
How To Get More Stars/Followers On GitHub
Tags: github, githunt, git, programming
Published: 2022-03-19 13:21:50

<h1 align="center">How To GET more stars/Followers On Github?</h1>
<br><br>
<h2 align="center">1.Make Your Repository With A LOT of tags</h2>
<br><br>
<p align="center">That Gonna Help You When Someone Wanna Search On Github With Tags, At Least This Way Gonna Make you With New 20 View In A Day, And This Number Gonna Grow When You Have Some Sweet Stars and That What We Gonna Do IN Step 2</p>
<br><br>
<h2 align="center">2.Try To Follow And Star Other Repository/Accounts</h2>
<br><br>
<p align="center">This Way Gonna Let ppl Know You, And Also Star You When You Star Him, And Follow You If You Follow Him, This Way gonna make your repos with more stars, and so github will make your repo the first in tags, But, How To Let Anyone Star/Follow You ON Github, And You Guess It! Its In Step 4 :-)</p>
<br><br>
<h1 align="center">4-1.How To Let Any One Star You</h1>
<br><br>
<p align="center">now, This Gonna Be Kinda Easy, Just Try To Make Your ReadMe COOL, Let Me Give You A Example, Its Not By Me But just Try Make HIm :-) https://github.com/raysan5/raylib so this repo just add a tiny little gif, and some texts, try do something like this, IDK i love see what you done in the comments, Maybe You Will Git Some Git Stars :---)</p>
<br><br>
<h1 align="center">Try Do What I Tell, But Really Stars Doesn't matter, Just Made Amazing projects :-) i love this smill face :-) BYE!</h1>
What I learn so far in my programming journey
Tags: webdev, beginners, programming
Published: 2022-03-19 12:57:41

   I have been committing to advance my skill in web development, and have been doing so for close to 8 months now. Looking back from when I started, I would say I have transform a lot. From being heavily focus on step by step tutorials to really put myself in an uncomfortable position and really go off on my own and really code. I still do use YouTube tutorials but I find myself stop the video, looking at source code, debugging it and really understand why it does the way it does. I learn so much but still feel like I am just scratching the surface. 
   It somewhat a humble experience to know that what you know, it's just a fraction of a whole piece of pie, and each time you think that you eat enough, there's a whole new big pieces added to it. I'm enjoying every little step that I've accomplish, I embrace the frustrations, the "damn, Am I that dumb" phase, the feel of temporary defeat. In many things I've tried, if I stumble on problem that frustrated, I would just avoid it and sometime never come back to it. I do feel like that with programming but as I have some form of doubt, my motivation and drive grew even higher to tackle what's in front of me and make it work. To be able to add cool styling or awesome functionalities give me a sense of joy that maybe I am underestimating my capability, and that in it self is something special.
3 Best Tools that you can use for Writing Awesome Articles
Tags: productivity, codenewbie, devjournal
Published: 2022-03-19 12:48:40


## 3 Best Tools that you can use for writing an article that will surely Sky Rocket your article reader's experience.

Whenever I write technical articles on programming or development. I like to add some code snips and explanatory illustrations.

So here are some tools that I have used for a long time and a few just started to use. 

### 1. Excalidraw
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yxubduywt3mzxntqkrvj.png)`(This example image is created using poet.so)`

The fascinating tool currently I have started using for my articles is **Excalidraw**.
(those articles are draft currently but soon will be released)
- It helps us create **illustrative diagrams** easily.
- It is **Free & Open Source** and basic features are more than enough. And need some more advanced features, you can just get a premium subscription called **Excalidraw+**.
- It has awesome collections of the **library** which has **Icons**, **UML blocks and elements**, and many more to create awesome explanatory diagrams.

**Link** : https://excalidraw.com/

{% github https://github.com/excalidraw/excalidraw no-readme %}

### 2. Snappify

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

Who doesn't like to add some code snippets in their article?
So here is one amazing and easy-to-use tool that creates code snippets for us seamlessly. 
- It is **free** with basic features and that's enough I guess for us to use in our article.

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

- It has customization for background **gradient colour**.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0mc6skf7efyvh5vzjqnf.png)
- **Size** customization option for the snippet image.
- **Theme** customization option.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/toxa1l6ipax4f1nc4t9l.png)

**Link** : https://snappify.io/

### 3. Poet.so

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

Few a times we need to add a Twitter thread in our article.
For example, many folks do #100daysoflearning in public and they create a thread on Twitter, so if they want to add that Twitter thread snap in the article and can be done using poetso.
- We have the option to include likes, retweets, and comments responses in the tweet snap image.
- It has different **background gradient** color.
- **Size customization** option of the tweet snap.

**Link** : https://poet.so/
Reading Note: A philosophy of Software Design Chapter 1
Tags: softwaredesign, software, books
Published: 2022-03-19 12:46:06

Recently, I read [A philosophy of Software Design](https://amzn.to/37KUJZR) with friends.
In this article, I write a reading note about it.

# Chapter1 Introduction( It's all about complexity)

There is a strong relationship between understanding the systems and writing software.
The more features you develop, the more it becomes complicated.
So complexity increases inevitably over the life of any program.

There are two general approaches to fighting complexity.
The first is to eliminate complexity by making code more straightforward and apparent.
The second is to encapsulate complexity to work on a system without being exposed to all its complexity at once. (modular design)

This chapter introduced waterfall model and agile development.

This book has two goals.
The first is to describe the nature of software complexity.
The second is to present techniques to minimize complexity.

## 1.1 How to use this book
Many of the design principles described here are abstract. This book may not be sufficient by itself to learn how to apply the principles.
The best way to use this is in conjunction with code reviews.

One of the best ways to improve design skills is to learn to recognize red flags. Red flags mean the signs that a piece of code is probably more complicated than it needs to be.

Even if you learn design ideas, you must use them with moderation and discretion because if you take them to their extreme, you will probably end up in the wrong place.


# Next
I want to introduce chapter 2 of this book.
Thanks.