teleren/devto huggingface dataset:
print function in python
Tags: python, programming, beginners, tutorial
Published: 2021-01-02 08:43:00

**print()** function and [*input() function*](https://lnkd.in/eXDgD-r) makes the program more interactive with the user.

Although, there are some extra things we can do with *print()* which makes the output formattable.

## Functionalities of print() function
* Let's start with the syntax:
`print(object(s), sep=separator, end=end, file=file, flush=flush)`
* *Fact: In python, all data types are implemented as an object.*
* *object(s)*: Will accepts any number of objects, which will be converted into a string before printed. We can pass it in two way:
1. Concatenated:
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/d862yfw68qch0xg4yza2.png)
2. Comma seperated:
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/avb86wz6301z7h6d0f42.png)
Output:
```
Enter any number: 2021
year:2021
```

* *sep='separator'*: This is Optional.
Used to specify how to separate the objects, if there is more than one.
Default is ' ' (space).
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/zzzxl27vj0sognuihgjj.png)
Output:
```
Enter any number: 2021
year:   2021
```
* *end='end'*:  This is Optional.
Used to specify what to print at the end.
Default is '\n' (new line).
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/ytgicradt44tei2tgogp.png)
Output:
```
Enter any number: 2021
year: 2021  month: Jan
```
* *file*: This is Optional. Default is sys.stdout. Used to specify the name of the file to write the output. If the file doesn't exist, it will create a new file.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/hzmz2vapi8vgwlr4zshy.png)
Output (in 'Greetings.txt' file):
```
!!!	Wish you a happy new year	!!!
Enjoy the year--->2021---> and the month --->January
```

* *flush*: This is Optional. A Boolean, specifying if the output is flushed (True) or buffered (False). Default is False.

* [Check out this GFG article for a detailed explanation of the flush parameter](https://www.geeksforgeeks.org/python-sys-stdout-flush/)

### Best Resources

- [Python Blog Series](https://dev.to/aswin2001barath/series/10416) : A Blog series where I will be learning and sharing my knowledge on each of the above topics.

- [Learn Python for Free, Get Hired, and (maybe) Change the World!](https://academy.zerotomastery.io/a/aff_tz1t0tpx/external?affcode=441520_dcwk-s8s) : A detailed roadmap blog by Jayson Lennon (a Senior Software Engineer) with links to free resources.

- **Zero To Mastery Course** - [Complete Python Developer](https://academy.zerotomastery.io/a/aff_9khypm7v/external?affcode=441520_dcwk-s8s) : A comprehensive course by Andrei Neagoie (a Senior Developer) that covers all of the above topics.

**Who Am I?**

I’m Aswin Barath, a Software Engineering Nerd who loves building Web Applications, now sharing my knowledge through [Blogging](https://medium.com/techsoftware) during the busy time of my freelancing work life. Here’s the link to all of my socials categorized by platforms under one place: https://linktr.ee/AswinBarath

**Thank you** so much for reading my blog🙂.
Text Summarization
Tags: machinelearning, computerscience, datascience, nlp
Published: 2021-01-02 08:38:35

Nowadays, large amounts of data are stored digitally, which is accessed by a computer for analysis. However, manually analyzing the data through human efforts is an expensive task. When the number of documents is high, we need more workforce. So, it is necessary to provide a better mechanism to extract useful information fast and most effectively. Therefore, various computerized methods have been proposed to do an automatic analysis of documents to provide a better summary than a human-generated summary with less effort and which is less expensive. Text summarization reduces the text of a document to provide a concise representation that contains the most important sentences or keyphrases of the original document for faster data analysis.
Mainly, automatic text summarization categorized into two:
**Extractive Summarization**, generates the summary by including the word, sentences, or key-phrases as it is in the original document while, **Abstractive Summarization**, generate the summary by taking the semantic meaning of the document. It May or may not include the word, sentences, or key-phrases from the original document, it can add new words, sentences also.
Basically, Extractive Text Summarization can be done in the following steps:
### Tokenization and Preprocessing: 
Tokenization is the process of breaking the document into words, knows as **word tokenization** or sentences, known as **sentences tokenization**. Next, removal of the stop words, stemming or lemmatization to get a base form of the word, come under preprocessing. We can use the NLTK Python library for tokenization and preprocessing. Note that before further processing of input data make sure you have indexed the sentences otherwise on the final summary it would be difficult to rearrange them into a sequence.
### Vector Representation:
Real-world data can’t be represented numerically, Therefore we need to apply some transformation in the input space to convert data into feature space. So, we can do numerical analysis on the input data. Text data is high-dimensional data that can be represented in different forms such as word count vector or TF-IDF vector.
### Sentences Scoring:
We have represented sentences in the form of vectors. Now, find the similarity between all the vectors. To find the similarity between vectors, Jaccard Similarity, Euclidean distance, Cosine similarity metrics are used. Based on their similarity, we can assign a score to each sentence using TextRank, LexRank, etc. 
### Sentences Extraction:
Each sentence has a score, based on their score sort them and pick the top n sentences from the source document. So, we get the human-readable form that will be included in our summary and rearrange them, based on their index. 



###### This is a formal introduction to automatic text summarization. Next, we will see each step's in-depth and practical implementation...
Code fatigue - looking ahead
Tags: mentalhealth, fatigue, programming, reflection
Published: 2021-01-02 08:34:14

## Remedies

Some ideas for coping with lack of energy and inspiration for coding.

Let go of the need to do and learn everything amazingly all the time. 

Remind myself to pick the projects and tasks that matter to me most.

Step away from the keyboard if I feel like I am anxious and losing a battle. 

Balance is important. I must make time to talk to people, read books and go on walks.

I should also step back and figure out what I want to achieve and what it making me frustrated and why. Then I can make a decision which might be to take pressure off myself.

## The bright side

Of course, 2020 has been a hard year for everyone. Yet despite that, I had many successes this year, which I cover in [this post](https://dev.to/michaelcurrin/2020-in-review-1563).

I have many years of learning and coding ahead of me. So I'll aim to be more patient with myself.

## Credits

<span>Cover image by <a href="https://unsplash.com/@next_academy?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">NEXT Academy</a> on <a href="https://unsplash.com/?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></span>
Learn MongoDB: Delete Documents
Tags: mongodb, tutorial, database, nosql
Published: 2021-01-02 08:22:15

Deleting documents is one last task that we need to study to finish the CRUD functionality. Deleting documents is similar to finding data. The only difference is, instead of getting the result, we want to delete that data. So, all the knowledge you gained from the post ["querying document"](https://dev.to/paras594/learn-mongodb-update-documents-2mc3) , will be applied here. 

---

**Table Of Content:**

- [Delete Methods](#delete-methods-in-mongodb)
- [Examples](#examples)

---

## Delete Methods in MongoDB

Main methods that we use in deleting docs are:

- deleteOne
- deleteMany

Methods that are mostly for database administrators and not used  at application level are:

- collection.drop()
- db.dropDatabase()

We will use our previous, `trainers` collection, to understand these methods. 
Following is the structure of document in trainers collection:

```json
{
   name: "Ash",
   age: 18,
   pokemons: [
      { name: "pikachu", type: "electric", level: 16 },
      { name: "charizard", type: "fire", level: 30 },
      { name: "squirtle", type: "water", level: 12 }
   ],
   badges: ["boulder badge", "cascade badge"],
   exp: 200,
   currentTown: "Pallet Town"
}
```



## Examples 

- **deleteOne() :** this method deletes the first document that matches our query. So, even if the query finds 20 documents, it will only delete the first one.

```bash
# delete trainer Ash
> db.trainers.deleteOne({ name: "Ash" })
```



- **deleteMany() :** this method deletes all the documents that matches our query. 

```bash
# delete trainers with age greater than 20
> db.trainers.deleteMany({
	age: { $gt: 20 }
})

# delete all trainers from the collection
> db.trainers.deleteMany({})
```



> I won't go deep into selecting nesting fields because it is already covered in the query documents post. There, all the operators and types of queries are explained with example. 



- **collection.drop() :** drop method, when used on a collection, deletes the whole collection from our database. This method is not used at application level because we don't usually delete whole collection.

```bash
# drop trainers collection
> db.trainers.drop()
```



- **db.dropDatabase() :** with this method, you can delete the whole database (sounds fun, isn't it?). Again, we don't use this method in our application for the same reason.

```bash
# switch to a db and use the following
> db.dropDatabase()
```



So, we managed to get rid of all the database and collections we had. 

---

That was it, we learned to delete docs, collections and databases.

In the next post, we will learn about indexes. They are pretty fun. They increase the speed of our queries even in a large collection of data.

Hope you are having fun learning mongoDB.

**Next Post :** [Working with Indexes](https://dev.to/paras594/learn-mongodb-working-with-indexes-36p9)

**Prev Post :** [Update documents](https://dev.to/paras594/learn-mongodb-update-documents-2mc3)
3D Shiny Image Grid (live demo)
Tags: lume, webgl, html, threejs
Published: 2021-01-02 07:59:20

Happy new year everyone!

Tonight I made a shiny image grid to start the new year of 2021. I wish to unleash more creativity this year!

{% youtube 5UK3Amre0tk %}

{% codepen https://codepen.io/trusktr/pen/rNMdamE %}

Made with #LUME

http://github.com/lume/lume

#webgl #threejs #html #css #javascript #webdev #webdevelopment #graphics #3D
OnlySearcher
Tags: firstpost, security, inclusion
Published: 2021-01-02 07:36:42

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

I'm glad to talk about the fist tool to [search onlyfans](https://onlysearcher.com) made from fan to fans. It's the first search engine and works getting the info from onlyfans and sharing all with the users.

OnlyFans is a content subscription service based in London, United Kingdom. It is a social media platform which allows content creators to post content and receive payment directly from their followers, or “fans”. It has millions of users that pay influencers for access to exclusive content.

OnlyFans has been around since 2016 and is widely used by sex workers, though celebrities like Cardi B and Bella Thorne have also recently begun using it to earn an income.

The popularity of the Platform was exploded in the last 2 years but but during the recent lockdown it has become more and more famous. The reason is simple OnlyFans is mostly used for NFSW type of content, so due to job loss many of the dance girls signed up on OnlyFans and earned their livings.

It has, however, because very useful for people offering adult entertainment, from cam girls, adult models to porn creators and porn stars. (And reality TV people who want to make extra cash by sharing revealing snaps.)

“As far as we’re concerned, if you use social media and produce your own content, you should be using OnlyFans,” its website says.

“Whether you’re uploading tutorials, tips, behind-the-scenes footage or just endless selfies, a lot of your followers would be willing to pay for them.”
return to react
Tags: react, todayisearched, devjournal
Published: 2021-01-02 07:26:59

In 2020 most of my time was spent dealing with legacy systems revolving around jQuery. By the end of the year, I had my personal roadmap quite laid out for 2021, and migration to react is on top of the list.

---

I started listing down the things I have to do:
- list the new feature requirements 
- check my current reactJS setup
- review reactJS changes and the packages I use

---

**Current setup:** reactJS + redux. To note, I'm using redux-form and redux-saga. I use this for my big dashboard projects.


**New setup:** reactJS, no redux. My new project does not need redux. I'm still in the process of redesigning, but this will probably be it. I will surely miss redux-saga though.

---

Anyway, for now here are things I learned / checked out:
- new form: [formik](https://formik.org/) vs [react-final-form](https://github.com/final-form/react-final-form). I learned both and their APIs do look similar.
- validations: [yup](https://github.com/jquense/yup). Clean validation schemas. I haven't looked for something else though. So no comparisons.
- xhr: [ky](https://github.com/sindresorhus/ky). Based on the native fetch.
- [react-query](https://react-query.tanstack.com/). Interesting, especially for data-heavy projects.
- new setup for [webpack5](https://webpack.js.org/blog/2020-10-10-webpack-5-release/) and babel
- [enzyme](https://enzymejs.github.io/enzyme/) vs [react-testing-library](https://github.com/testing-library/react-testing-library). Decided not to change my current setup using enzyme. At least not for now, because I just have too many other things to decide on.
- Learned [redux-saga can be used without redux](https://github.com/redux-saga/redux-saga/issues/1198)

Lastly, [Robin Wieruch's tutorials](https://www.robinwieruch.de/categories/react). I first started truly learning reactJS through his ebooks. That was in 2017. Every time I want to brush up on my FE knowledge, I always visit his website.
Getting input in python
Tags: python, programming, beginners, tutorial
Published: 2021-01-02 07:22:00

Getting input from the user is what makes a program more interactive with the user.

Hence, in python we have an input function: **input()**, to receive input from the user.

Take a look at an example.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/e3sp4ikfalv5h6fkmt0d.png)
Output:
```
Enter any data:Happy new year!
Happy new year!
```

## input function under the hood
* When *input()* function is encountered by python, the program will pause until the user enters data.
* Later, any input entered by the user will be converted into a *string*. Let's see another example to understand this point.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/cp4cys4cxrykhdi831tu.png)
Output:
```
Enter any text: Have a great year ahead.
text: Have a great year ahead. , type: <class 'str'>
Enter any number: 2021
number: 2021 , type: <class 'str'>
```

* So, in these cases make sure that you convert the input to your preferred data type using its corresponding constructors. Let's see that example too.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/7igk9a1p5mmnrtga77ln.png)
Output:
```
Enter any number: 2021
number: 2021 , type: <class 'int'>
```

### Best Resources

- [Python Blog Series](https://dev.to/aswin2001barath/series/10416) : A Blog series where I will be learning and sharing my knowledge on each of the above topics.

- [Learn Python for Free, Get Hired, and (maybe) Change the World!](https://academy.zerotomastery.io/a/aff_tz1t0tpx/external?affcode=441520_dcwk-s8s) : A detailed roadmap blog by Jayson Lennon (a Senior Software Engineer) with links to free resources.

- **Zero To Mastery Course** - [Complete Python Developer](https://academy.zerotomastery.io/a/aff_9khypm7v/external?affcode=441520_dcwk-s8s) : A comprehensive course by Andrei Neagoie (a Senior Developer) that covers all of the above topics.

**Who Am I?**

I’m Aswin Barath, a Software Engineering Nerd who loves building Web Applications, now sharing my knowledge through [Blogging](https://medium.com/techsoftware) during the busy time of my freelancing work life. Here’s the link to all of my socials categorized by platforms under one place: https://linktr.ee/AswinBarath

**Thank you** so much for reading my blog🙂.
Why I Hate Python
Tags: python, programming, beginners
Published: 2021-01-02 07:13:09

[![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/o5sfw2wwhi7hxsbs0egz.png)](https://aagamsheth.com/why-i-hate-python)
# [**Why I Hate Python By Aagam Sheth**](https://aagamsheth.com/why-i-hate-python)

Click on the Image or the header to view my blog on my personal Site.
Project 27 of 100 - mini-project: Configuring a React Project for Tailwind CSS
Tags: react, javascript, 100daysofcode, css
Published: 2021-01-02 07:07:53

*Hey! I'm on a mission to make 100 React.js projects ending March 8th. Please follow my dev.to profile or my [twitter](https://www.twitter.com/jwhubert91) for updates and feel free to reach out if you have questions. Thanks for your support!*

Link to today's deployed app: [Link](https://100-react-projects-day-27-tailwind-css.netlify.app/)
Link to the repo: [github](https://github.com/jwhubert91/100daysofreact/tree/master/day-27-tailwind)

Just a short post today.

Tailwind CSS is in about half of the React/Javascript job postings I see for New York. I'm getting ready to put together a Firebase project using Tailwind and wanted to first go through a configuration of it.

Tailwind is essentially a large library of pre-made CSS classes that suits many needs. Their goal is to allow you to write applications without having to write custom CSS.

When the application is compiled, Webpack or another bundler tool creates a CSS file for your project based on the classes you used.

On the recommendation of a blogger I revere, I followed this simple Tailwind project ([link here](https://dev.to/hagnerd/setting-up-tailwind-with-create-react-app-4jd)).

One of the main noted problems with Tailwind is that the CSS file it generates on compile is pretty large- up to 3000 lines long, which can drag down page load times.

I also installed the package `purgecss` in order to get rid of any CSS that is for classes that aren't being used in the html/JSX for a smaller, lighter weight project.
How to connect your Django local development server to your mobile phone and test your app on your phone.
Published: 2021-01-02 06:46:41

Building a web application in [Django](www.djangoproject.com), the developer will often use the lightweight local development server to run the code and see the changes that have been made.

However it is often useful to see how the web app is doing on a particular mobile phone.

To do that, we need to connect the phone and the computer(local machine) on the same WiFi network. With Phone as the hotspot and the computer as WiFi.

Thereafter, click on your computer WiFi settings and note the IP address used.

For this example I am using 192.168.43.167 as the WiFi IP address.

On the Django project on your computer, click on the settings.py and navigate through to the Allowed Host. Change the empty list to the IP address noted earlier.
```python
#Settings.py

Allowed Host = ["192.168.43.167"]
```

Start your local development server by running

Python manage.py runserver IP:Port

For example, if the WiFi IP address noted earlier is 192.168.43.167.

```python
Python manage.py runserver 192.168.43.167:8000
```

On your phone browser input the IP address and the port number into the address bar to see your app.

http://192.168.43.167:8000
remove unwanted css using post css
Tags: css, postcss, github, postremoveuncss
Published: 2021-01-02 06:34:39

UnCSS is a tool that removes unused CSS from your stylesheets. It works across multiple files and supports Javascript-injected CSS.

https://github.com/uncss/uncss
https://shorturl.at/yzSVX
https://uncss-online.com/
🌈 My Retrospective 2020
Tags: nuxt, giraud, florent, retrospective
Published: 2021-01-02 06:32:18

At the beginning, I was not sure to publish my retrospective.

Why? Because there are so many awesome people in the community. I didn't feel like I deserve it.

Finally, I am really proud of my year and all the awesome things that happen to me and I want to share with you my doubt and my success.

## 8 articles [dev.to](http://dev.to/f3ltron) and [1 article on storyblok](https://www.storyblok.com/tp/nuxtjs-translated-slugs)

I remember my first article. 😱 I didn't know if it would interest people. But article after article I just wanted to share my knowledge.

The saint Graal was when I received a message that says thank's for your article that was exactly what I was looking for 🦄... What more?

Also, I have special thanks to Storyblok. I wrote an article about [How to work with translated slug with Nuxt and Storyblok ?](https://www.storyblok.com/tp/nuxtjs-translated-slugs). And Storyblok came to me and offer to publish it on their website. Thanks for all their support.

## Organizator at Vue Montreal

When I arrived in Montreal. I was looking to participate in Vue community and Vue Montreal community was perfect for this.

I was really proud of all our work to maintain one meetup a month Even if COVID forced us to do less online meetup.

## Refactor Vue Montreal website (refactor incoming) with nuxt static generation

We moved our old website build with Vuepress to Nuxt and Storyblok.

## Integrate NuxtJS ambassadors

That's probably the best thing for me this year. I worked a lot with Nuxt in all my jobs. And had the chance to meet Debbie O'brien at Vue Toronto. Since then I knew I really wanted to be more implied in the community. And one day 😎. Debbie sent me a message if I wanted to join Nuxt ambassadors. OF COURSE, I WANT! I don't exaggerate. I answered literally like this ^^.

## Create a NuxtJS formation

In my jobs, I had to teach other devs what is Nuxt so I had to create a Nuxt formation. It was so cool and challenged me at the same time. It was time for me to know if I really know or not Nuxt.

## Create my first official plugin nuxt-snipcart-plugin

The last thing was my first official module for Nuxt. I am really proud of this one too because it was my first official module since I am a Nuxt ambassador.

Conclusion:

It was a long journey and everything didn't go well. I didn't write about all things that I didn't publish, didn't finish, didn't speak about. But what I know is I learned from all of this.

I hope it will inspire you. And don't forget Nuxt the world 😎.