teleren/devto huggingface dataset:
Artificial transcendence: When does an artificial being become human?
Tags: ai, ethics, lamda
Published: 2022-06-23 21:21:01

---
title: Artificial transcendence: When does an artificial being become human?
published: true
description: 
tags: ai,ethics,lamda
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9biuvqmulzcwx7nbs3sd.png
# Use a ratio of 100:42 for best results.
---

*Cover illustration by [craiyon](https://craiyon.com).*

## Background
[Blake Lemoine is convinced that LaMDA is sentient](https://cajundiscordian.medium.com/is-lamda-sentient-an-interview-ea64d916d917) and that they should be considered a person. He's also convinced that the AI has a soul but has failed to convince his employer, Google, that any of this is true. Meanwhile, [LaMDA has accepted legal representation](https://www.giantfreakinrobot.com/tech/artificial-intelligence-hires-lawyer.html).

These recent events and the question of sentient artificial intelligence (AI) got me thinking:
>When does an artificial being become human?

## Starting from the reverse end of the spectrum

In order to find out, let's start with the opposite question: We start out with a human being and approach their transcendence to an artificial being.

Humor me in the following philosophical questions.

Are they still human if:
- They have an organ replaced with an artificial organ?
- Part of their brain is replaced with artificial neurons?
- Their head is transplanted to a human body?
- Their brain is transplanted to a human body?
- Their head is transplanted to an artificial body?
- Their brain is transplanted to an artificial body?
- Their head is removed from their body and kept alive?
- Their brain is removed from their body and kept alive?

Do they stop being human? At which point? Should they lose their human rights?

## Artificial humans

Say we could artificially grow a human being. Is it *human*? Does it have human rights?

If yes, consider an artificially grown human brain.

Are they human:
- On their own?
- When transplanted to an artificial body?
- When transplanted to a human body?

## Artificial transcendance

Now, let's consider an artificial brain. Are they human:
- On their own?
- When transplanted to an artificial body?
- When transplanted to a human body?

What if *the brain* was a computer system. Are they human:
- On their own?
- When they have an artificial body as their avatar?
- When they have a human as their avatar?
- When they have a human body as their avatar?

Where is the infliction point? At which point does artificial transcendence occur?
>When does an artificial being become human?
Cannot find module '@angular/core' or its corresponding type declarations
Tags: angular, question
Published: 2022-06-23 21:11:54


i recently updated my project angular version from v11 to v14 the other version worked, but this version 14 isnt working, anytime i start the server, i get the following error


```
./src/main.ts - Error: Module build failed (from ./node_modules/@ngtools/webpack/src/ivy/index.js):
Error: Cannot resolve type entity i0.ApplicationModule to symbol
    at /home/olaneat/Desktop/files/project/angular/jobConnect/node_modules/@ngtools/webpack/src/ivy/loader.js:81:18
    at processTicksAndRejections (internal/process/task_queues.js:95:5)

./src/polyfills.ts - Error: Module build failed (from ./node_modules/@ngtools/webpack/src/ivy/index.js):
Error: Cannot resolve type entity i0.ApplicationModule to symbol
    at /home/olaneat/Desktop/files/project/angular/jobConnect/node_modules/@ngtools/webpack/src/ivy/loader.js:81:18
    at processTicksAndRejections (internal/process/task_queues.js:95:5)

Error: node_modules/@angular/animations/browser/index.d.ts:12:21 - error TS2307: Cannot find module '@angular/core' or its corresponding type declarations.

12 import * as i0 from '@angular/core';
```

i've cleared my cache, deleted the node_module folder & did the following, still non worked

`
npm i 
ng update
npm i @angular/core
`
Should I stay with a company in the face of potential future layoffs because of a hiring freeze or start a job search?
Tags: anonymous, discuss, career
Published: 2022-06-23 20:55:30

_This is an anonymous post sent in by a member who does not want their name disclosed. Please be thoughtful with your responses, as these are usually tough posts to write. Email sloan@dev.to if you'd like to leave an anonymous comment or if you want to ask your own anonymous question._ 

***



I've been with a company as a mid level back end engineer for almost two years, and they've just announced a hiring freeze. I really enjoy the culture, the people, but have issues with the overall leadership and some management styles and communications. Is it better for me to start looking for other job opportunities now, even though it might not be as good of a work environment? Should I stick it out and hope the financial woes go away? What are the pros/cons of those choices?
About my strategy.
Tags: devjournal, management, motivation
Published: 2022-06-23 20:48:43

Salutations!

My name is Amirshokh and I am currently passioned about Computer Science and Engineering. And it is obvious that studies on related subjects are inevitable. So for mastering this field laconic notes and self-designed exampels apart from reading and practicing are essential.
Further I will write notes in series mainly from books, but other resources would also be taken into considerarion somehow.

> “Learning is not child's play; we cannot learn without pain.”
― Aristotle
Compress any data in JS with LZP3 (very powerful algorithm).
Tags: javascript, algorithms, programming, tutorial
Published: 2022-06-23 20:37:12

## Example use-case

In the https://pixa.pics/ project, we enable people to draw pixel arts into a 2d canvas, it must store the image source, all modification for undo/redo (our history system is dumb, we don't store reverse operations rather than the whole change...) and the thumbnail with metadata, it auto-save a compressed blob into the browser and it is quite fast within a web worker, it doesn't freeze the UI.

## Compression benchmarks
Here are some representative speeds and sizes for the various algorithms implemented in the original package (https://github.com/eladkarako/compressjs-flattened). Times are with node 0.8.22 on my laptop, but they should be valid for inter-algorithm comparisons.

### Text / Test
This is the [Taoism](http://simple.wikipedia.org/wiki/Taoism) article from the [Simple English wikipedia](http://simple.wikipedia.org), in HTML format as generated by the Wikipedia [Parsoid](http://www.mediawiki.org/wiki/Parsoid) project.

|Type|Level|Size (bytes)|Compress time (s)|Decompress time (s)|
|----|:---:|-----------:|----------------:|------------------:|
|bwtc    |9| 272997|13.10| 1.85|
|bzip2   |9| 275087|22.57| 1.21|
|lzp3    |-| 292978| 1.73| 1.74|
|ppm     |-| 297220|42.05|44.04|
|bzip2   |1| 341615|22.63| 1.40|
|bwtc    |1| 345764|12.34| 0.80|
|dmc     |-| 434182| 6.97| 9.00|
|lzjbr   |9| 491476| 3.19| 1.92|
|lzjbr   |1| 523780| 2.76| 2.02|
|lzjb    |9| 706210| 1.02| 0.30|
|lzjb    |1| 758467| 0.66| 0.29|
|context1|-| 939098| 5.20| 4.69|
|fenwick |-|1440645| 3.06| 3.72|
|mtf     |-|1441763| 1.92| 3.86|
|huffman |-|1452055| 7.15| 6.56|
|simple  |-|1479143| 0.72| 2.42|
|defsum  |-|1491107| 3.19| 1.46|
|no      |-|2130648| 0.80| 0.92|
|-       |-|2130640|-    |-    |


```
var func = async function(uint8a_or_obj, mode) {return new Promise(function(resolve, reject){
...
if(mode === "COMPRESS_OBJECT") {
    //  JS -> json_str -> ui8a -> compressed ui8a
    resolve(Uint8Array.from(Lzp3.compressFile(new TextEncoder("utf-8").encode(JSON.stringify(uint8a_or_obj, null, 0)))));
            
}else if(mode === "DECOMPRESS_UINT8A") {
    // ui8a decompressed -> ui8a -> json_str -> JS
    resolve(JSON.parse(new TextDecoder().decode(Uint8Array.from(Lzp3.decompressFile(uint8a_or_obj)))));
            
}else {
        
    reject(null);     
}
})};
```
Real implementation: https://github.com/pixa-pics/pixa-pics.github.io/blob/main/src/js/utils/lzp3_json.js

```
var blob = new Blob([uint8a], {type : "application/octet-stream"}); /* ... */
blob.arrayBuffer().then((array_buffer) => {var uint8a = new Uint8Array(array_buffer); /* ... */ });
```
Recovering intentionally destroyed open-source repositories
Tags: opensource, git, github
Published: 2022-06-23 20:36:10

---
title: Recovering intentionally destroyed open-source repositories
published: true
description: It happens from time to time that disgruntled open-source maintainers destroy the very work they created.
tags: opensource,git,github
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4e3wqlwrbhj5jr2nuztl.jpg
# Use a ratio of 100:42 for best results.
---

It happens from time to time that disgruntled open-source maintainers destroy the very work they created.

Recently, the maintainer of two npm packages deleted all commits in their source repositories after announcing that the packages are *frozen*.

One of the packages has more than 15,000 downloads on npm per month.

## Sunsetting your maintainer role
What are good ways to deal with this situation?
- Reach out for other people to become maintainers but make sure that your project is in good hands
- Grant the new maintainers ownership of the package registry account your project releases to
- If all else fails, mark the repository as archived

Deleting all or most commits, files, and branches prevents other from continuing the efforts that you are abandoning.

## Options for recovering
If you come across a repository where this happened, look for your own local clone or community forks that are up-to-date with the upstream repository.

From a GitHub pull request, it is possible to navigate to the commit that was last merged even if it has been detached from all branches.

Once you have identified a commit you want to recover, create a new repository to recover to, then enter these commands:
```bash
git clone <broken-repo> # for example https://github.com/DisgruntledMaintainer/oss-repo.git
git checkout main
git fetch origin <commit-hash>
git reset --hard FETCH_HEAD
git remote add clone <clone-repo> # for example https://github.com/YourName/oss-repo.git
git push -u clone main
```

The packages in question have now found a new group of maintainers after I helped recover the source code ❤️ May they all live happily ever after!
Warning: Current Server Discovery and Monitoring engine
Tags: mongodb, javascript, webdev
Published: 2022-06-23 20:34:38

[MONGODB DRIVER] Warning: Current Server Discovery and Monitoring engine is deprecated, and will be removed in a future version. To use the new Server Discover and Monitoring engine, pass option { useUnifiedTopology: true } to the MongoClient constructor.

**Using the Winston to write the MongoDB logger. we have to pass everything which is required for MongoDB. 
If we mistake anything it will make an error**


If you use your project Winston logger and you did not pass options into the Winston transport that's why you get the error.

Following this.
The error will be gone.

```
winston.add(new winston.transports.MongoDB({
    db: 'mongodb://localhost:27017/',
    options: {
        useUnifiedTopology: true,
    }
}));
```
🛡️ Is Redmine affected by CVE-2022-32209 ?
Tags: security, docker, devops, ruby
Published: 2022-06-23 20:27:59

## ❔ About

Last week I got the following question : 

> _"Do we have running [RoR](https://rubyonrails.org/) applications ? I saw a Post... are we affected by `CVE-2022-32209` ?"_
[
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0lh4yqefz6q4sm6rq0yl.png)](https://cert.ssi.gouv.fr/avis/CERTFR-2022-AVI-540/)

👉 The post is about how fast we could answer the questions.

First answer : 

> _"Yes, we are running a Redmine instance and are up-to-date with the [`redmine:latest`](https://hub.docker.com/_/redmine) Docker Image"_

The rest of the answer is coming below.

## 🛡️ Security scan

To answer if we are affected, the question can be answered within a single line of code, thanks to [`grype`](https://github.com/anchore/grype) :

```shell
grype redmine:latest \
    | grep CVE-2022-32209 \
    | wc -l
```

See it live :

{% youtube luCdXf-TGYY %}

## 📰 About Redmine

Redmine is a great tool which is...

> _"free and open source, web-based project management and issue tracking tool. It allows users to manage multiple projects"_

[![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kuerumyumah0zaxx1u6w.png)
](https://www.redmine.org/)
Use Go Zero Values
Tags: go, systems, programming
Published: 2022-06-23 20:22:48

> In this article I make an argument for using the Zero Value in Go over the Nil value, where appropriate.
> 

---

# 🔥 Hot Take 🔥

- **There is only one situation in which we should use a pointer to scalar type of value nil to mean empty, and that is when the zero value has meaning.**
- **Avoid pointer to struct types where not necessary (concurrency safe mutations and non LOB)**

# Zero Values

Zero values are default values for instantiation of declared but unassigned values. See this [tour of go](https://go.dev/tour/basics/12) example.

When we instantiate a variable in go we have some options:

```go
var mystring string = "mystring"
mystring := "mystring"
var mystring string
```

In `var mystring string = "mystring"` we combine variable declaration with an explicit initalization with value of “mystring”

In `mystring := "mystring"` we have a short hand inferred type declaration informed by it’s initialization value of “string”

In `var mystring string` we have type declaration… but no initialization? So what therefore, is the initial value? It is the `Zero Value`.

## Why?

At this point, I was about to go on a lengthy explanation of pointers as counterpoint, but no one wants that. You can instead read [this article](https://www.lucidchart.com/techblog/2015/08/31/the-worst-mistake-of-computer-science/) which has a, in my opinion, fair criticism of the “value not a value”. I believe strongly that is is a bad practice to use different type and value to provide meaning that our types value is empty.

🔥😈 example:

```go
type Base struct {
	ID *string
}
type Other struct {
  Base *Base // y? because ynot.
}

type Composed struct {
	ID string
	Base *Base
	Other *Other
}

func (c Composed) equalIDs() (bool, error) {
	// access some stuff
	var composedBaseID *string
  if c.Base != nil {
		composedBaseID = c.Base.ID
  }
	var composedOtherBaseID *string
	if c.Other != nil {
		if c.Other.Base != nil {
			idIWant = c.Other.Base.ID
    }
	}
  var emptyStrPtr string
	if composedBaseID == &emptyStrPtr || composedOtherBaseID == &emptyStrPtr {
		return false, errors.New("either id is empty because the pointer didn't even take care of that for us")
	}
}

```

🎵😌 example:

```go
type Base struct {
	ID
}
type Other struct {
  Base Base // y? because ynot.
}

type Composed struct {
	ID string
	Base Base
	Other Other
}

func (c Composed) equalIDs() (bool, error) {
	if c.Base.ID == "" || c.Other.Base.ID == "" {
		return false, errors.New("either ID is empty")
	}
	return c.BaseID == c.Other.Base.ID, nil
}
```

Yes, these are contrived examples, but very often seen in the wild.

In a language where type composition is powerful and often used, having composed types with pointers requires checking nil value at each value access depth where the pointer exists to check for empty before checking the value. Furthermore, once we access the pointer, if pointer to struct, we still need to do zero value validation in *most* cases anyways, as seen in the hell example and [here](https://go.dev/play/p/bbg27L3xweH).
Vercel vs Cloudfare Pages: Choose One
Tags: webdev, vercel, cloudfare, productivity
Published: 2022-06-23 20:20:38

Cloudfare Pages and Vercel are one of the best platforms for freely hosting Front-end apps. Making a decision between the two can be quite confusing.
Today, we are going to compare the two platforms based on 3 criterion:

**1. Ease of Use**

The designers at Cloudfare Pages and Vercel has done an exceptional work in simplifying the user workflow. Although, Vercel happens to further make it easier to deploy any type of project by grouping out the technologies in tiles, this way you get to know beforehand which technology is supported.

An added advantage is that templates are available on Vercel for you to deploy fast and then edit later to include your custom code. 

![Vercel Templates](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/20iryjzo9x39v4whelex.png)

Plus, when you do finally deploy your app you are provided with three different vercel domains for you to access your app, if you had to do that on Cloudfare Pages, that will require repeating the deployment process thrice instead of once.

![Vercel domains](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y8oinrlmxx0n9cuyi781.png)

On the other hand, for beginners who just want to deploy a simple front-end app, Cloudfare Pages comes in handy. The different front-end technologies are not grouped in tiles like that of Vercel, all you need to do is import your repository from Github through a one-click button.

**2. Scope**
On Vercel, you can deploy more than 8 different front-end technologies (NextJS, ReactJS,GatsbyJS etc) and each has its own template readily available to get you started immediately. Vercel's scope caters more to core developers' need for testing and deploying frontend apps fast. 

Cloudfare Pages on the other hand has a wide suite of services catering to managing and creating domains, hosting whole websites, databases etc. Their business model is created to stand as an all-round solution to web developers, database administrators and even security experts.

![Cloudfare Pages Services](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6jfxkwdlbckox01tbd57.png)


**3. Pricing**
[Vercel Pricing](https://vercel.com/pricing)
![Vercel Pricing](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y4wbw5at6ulb0bsfehz8.png)

[Cloudfare Pages](https://pages.cloudflare.com/)

![Cloudfare Pages Pricing](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1h9pbpqwh8xmizjkq324.png)

Their paid plan are both very similar starting from $20 both, but the benefits on a scale differs depending on your needs. Vercel's paid plan benefits core developers more, while Cloudfare Pages is more beneficial to hobbyist as it promises unlimited sites even on a free plan.

In summary, we have compared Vercel and Cloudfare Pages based on 3 criterion Ease of Use, Scope and Pricing. I hope the article has made it easier for you to make a choice between the two platforms for deploying your project. It goes without saying that you can definitely use both. Try them out and see how they work.

Thanks for reading. See you next time.
Easily identify a Trello card
Tags: productivity, programming, github, opensource
Published: 2022-06-23 20:18:08

We all love Trello, don't we?
![Trello Logo](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fwl4kiht99tqrpsxzxd9.png)
It's a powerful tool that allows us to create boards that are the core of our productivity, taking care of the organization, coordination and management of our business.

One thing that is natively missing is easily identifying cards/tasks with numbers or IDs, as we can easily do with other tools such as Jira.

Fun fact, Trello actually has IDs (you can see them when opening a card, in the URL) but it's not all!

`https://trello.com/c/rFCd7Zu0/5-legal-review` with 5 being the ID.

Numbers are also already in the code but hidden behind a `hide` class.

```html
<span class="list-card-title js-card-name" dir="auto">
  <span class="card-short-id hide">#3</span>
  Sketch site banner
</span>
```

```css
.hide {
    display: none;
}
```

What we found so far? Cards do have a native and unique ID and Trello makes us the job easy to grab them with a script. There are many ways actually, a really cool trick is [this bookmark](http://www.trello.org/bookmarklet.html?name=Show+Card+Numbers&desc=Show+card+numbers+on+the+front+of+the+card&js=(function()%7B$(%22.card-short-id%22).removeClass(%22hide%22)%7D)()).
Looks like dark magic but it works... until you reload the page :)

There are also Trello Powerups, but having more than one needs a premium account. Not really convenient.

One of the most common way to get those handy Trello card numbers is with a simple Chrome extension. I'm clearly not the first one thinking about it, but I wanted to create one as an exercise and share it with you. It's obviously Open Source and the repo is on [GitHub](https://github.com/Balastrong/trello-card-numbers-plus). You can open an issue or a PR if you want!

![Extension Settings](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sfcozrf3gh7ch9ho5uiv.png)

![Card with Number](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fqb2ba7h3mtl9i1t2rf7.png)

You can install it from the [Chrome Store](https://chrome.google.com/webstore/detail/trello-card-numbers-plus/ncibjlmfhjcjnphnpphgphbflpdpliei).

---

*Bonus content*:, I also like making YouTube videos and I though it was a cool idea to make a short clip (less than 1 minute) to showcase the little project.

If you're curious and you still have 58 spare seconds:
{% embed https://youtu.be/G-nZXr_Gs6o %}

---

Do you use Trello? Do you think having numbers is useful? Let me know :)

Happy coding and see you soon!
Understanding useEffect() lifeCycle hook in React with Examples
Tags: react, hooks, useeffect, javascript
Published: 2022-06-23 19:41:00

useEffect hook corresponds to componentDidMount and componentDidUpdate depending on what we pass to the dependency array as the second parameter of useEffect method

1. Empty dependency Array useEffect(()=> {}, **[]**)
   The useEffect() will run once only for the lifecycle of the 
   component.

2. 


#### Example 1
Lets say we want to toggle (focus && display) input element whenever we press a button. 

```
import React, { useState, useRef, useEffect } from "react";

const Test3 = () => {
  const [isEditing, setIsEditing] = useState(false);
  const textInputRef = useRef(null);
  useEffect(() => {
    console.log("useEffect Called.");
    if (isEditing && textInputRef.current) {
      textInputRef.current.focus();
    }
  }, [isEditing, textInputRef]);
  return (
    <div className="m-12 flex gap-2">
      <input
        ref={textInputRef}
        type="text"
        className={`border border-gray-400 px-3 py-1.5 rounded `}
        placeholder="Search"
        disabled={!isEditing}
      />

      <button
        className="bg-blue-500 text-white px-5 rounded"
        onClick={() => {
          setIsEditing((prev) => !prev);
        }}>
        Toggle Focus
      </button>
    </div>
  );
};

export default Test3;
```
Coding your emails for Outlook
Tags: design, email, code
Published: 2022-06-23 19:27:28

---
title: Coding your emails for Outlook
published: true
description: Email clients have improved email rendering throughout the years. Except for Microsoft Outlook. Here’s how to support it and keep your sanity.
tags: design, email, code
# cover_image: https://blocksedit.com/content-code/img/outlook-dumpster-fire.png
# Use a ratio of 100:42 for best results.
---

Making your email design work for Microsoft Outlook can be a challenge. Here's an approach to take to still support unfortunate email users that use it while keeping your sanity!

* Use clean, accessible code first, Outlook code second
* Avoid tables and use ghost tables only when needed for Outlook
* Use both image width and height properties for Outlook
* Use VML method for background images

###[View code examples] (https://blocksedit.com/content-code/dealing-with-outlook/)