teleren/devto huggingface dataset:
What you didn't know about presenting screens with react-navigation
Tags: reactnative, react, tutorial
Published: 2021-09-20 22:18:58

![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/13gbp19yu15es5t5fvoo.png) 
 
Routing and Navigation in your react native apps have always been managed conveniently by [react navigation](https://reactnavigation.org/docs/getting-started/) using different navigators like the Stack Navigator. 

But do you know you can easily manage how your screens are presented by editing the stack navigation options?
This can be done using TransitionPresets imported from “@react-navigation/stack”. Let’s get right into it. First you import TransitionPresets.

![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/75ihajtl495wx0dbu05k.png)

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

From the dropdown in the image above, we have lot of options to choose from when presenting our screens. In this article, we will examine a few.

**ScaleFromCenterAndroid:** As stated in the image, this is the standard Android navigation transition when opening an activity. See in the gif bellow how it is been used in a [Dating app](https://www.quickcomponent.com/react-native-dating-app) to transition from a card to a card detail.

![image](https://miro.medium.com/max/592/0*efENFGheogt_6h5q.gif)
 

**ModalPresentationIOS:** In here, we have the standard ios modal presentation style introduced in iOS13.

![image](https://miro.medium.com/max/592/0*Lp9ePfjWuiKwalVR.gif)
 

You should note that transitions are very smooth, but reduced here since it was a gif image upload. Moving forward, you can take advantage of this TransitionPreset and try out other options on your own. In doing so, you won’t even need the modal component imported from react-native, and you will have more control on how individual screens are presented. 
See here how we have taken full advantage of this at [Quickcomponent](https://www.quickcomponent.com/app-templates) with all fully functioning templates like the [Dating app](https://www.quickcomponent.com/react-native-dating-app), [Whatsapp clone](https://www.quickcomponent.com/react-native-whatsapp-clone), [UberEats clone](https://www.quickcomponent.com/react-native-uber-eats-clone) and more.
How to Setup a Hashnode Blog Sub Domain on Netlify
Tags: hashnode, domain, netlify
Published: 2021-09-20 22:09:08

---
title: How to Setup a Hashnode Blog Sub Domain on Netlify
published: true
description: 
tags: hashnode, domain, netlify
//cover_image: https://direct_url_to_image.jpg
---

So you have a your own personal website hosted on Netlify, but want to start writing like I am and create a blog using Hashnode ? How does one do that and is it possible to setup a custom sub domain with Hashnode? The answer is yes.



1.  Login into your Netlify account and click on the domain app you want to setup a subdomain. I am choosing martinpatino.com.


![Screen Shot 2021-08-31 at 9.09.12 PM.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1630469567299/RociHByV_.png)


2. Click on **Domain Settings** button 
![Screen Shot 2021-08-31 at 9.15.38 PM.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1630469769720/hDgYsLPOM.png)

3.Under Domains and click on ** Go to DNS Panel** on the domain you want to target.
![Screen Shot 2021-08-31 at 9.19.16 PM.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1630469999864/rA6_krvVo.png)

4. Next just click on "Add a New Record" and enter the following DNS Settings and in the fields available just fill out the following 

```
Record Type: CNAME

Name: blog or any subdomain of your choice

Value: hashnode.network
```
Result: 

![Screen Shot 2021-08-31 at 9.24.52 PM.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1630470367889/OHNiViAXC.png)

That is pretty much it for Netlify so congrats on this part. Now all that is left is complete the setup on Hashnode side.

5. Under Domains in the dashboard settings you will just add custom domain such as blog.martinpatino.com. The DNS propagation can take up 24 hours to complete.

![Screen Shot 2021-08-31 at 9.41.43 PM.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1630471318477/36eTVQ74n.png)


You can see blog.martinpatino.com now hosting Hashnode custom subdomain blog ☕
DELPHI - Error: Unit not found
Tags: delphi, embarcadero
Published: 2021-09-20 22:06:49

Ir a las opciones del proyecto: Shift + Ctrl + F11

En la sección de "Delphi compiler" en la columna "Search Path" agregar las rutas:

C:\Users\Public\Documents\tmssoftware\TMS Component Pack\Delphi101Berlin\Win32\Debug;

C:\Program Files (x86)\Embarcadero\Studio\18.0\lib\win32\release;C:\DISCD\ftes.delphi2010\comun;
Day 455 : Hurray
Tags: hiphop, code, coding, lifelongdev
Published: 2021-09-20 22:00:37

_liner notes_:
- Saturday : Got up early to finish putting together the radio show. Then I worked on my quick side project. I also did my laundry and even cut my hair. Got quite a bit done before the radio show. Then it was showtime, and did the radio show. Had a good time as usual. The recording of this week's show is at https://kNOwBETTERHIPHOP.com

![Radio show episode image of a screen capture from CNN where a general from the US military giving pitiful reasons on why they murdered 10 civilians including 7 children  with the words Sept 18th 2021 Surrounded by LOVE bugs](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ennsbca16kdf6n2qv1rg.jpg)

- Sunday : Did the https://untilit.works cyphers. Got to demo my new quick side project and a thing I built for work. During the work sessions, I was able to add a status section and some time conflict checks for my scheduling app. I also got the Cloudinary upload widget integrated into my side project. I still have to fine tune it, but it's in there and working. After that, I watched "The Walking Dead" and "Talking Dead" and read a chapter in a book.

- Professional : The pull request with the changes I made to the Web Components so that they could be styled was merged. Hurray! The components I published were also approved, so I set all the versions to 1.0.0 and merged the code and republished. Had a few meetings. Worked on some last minute changes to a blog and demo I created from before. Also worked out another way to get some data on another demo application I'm working on. Pretty productive way to start the work week.

- Personal : So, I came up with yet another side project idea and the domain name I want is available. Normally, I would just purchase it and add it to my long list of domain names. This time, I'm going to see if I can build a quick proof of concept and if it works, I'll get the domain name and build it out more. That's called growth. haha

![Looking through a forest in Ardennes, Belgium with moss on the ground and rays of light coming through the trunks of the trees](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/opea3mu9lcxqcdfi2jke.png)

Going to work on my larger side project. Watch an episode of "Boruto". Read a chapter of this electronic book I bought online. It's something I've been meaning to read for years and my new phone makes reading really easy.

Have a great night!

peace piece
Dwane / conshus
https://dwane.io / https://HIPHOPandCODE.com
{% youtube 5d59F6UQDz4 %}
Sorting tags from a Git repo using semantic versioning
Published: 2021-12-09 06:03:10

---
title: Sorting tags from a Git repo using semantic versioning
published: true
date: 2021-09-20 21:10:00 UTC
tags: 
canonical_url: https://gastaud.io/en/article/git-sort-tags-semantic-version/
---

A quick post today to tell you about a recent discovery in Git's sorting functions and tags based on [semantic versioning](https://semver.org/).

By default, if you run the `git tag -l` command, Git will do an alphabetical sort.

However, this sorting gives confusing results when the tags use semantic versioning notation.

```
git tag -l
v2.6.1
v2.6.10
v2.6.11
v2.6.12
v2.6.2
v2.6.3
v2.6.4
v2.6.5
v2.6.6
v2.6.7
v2.6.8
v2.6.9
v2.7.0

```

Notice here the sequence `v2.6.10`, `v2.6.11` and `v2.6.12` which is interposed between version `v2.6.1` and `v2.6.2`.

To solve this problem, it is possible to use the `--sort` function with the `version` attribute in Git.

```
git tag --sort=version:refname

```

This will display the sorted results consistently:

```
git tag --sort=version:refname
v2.6.1
v2.6.2
v2.6.3
v2.6.4
v2.6.5
v2.6.6
v2.6.7
v2.6.8
v2.6.9
v2.6.10
v2.6.11
v2.6.12
v2.7.0

```
Racquetball Win Simulation
Tags: python, programming, computerscience
Published: 2021-09-20 21:08:10

![Console Output](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/myq4jqew8ac4a59ec7gm.png)
```python
# racquetball.py
#   This program simulates the game of racquetball between two players
#   called "A" and "B". The ability of each player is indicated by a
#   probability (between 0 and 1) that the player wins the point when
#   serving. Player A always has the first move.
#   (Derived from: Python Programming an Introduction to Computer Science)
# by: Scott Gordon

from random import random


def main():
    print_intro()
    prob_a, prob_b, n = get_inputs()
    wins_a, wins_b = sim_n_games(n, prob_a, prob_b)
    print_summary(wins_a, wins_b)


def print_intro():
    print('''This program simulates a game of racquetball between two
        players called "A" and "B". The ability of each player is
        indicated by a probability (a number between 0 and 1) that
        the player wins the point when serving. Player A always has
        the first move.
        ''')


def get_inputs():
    a = float(input("What is the probability player A wins the serve? "))
    b = float(input("What is the probability player B wins the serve? "))
    n = int(input("How many games to simulate? "))
    return a, b, n


def sim_n_games(n, prob_a, prob_b):
    wins_a = wins_b = 0
    for i in range(n):
        score_a, score_b = sim_one_game(prob_a, prob_b)
        if score_a > score_b:
            wins_a = wins_a + 1
        else:
            wins_b = wins_b + 1
    return wins_a, wins_b


def sim_one_game(prob_a, prob_b):
    serving = "A"
    score_a = 0
    score_b = 0
    while not game_over(score_a, score_b):
        if serving == "A":
            if random() < prob_a:
                score_a += 1
            else:
                serving = "B"
        else:
            if random() < prob_b:
                score_b += 1
            else:
                serving = "A"
    return score_a, score_b


def game_over(a, b):
    # Return True if game is over False otherwise
    return a == 15 or b == 15


def print_summary(wins_a, wins_b):
    n = wins_a + wins_b
    print('\nGames simulated:', n)
    print(f'Wins for A: {wins_a} {wins_a/n:0.1%}')
    print(f'Wins for B: {wins_b} {wins_b/n:0.1%}')


if __name__ == '__main__':
    main()
```

Photo by <a href="https://unsplash.com/@thomascpark?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Thomas Park</a> on <a href="https://unsplash.com/s/photos/racquetball?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Unsplash</a>
Arch linux with Realtek rtl8821ce kernel freezing when WIFI is connected
Tags: archlinux, garudalinux, linux, newbie
Published: 2021-09-20 20:58:22

If you have recently installed linux and you are facing any freezing problem when connected to the WIFI, chill up buddy. I am here for you.

Do not panic. There is nothing wrong with the distro nor your device. Just the kernel using the default wifi driver it came with. 

I would recommend you run a system update first.
```
sudo pacman -Syyu
```

If problem still persists, then follow the next instructions.

## How I Solved Mine.
* I tried installing the drivers manually.
   https://tutorialforlinux.com/2020/01/12/step-by-step-arch-linux-realtek-rtl8821ce-driver-installation-guide/

The link above should help.
For garuda linux users, you can visit the **add/Remove Software** to download the drivers.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k5sl3vjhg7z8yfpy2rxd.png)

* I went into the `/etc/modprobe.d/` folder and created a file blacklist.conf. You might have to root the folder before you can create the file.

* Inside the file I only wrote:
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x8reb5xyzcfd53bijdrw.png)

* I then went to `/etc/default/grub` and added `pci=noaer` to the kernel parameters.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sdkdi2mnu64rm1boicgf.png)

* Open terminal and run 
```
sudo update-grub
```
then 
```
sudo reboot
```

Problem solved!!! Screen freezes no more.
I hope it solves yours.
Front Matter version 4 coming soon
Tags: tooling, cms, webdev, staticsites
Published: 2021-09-20 20:13:58

Currently, I'm preparing the next major version of Front Matter - a full CMS running in Visual Studio Code. Front Matter allows you to customize it to your needs, like adding your own custom Node.js scripts to automate additional tasks.

A big PRO about Front Matter is that you get a CMS that doesn't require any account or APIs to manage your content.

In version 4 there will be a couple of big changes like:

- Content-Type support with new fields types: image, choice, date, ...
- Image selection support for your articles
- Team level settings: move your settings from the user workspace level to a higher level to share with the rest of your editors.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/molkyoeprgt9s8rqshob.gif)

It would be great if you would give Front Matter a try and a GitHub ⭐️ [the repo](https://github.com/estruyf/vscode-front-matter).

Check out the beta release notes: [v4.0.0 release notes](https://beta.frontmatter.codes/updates/v4_0_0).

[frontmatter.codes](https://frontmatter.codes)
Getting Started With Flutter
Tags: flutter, dart, 100daysofcode, beginners
Published: 2021-09-20 19:59:38

Hey guys so I started a blog over at Hashnode where I'll being speaking about various topics and I'll be taking suggestions so feel free to check it out [here](https://meshamakes.hashnode.dev/get-started-in-flutter-a-flutter-guide).

I do hope that this article was informative and helped you guys, if you have any suggestions or questions feel free.
Demystifying Spring Task Executor
Tags: java, taskexecutor, poolsize, scheduling
Published: 2021-09-20 19:58:52

`corePoolSize` vs. `maxPoolSize` vs. `queueCapacity`

```java
  @Bean
  @Primary
  public TaskExecutor taskExecutor() {
    ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
    executor.setCorePoolSize(3);
    executor.setMaxPoolSize(6);
    executor.setQueueCapacity(4);
    executor.setWaitForTasksToCompleteOnShutdown(false);
    executor.setThreadNamePrefix("my-async");
    executor.initialize();
    return executor;
  }
```

#### Core pool size
In a nut shell, `Core pool size` is the happy path.
When a new task is submitted and fewer than Core Pool Size threads are running, a new thread is created to handle the request, even if other threads are idle. If there are greater than Core Pool Size but fewer than Max Pool Size threads running, a new thread is created only if no threads are idle.

#### Max pool size
It defines the upper limit of threads that can ever be created! Once limit is reached(no thread is available), no more tasks are accepted.

#### Queue capacity
Defines the number of tasks to queue when all core pool are filled. Threads will be scalable to maximum pool size when queue is full.

#### Explain to me like I'm 5 years old

A simple and efficient way to get this is by considering yourself being in a bank.

You ever stood in a line even though there is a window available?
Why would the bank keep a customer in a queue if there are available cash-window? That's exactly the case with `core pool size`. If there are un-used threads, new tasks are directly allocated to them.

[![enter image description here][1]][1]

One the available window(core pool size) is full, customers are asked to wait in the queue. This is where the `queue-capacity` comes in picture! New tasks are keep on queueing until no more tasks can be queued.

[![enter image description here][2]][2]

What if the wait-lounge is full of customers? Bank can allocate/open new cash-windows as they see spike in number of customers(tasks). They had 3 more in reserve.
Here comes the `max pool size` in context.

Once these windows(threads) are all occupied, Bank can no longer server any new customers(tasks). Agree? And henceforth, new tasks are not accepted!

[![enter image description here][3]][3]



  [1]: https://i.stack.imgur.com/SnOAz.jpg
  [2]: https://i.stack.imgur.com/hyael.jpg
  [3]: https://i.stack.imgur.com/UfvHK.jpg
Block in JS  part-1
Tags: javascript, beginners, webdev, blockscope
Published: 2021-09-20 19:38:34

Hello Folks, Hope you are doing good. This is my first blog on javascript. I hope You find my blog interesting. If you find something wrong, please provide suggestions in the comment box. 

This is the part1 of the blog on block. Soon part2 of the blog will come which will cover block scope and shadowing in JS.

Let's discuss the topic-

Frist of all we need to learn what is the block in JS. Many a times when people are asked about the block in JS, first thought they get in mind is that block is related to let and const concept. let and const are bloced scoped but they have nothing to in this topic. 

Block is also known as "Compound statement". When we write a code, JS accepts one line code.when we combine multiple line of code into the block, JS treats that as single line code.

Suppose we need to just console single line we would have just written in following way:

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zobb77k71l8crb1uf8m5.JPG)

But, if we needed to print the value of "a" only, if loop was true then:
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uh0shszijlbujermrce2.JPG)

Basic syntax of for loop or if loop is same as mentioned below

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hpvzsjosmuie6um2s72j.JPG)

but if we want to use multiple lines inside if or for loop then we need to use block.

Basically block are commonly used in for loop, if loop, if...else loop, functions, etc.

javaScript basically accepts single line at a time but to make javaScript accept the multiple line, we combine them into a block.
3 Type Function in Javascript 
Tags: javascript
Published: 2021-09-20 19:20:17

Hello there, maybe you feel weird but today we are talking about 3 types of functions. After 2015 javascript have massive change. Bring something syntactical sugar and also more. So let's start exploring more tricky things.

We have divided the javascript function into 3 types for better understanding.

1. Normal Function: That is a very common function and we are using that every day. That has a simple syntax and is very easy to use that.
we can also pass data as a argument. 
example : 
```javascript
function showme(x){
console.log('hello world' + x) }
showme('your name');
```
2. Function expression: normal function and function expression do have not much difference between them. just have some syntax differences. After defining the function we need to call the function with any argument or without argument under a variable. That has so many advantages. we can use this function where we need it. That is very simple from normal function.
```javascript 
const f = function get (){
  return 'hello';
}
console.log(f)
```
3. Arrow function: maximum newbie programmer very confused about arrow function. The first benefit in the arrow function, that is helps to keep code more clean, clear, and understandable. If only one statement has in the function we can return that only one line code. we do not use function keywords and also return keywords. If we need to use more statements we can use that inside the second breaker. But that is not the only main thing. The main thing in the arrow function is the 'this' keyword.that is called some times Lexical 'this' keyword. Arrow function did not do something or do not access in 'this' keyword value. That's why we can use that as a call-back function in many methods. 
```javascript
normal function
const dt = {
    user: 'mahin',
    age:28,
    location:['mymensingh', 'Dhaka'],
    doAction:function(){
     this.location.forEach(function(info){
        console.log(this.user,info); // its provide error (undefined)
     })
    }
}
dt.doAction() 

// its working on another code editor
 
arrow function 
const dt = {
    user: 'mahin',
    age:28,
    location:['mymensingh', 'Dhaka'],
    doAction:function(){
     this.location.forEach((info)=>console.log(this.user,info))
    }
}
dt.doAction() // its working on other code editor
```
support: sumit saha , javascript with junaied
Lava Flow 🔥
Tags: beginners, programming, architecture
Published: 2021-09-20 18:33:45

## Haz un QuickFix/Parche, luego lo arreglamos bien. 🙅

Escribir mal un código sin una arquitectura clara desde el principio solo hará que nuestras funciones de más de 100 líneas, nuestro código sin uso, nuestros métodos no documentados o nuestros procesos mal organizados que parecían 'Código que podremos desechar en cualquier momento' se vuelva más complicado de mantener.

Conforme el sistema avanza en su desarrollo, y crece, se dice que estos flujos de lava se solidifican, es decir, se vuelve mucho más complicado corregir los problemas que originan, y el desorden va creciendo.

### Mi sistema sufre de Lava Flow?

> ⚠️ Pon atencion a las alertas. ⚠️

- Se declaran variables no justificadas.
- Se construyen clases o bloques de código muy grandes y complejas sin documentar.
- Usando una inconsistente y difusa arquitectura.
- Cuando en el sistema existen muchas áreas con código por terminar o reemplazar.
- Cuando dejamos código sin uso abandonado.
- Cuando duplicamos funciones que se diferencian apenas por un ligero cambio.

### Solución

- Recuerda que la complejidad planeada siempre es mejor que la complejidad por deuda técnica
- Con tu equipo elijan la arquitectura más adecuada para el sistema.
- No más `push master`. Asigna un lider de proyecto y que sea este quien revise las PR (Pull Request).
- Documenta todo.
- Deja de hacer parches y crea soluciones reales.
Adding a button with onclick on InfoWindow - Google Maps API
Tags: javascript, tutorial, googlemaps
Published: 2021-09-20 18:58:18

> InfoWindow in google maps is a type of toast div or should I say a popover that appears when we hover over the map marker, it contains information about a specific place anything you want to show in it.

- Let me show you the easiest way to add a button with onclick function inside the infoWindow content string if nothing else is working or if you are trying to click on the button before the DOM is ready.

- **Content String**: 
```
let buttonName = "any name"; 
let contentString = "<div>" +
                     // other divs ....
                      "<button id='btn-click'>" + buttonName                       
                       + "</button>" 
                     // other divs ....
                    +"</div>";

```

- **Adding click event on your function:**

```
google.maps.event.addListener(infoWindow, 'domready' () => {
 const someButton = document.getElementById('btn-click');
 if (someButton) {
   google.maps.listener.addDomListener(someButton, 'click',    
   () => {
           // show something.
           // add something.
         })
 }
});

```

- **Marker Code:**

```
google.maps.event.addListener(marker, 'mouseover', function(){
 // some code about setting content inside info window or showing up the info window however you want to show it.
});
```

##### That's it, let me know if it worked :).