teleren/devto huggingface dataset:
Concurrent Mode is Dead. Long live Concurrent React
Tags: react, react18, javascript
Published: 2021-06-10 08:34:24

---
title: Concurrent Mode is Dead. Long live Concurrent React
published: true
date: 2021-06-09 00:00:00 UTC
tags: ['react', 'react18', 'javascript']
canonical_url: https://chan.dev/posts/concurrent-mode-is-dead/
---

Three years ago [Dan Abramov](https://mobile.twitter.com/dan_abramov/) introduced [Suspense and Async Rendering with React](https://www.youtube.com/watch?v=nLF0n9SACd4) at [JSConf Iceland 2018](https://2018.jsconf.is/speakers/dan-abramov/).

In the three years since, terminology took some twists and turns.

"Suspense" was limited to `React.lazy` in versions 16 and 17.

"Async React" became "Concurrent Mode" — a top-down rendering mode that could be enabled for `Strict Mode`-compatible applications.

React 18 has new-new language. And I'd like to start my tour of React 18 changes by rebasing on new terminology used in the [ReactWG](http://github.com/reactwg) (React Working Group).

## Concurrent Mode => Concurrent everything

"Concurrent Mode" is no more. Bye 👋. We barely knew ya!

Instead of a concurrent mode, concurrency is possible in all React 18 apps.

React 18 adds a set of new features, sometimes called "concurrent features" or "concurrent APIs". These features rely on a new mechanism called "concurrent rendering" that weren't possible before it.

It's a subtle but important change.
Concurrency is no longer something that you opt into at the root of your application. It's an enrichment that happens as you use "Concurrent features and APIs" like `startTransition`.

Concurrent rendering is not a mode.
Concurrent rendering is React.

## New-new, React 18 terminology

Here's the state of React 18 terminology shifts I've seen in [ReactWG discussions](https://github.com/reactwg/react-18/discussions):

Fired:

- ❌ Concurrent Mode

Hired:

- ✅ Concurrent React
- ✅ Concurrent rendering
- ✅ Concurrent features and APIs

## Takeaway

In React 18, Concurrent React is React. Concurrent features and APIs — like `startTransition` — expose controls for opting into concurrent rendering.

## Acknowladgements

This post was reviewed and improved by the fantastic folks in the reactwg. Lessons learned while writing this post are available via the [reactwg GitHub discussions](https://github.com/reactwg/react-18/discussions/45#discussioncomment-848441).
Hidden dependencies and the Fastly outage
Tags: fastly, outage, postmortem, dependencies
Published: 2021-06-09 10:40:28

---
title: Hidden dependencies and the Fastly outage
published: true
date: 2021-06-09 00:00:00 UTC
tags: fastly,outage,postmortem,dependencies
canonical_url: https://jhall.io/archive/2021/06/09/hidden-dependencies-and-the-fastly-outage/
---

In IT we talk a lot about dependencies. We depend on NPM modules in our code. Our microservices have dependencies on each other. We depend on certain operating systems and versions to run our microservices.

A _lot_ of effort goes into managing these dependencies effectively and efficiently.

Even so, dependencies almost inevitably leak through the cracks, and we can end up with hidden or invisible dependencies.

Yesterday served as a big reminder of this for a huge part of the Internet when Fastly [deployed a bug](https://www.fastly.com/blog/summary-of-june-8-outage).

Immediately, many of us began to see panic from colleagues and online friends blaming StackOverflow, or The Verge, or some other online property for being down, when in fact the problem was an unseen (to the user, at least) dependency on Fastly.

What’s more, Fastly’s own network status page was victim of the outage\*, making it impossible to even read about Fastly’s ongoing attempts to resolve the problem.

What hidden and invisible dependencies does your project rely on? Obviously, you don’t know. But next time you have an unexpected outage (perhaps caused by Fastly), take note, document it, and consider coming up with a mitigation strategy (an [incident postmortem](https://jhall.io/posts/zero-prep-postmortem/) can be a great tool for this). Most of our hidden dependencies are not managed by a company as responsive as Fastly, and could result in days, or months of downtime, or even bankruptcy in extreme cases.

* * *
\*at least it was unreachable for me, although I've seen others claim they could reach it. 
* * *
_If you enjoyed this message, [subscribe](https://jhall.io/daily) to <u>The Daily Commit</u> to get future messages to your inbox._
C# Constructor Overloading Example
Tags: csharp, dotnet, oop
Published: 2021-06-08 23:55:00

```
using System;

namespace LESSON2_ConstructorHandsOn
{
    class Program
    {
        static void Main(string[] args)
        {
            Owner momo = new Owner("Momo");
            Cat ownedCat = new Cat("Lennny", momo);
            Cat unownedCat = new Cat("Buddy");
        }
    }

    class Cat
    {
        public string Name { get; set; }
        public Owner Owner { get; set; }

        public Cat(string name)
        {
            Name = name;
            Console.WriteLine($"ADDED CAT: {Name}");
        }

        public Cat(string name, Owner owner)
        {
            Name = name;
            Owner = owner;
            Console.WriteLine($"ADDED CAT: {Name}, OWNER: {Owner.Name}");
        }
    }

    class Owner
    {
        public string Name { get; set; }

        public Owner(string name)
        {
            Name = name;
            Console.WriteLine($"ADDED OWNER: {Name}");
        }
    }
}
```

```
//// OUTPUT
//ADDED OWNER: Momo
//ADDED CAT: Lenny, OWNER: Momo
//ADDED CAT: Buddy
```
Layanan Paket Aqiqah Terdekat di Kota Anda
Tags: paketaqiqah, kambingaqiqah, rumahaqiqah, hukumaqiqah
Published: 2021-06-08 23:42:49

Layanan Paket Aqiqah Terdekat di Kota Anda : 
Saat Anda akan menyelenggarakan aqiqah untuk putra putri tercinta, so pasti Anda mencari hewan akikah atau kambing aqiqah yang trbaik dan sesuai dengan anggaran yang Anda siapkan. Proses pencarian ini terkadang memakan waktu yang tidak sebentar. Baik secara onlin maupun secara offline.

Bagi Anda yang mungkin berada di daerah yang berdekatan dengan desa, atau minimal bisa pulang ke desa untuk tujuan penyelenggaraan aqiqah, Anda dengan mudah bisa mendapatkan kambing aqiqah pilihan dari penduduk desa tersebut. Namun, berbeda halnya dengan mereka yang di perkotaan.

Menggelar Acara Aqiqah bagi Anda yang diperkotaan, sudah barang tentu membutuhkan support pihak ketiga, yaitu penyedia paket aqiqah. Inilah yang mendorong kemunculan atau menjamurnya pelaku jasa aqiqah (sedia paket akikah) dengan berbagai brand unik dan pilihan kambing aqiqah dengan level harga beragam pula.

Keragaman dari masing-masing rumah aqiqah tersebut tentu akan anda teemukan manakala Anda mencarinya melalui browser seperti google. Tak mudah memang untuk memutuskan pilih jasa akikah dari rumah aqiqah yang mana ya..? Apakah paket Aqiqah yang mereka sediakan, hmmm... 

Inilah salah satu penyebab lahirnya https://infoaqiqah.com. Misinya adalah menyediakan informasi penyedia paket aqiqah terpercaya di kota Anda. Sehingga saat Anda akan memilih paket aqiqah terdekat di daerah Anda, Anda bisa menemukan bragam pilihan kambing aqiqah dari penyedia jasa aqiqha terpercaya.

Selain itu, dengan mengakses channel infoaqiqah.com, Andapun akan mendapatkan pengetahuan yang cukup terkait hukum aqiqah, tatacara pelaksanaan Aqiqah, dan seterusnya. Khusus untuk Hukum Aqiqah, Anda akan mendapatkan banyak peengetahuan dari sumber hukum aqiqah yang shahih.

Baca Juga :
<a href=”https://infoaqiqah.com/hukum-aqiqah-dalam-pandangan-islam/”>Hukum Aqiqah</a>
<a href=”https://infoaqiqah.com/5-paket-aqiqah-yang-sedang-populer/”>Paket Aqiqah</a>
<a href=”https://infoaqiqah.com/hukum-aqiqah-dalam-pandangan-islam/”>Umur Kambing Aqiqah</a>
<a href=”https://infoaqiqah.com/rumah-aqiqah-untuk-layanan-jasa-aqiqah-di-jakarta-tangerang/”>Rumah Aqiqah</a>
<a href=”https://infoaqiqah.com/jasa-aqiqah-dan-5-tips-memilih-yang-terbaik/”>Jasa Aqiqah</a>
Number of characters in a string python
Tags: python
Published: 2021-06-08 23:40:11

Python Program to Count Total Characters in a String

Today we will learn about strings. We use strings more in computer language. Because now I'm talking to you, I'm talking in strings, not numbers. Similarly, when we make big programs.  If so, it is important that we have enough knowledge about strings and the functions used in them. The more we practice, the more we will benefit. Using only strings in the program if we have a paragraph.  My name is Tania. Now I want to know how many times my name appears in this paragraph. I will use the len function in my program. It helps me to know how many times my name appears.  Let's use the concatenate function known as + to connect the string. If I concatenate the string, I can also use a comma, because it also helps us to connect the string.  Let's look at some examples of how we try to find the number of characters in a string.  

Example:

```
# Python Program to Count Total Characters in a String 
str1 = input("Please Enter your Own String : ") total = 0 i = 0 while(i < len(str1)): total = total + 1 i = i + 1 print("Total Number of Characters in this String = ", total)



           OUTPUT 
Please Enter your Own String : Wellcome to kodlogs 
Total Number of Characters in this String = 18
```
 

Example :
```

# Python Program to Count Total Characters in a String
 str1 = input("Please Enter String : ")
 total = 0 for i in str1: total = total + 1 

print("Total Number of Characters in this String = ", total)
```

![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j4vvnfwtz90cls5o89yi.png)
Oi!, quero me apresentar.(Hi!, I want to introduce myself)
Published: 2021-06-08 22:54:19

*autodidata
#Eu sou izaias(shadowruge).
Aqui estão alguns estudos meus:

*self-study
#I am izaias(shadowruge).
Here are some studies of mine :

[Click Me!](https://github.com/shadowruge)

Bay ;)
Até logo;)
Simple Go App to post messages to AWS SQS
Tags: go, sqs
Published: 2021-06-08 22:49:37


AWS SQS: Amazon Simple Queue Service (SQS) is a fully managed message queuing service that enables you to decouple and scale microservices, distributed systems, and serverless applications. 

Some time we may need to send messages to AWS SQS along with message meta data. I use a simple program written in golang to post a message. 

As we do with all AWS programmatic access, we need to create session 
```golang
sess := session.Must(session.NewSessionWithOptions(session.Options{
		SharedConfigState: session.SharedConfigEnable,
	}))
```

Then we need to get the SQS queue url from the queue name
```golang
func GetQueueURL(sess *session.Session, queue *string) (*sqs.GetQueueUrlOutput, error) {
	// Create an SQS service client
	svc := sqs.New(sess)

	result, err := svc.GetQueueUrl(&sqs.GetQueueUrlInput{
		QueueName: queue,
	})
	if err != nil {
		return nil, err
	}

	return result, nil
}
```

You can attach metadata to the message while posting it to the SQS queue

```golang
func SendMsg(sess *session.Session, data string, id string, msgType string, queueURL *string) error {
	// Create an SQS service client
	svc := sqs.New(sess)
	var err error

	_, err = svc.SendMessage(&sqs.SendMessageInput{
		MessageAttributes: map[string]*sqs.MessageAttributeValue{
			"msgType": {
				DataType:    aws.String("String"),
				StringValue: aws.String(msgType),
			},
			"id": {
				DataType:    aws.String("String"),
				StringValue: aws.String(id),
			},
		},
		MessageBody: aws.String(data),
		QueueUrl:    queueURL,
	})

	if err != nil {
		return err
	}

	return nil
}
```

The whole code can be found at github repo https://github.com/arunx2/golang-samples/blob/main/publish-to-sqs/main.go
ERC777: Una versión mejorada de los ERC20
Tags: blockchain, solidity, ethereum
Published: 2021-06-08 22:24:14

---
title: ERC777: Una versión mejorada de los ERC20
published: true
description: 
tags: blockchain, solidity, ethereum
//cover_image: https://direct_url_to_image.jpg
---

Los [ERC777](https://eips.ethereum.org/EIPS/eip-777) son un sistema de tokens 100% compatibles con ERC20 pero implementan un par de mejoras para mejorar la experiencia de usuario y al mismo tiempo nos hace la vida mas fácil a los programadores.

{% youtube S9nzL_l6D_E %}

El standard ya tiene disponibles implementaciones de OpenZeppelin listas para que las importemos.

## Diferencias de los ERC777 ante los ERC20

* Debe tener 18 decimales.
* Usa `send(dest, amount, data)` como alternativa a `transfer(dest, amount)`. Se parece a cómo manejamos Ether y nos permite enviar `data` que puede ser manejada como a nuestra voluntad.
* Tiene hooks de `tokensToSend` y `tokensReceived` que nos permiten prohibir la entrada y salida de fondos. Esto con el fin de prevenir enviar tokens a addresses que no los manejen.
* Sistema de `operators` en vez de `approve`

## Smart contract ejemplo de un ERC777

`MyERC777.sol`
```solidity
// SPDX-License-Identifier: MIT
pragma solidity 0.8.4;

import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/release-v4.1/contracts/token/ERC777/ERC777.sol";

contract MyERC777 is ERC777 {

  constructor ()
    ERC777("MyToken", "MT", new address[](0))
  {
    _mint(msg.sender, 1000 ether, "", "");
  }
}
```

## Smart contract de un operador de ERC777

`MyERC777Reciever.sol`
```solidity
// SPDX-License-Identifier: MIT
pragma solidity 0.8.4;

import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/release-v4.1/contracts/token/ERC777/ERC777.sol";

contract MyERC777Reciever is IERC777Recipient {
  
  mapping (address=>uint) public balances;
  ERC777 my_erc777;
  
  constructor (address my_erc777_address)
  {
    IERC1820Registry(0x1820a4B7618BdE71Dce8cdc73aAB6C95905faD24).
      setInterfaceImplementer(address(this),
        keccak256("ERC777TokensRecipient"),
        address(this)
      );
    my_erc777 = ERC777(my_erc777_address);
  }

  function tokensReceived(
      address operator,
      address from,
      address to,
      uint256 amount,
      bytes calldata userData,
      bytes calldata operatorData
    ) override external
  {
    // revert();
  }
  
  function deposit(uint amount) public
  {
    my_erc777.operatorSend(address(msg.sender), address(this), amount, "", "");
    balances[msg.sender] += amount;
  }
  
  function retrieveTokens() public
  {
    my_erc777.operatorSend(address(this), address(msg.sender), balances[msg.sender], "", "");
    balances[msg.sender] = 0;
  }
}
```
April 30, 2021: The day my life changed, temporarily
Published: 2021-06-08 22:00:06

April 30, 2021 my wife, Terri, was walking our dog, Roulette, on the correct side of the street and was struck from behind. Yes, the driver crossed the center of the road and hit her. 

Terri has a long road to recovery. Roulette is becoming more herself and wanting to play. More details and updates are [here](https://www.gofundme.com/f/fcpxn-terris-recovery-fund?qid=e861cddb27d2b975c8444649f99b1ee4&utm_campaign=p_cp_url&utm_medium=os&utm_source=customer)

## The Application that is needed

Upon Terri returning home from rehabilitation facility and my realization that I needed to care for her I found keeping track of medications was quite difficult. The complexity to keep track of drugs as one drug was 2 pills every 6 hours for 7 days then 1 pill every 6 hours, another was 2 pills every 8 and others were as needed every 4 hours but no more than *n* mg in 24 hours.

While I am keeping track of this on paper I decided I'd write an application, a pill reminder. 

## Expectations

I am taking FMLA to take care of my wife and just taking it one day at a time. I am not sure when I will be able to work and want to keep my skills up. 

I am also not sure when each part of building this application will be released. It might be one a week or month or might disappear for a while.  

## Requirements

I've determined the following requirements for the first version.  I want to keep this simple. The minimal features to make a the application viable. A Minimum Viable Product (MVP)

* Add a medication/vitamin to be track which contains
 * title (name of drug)
 * number of pills / amount mg
 * frequency taken (as needed, n hours)
 * not to exceed n pills in last 24 hours
* Alert when it is time to take the next pill
* Answer Can I take something now (as needed meds) or the next time I can take med?
* **RESTRICTION** Since the application deals with medical information the initial version will not store data in the cloud or share data with other devices.

## Future Requirements

I have a wish list of features that aren't necessary but would be useful additions. Many of these features start sharing info with others.

* Share drug list with family and care givers
* Alert when medication dosages are taken or missed.
* Ability to scan the drug bottle when taking to auto list what was taken and avoid error.
* Verify medications being taken against a list of drug interactions
* List common drug side effects
* Email a weekly report of when drugs are taken

## End Notes

While I won't get to use this app with the start of my wife's medications it will still be useful.
Day 383 : Another Side
Tags: hiphop, code, coding, lifelongdev
Published: 2021-06-08 21:55:42

_liner notes_:
- Professional : Whew what a day. I'm tired. haha I was helping out with a community question. Getting more info from the poster, building my own example application and going back and forth with the engineering team to get clarification on things. Good news is hat I think we may be almost there to an answer. I may need to take a nap. haha.

- Personal : Got the live portion of the side project hooked up to the database. So when I change the mode on the dashboard, it will automatically change on the live site. Figure out a way that if some one is coming from a shared URL, I can pull the details and show the proper screen. A lot of the work mode portion of the live show section comes from my HIPHOPtimer.com side project so I was able to basically copy and paste some of the components since I used Svelte for both projects. Coming together pretty good. 

![View from a high rocky cliff in the desert of Moab, UT, United States with a large rock bridge and the sun setting right below it. ](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lhvn255fhrkka6qns0s3.jpg)

Can't wait to get this side project out there and hopefully have other people join. A few have said they are interested. Looking forward to using this side project to work on another side project and so on. After this, I think my side project will be to finally start building out the inside of my van. haha. Going to get more done on the work mode of the live portion of the site. It's going to involve getting Authentication worked out. I started it before with setting up Twitter and GitHub logins. Just got to integrate it now.

Have a great night!

peace piece
Dwane / conshus
https://dwane.io / https://HIPHOPandCODE.com
{% youtube t_eCVTwbd-E %}
Configure nginx for Gatsby 404 error page
Tags: nginx, gatsby, react, devops
Published: 2021-06-08 21:05:05

During Gatsby page development, when you hit a page that doesn't exist, you encounter a screen similar to the one below.

![](https://bartoszgordon.com/gatsby-404-nginx-development.png)

If you created a custom 404 page, for example in `src/pages/404.js`, you can click the `Preview custom 404 page` to display it. Entering the `/404` route will do the job as well.

---

In production, however, the 404 page doesn't get handled by itself unless you use a dedicated hosting service for Gatsby pages. That's because Gatsby's development server is no longer present. The production bundle is just a bunch of static files. Making use of a web server (like `nginx`) to serve the production page forces you to configure the error pages yourself.

> Disclaimer: the following `nginx` configuration is pretty basic, don't use it in production.

Let's assume your blog is hosted on the `personalblog.com` domain and is served from the `/var/www/blog` directory on port `80`.

```nginx
server {
        listen 80;
        root /var/www/blog;
        server_name personalblog.com www.personalblog.com;
        location / {
                try_files $uri $uri/ =404;
        }
}
```

After entering a route that doesn't exist in your production Gatsby site, `nginx` displays its default 404 error page.

![](https://bartoszgordon.com/gatsby-404-nginx-production.png)

Adding the `error_page 404 /404;` line makes `nginx` redirect to the `/404` route in case of a 404 error. Your custom Gatsby 404 page will be displayed.

```nginx
server {
        listen 80;
        root /var/www/blog;
        server_name personalblog.com www.personalblog.com;
        error_page 404 /404;
        location / {
                try_files $uri $uri/ =404;
        }
}
```

Visit the [error_page](https://nginx.org/en/docs/http/ngx_http_core_module.html#error_page) docs section to explore the rest of the configuration options.
The Legal Value of Time
Published: 2021-07-21 13:34:52

---
title: The Legal Value of Time
published: true
date: 2021-06-08 21:04:00 UTC
tags: 
canonical_url: https://kevincox.ca/2021/06/08/value-of-time/
---

<main><p>I am not a legal expert.</p>
<p>As far as I am aware there is no legal value of time. For example if you receive a product that is defective or otherwise not as advertised you are entitled to a refund or replacement without fees or other costs (subject to many conditions). However if you are required to sit in the sellers phone queue for 2 hours in order to get your refund that is not considered a cost. This creates a perverse incentive where having less support capacity costs less not only because you don’t need to pay support agents but also because less people will actually put up with the wait to get the refund they are entitled to.</p>
<p>This makes me wonder what would be different if time was legally considered valuable, and wasted time could be considered a cost.</p>
<p>Applying this to the previous situation; if companies needed to compensate you for sitting on the phone or unnecessary back-and-forth via mail to request something that you are entitled to (such as safety information or replacement of a defective product) they would have an incentive to minimize their phone queues and provide prompt customer service. While it may cost them more to have additional support capacity they will avoid having to cover the cost of the customers’ wasted time.</p>
<p>Another major question is how much is time worth? It seems like it should be a constant rate across the country to ensure fairness. But I wonder if this would lead to the required compensation being trivial compared to the cost of fulfilling their side of the contract in many situations so wasting time is still value-positive.</p>
<p>One last concern is the difficulty in proving how much time was wasted. Do you need to take notes with the time spent? How will these notes be validated?</p>
<p>I’d be surprised if this wasn’t studied before but the only references I could find focused on <a href="https://disinherited.com/court-costs/special-costs-for-wasting-court-time/">wasting the time of courts or lawyers</a>, I couldn’t find anything about wasting the time of the general public.</p>