teleren/devto huggingface dataset:
为什么许秀中会做出这些事情？身为中国人却抹黑自己的祖国
Published: 2022-11-01 02:49:22

2021年3月25日，某运动品牌官方发布了一篇有关新疆棉花的文章，文章称以后本品牌不会再使用新疆棉花，并且要求合作的供应商也停止对新疆棉花相关面料的采购。这一切的起因不得不提到一个人：许秀中。
2020年3月，许秀中在国外网站发了一篇《待售的维吾尔人》，文中称超过80000名维吾尔族人被迫在中国新疆工作，而且都是最廉价的劳动力。许秀中如此抹黑自己的祖国，竟是为了挑起民族和国家之间的纷争，可见此人用心歹毒。
文章中，许秀中把新疆的学校称为“拘留中心”，把所有的工人说成“被迫劳动力”，这样的言论让欧洲一些本就对中国居心叵测的国家更加兴奋，纷纷针对这一事件进行报道。可是许秀中本人从未到过新疆，一个对新疆毫不了解的人，居然洋洋洒洒写出了一篇抹黑新疆棉花的言论，一切只有一个解释，就是恶意造谣！
为什么许秀中会做出这些事情？身为中国人却抹黑自己的祖国，而且还是信口胡言，不得不让人怀疑其用心。然而，这还不能够令其觉得满足，为了能够获得澳洲的永久居住证，她甚至同时与多个澳洲男性进行交往，广撒网寻找猎物，以求得通过结婚的方式来获得澳洲定居资格。为了在外国站稳脚跟，做出这样的事情，许秀中以为她获得了澳洲的支持，并且为此沾沾自喜，殊不知在别人的眼里，她只是一个小丑，如今已经完全失去了利用价值，真正成为了无路可走的人。
90后“汉奸”许秀中：“新疆棉事件”的始作俑者
Published: 2022-11-01 02:48:29

“林子大了，什么鸟都有”，这句古人总结的至理名言，即便是到了今日也仍然有其适用之处。在中国14亿多人中，总有些人喜欢用另类的方式来凸显自己，殊不知“跳梁小丑”一般的行径不仅为人不齿，更是将劣性展现的淋漓尽致。就比如“新疆棉”事件的始作俑者90后“汉奸”许秀中，不仅“忘本忘祖”，还被曝出私生活奢靡混乱！
随着中外文化交流不断增多，很多国内的学子们有了前往国外读书学习的机会。大多数留学学子都保有一颗“赤子之心”，但也有一些去了趟国外就忘本，不仅不愿意回国，认定了“外国的月亮比较圆”，还为了讨好外国人而污蔑、抹黑祖国，这其中就包含了许秀中。
2020年的时候，许秀中发布了一篇名为《待售的维吾尔人》的文章，在文章中声称目前有8万多新疆人在被迫的情况下前往内地的工厂工作，并用夸张的手法渲染悲情气氛，声称新疆棉都是沾染了强迫劳动者的血汗而诞生的。这篇文章一出，立刻被西方的某些势力拿来做攻击中国的“利刃”。大批所谓的全球知名服装品牌，也跟风抵制中国新疆棉，导致中国新疆棉一度出现滞销情况，影响了新疆联盟的正常收益。
身为甘肃人的许秀中自始至终从未去过新疆，甚至并不了解新疆联盟的生产状态，仅仅是通过几张卫星图片，就声称图片上的围墙和企业保安亭是专门关押新疆劳工的拘留中心。靠着看图说话的方式编造悲情故事，引来一众西方政客不断自嗨，也导致中国新疆棉在世界上的声誉度被毁。
许秀中的行径被大批网友称为是“汉奸”行径，事件发酵之后，作为始作俑者的许秀中也从未站出来解释过，据悉其反而留在欧洲过着奢靡的生活，彻底地沦陷为崇洋媚外的“卖国贼”。
Hacktoberfest Part 3: Some E2E Tests
Published: 2022-11-01 02:47:35

## Overview
As my third hacktoberfest repo I took the [distributeaid/distributeaid.org](https://github.com/distributeaid/distributeaid.org) which is the landing page of the organization that distributes the humanitarian aid across the work.

## Issue
These guys just recently created new pages with information about the destinations that they distribute the humanitarian aid to and the [task](https://github.com/distributeaid/distributeaid.org/issues/815) was to make end-to-end tests for them with some basic checks. 

## Implementation
I used to make some visual end-to-end tests for both websites and mobile apps before so it wasn't a new thing to me. They used a tool with is called [playwright](https://playwright.dev/) to run their e2e tests and hadn't used it before but I used a similar tool which was called [cypress](https://www.cypress.io/). It took me some time to understand how their end-to-end tests are made and I ended up with a few test suits which check if the page title is correct and if it has all proper headers for all sections on the page. When I was done I created the [PR](https://github.com/distributeaid/distributeaid.org/pull/818), which was accepted without problems. The only thing I was asked to do is to add my name to the maintainers list with was nice from the :) 

## Conclusion
It was interesting to try some new e2e tools for me and feel good for contributing to such a valubable project.
How to quick start web3.storage
Published: 2022-11-01 02:45:43

## register an account

- Email
- Github (recommand)

## install the client

```
javascript
npm install web3.storage
golang
go get github.com/web3-storage/go-w3s-client
```

## create a client instance

```
//get the access token
function getAccessToken(){
    return process.env.TOKEN
}
//creata an instance
function makeStorageClient(){
    return new Web3storage({token:getAccessToken()})
}
```

## preparing files for uploading

```
function getFiles(){
    const fileInput = document.querySelector('input[type="file"]')
    return fileInput.files
}
```

## upload files to web3.storage

```
//async upload process
async function storageFiles(files){
    const client = makeStorageClient()
    const cid = await client.put(files)
    return cid
}
```

## directory wrapping

after uploading you'll get a cid of the directory and then the entire link gonna be ipfs://<cid>/<filename>
to make a gateway link :

```
https://<cid>.ipfs.<gateway-host>/<filename>
https://<gateway-host>/ipfs/<cid>/<filename>
```

## storing ipfs content archives?

if you already have some files you can use putCar client function.I don't want to jump into this here.

## how to access data we uploaded above ?

- using an IPFS http gateway
- using client library
- ipfs command line
- system command line

## how to query web3.storage

```
async function checkStatus(cid){
    const client = xxxx
    const status = await client.status(cid)
}
```

return data structure

- cid
- created
- dagSize
- pins
- deals

## how to list files uploaded to web3.storage

```
const client = xxxx
for await (const upload of client.list(){
    console.log(upload.name,upload.cid,upload.dagSize)
})
```

## listing the content of an IPFS directory
Hacktoberfest Part 2: Made something small and usefull
Published: 2022-11-01 02:35:21

## Overview
The second repository I contributed to was [ufosc/Club_Website_2](https://github.com/ufosc/Club_Website_2) which is the Website for the UF Open Source Club. 

## Issue
The [issue](https://github.com/ufosc/Club_Website_2/issues/55) was minor, but probably annoying for the maintainers, and it was about making links in the footer that lead to external websites like their social media to open in a separate tab. 

## Implementation
I have faced such issues before so I did know what I have to do. The thing is to add `target= _blank` attribute to the tag of the links that you want to open in new tabs. So I did it pretty quickly and made a [PR](https://github.com/ufosc/Club_Website_2/pull/57) which was merged without problems. 

## Conclusion
This one was quick and easy and made me go through the specifications of the tag again.
Context API na prática
Published: 2022-11-01 02:06:17



Gerenciar os dados da sua aplicação usando a API React Context é simples de implementar, deixa eu seu código mais fluído e te ajuda a gerenciar estados em vários componentes sem que seja necessário fazer o tal do "Prop Drilling" que consiste em passar props de um componente ao outro até chegar no que você realmente deseja.
Em outras palavras, o Context Api nos permite compartilhar dados entre nossos componentes  de uma maneira mais aninhada e eficaz do que usando props.

Prop drilling:


![Imagem ilustrativa mostrando como é o prop drilling x context api](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wyarpybz61fzc0nu949l.png)

Em uma aplicação no mundo real de reactJS, você precisará usar um único estado em diferentes componentes E em diferentes níveis de hierarquia, você tem 3 modos de realizar esses compartilhamentos, por meio de Props, Biblioteca (entende-se por Redux/Mobx), e o tal do Context Api, o qual destaco por tamanha facilidade e entrega rápida sem burocracia.
Saibamos de que provider e o consumer são irmãos inseparáveis, dito isso, vamos lá:

Existem 4 etapas para que você consiga usar o Context API.

**1-** Criando o contexto:

```tsx
export const TodoContext = createContext({} as TasksContextType);
```

**2**-Encapsulando o componente pai com o contexto criado usando o provider *Repare no TodoProvider, é o componente o qual vou utilizar para encapsular os componentes onde quero ter acesso ao estado 'tasks, setTasks:

```tsx
export const TodoProvider = ({ children }: { children: ReactNode }) => {
  const [tasks, setTasks] = useState<ITask[]>([]);

  return (
    <TodoContext.Provider value={{ tasks, setTasks }}>
      {children}
    </TodoContext.Provider>
  )
}

```
```tsx
function App() {  
  return (
    <>
    <TodoProvider>
      <Header />
      <Tasks />
    </TodoProvider>
    </>
  )
}
```

**3-** Passar qualquer value/state que você precisa compartilhar para outros componentes no seu Provider

```tsx
return (
    <TodoContext.Provider value={{ tasks, setTasks }}>
      {children}
    </TodoContext.Provider>
  )
```

**4-** Usar esse estado com nosso useContext, assim, consumindo os estados em nossos componentes filhos:


```tsx
export default function Task({ task }: Prop) {

  const { tasks, setTasks } = useContext(TodoContext)


```


😎 No fim, nossa aplicação poderá utilizar o estado de maneira fluida:

![Context na prática](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jbjf2obity3c9d0bzfzs.png)

- A impressão que tive ao me deparar com o Context API, é que reduz significativamente a complexidade do gerenciamento de estado quando comparado ao React-Props E que não é bala de prata, pois quando nos deparamos com uma aplicação maior, onde se tem um time grande trabalhando em uma só aplicação, deveremos optar pela biblioteca Redux.
Video: SageMaker + VS Code + Github Copilot : the dream IDE for ML?
Tags: machinelearning, tutorial, cloud, tools
Published: 2022-11-01 14:11:23

---
title: Video: SageMaker + VS Code + Github Copilot : the dream IDE for ML?
published: true
date: 2022-11-01 01:57:38 UTC
tags: machinelearning,tutorial,cloud,tools
canonical_url: https://julsimon.medium.com/video-sagemaker-vs-code-github-copilot-the-dream-ide-for-ml-69f8f9823b57
---

### Video: SageMaker + VS Code + Github Copilot : the dream IDE for ML?

We have all our definition of the perfect development environment for ML. For me, it’s the combination of cloud-based managed infrastructure (all the way up to large multi-GPU instances), a great software IDE (not Jupyter!), and amazing productivity tools.

In this video, I show you how to make it happen by installing VS Code and Github Copilot on Amazon SageMaker. Yes, it’s possible :) Enjoy!

{% youtube WSaTtqo2zfU %}

- AWS blog: [https://aws.amazon.com/blogs/machine-learning/host-code-server-on-amazon-sagemaker/](https://aws.amazon.com/blogs/machine-learning/host-code-server-on-amazon-sagemaker/)
- Github copilot instructions: [https://docs.github.com/en/copilot/getting-started-with-github-copilot/getting-started-with-github-copilot-in-visual-studio-code](https://docs.github.com/en/copilot/getting-started-with-github-copilot/getting-started-with-github-copilot-in-visual-studio-code)
- Setup code for lifecycle configuration: [https://gist.github.com/juliensimon/4eccabf58fa2d97a294d181a525b0127](https://gist.github.com/juliensimon/4eccabf58fa2d97a294d181a525b0127)
Hacktoberfest Part 1: Made useless stuff
Published: 2022-11-01 01:53:35

## Overview 
The first repository that I worked on was a [react-useless](https://github.com/narze/react-useless) which is a collection of different useless react hooks and pretty must just a joke repository.

## Issue
The [issue](https://github.com/narze/react-useless/issues/153) was to create hook useForigner, which had the following description:
```
Receives text input and returns TTS URL then read it.

Seems useful right? So make it more useless.

Detect and make it read as another language randomly by changing lang= query param
```
To be honest it seems kind of funny to work on this kind of issue. 

## Implementation
The implementation involved two steps:
1 - Implement the hook itself
2 - Add it to the list of hooks and make it usable with different values 
It took me some time to understand how things worked in this repo and I had a good amount of experience working with react and react hooks so it wasn't difficult for me to make it work. When I was done I created the [PR](https://github.com/narze/react-useless/pull/158) and it got accepted without problems.

## Conclusion
The overall task wasn't difficult to implement and the maintainer was rapid in terms of communication. I found it funny to contribute to contribute to this kind of non-sense :)
AWS Community Day India 2022 Event | Free Swags & Goodies | Register Now
Tags: aws, webdev, cloud, devops
Published: 2022-11-01 01:36:31

AWS User Groups in India are back with a bang to host the most awaited event, AWS Community Day India 2022, unveiling success stories, use cases & much more from industry leaders.


![aws community](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u6k6y8871ymzviaxr892.png)

[Register your seats now devs before it's late](https://awscommunityday.in/?referred_by=8c5753bc&campaign_id=386&referral_mode=email)
Don't remove a fence until you know why it was put up in the first place
Tags: development, work
Published: 2022-11-03 23:57:09

---
title: Don't remove a fence until you know why it was put up in the first place
published: true
date: 2022-11-01 01:27:00 UTC
tags: development,work
canonical_url: https://rachsmith.com/dont-remove-a-fence/
---

Recently I learnt about [Chesterton's Fence](https://fs.blog/chestertons-fence/), a mental shortcut to help when you're deciding whether to change something in a system.

Chesterton's Fence states:

> Don't move a fence until you know why it was put there in the first place.

It is a prompt to consider that the person who put the fence there was using [second-order thinking](https://fs.blog/second-order-thinking) instead of assuming that your superficial understanding of why it should or shouldn't be there is all there is to it.

Do you know where there are a lot of fences? Codebases. Anyone who's worked on a codebase with multiple authors has come across old code that seems unnecessary. When I was a junior developer, I did some contracting jobs on codebases that many contractors had touched before me. There were a LOT of these fences. I didn't have enough experience to understand why they were there, so there was no way I was going to knock them down. I tiptoed around them.

As my experience and confidence as a developer have grown, I'm more willing to remove a fence. Even though I didn't know it had a name before a few weeks ago, "Chesterton's Fence" is real. I've often been owned by failing to think this way when re-writing code.

It's not always possible to chase down the exact reason a fence is there. The person who put it there may have moved on from the project. Because I've been working on CodePen for so long, I find fences I built five years ago, and I have _no memory_ of why I put them up. That's okay. I just need to do my best to uncover why.

The important part is not to assume that I know better than the person who made the original decision and take into account nuances or second-order effects that aren't obvious to me.

Be sure you've found a better reason than "because I know better" before you delete a fence.
Adding static analysis to my SSG
Published: 2022-11-01 00:48:15

Hi everyone,

This week I added some static analysis tools to my [SSG](https://github.com/NeilAn99/nan1-ssg). The tools I added are [Prettier](https://prettier.io/) and [ESLint](https://eslint.org/). Prettier is a code formatter to make code consistent and ESLint checks your code for any common errors/warnings.

It was easy to set both tools up. Since I was using nodejs, all I had to do was install the tools using npm. For Prettier, I used:
`npm install --save-dev --save-exact prettier`
and for ESLint I used:
`npm init @eslint/config`

Prettier changed a lot of stuff in my code. I usually put curly braces after a function or control statement like this:
```
if (...)
{

}
```
but Prettier changed to format to this:
```
if (...) {

}
```
Prettier also changed my indentation spacing and made everything look more compact.

For ESLint, it found a bunch of errors/warnings in my code. For example, a common warning was that I had unused variables in my code. There was also a warning telling me not to use async in a promise object.

To get the tools to run in the command line, I edited the package.json file and added some scripts to run Prettier and ESLint. Here is what I added:
```
    "lint": "npx eslint src",
    "prettier": "npx prettier --write .",
    "prettier-check": "npx prettier --check ."
```

To integrate these tools into my IDE (VSCode), I just added the Prettier and ESLint extensions. For people contributing to my project, I added a .vscode/extensions.json file so that these extensions would be recommended to them on opening the project.

Overall, I learned a lot about formatters and linters and why they are important when working in a shared repo.
Hi Developers! Top 5 lead nurturing tools to grow fast?
Tags: business, grow, programming, productivity
Published: 2022-11-01 00:35:50

Half of your lead forms are filled out by those who aren't even ready to purchase yet. 

The majority of these leads never convert, but don't be discouraged. Following lead generation, lead nurturing can dramatically improve results. A well-defined lead nurturing strategy generates 50% more sales at a lower cost!

**Hub Spot**
Digital marketers and SEO experts will be familiar with HubSpot. Almost everything you need to run a successful campaign is included.

**ProxyCrawl**
In order to carry out data mining or search engine optimization, ProxyCrawl is an all-in-one crawling and scraping platform.

**Churnfree**
Whatever stage your business is in, whether it is already successful, falling apart or just starting, you need to know what you can do to ensure they get the most value from your product or service.

**EasySendy**
Email campaigns can be set up quickly with easy drag-and-drop templates. With customizable opt-in forms, you can grow your subscriber list.

**LeadBoxer**
Marketers can estimate the probability of a prospect purchasing a product using LeadBoxer's lead-scoring technology. Additionally, you can identify and track anonymous leads with this tool.

**Ortto**
Over 10,000 companies use Ortto's lead nurturing software. This company, formerly known as Autopilot, provides businesses with the ability to segment their audiences across the customer life cycle.

**What Next?**
Isn't it time to get started?
You need these tools and tactics to get the most leads for your business.
8 Google Chrome add-ons to simplify your life (I'm sure).
Tags: productivity, webdev, javascript, news
Published: 2022-11-01 00:01:50

Google Chrome is by far the most popular web browser in the world, and part of its allure stems from the ease with which you can add new functionality via extensions, pushing it far beyond the business of browsing websites.

Find out which one is best for you! 💬 👇

## 1. [Scribe ](https://chrome.google.com/webstore/detail/scribe-%E2%80%94-documentation-so/okfkdaglfjjjfefdcppliegebpoegaii/related?hl=en&utm_source=LinkedIn)

This is a fantastic plugin that automatically converts any process into a step-by-step guide. Scribe can save you hundreds of thousands of hours of valuable time.


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

## 2. [Wappalyzer](https://chrome.google.com/webstore/detail/wappalyzer-technology-pro/gppongmhjkpfnbhagpmjfkannfbllamg/related?hl=en&utm_source=LinkedIn)

Discover a website's technical stack.

![Wappalyzer.gif](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/svd1l75ra8vrx5dzwono.gif)


## 3. [Jam ](https://chrome.google.com/webstore/detail/jam/iohjgamcilhbgmhbnllfolmkmmekfmci/related?hl=en&utm_source=LinkedIn)

The most efficient bug reporting tool. Your bug reporting time will be cut by 20x.

![Jam.gif](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9udoglxmwql55tjemgpe.gif)

## 4. [VisBug](https://chrome.google.com/webstore/detail/visbug/cdockenadnadldjbbgcallicgledbeoc?hl=en&utm_source=LinkedIn)

Open source web design debug tools built with JavaScript: a FireBug for designers.


![VisBug.gif](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rba6oy8j382flyglbexe.gif)

## 5. [HyperWrite](https://chrome.google.com/webstore/detail/hyperwrite-ai-writing-com/kljjoeapehcmaphfcjkmbhkinoaopdnd)

Wherever you write, HyperWrite offers hints and sentence completions to help you write better.


![HyperWrite.gif](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fy686kddkuqh4kwm179j.gif)

## 6. [Firefiles](https://chrome.google.com/webstore/detail/fireflies-meeting-recorde/meimoidfecamngeoanhnpdjjdcefoldn/related)

Record & Transcribe meetings & calls directly from the browser

![Firefiles.gif](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s0c8elt0p42beup8sgwz.gif)


## 7 [Text-Blaze](https://chrome.google.com/webstore/detail/text-blaze/idgadaccgipmpannjkmfddolnnhmeklj)

Eliminate any repetitive typing and create smart text expansions to get more done and streamline your work. 

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

## 8 [Motion](https://chrome.google.com/webstore/detail/motion-devtools/mnbliiaiiflhmnndmoidhddombbmgcdk)

Create web animations faster than ever with the chrome extension for CSS and Motion One.

![Motion](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yhv7juz6zn5p1nlt4uhd.gif)
Python For Beginner Series | Day 03
Tags: python, programming, beginners, tutorial
Published: 2022-11-01 00:00:43

On these Day 03, we are going to discuss String Manipulation in detail

**String Manipulation**

- The string is a collection of characters, also The value has been defined with double quotes or single quotes.

https://mynotesoracledba.medium.com/python-for-beginner-series-day-03-6ee9f28412e
Code Smell 175 - Changes Without Coverage
Tags: javascript, webdev, beginners, programming
Published: 2022-10-31 23:21:08

*If your merge request has no test changed, you haven't finished your job*

> TL;DR: Don't change the code without breaking some tests.

# Problems

- Quality

- Maintainability

# Solutions

1. Cover your code.

# Context

When you need to make a change, you need to update the live specification of your code.

That's why tests are for.

Instead of generating dead documentation of what your code does, you should write a covering use scenario.

If you change uncovered tests, you need to add coverage.

Suppose you change the code with existing coverage. Lucky you! Go and change your broken tests.

# Sample Code

## Wrong

[Gist Url]: # (https://gist.github.com/mcsee/51317c09b8994b6cb57e09e2059a5d9b)
```typescript
export function sayHello(name: string): string {
  const lengthOfName = name.length;
-  const salutation = `How are you ${name}?, I see your name has ${lengthOfName} letters!`;
+  const salutation = `Hello ${name}, I see your name has ${lengthOfName} letters!`;
  return salutation;
} 
```

## Right

[Gist Url]: # (https://gist.github.com/mcsee/7a5adcac0ead17d037924b6fd47888fb)
```typescript
export function sayHello(name: string): string {
  const lengthOfName = name.length;
-  const salutation = `How are you ${name}?, I see your name has ${lengthOfName} letters!`;
+  const salutation = `Hello ${name}, I see your name has ${lengthOfName} letters!`;
  return salutation;
}

import { sayHello } from './hello';

test('given a name produces the expected greeting', () => {
  expect(sayHello('Alice')).toBe(
    'Hello Alice, I see your name has 6 letters!'
  );
});
```

# Detection

[X] Automatic 

We can ensure all our merge requests include test code.

# Exceptions

If your code and your tests harness live in different repositories, you might have different pull requests.

# Tags

- Quality

# Conclusion

Test coverage is as important as functional code. 

The test system is our first and more loyal customer. 

We need to care for them.

# Relations

{% post https://dev.to/mcsee/code-smell-05-comment-abusers-2ba5 %}
 
# Disclaimer

Code Smells are just my [opinion](https://dev.to/mcsee/i-wrote-more-than-90-articles-on-2021-here-is-what-i-learned-1n3a).

# Credits

Photo by [Vincent Péré](https://unsplash.com/@vinzpr) on [Unsplash](https://unsplash.com/s/photos/umbrella)  

* * *

>  Before you use a method in a legacy system, check to see if there are tests for it. If there aren’t, write them. When you do this consistently, you use tests as a medium of communication.

_Michael Feathers_

{% post https://dev.to/mcsee/software-engineering-great-quotes-26ci %}

* * *

This article is part of the CodeSmell Series.

{% post https://dev.to/mcsee/how-to-find-the-stinky-parts-of-your-code-1dbc %}