teleren/devto huggingface dataset:
Advent of Code 2021 - Day 23
Published: 2021-12-23 12:07:29

---
title: Advent of Code 2021 - Day 23
published: true
description: In this video series, I try to challenge myself with the Advent of Code trials. Each solution will be published to Github, and I hope you will learn something from my coding mistakes and perhaps send some code my way on how you have done these challenges. I know by reading code, so this is such an exciting thing for me.
tags:
cover_image: https://i.ytimg.com/vi/WsgA5uUT7OI/maxresdefault.jpg
---

{% youtube WsgA5uUT7OI %}

In this video series, I try to challenge myself with the Advent of Code trials. Each solution will be published to Github, and I hope you will learn something from my coding mistakes and perhaps send some code my way on how you have done these challenges. I know by reading code, so this is such an exciting thing for me.
Advent of Code 2021 - Day 22
Published: 2021-12-23 12:07:15

---
title: Advent of Code 2021 - Day 22
published: true
description: In this video series, I try to challenge myself with the Advent of Code trials. Each solution will be published to Github, and I hope you will learn something from my coding mistakes and perhaps send some code my way on how you have done these challenges. I know by reading code, so this is such an exciting thing for me.
tags:
cover_image: https://i.ytimg.com/vi/MghReARc6gw/maxresdefault.jpg
---

{% youtube MghReARc6gw %}

In this video series, I try to challenge myself with the Advent of Code trials. Each solution will be published to Github, and I hope you will learn something from my coding mistakes and perhaps send some code my way on how you have done these challenges. I know by reading code, so this is such an exciting thing for me.
Design Projects to practice with visual examples
Tags: design, ux, uiweekly, challenge
Published: 2021-12-23 11:56:46

I strongly believe that practice makes perfect and that well suits with every skill we learn.

Here i curate 15 different projects from various domains where you can practice designing or developing with example visuals that will blow up your mind. 

**1.Product Showcase Application **

Example visual:


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

**2.Task Management Application **

Example visual:


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

**3.Movie player Application  **

Example visual:


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

**4.Subscription Management Application  **

Example visual:

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

**5.payment transaction Application **

Example visual:

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

**6.Virtual meet Application **

Example visual:

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

**7.Ecommerce application **

Example visual:

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

**8.Money Tracker Application **

Example visual:

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

**9.Tutor Finder Application **

Example visual:

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

**10. VPN application **

Example visual:

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

**11.Podcast Application **

Example visual:

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

**12.File Manager **

Example visual:

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

**13.DOC finder Application **

Example visual:

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

**14.job Finder Application **

Example visual:

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

**15.Event Manager Application **

Example visual:

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

Thanks Much for reading, Do share your feedback. Happy to hear it out :)
How to get hired as a freelance Java Developer?
Tags: javadeveloper, programming
Published: 2021-12-23 11:55:38

To get hired as a freelance Java developer, you first need to check for the roles and responsibilities of a Java developer and the skills required for each role. Then you can set your path and start working on it. Even if you want to explore more than one role or opportunity then also you need to follow the same procedure for each role of your choice and set the different roles based on your preference in decreasing order, and then start working on each of these. For this, one of the key features is time. For learning about the roles and responsibilities of a particular role minimum time should be allocated because after that your major time will be involved in learning those skills.

If you are a freelancer with some experience in Java then you can directly go for advanced Java skills and relevant roles. The steps to get hired as a Java developer include:

Enrollment in a relevant course, e.g., Computer Science Engineering
Getting details about various roles and responsibilities offered to a Java developer
Gathering information about skill sets required for a particular role
Complete your learning
Practice your skill sets by undertaking different projects. You can also get a wide variety of projects on Eiliana
Cross-verify your outputs by testing them
Verify your Java Developer’s domain of interest, e.g., developer, engineer, project lead, designer, tester, etc.
Search for Java Developers’ job opportunities via different platforms. Eiliana is one of the best platforms for this purpose
Connect with clients who select your profile
Get selected

To get hired, make sure that you have learned all the relevant skills for that particular project and you have good practice and confidence. The best platform to find quality clients is Eiliana!
block element and inline element 
Published: 2021-12-23 11:52:46

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

```html
<p>This paragraph is a block-level element; its background has been colored to display the paragraph's parent element.</p>
```

```css
p { background-color: #8ABB55; }
```
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hsgxriwb3a22vitf6ucg.png)
 
inline elements example : 
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8me3d1nu9nbfawstmvz4.png
)

```css
.highlight {
  background-color:#ee3;
}
```

```html
<div>The following span is an <span class="highlight">inline element</span>;
its background has been colored to display both the beginning and end of
the inline element's influence.</div>
```
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tua5k6mqkygy5kkzrjyc.png)
Website make only html and css
Published: 2021-12-23 11:44:24

Hello everyone i'm new student in front-end dev 
And i make this website with only html and css
Waiting for your opinions and criticism
Live preview : 
https://elhoussnimed.github.io/gabooo-templace/
Link for the repositry in github :
https://github.com/elhoussnimed/gabooo-templace
Thank you
Docker Hot Tips
Tags: docker, linux, webdev
Published: 2021-12-23 11:42:56

These tips will be useful for developers who are already familiar with docker and understand the fundamental principle behind it. In my opinion, these are the hottest tricks for the newcomer who for some reason has not yet memorized these commands.

_PLC - Peace! Love! Code!_

### Docker build container

```
docker build ./ -t "<name>:<version>" --platform=linux/amd64
```

### SSH into a container

```
docker exec -it <mycontainer> bash
# or
docker exec -it <mycontainer> sh
```

### Remove: all containers & all images

```
# List all containers (only IDs)
docker ps -aq

# Stop all running containers
docker stop $(docker ps -aq)

# Remove all containers
docker rm $(docker ps -aq)

# Remove all images
docker rmi $(docker images -q)
```

---

### docker-compose build

```
# --build-arg ENV_VAR=<value> - add args
docker-compose --project-name "<name>" build \
--build-arg ENV_VAR=<value>
```

### docker-compose up

```
# -d - Detached mode: Run containers in the background
docker-compose --project-name "<name>" up -d
```

### docker-compose down

```
docker-compose --project-name "<name>" down
```

---

### Use for notes: 
https://notepad.site/
A lookout on JWT
Published: 2021-12-23 11:40:20

Today we are going to explore a very interesting topic called JWT!! Its full version is Jason web token.  So what actually JWT is, you might be wondering. Well it is a simple yet a very strong way of verifying a user of any json data. This approach is very helpful during two party interaction. We might want to authenticate the person whom the data is sent to. JWT spares us from the repeated action of sending private credentials on every request. Life gets a bit simpler with this right? :D 

So how does JWT work? It is basically an encoded URL string that can contain any amount of data and it is made secure by making it cryptographically signed. Servers generally use these tokens and they can label it as trusted as the data has been signed from the source. No other party in between can have access to it or modify it. 

However, the data we are sending it is only verifying the ownership of the data. If any one intercepts the data they can easily see the data we are sending. It is because the data is serialized and the data is still not encrypted. To make the data protected we have to encrypt the data. So to overcome this situation it is recommended to use JWT with HTTPS.

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

This is how a JWT token looks after encryption. No one can modify this let alone read the data unless they decode it. Although, we can use JWT.io to decode this data. 

JWT contains 3 parts: header, payload and signature. Header contains the information of the type of request and hashing algorithm data.
Payload is where all the data which we are sending.  Finally signature is used to send a secret key. The secret is the Signature held by the server in order to verify tokens and sign new ones.

We now know what JWT actually is, its purpose and what kind of information does JWT hold. Now lets look at the steps of how the process happens 
Lets consider a scenario where a user sends login request with there credentials. The server verifies the user and then assigns it a token that contains the user's identity. The token automatically is saved into local system when that user enters the application. Now when the user requests for anything that token is added with the request and sent to server. The browser then checks for tokens and if found verifies the user and authorises the user to have access to the requested data. 

This steps are always true for any kind of requests user makes inside the application. Finally when the user logs out the token is removed from the local system automatically.

JWT makes server to server authorization easy. However we should not use it as session token as JWT has large scope and there are alleyways to make mistakes. Moreover, we can not remove the tokens at the end of the session as there is no central authority to invalidate them.

We also should not use it with cookies as it will increase the size of the overhead of the request. 

That's all for it today folks!!!
React Concepts 
Tags: react, beginners, writing
Published: 2021-12-23 11:35:36

Context Api - Context API is a method that allows passing data through the component tree and not necessarily pass props in respective hierarchy .
Typically data is passed from the topmost parent towards the immediate child and the child pass it to its child gradually .
Context api brings a next level solution to this issue 

Hooks and Custom Hooks - Hook is a system of let one use state and other react features without writing a class . for example , useState , useEffect 
On the other hand custom hooks are javascript function whose nam starts with “use” and that may call other hooks. Custom hooks are a convention that naturally follows from the design of Hooks , rather than a react feature .

> Optimize React Application Performance - React does many things to rebuild performance made by this tech . There are several ways to speeding up the react application .
Use of production build - you can test your app with the minified production build. React dev tool in chrome will help in this issue .
Create react app - is used for creating react application
Single file builds -  only  react files along with .production .min.js are suitable for production.
Brunch - install terser-brunch plugin for efficient brunch production build .
Browserify - install plugins  envify to ensure right build environment  is set , uglifyify for removing development imports 
Webpack - webpach v4 will minify the project code by default in production mode .
Virtualizing long lists - rendering small set of data at a time this method is called windowing . react-window and react-virtualized are popular windowing libraries .
Avoid reconciliation - react is an advanced intelligent web developing technology that renders only the necessary part of the components and avoids unnecessary rendering of  component elements it creates efficiency in user experience .
Decentraland Vs Sandbox — Battle of Metaverses

Tags: decentraland, sandbox, metaverses, cryptocurrency
Published: 2021-12-23 11:34:44

Incredibly, the COVID-19 pandemic exposed the world to its virtual side. In addition, it was, the name change of Facebook in 2021 to Meta in 2021 caught the attention of the world and made the ‘ Metaverse’ an unresolved issue.
Between these debates and discussions, those from the blockchain and cryptocurrency industry began to make it an actuality.
Source:https://medium.com/buyucoin-talks/decentraland-vs-sandbox-battle-of-metaverses-663f4197a7fc
Why is your employer keen on keeping strangers out?
Tags: security
Published: 2021-12-23 11:26:23

If you saw Santa in your office you will know that he does not work there, did you challenge him, his ID and purpose for being there?

The scary truth is that some 75%+ cyber attacks start with an altogether more human act of social engineering. The act of hacking people by manipulation IRL, phishing etc.

A rule following employee who follows everything without question is going to leave a door open if there is a note signed by the manager, they are an easy target.
Even simple things your publicly available benefits plan can be used to exploit and gain access: An MOT (car repair) service plan in the car park, could get a thief through the gates, and you would not bat an eye. Thats one step closer to  key-logger in the back of a USB port, then, you're toast. 

Anyway Happy Christmas
jQuery Validation [Number]
Tags: javascript, validation, beginners, programming
Published: 2021-12-23 11:18:38

**Here is simple jQuery validation.**

HTML code:
```
<form id="formId" method="post">
<div class="body">
<input class="form-control text-right" type="number" name="fieldName" min="0" max="1000" />
</div>
<div class="footer">
<button type="button" onclick="clearValidation()" class="btn btn-sm" >Cancel</button>
<button id="btnSubmit" type="button or submit" class="btn btn-sm">Submit</button>
</div>
</form>
```
Put this code on document ready.
```
$("#formId").validate({
        rules: {
            fieldName: {
                required: true,
                number: true,
                min: 1
            }
        },
        messages: {
            fieldName: {
//Custom messages
                required: "Required",
                min: "Value must be greater than 0"
            }
        }
    });
```
Check if fields are valid according to rules defined above:


```
var form = $("#formId");
    if (form.valid()) {
        //do something...
    }
else
{
return;
}

```
This is code for removing validation on form.

```

function clearValidation() {
    var form = $("#formId").validate();
    form.resetForm();
}
```
Find React Areas Of Exploration
Tags: beginners, react, tutorial, javascript
Published: 2021-12-23 11:12:31

Hello Everyone, Today We Will Discuss About SOME React Areas Of Exploration. We Have a Perfect Name For This BLOG, Which is called, Free Fire React Areas Of Exploration. Sound Cools. **Let's Start**,

### React Component lifecycle

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vt4too4wkcp6rgzzodgx.png)
 
Each component in React has a lifecycle which you can monitor and manipulate during its three main phases. Mounting, Updating, and Unmount. This is referred to as a component lifecycle. This method is a built-in method in React.

### Custom hook

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3mpqgcap88bjz6peexxn.png)
 
Custom Hooks offer the flexibility of sharing logic that wasn't possible in React components before.

### Higher order component

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/68axq1dja3ws5lie6qx7.png)
 
Higher order Component is an advanced technique in React for reusing component logic. And It is not part of the React API. 

### Features of React

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/veoh4ql9gxprzw78t16l.png)
 
The Major Features of ReactJs is a virtual DOM. React uses server-side rendering. And ReactJS follows unidirectional data flow or data binding.


### Limitations of React

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c7077erroixbuctxs7v9.png) 
 
The Limitations of React are React is just a library, not a full-blown framework. Its library is very large and takes time to understand. And It uses inline templating and JSX.

### Why can’t browsers read JSX

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/djl4dnvb70uaues7kk8z.png)
 
Browsers can Only Read JavaScript Objects BUT JSX is not a Regular JavaScript Object.  We Have To Transform JSX with Babel For Pass in The Browser.
Forcing an app out of memory on iOS
Tags: ios, tutorial, productivity
Published: 2021-12-23 11:11:14

I’ve recently been working on a background uploading feature for an app. One of the key aspects to get right with a feature like that is to correctly handle scenarios where your app is suspended by the system due to RAM constraints or other, similar, reasons. Testing this is easily done by clearing the RAM memory on your device. Unfortunately, this isn’t straightforward. But it’s also not impossible.

Note that opening the task switcher and force closing your app from there is not quite the same as forcing your app to be suspended. Or rather, it’s not the same as forcing your app out of memory.

Luckily, there’s somewhat of a hidden trick to clear your iOS device’s RAM memory, resulting in your app getting suspended just like it would if the device ran out of memory due to something your user is doing.

To force-clear your iOS device’s RAM memory, go through the following steps:

1. If you’re using a device without a home button, enable Assistive Touch. If your device has a home button you can skip this step. You can enable Assistive Touch by going to **Settings → Accessibility → Touch → Enable Assistive Touch**. This will make a floating software button appear on your device that can be tapped to access several shortcuts, a virtual home button is one of these shortcuts.

![Settings window for accessibility -> touch -> assistive touch](https://www.donnywals.com/wp-content/uploads/IMG_0091-1024x715.png)
    
2. In a (somewhat) fluid sequence press **volume up**, **volume down**, and then hold your device’s **power button** until a screen appears that allows you to power down your device.
3. Once that screen appears, tap the assistive touch button and then press and hold the **virtual home button** until you’re prompted to unlock your device. You’ve successfully wiped your device’s RAM memory.
    
![Shut down screen with assistive touch actions visible](https://www.donnywals.com/wp-content/uploads/IMG_0092-1024x715.jpg)
    

Being able to simulate situations where your app goes out of memory is incredibly useful when you’re working on features that rely on your app being resumed in the background even when it’s out of memory. Background uploads and downloads are just some examples of when this trick is useful. 

My favorite part of using this approach to debug my apps going out of memory is that I can do it completely detached from Xcode, and I can even ask other people like a Q&A department to test with this method to ensure everything works as expected.
Your Game
Published: 2021-12-23 11:09:13

When I was in college I had made up my mind that I wanted to do something good with my career and being a gamer geek my inclination was always towards the games. Earlier, game development was not that popular, hence I made lots of efforts to get to the root of this domain.
Back at that time, all the games that were present in the market were pure gems, they had the spark that would have allowed the user to sit in some corner and spend hours playing that, the games nowadays are no different. Perhaps with the evolution of time, a new era of gaming took birth which spread the gaming environment globally into the hearts of many. I have been in this industry for the past 10 years and now when I look back I think that I made the right choice and that joy had made me contribute more towards this sector.
In my free time I like to play WarCraft, Destiny 2 and I know what situations there are in the game when I cannot pass a certain level for a long time. At the company that I work for - [Leprestore](https://leprestore.com/wow-us/boost/character-leveling/), can provide assistance at any time if you are struggling or got stuck. Leveling boost, character boost, class boost, gear boost, profession boost, craft boost - they will do it all quickly and professionally.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ansrjvne37u7ryf0zhmb.jpg)
Contact Me Animation
Tags: codepen
Published: 2021-12-23 11:08:44

<p>Based on a <a href="https://dribbble.com/harunpehlivan</a> by <a href="http://thewebwall.glitch.me/">HARUN PEHLİVAN </a>.</p>

<p>Click on the "Contact Me" button to see it in action.</p>

{% codepen https://codepen.io/harunpehlivan/pen/JjJZGXa %}
Inverting a Binary Tree
Tags: binary, tree, invert, python
Published: 2021-12-23 11:06:41

**Binary Tree:**
```         
         (4)
        /  \
       /    \
     (2)    (7)                  
     / \    /  \
    /   \ (6)  (9)
  (1)   (3)
```
Inverting a Binary tree means mirroring the tree, i.e, swapping the children from left to right and vice versa.

**Inverted Binary Tree:**
```
         (4)                         
        /  \
       /    \
     (7)    (2)                    
     / \    /  \
    /   \ (3)  (1)
  (9)   (6)
```
This can be easily achieved using recursion,

**Code:**

```
tree = {
    4: [2, 7],
    2: [1, 3],
    7: [6, 9],
    1: [],
    3: [],
    6: [],
    9: []
}


def invert_tree(tree, node, path=[]):
    if tree[node]:
        path.extend(tree[node][::-1])
        invert_tree(tree, tree[node][1], path)
        invert_tree(tree, tree[node][0], path)
    return [node] + path
```