teleren/devto huggingface dataset:
Creating Convincing Arguments 
Tags: writing, productivity
Published: 2021-01-04 15:28:04

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/82wzwvvimq7fo88vparv.jpeg)

This materials were taken from [Coursera's Science Literacy Course](https://www.coursera.org/learn/science-literacy/).

Aristotle taught about three basic modes of persuasion. These modes appeal to human nature and continue to be used today in writing of all kinds, politics, and advertisements.

A well-rounded, well-developed, argument, includes: 1) Ethos, 2) Pathos, and 3) Logos looks credible and will maintain your audience's attention, even if they don't agree. 

**1. Ethos (supporting evidence):**

* Build credibility by integrating anecdotes from those with specific experience or education,
* Avoid logical fallacies. As they are not supported by scientific evidence, rather are a product of fake science,
* Do not discuss the extremes. As these may hurt credibility if they are not representative of the problem,
* Use systematically collected evidence as it is least likely to be biased by emotions,
* And balance the Pathos (emotions) and Logos (logic).

**2. Pathos (emotions):**

* Appeal to emotions by considering all potential emotions people experience,
* To be effective, use emotions most related to your topic (ex. sympathy for students financial situation),
* Use credible, verified, examples to appeal to target emotions (ex. provide examples of students real life financial stress),
* Don't sound too emotional, maintain an even tone.

**3. Logos (present the logical conclusion given the evidence discussed):**

* Appeal to logic
* Consider the audience perspective and Build argument around what makes sense to audience
* Present a clear line of reasoning
* Avoid faulty logic
* Clearly present research and, if appropriate personal experience, to provide evidence.

#365writings #365figures
3 Accurate Speech-to-Text APIs You Don't Know About
Tags: ai, machinelearning, programming, saas
Published: 2021-01-04 15:23:38

Since speech recognition is at the forefront of most machine learning efforts, most developers have been leveraging some of the most popular and advanced speech-to-text APIs to build their services. Many large companies, like Google, Microsoft, Amazon provide cloud APIs for speech processing. Below are three speech to text APIs you may not have heard of, but which are successfully compete with popular vendors and provide you the best-in-class accuracy.

#1. [Rev.ai](https://www.rev.ai/)
The Rev.ai API provides speech-to-text recognition services that can make audio and video content searchable and accessible. Rev.ai offers global recognition models supporting all major English accents for use in speech-to-text transcription. The speech recognition engine was trained on 50,000+ hours of human-transcribed content from a wide range of topics, industries, and accents. You can easily check how Rev.ai [compares with Google](https://www.rev.ai/compare).  

#2. [SpeechText.AI](https://www.speechtext.ai/)
The SpeechText.AI API automatically transcribes speech to text and summarizes audio data with high accuracy in multiple languages. SpeechText.AI uses a combination of speech recognition and natural language processing models to auto-summarize your recordings and highlight key moments in discussion. The unique domain-specific speech recognition technology enables users to improve the accuracy of automatic transcription for industries such as finance, healthcare, legal, IT, HR, and others. The service can recognize multiple speakers and add word-by-word timestamps, punctuation, casing to transcription results. SpeechText.AI supports almost all common media file formats and can transcribe audio/video files stored on your hard drive or files accessible over public URLs (HTTP, FTP, Google Drive, Dropbox, etc.). The SpeechText.AI's speech recognition algorithm achieves a word error rate of 3.8% on the open source LibriSpeech dataset (~96% accuracy).

#3. [AssemblyAI](https://www.assemblyai.com/)
AssemblyAI offers speech recognition and transcription capabilities which help developers in building voice-powered applications. The API supports customizable transcription which recognizes industry-specific phrases unique to a product. It is more than speech-to-text service. AssemblyAI has a lot of useful functions. E.g. it automatically detects and removes sensitive information from audio files such as credit card numbers, SSNs, and more. 


Do you have another speech recognition engine you use? Tell me about it in the comments.
Create ToDo App With Vue 3 Composition API
Tags: vue, javascript, webdev, opensource
Published: 2021-01-04 15:18:47

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/2bb7dh3kvz5xq5c4wwdm.png)

Hi there,
I will show you how to create todo app with composition api. Composition api is new feature to Vue.js and it's like React Hooks.

Let's build app.

**1. Create new Vue 3 project with Vue CLI.**
```
vue create-app todo-app
```

**2. Create form and todo list in App.vue.**
```vue
<template>
	<h1>ToDo App</h1>
	<form @submit.prevent="addTodo()">
		<label>New ToDo </label>
		<input
			v-model="newTodo"
			name="newTodo"
			autocomplete="off"
		>
		<button>Add ToDo</button>
	</form>
	<h2>ToDo List</h2>
	<ul>
		<li
			v-for="(todo, index) in todos"
			:key="index"
		>
			<span
				:class="{ done: todo.done }"
				@click="doneTodo(todo)"
			>{{ todo.content }}</span>
			<button @click="removeTodo(index)">Remove</button>
		</li>
	</ul>
	<h4 v-if="todos.length === 0">Empty list.</h4>
</template>
```

**3. Import `ref` package. Takes an inner value and returns a reactive and mutable `ref` object.**
```vue
<script>
import { ref } from 'vue';
</script>
```

**4. The `setup` function is a new component option. Create `setup` function.**
```vue
<script>
import { ref } from 'vue';
export default {
  name: 'App',
  setup () {
  }
}
</script>
```

**5. Create all property and methods. Also we use `localStorage` for data saving.**
```vue
<script>
	import { ref } from 'vue';
	export default {
		name: 'App',
		setup () {
			const newTodo = ref('');
			const defaultData = [{
				done: false,
				content: 'Write a blog post'
			}]
			const todosData = JSON.parse(localStorage.getItem('todos')) || defaultData;
			const todos = ref(todosData);
			function addTodo () {
				if (newTodo.value) {
					todos.value.push({
						done: false,
						content: newTodo.value
					});
					newTodo.value = '';
				}
				saveData();
			}
			function doneTodo (todo) {
				todo.done = !todo.done
				saveData();
			}
			function removeTodo (index) {
				todos.value.splice(index, 1);
				saveData();
			}
			function saveData () {
				const storageData = JSON.stringify(todos.value);
				localStorage.setItem('todos', storageData);
			}
			return {
				todos,
				newTodo,
				addTodo,
				doneTodo,
				removeTodo,
				saveData
			}
		}
	}
</script>
```

That's it. Also i add some SCSS code in App.vue. See demo:
###**Demo: [https://todo-app.burakgur.vercel.app/](https://todo-app.burakgur.vercel.app/)**

####Repo: [https://github.com/BurakGur/vue3-composition-api-todo-app](https://github.com/BurakGur/vue3-composition-api-todo-app)

Thanks for reading 😊
Problems with getting data from redux-store
Published: 2021-01-04 15:17:00

I create the component, connect it to redux, initialized the state and created reducer.

Component:

     const store = createStore(fetchReducer, initialState, devToolsEnhancer());

    class Table extends React.Component {
      // constructor

       getDataFromState = function () {
          let propsContent = this.props;
          let itemsStored = propsContent.itemsProp;
          return itemsStored;
         };

       getOperationItems = function () {
          let itemsStored = this.getDataFromState();
          itemsStored.map((item, index) => (
              <li> key={index} item={item}</li>
           ))};

       render() {
           return (
               <div className={styles}>
                   {this.getOperationItems()}
               </div>
             );
         }
     }

     const mapStateToProps = (store) => {
         return {itemsProp: store.items}
      };

     export default connect(mapStateToProps)(Table)

    ReactDOM.render(
       <Provider store={store}>
           <Table/>,
        </Provider>,
       document.getElementById("app")
    );

Initial state:

    export default {
       items: [
          {
            'Date': 1,
            'Operation': 1
           }
         ]
     }
Reducer:

     import initialState from '../constants/initialState';

     export default function update(state = initialState) {
               return state;
      }

But I cant get the initial data from store. Debugging, I see in method Table#getDataFromState that propsContent contains the empty ({}) array - not the expected [{'Date': 1,'Operation': 1
}].

Debugging also I see, that reducer receive the initial state with properly data: [{'Date': 1,'Operation': 1}]
'Bitcoin is now programmable money' | Stacks 2.0 set to Launch on Jan 14
Tags: bitcoin, blockchain, smartcontract, stacks
Published: 2021-01-04 15:11:40

Blockstack is launching its <b>[Stacks 2.0 Blockchain](https://stacks2.com/register?ref=fh)</b>, which uses Bitcoin blockchain as a secure base-layer that brings decentralized apps and smart contracts to Bitcoin through a unique consensus mechanism (Proof-of-Transfer) that runs between the Bitcoin blockchain and the Stacks chain, unlocking new innovation and a new way to earn Bitcoin. 

_"The first chain to implement PoX (Proof-of-Transfer) is Stacks 2.0, the latest version of the Blockstack chain, which derives its security from Bitcoin. This means that participants in the Stacks 2.0 consensus earn BTC. And Stacks 2.0 has direct access to Bitcoin state and can trigger logic in Clarity smart contracts through changes in Bitcoin state. Clarity itself provides important innovations, such as being decidable for dramatically increased security and assured performance."_ -- [Albert Wenger](https://www.usv.com/writing/2020/12/stacks-2-0/), managing partner at Union Square Ventures


The launch will be just the beginning of an exciting new era for the Stacks community and for crypto broadly as developers begin to leverage Stacks to build a user-owned internet on Bitcoin.


[![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/1tnpyf1sb3zpoxksohmr.png)](https://stacks2.com/register?ref=fh)


If you're a developer who is interested in learning more about Stacks 2.0, feel free to register for the <b>[Stacks 2.0 Launch Event](https://stacks2.com/register?ref=fh)</b> for free and hear straight from the Stacks crew, featuring leading industry experts: [Anthony Pompliano](https://twitter.com/APompliano) and more.


Cover photo credit: [Alex Lee](https://twitter.com/kkomaz/status/1337053109693140996)
the overengineer
Tags: webdev, frontend, devjournal
Published: 2021-01-04 15:04:15

> Kailan ka ba titigil?

A team mate asked me when I'll finally stop. He was referring to my seemingly never-ending refactors. 

--- 

The frontend landscape is always changing. You wake up, and there's two new frameworks or bundlers or "must-use" packages. Everything is changing constantly, and sometimes it's really tiring. And when I get tired of all the crazy stuff, I remember Chris. 

--- 

The cover image is [Chris Heilmann](https://christianheilmann.com/) in JS Conf 2015. His **Overboard.JS** talk continues to console me to this day. It's a reminder that I don't have to use every new and shiny thing right away! Actually, I may not have to use all of them. Or any of them.

It's a matter of good judgment. And staying in this domain? It's a matter of passion.
Scrape Facebook public pages without an API key or limitations
Tags: facebook, python, scraping, selenium
Published: 2021-01-04 15:02:44

Facebook's API is really difficult to setup and have rate limiting as well. Why not getting public data with some automation?. Here's a python library that does the job.

Install it with pypi:
``` pip install facebook-page-scraper ```

Or 
Install it from source:
Download it using git:
``` git clone https://github.com/shaikhsajid1111/facebook_page_scraper.git ```

and open terminal inside folder and enter command:
``` python3 setup.py install ```.

How to use it?
Well its simple!,
Just import class from the package,instantiate and start scraping.

Suppose I want posts from Facebook AI,
```python
from facebook_page_scraper import Facebook_scraper

#instantiate the Facebook_scraper class

page_name = "facebookai"
posts_count = 10
browser = "firefox"

facebook_ai = Facebook_scraper(page_name,posts_count,browser)
``` 

Above was instantiation part, Suppose you want data in JSON format than just call the ``` scrap_to_json() ``` method.
Like:
```python
json_data = facebook_ai.scrap_to_json()
print(json_data)
```
And you will get the JSON Output:

```JSON
{
    "1730063790503900": {
        "name": "Facebook AI",
        "shares": 65,
        "reactions": {
            "likes": 305,
            "loves": 31,
            "wow": 7,
            "cares": 0,
            "sad": 0,
            "angry": 0,
            "haha": 0
        },
        "reaction_count": 343,
        "comments": 11,
        "content": "We\u2019re training computer vision models that leverage Transformers, a deep neural network architecture. Data-efficient image Transformers (DeiT) use less data and computing resources to produce high-performance image classification AI models.  We hope to advance the field of computer vision by sharing this work with the broader community, making large-scale systems that train AI models more accessible to researchers and engineers.",
        "posted_on": "2020-12-24T04:05:27",
        "video": "",
        "image": [
            "https://scontent-bom1-2.xx.fbcdn.net/v/t39.2365-6/p540x282/131570013_988138305044034_3894567585410559092_n.png?_nc_cat=109&ccb=2&_nc_sid=eaa83b&_nc_ohc=mAeDelparrEAX-3Mk7E&_nc_ht=scontent-bom1-2.xx&_nc_tp=30&oh=3fedb0e3cea6ad6f934ca20f77bec624&oe=600CB4C9"
        ],
        "post_url": "https://www.facebook.com/facebookai/posts/1730063790503900"
    },    ...

}
```
if you want to save the data to CSV file directly, Just call the ``` scrap_to_csv() ``` method.

Like:
```python
filename = "data_file"  #file name without CSV extension,where data will be saved
directory = "E:\data" #directory where CSV file will be saved
facebook_ai.scrap_to_csv(filename,directory)
```
Output:

![CSV output](https://dev-to-uploads.s3.amazonaws.com/i/f2nidz5yyd955374bpzj.png)

[source](https://github.com/shaikhsajid1111/facebook_page_scraper)
Prevent an object key from appearing in `Object.keys()` or `for..in` loop
Tags: javascript, webdev, codenewbie, beginners
Published: 2021-01-04 15:00:08

```js
const obj = { name: "Human", age: 26, location: "World", role: "Developer" };

console.log(Object.keys(obj)); // [ 'name', 'age', 'location', 'role' ]

// Updating setting for `name` property 
Object.defineProperty(obj, "name", {
  enumerable: false,
});

console.log(Object.keys(obj)); // [ 'age', 'location', 'role' ]

const objKeys = [];
for (const key in obj) objKeys.push(key);

console.log(objKeys); // [ 'age', 'location', 'role' ]
```

---

**Thanks for reading 💙**  
Follow **@codedrops.tech** for daily posts.  
[Instagram](https://www.instagram.com/codedrops.tech/) ● [Twitter](https://twitter.com/codedrops_tech) ● [Facebook](https://www.facebook.com/codedrops.tech/)

Micro-Learning ● Web Development ● Javascript ● MERN stack ● Javascript  
**[codedrops.tech](https://www.codedrops.tech/)**
How to Force git to Prompt You For a Password
Tags: git, github, authorization, passwords
Published: 2021-01-05 13:53:12

---
title: How to Force git to Prompt You For a Password
published: true
date: 2021-01-04 15:00:00 UTC
tags: git,github,authorization,passwords
canonical_url: https://seankilleen.com/2021/01/how-to-force-git-to-prompt-you-for-a-password/
---

A fun git challenge! I had to make a request against a remote repository in git. The only issue is that only a shared GitHub account had access, not my own account (due to a vendor limitation). So when I occasionally needed to use this remote, I would have to log out and log in as the service account. It just seemed a bit messy.

I found a reasonable way to do this, and I’ll run through the steps below. (Have a better way? I’d love to hear about it in the comments!)

## Generate an Access Token for the Shared Account

- Login with the shared account. Since I had the credentials, I did this via a normal browser session (in a private window since I was just logging in once.)
- Generate a personal access token. If you’re unfamiliar with this, you can [follow the steps in the GitHub docs](https://docs.github.com/en/free-pro-team@latest/github/authenticating-to-github/creating-a-personal-access-token).
- Store in my password manager. This access token is as good as a password, so I treat it with the respect it deserves.

## Add the Remote in Git

- Add the remote if it’s not already added: `git remote add REMOTE_NAME THE_URL_OF_THE_REMOTE`

## Unset the git credential manager temporarily

I’m doing the steps here manually but it could almost certainly be automated in a tiny script.

- Check the value of credential manager: `git config --system credential.helper`. Note this value for later; you will need it to set things back.
- Unset the credential manager, which will prompt you for PW going forward: `git config --system --unset credential.helper`

## Running the command

- Run your applicable command, e.g. `git fetch upstream` in my case. You’ll be prompted for a password.
- Use the shared account username, and the personal access token as the password

## Return things to normal

- Set the value of the credential manager back to what it was, e.g manager-core in my case: `git config --system credential.helper manager-core`

That will let you quickly do one-time operations as the other account without needing to log out / in, mess up your other git credentials, etc.

Happy gitting!
Python has a built in search function. Here's how to use it
Tags: python, beginners, tutorial, programming
Published: 2021-01-04 14:58:27

I was going through the Python docs and guess what I came across? A function that helps you get closest matches to a list of other strings. Now why would that function be useful, you'd ask. Let me give you a proper example.

### The problem

About 1 and a half years ago, I was working on playx. It is a tool that lets you stream music from the commandline directly from YouTube. While working on it, we decided that adding a feature to cache the files would be pretty nice. Now, while implementing that, we came across a problem. We needed to check if a song is already cached.

Now, the issue is, on YouTube, one song is uploaded by various channels which means the titles vary and since we were caching the songs using the title of the video from YouTube, that meant that if we did a direct match of the titles, it would be a very inefficient way to check if the song has been cached already.

For example, if we have the song name `Sundown`. This song might have been saved as `Sundown - Gordon Lightfoot`. However, the next time user tries to play the same song which had a different title, something like `Sundown - Lyrics only | Gordon Lightfoot`. In this case, a simple match would indicate that both songs are different and the tool would end up caching both even though the songs are same.

If you got an idea of the problem from reading the above, I think you would agree with me that it is similar to searching a particular file in a list of files.

## This was originally posted on my personal blog and can be read [here](https://blog.deepjyoti30.dev/pythons-builtin-search-function)
TIL to peek into zip archives
Tags: linux
Published: 2021-01-04 14:55:06

It is just a minute of googling, but I just learned it and I think it is worth sharing. Say you have `data.zip`, then you can:
1. `$ vim data.zip`
2. `$ less data.zip`
3. or the not-so-fancy `$ unzip -l data.zip`
The vim version is super fancy - you can even peek into different files in the archive there! (doesn't really work for images, but oh well, what can you do)
Add Some Colour To Your Python Logs
Tags: python, codenewbie
Published: 2021-01-04 14:48:29

Logging is an essential part of any mid-large size application which will give you an idea of the inner working of your code.   Once you get beyond a small application, just using print statements can be quite cumbersome and difficult to maintain.

The python `logging` library is already very useful to allow you to create output of logs, but then they can be quite difficult to read.  It can be especially difficult when you are trying to trace through an execution to debug what happened.

This is where the `colorlogs` library can really help.  With the library you can add some color based on types of logging messages - e.g. red for error, blue for debug etc.

See the following code snippet:

```
import coloredlogs, logging

mylogs = logging.getLogger(__name__)

coloredlogs.install(level=logging.DEBUG, logger=logger)
# Some examples.
mylogs.debug("This is debug")
mylogs.info("This is info")
mylogs.warning("This is warning")
mylogs.error("This is an error")
mylogs.critical("This is a critical message")
```
![colored-output](https://dev-to-uploads.s3.amazonaws.com/i/tr6qzd0tp2a23kwwa21c.png)


`coloredlogs` creates a stream handler and attaches it to the logger passed. It has its own default format and colour settings which can be customised as per interest. Lets first look at the few important parameters we can pass in `coloredlogs.install()`

* `level` - An integer to denote the level. (Remember logging.DEBUG returns an integer)
* `logger` - Name of the logger in which this stream handler has to be attached. (Performs same act as `logger.add_handler()` )
* `fmt` - A string denoting the format style.
* `datefmt` - A string denoting the format of asctime .
* `level_styles` - A dictionary containing the data of level and their colors
* `field_styles` - A dictionary containing the data of field and their colors 

To find out more about setting up logs, you can see our full article [Logging in Python 3, How To Output Logs to File and Console](https://pythonhowtoprogram.com/logging-in-python-3-how-to-output-logs-to-file-and-console/?utm_source=dev.to&utm_medium=cp&utm_campaign=ctalink&utm_term=logging-in-python-3-how-to-output-logs-to-file-and-console) .  We give tips on how to setup log output both to a screen and a file, as well as other great tips.
EVERYTHING you NEED to know about {{TREND}} in 2021
Tags: programming, productivity
Published: 2021-01-04 14:45:55

1. That it exists.
2. How to find its documentation and tutorials.
3. A 30 second "elevator pitch" of when it is best used.

And that's it! Everything you **_need_** to know about `{{TREND}}` this year. Of course, you may **_want_** to learn more about `{{TREND}}` in 2021, for that refer to items one and two (and for deciding if it is a good idea for you to learn `{{TREND}}`, refer to item three).