teleren/devto huggingface dataset:
Starting Problem Solving Again
Published: 2022-10-13 15:39:10

I started doing problem solving at the beginning of my first year. Then the corona hit, the lockdown started. Lost all motivation to code and do anything productive. Spent my days playing games and watching animes or web series. 
Three years later I have nothing but regrets. Well, and some skills with Unity, digital arts, Illustrator, photoshop and ricing Linux.
So, here I am again, after 3 years, starting competitive programming again, to better myself.
Also starting this blog to record myself.
Q&A Session on Discord
Tags: opensource, microservices, embedded, luos
Published: 2022-10-13 15:32:57

🔴 On Tuesday, we held our second live Q&A session on Discord and it was a pleasure to exchange with all of you!

If you missed it or want to watch it again ⏩ [here](https://www.youtube.com/watch?v=I2dsTqB-7Jk) is the recording.
Analyze Lua Memory Leak With Systemtap
Tags: luajit, openresty, nginx, systemtap
Published: 2022-10-13 14:59:56

The memory used by lua codes is managed by the GC, not calling `malloc/free` directly. The luajit GC uses mark-and-sweep algorithm. In simple words, it will links all gc objects in a global list. When the memory is in pressure, it would trigger recycle procedures. Note that because of single-threading design, the GC is interspersed in the flow of lua codes (either compiled
or interpretered), e.g. after string allocation. GC would try to check if the gc object is still in used, e.g. as an upvalue, reside in a stack. The GC would sweep all dangling gc objects at the end, and the corresponding memory would be freed and returned to C allocator.

In luajit, `lj_alloc_malloc` and `lj_alloc_realloc` would allocate gc objects, and `lj_alloc_free` would free them. So naturally, we could trace the invocations of these functions to check memory leak.

Note that triggering gc is a bit uncertain and the gc steps would be splited in different time slices.  So it would not free unused memory immediately. Moreover, the lua codes may use caches. So it's necessary to check the codes to distinguish the real memory leak.

Please check my blog site:

http://luajit.io/post/2022/analyze-lua-memory-leak-with-systemtap/
Is it OKAY to publish Daily Journal on Dev.to ?
Tags: discuss, watercooler, design, beginners
Published: 2022-10-13 14:58:54

What you think, Please respond here 👇


[![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/frmcluwmeedrs5utqp92.png)](https://twitter.com/thevedicdev/status/1580573140455149568)
My first game in JavaScript...
Published: 2022-10-13 14:55:33

SO I made a game, but this was for my computer science class with **CodeHS.** It is fairly simple with just pressing the ball that has different colors on it. 

_**Colors for the ball in the code:**_

//Red
//Yellow 
//Green

## 
**//THE CODE
**

`var RADIUS = 100;
var OFF_SCREEN = -200;
var DELAY = 600;
var ball;
var score = 10;
var scoreText;
var WIN_SCORE = 20; 

//Starts the program start code
function start(){
    setUpBall();
    setTimer(changeBall, DELAY);
    mouseClickMethod(clickHandler)

    scoreText = new Text(score);
    scoreText.setPosition(0, getHeight())
    add(scoreText)
}

function clickHandler(e){
    var elem = getElementAt(e.getX(),e.getY());
        if(elem != null && elem.getColor() == 
        Color.green){
                println("Great!")
                score++;
        }else{
            println("Fail.")
            score--;
        }

        if(score == 0){
            displayMessage("You Lose :(");
        }
        if(score == WIN_SCORE){
            displayMessage("You Win!!! :D");
        }

        scoreText.setText(score);
}

function displayMessage(text){
    stopTimer(changeBall);
    var msg = new Text(text);
    msg.setPosition(getWidth()/2 - msg.getWidth()/2
    ,200)
    add(msg)

}

//Sets up the ball for the game to be used with. 
function setUpBall(){
    ball = new Circle(RADIUS);
    ball.setPosition(OFF_SCREEN, OFF_SCREEN);
    add(ball);
    
}
//Makes the ball go in a random position every 500 milliseconds
function changeBall(){
    var x = Randomizer.nextInt(ball.getRadius(),
        getWidth() - ball.getRadius());
    var y = Randomizer.nextInt(ball.getRadius(), 
        getHeight() - ball.getRadius());
        
        
        ball.setColor(Randomizer.nextColor());
        

        
        ball.setPosition(x, y); 
        changeColor();
}
/*changes the color of the ball from red to yellow when it
moves every time to a new position.*/ 
function changeColor(){
    var colorCode = Randomizer.nextInt(0, 2);
        var color;
        if(colorCode == 0){
            color = Color.red;
        }else if(colorCode == 1){
            color = Color.yellow;
        }else{
            color = Color.green
        }
        
        ball.setColor(color);
}`


The Result
----------------------------------------------------------
----------------------------------------------------------
https://codehs.com/sandbox/id/my-first-javascript-game-vQE9Su/run



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


Thanks! :D
code book
Published: 2022-10-13 14:51:05

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
</html>
#MSIgnite – Power Automate with AI powered copilot capabilities
Tags: englishpost, openai, powerautomate
Published: 2022-10-13 17:42:20

---
title: #MSIgnite – Power Automate with AI powered copilot capabilities
published: true
date: 2022-10-13 14:49:33 UTC
tags: EnglishPost,EnglishPost,OpenAI,PowerAutomate
canonical_url: 
---

Hi !

During this Microsoft Ignite 2022, we had a lot of annoucements about super cool features. As an (long-time) AI and (newly) Low Code – No Code enthusiast, this one goes directly to my top 3:

<iframe width="750" height="422" src="https://www.youtube.com/embed/9lnDnxLcis4?version=3&amp;rel=1&amp;showsearch=0&amp;showinfo=1&amp;iv_load_policy=1&amp;fs=1&amp;hl=en&amp;autohide=2&amp;wmode=transparent" allowfullscreen="true" style="border:0;" sandbox="allow-scripts allow-same-origin allow-popups allow-presentation"></iframe>

How cool is this? For me, 5 stars ⭐⭐⭐⭐⭐

And if you are wondering how this works, is as easy as:

#### Describe it and let AI build it

The main idea is to save time for the final user. Using the new “Describe it to design it” template, we can jump right in and get started.

![Template 1st step](https://brunocapuano.files.wordpress.com/2022/10/image-2.png?w=1024)

We just write a description using everyday language and Power Automate then uses OpenAI Codex to translate this description into code, and provides a list of corresponding flows that you can create instantly.

In example, let’s take a look at the following sentence

#### Send me an SMS for every email from my manager

And the suggested outputs includes an option sending a notification using the mobile Flow application, and also a 3rd party integration using Twilio.

![](https://brunocapuano.files.wordpress.com/2022/10/image-3.png?w=902)

We can check the details of the suggested flow, and check the suggested trigger and actions.

![](https://brunocapuano.files.wordpress.com/2022/10/image-4.png?w=338)

And we are almost there. I’ll skip the last 2 steps, so you can test it.

And if you want to know more please take a loot at

#### [New ways to innovate with AI and Microsoft Power Automate](https://powerautomate.microsoft.com/en-gb/blog/new-ways-to-innovate-with-ai-and-microsoft-power-automate/)

Happy coding!

Greetings

El Bruno

More posts in my blog [ElBruno.com](https://www.elbruno.com).

* * *
WSL2 Terminal On jetbrains Fleet
Published: 2022-10-13 14:38:50

Not going to tell you story, Just go to the setting then click on show settings.json

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9vq51mfpi676w5wcoiku.png)
now copy and paste this :
`{
    "terminal.profiles": [
        {
            "program": "C:\\Windows\\System32\\wsl.exe",
        }
    ],
}`
if it's not working for you, probably path to wsl.exe is different for you, just change it and all good.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/iv6q5iksuno44vy7hqmt.png)
if you like this tutorial, don't forget to like or upvote or whatever this site has.
# #Fleet #IDE #jetbrains #jetbrains_Fleet
Java Efetivo Essencial - Imutabilidade
Tags: java, programming
Published: 2022-10-13 14:36:00

## Reduza a mutabilidade das classes ao minimo

_Esta é uma série baseada no entendimento de tópicos relacionados ao livro com foco no resumo._

**Imutabilidade**

 Uma classe que não permite que suas instâncias sejam modificadas é considerada uma classe imutável. Ou seja, cada informação contida em um objeto durante seu ciclo de vida não é modificado.
Existe uma facilidade em projetar, implementar e utilizar classes IMUTÁVEIS, além de promover uma maior segurança e evitar muitos erros decorrente da alterações de objetos durante seu ciclo de vida.

**Receita para classe Imutável**

1 - Não forneça métodos que modifiquem o estado do objeto(mais conhecido como setters);
2 - Garanta que a classe não possa ser extendida(quando tornamos a classe final);
3 - Faça com que os campos/atributos sejam finais e privados;
4 - Não deixe que campos/atributos mutáveis sejam acessados por suas referências; 

**Na prática**

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


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

**Como Resolver**
No caso anterior podemos realizar cópias defensivas, para gerarmos uma nova referência e não expor a referência que esta no objeto.

```java
public Servico getServico() {
        Servico servicoRetorno = new Servico();
        return BeanUtils
           .copyProperties(servicoRetorno, servico);
}
```

**Mais sobre**

Os objetos imutáveis são thread-safe, não exigem sincronização, o que é muito posivito em cenários de paralelismo, ou seja, quando várias threads acessam o mesmo objeto simultâneamente.
É interessante também que essas classes podem implementar o método static factory e reutilizar instâncias existentes da mesma classe.

**Vantagens**

Os objetos imutáveis são ótimos para construir novos objetos. Pois garantimos que esse objeto não mudará.
Os objetos imutáveis fornecem atomicidade de falha de graça,pois o estado nunca muda, o que evita inconsistências geradas por mudanças no estado do objeto.

**Desvantagens**

Porém uma desvantagem é que muitas vezes quando precisamos fazer modificações do objeto, por ser imutável precisamos gerar cópia dele e por isso em cenários onde temos que realizar multiplas vezes alterações precisaremos gerar muitas cópias e isso dependendo do volume de objetos ser um ponto de atenção em relação a performance.

**Finalizando**

Nem sempre conseguimos garantir que a classe seja 100% imutável, mas restringirmos a mutabilidade pode ser uma boa abordagem.
Evite a criação de setters a menos que haja necessidade.
Em classes imutáveis precisamos garantir que os construtores recebam todas as informações para construir o objeto.
Animated Portfolio Website HTML CSS JS | No Frameworks
Tags: javascript, css, beginners, tutorial
Published: 2022-10-13 14:35:45

{% youtube jOA6ROBXdRE %}

How to Build Build an Aminated Portfolio Website HTML CSS JS | Without any framework

This video will show you how to build an animated portfolio website using html css javascript

[Github Repo](https://github.com/codewithsadee/richard-ryan)

---

HI 👋
I'm Sadee (webdev)
In this channel I make videos about Complete Responsive website.
You can checkout my channel 👇

📺 My Channel : [codewithsadee](https://www.youtube.com/channel/UC1PZHWV6VvICTL1LgFUZq6g)
🔔 Subscribe : [subscribe now](https://www.youtube.com/channel/UC1PZHWV6VvICTL1LgFUZq6g?sub_confirmation=1)

---

🔗 Essential links
-----------------------------
[Download the starter file to practice](https://drive.google.com/file/d/1QDmslnGquOlkGmuOZYtDx7hO0iKuohH4/view?usp=sharing)

---

⏱️ Timestamps
-----------------------------
0:00 - Demo
6:06 - Download the sturter file before starting project
6:21 - File structure
7:21 - Project initial
15:08 - HTML - Preloading
16:10 - CSS - Preloading
20:10 - JS - Preloading
21:41 - HTML - Header
26:09 - CSS - Header
38:25 - JS - Header
43:29 - HTML - Hero section
45:43 - CSS - Hero section
49:53 - JS - Hero text animation
1:03:28 - HTML - Gallery section
1:09:21 - CSS - Gallery section
1:21:22 - HTML - Category section
1:26:03 - CSS - Category section
1:28:18 - HTML - About section
1:33:01 - CSS - About section
1:36:57 - HTML - Service section
1:40:14 - CSS - Service section
1:45:36 - HTML - Portfolio section
1:50:00 - CSS - Portfolio section
1:53:56 - HTML - Footer
1:59:18 - CSS - Footer
2:04:48 - HTML, CSS - Back to top 
2:08:18 - JS - Back to top
2:12:19 - CSS - Scroll reveal
2:14:23 - JS - Scroll reveal
2:17:53 - Media queries
2:42:33 - Custom cursor
2:51:39 - Media queries

---

[![Become a patreon](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fnjl14kdm5qf08hu5lop.png)](https://www.patreon.com/bePatron?u=62535867)
DPS909 Blog :Second contirbution in HACKTOBERFEST
Tags: opensource
Published: 2022-10-13 14:28:19

Hey everyone, thanks for reading my Blog post. This post is regarding my second contribution to the [HACKTOBERFEST](https://hacktoberfest.com/).

## Overview
In Release 0.2 we were asked to participate in the Hactoberfest so that we could contribute to real open source projects. Furthermore, the main goal of this release is to help you gain experience and confidence in contributing to open source projects through direct involvement in a number of real projects.

## Finding right Open Source Projects
For my second contribution to an open source project i have chosen this Repo on  [github](https://github.com/Diptenusarkar/html.org.in).

[html.org.in](https://www.html.org.in) is an open-source HTML learning website which contains all the information about latest Html5 features and how to use them.

## Issue
Issue which i have found in [html.org.in](https://www.html.org.in) is about the spelling errors on their websites.

Link to [issue-17](https://github.com/Diptenusarkar/html.org.in/issues/17)

In this issue I have to find and fix all `typo errors on their websites on all the linked html pages.`

## Pull Request
After fixing all the errors on their html page i have created this [PR](https://github.com/Diptenusarkar/html.org.in/pull/30).

## Conclusion

Working on Open source projects has really helped me a lot to learn about the new way and let me gain some experience on how to work on open source projects.

`Thanks`
Looking for an entry level Web Developer role.
Tags: webdev, javascript, python, react
Published: 2022-10-13 14:23:48

Hey Everyone!
I'm a Full-Stack Developer specializing in React ,Flask and Springboot.
Hands-on experience on In demand Tech-Skills:
HTML, CSS, JavaScript, Java, python, Styled-Components, React, machine-learning, Redux, Axios, Rest APIs, GraphQL, MySQL, SpringBoot, Agile, Git.

My Stack:
React, SpringBoot, Flask, MySQL

Email: mkhue47@gmail.com
My Portfolio: [portfolio-site](https://mkhue.vercel.app)
LinkedIn: [linkedIn-Profile](https://www.linkedin.com/in/mkhululi-ndlovu-28ab9b248)
GitHub: [github-code](https://github.com/mk870)
Day22-23 of #100DaysOfCode
Tags: nextjs, github, css, webdev
Published: 2022-10-13 14:18:28

Woohoo! I finally finished coding the website!

I finished all of the data fetching, cleared out all of the small bugs and warnings that occurred during npm run build.

Now the website is working as I wanted locally.  Can’t wait to see it on the web!

Unfortunately when I tried to deploy using Vercel (supposed to be easy because I setup my github account a few days back), Vercel couldn’t load my github repo and it showed errors.

Been trying it for a few hours and still couldn’t connect. 😭

I guess I need to try it again tomorrow.

Hopefully my first site will be online by tomorrow!
AWS-CDK Custom constructs
Tags: aws, awscdk, construc, node
Published: 2022-10-13 13:36:50

CDK constructs are cloud components. We use constructs to encapsulate logic, which we can reuse throughout our infrastructure code.
AWS also defines Constructs as they are the basic building blocks of AWS CDK apps. A construct represents a "cloud component" and encapsulates everything AWS Cloud Formation needs to create the component.

```
import * as s3 from 'aws-cdk-lib/aws-s3';
import { Construct } from 'constructs';
import * as cdk from 'aws-cdk-lib';

export class s3BucketConstruct extends Construct {
  public readonly s3Bucket: s3.Bucket;

  public constructor(scope: Construct, id: string) {
    super(scope, id);

    this.s3Bucket = new s3.Bucket(scope, `sample-s3-bucket`, {
      // Block all public access
      blockPublicAccess: s3.BlockPublicAccess.BLOCK_ALL,
      // When stack is deleted, delete this bucket also
      removalPolicy: cdk.RemovalPolicy.DESTROY,
      // Delete contained objects when bucket is deleted
      autoDeleteObjects: true,
    });
  }
}
```

This is how we can create custom construct. 
You can also refer https://kuchbhilearning.blogspot.com/2022/09/aws-cdk-custom-constructs.html
Tagged Union Types
Tags: typescript, beginners, programming, webdev
Published: 2022-10-13 14:18:17

Union types with a common tag. And whats special with these tags is that they help in discriminating  the types which are combines to make the union type.

For example lets create three shapes circle, rectangle, triangle .

```typescript
interface Circle {
	type: 'circle';
	radius: number;
}

interface Rectangle {
	type: 'rectangle';
	height: number;
	width: number;
}

interface Triangle {
	type: 'triangle';
	height: number;
	width: number;
}
```

Now lets create a union type with it 
```Typescript
type Shapes = Circle | Rectangle | Triangle
```

The benefit of having a property which is discriminating from all interfaces is that it helps in narrowing down the type while using it.

Practically, let's define a function which returns area of the Shapes passed in 
```Typescripts
const area = (shapes: Shapes) {

}
```

Now if you accessing shapes , it won't provide all properties in each interfaces rather it would provide the property which is common in all interfaces .
![](https://i.imgur.com/1m4lI4N.png)

Which is actually a good thing because we can use this to narrow down our types . Which essentially means the discriminated property acts as a **type guard** .So now lets narrow down our types using a switch statement 
![](https://i.imgur.com/EyoCHkB.png)

Since we are discriminating using the common property within the interfaces, now typescript can easily differentiate interfaces within the union type .
![](https://i.imgur.com/G08F7EQ.png)
Digitizing human consciousness
Published: 2022-10-13 14:03:26

It sounds like science fiction, and as things currently stand, it is. Despite recent advances in both neuroscience and computing, we’re nowhere near being able to digitize a human brain — but many futurists are hoping we’ll get there within the next few decades. There’s even a nonprofit organization called the 2045 Initiative that’s dedicated to making it happen by (you guessed it) 2045.

http://2045.com/

_**“If we build this brain right, it will do everything… When I say everything, I mean everything.”**_
API Gateway and Cloud Front in the same domain with different path
Published: 2022-10-13 13:56:04

This is a very useful feature where we can have both cloudfront and api gateway in the same domain.

Cloudfront has a beautiful feature of origins and behavior with which we can redirect to specific resource based on certain pattern.

This is in assumption that already api gateway and cloudfront is created along with route53 configurations.

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

First we will create origin for pointing to S3 bucket.

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

Save the configurations.

Later verify that we have new S3 origin.

Let's create another origin pointing to api gateway.

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

We now want to create the behavior and attach the origin to it.

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

We have successfully created the behaviour, default is pointing to S3 bucket.

You can also check https://kuchbhilearning.blogspot.com/2022/10/api-gateway-and-cloud-front-in-same.html
What is E2E?
Tags: e2e, beginners
Published: 2022-10-13 13:56:00

## Image before study

I don't know

## Study

### What is E2E?

It stands for end to end.
In IT, it often refers to the entire pathway connecting two parties in communication.

### End-to-end principle

One of the network design concepts is the `end-to-end principle.
This means that advanced processing such as communication control and error detection is done in the end system, while simple processing and relaying is done on the network path.
The end-to-end principle is that advanced processes such as communication control and error detection are performed by the end systems, and only simple processing and relaying are performed on the network paths.

Another related term is `E2EE (end to end encryption)
messages, etc., are all encrypted from one end to the other.
This encryption method is highly anonymous because only the sender and receiver can view the message.

## Image after study

I figured this one out when I thought about it!
But the thought of advanced processing at the end wasn't so much as a recognition, so I'll keep it in mind.