teleren/devto huggingface dataset:
Expecting is learning
Tags: discuss
Published: 2019-05-26 19:51:19

---
title: Expecting is learning
cover_image: https://thepracticaldev.s3.amazonaws.com/i/2vb1ajw7kcwjh1g8dane.jpg
published: true
description: Is the key to learning new techniques to be able to expect features from the tools you use?
tags:
  - discuss
---

> *Disclaimer* &mdash; This story sounds like I'm a pedantic fuck. I know. But I try to keep things as factual as possible. I hope it's staying within reasonable limits :)

When I completed my first developer internship, some of the other junior-to-intermediate developers in the team asked me to my surprise: "but how do you know all of that?".

Indeed, I had been helping them on many topics but mostly did not know the answers in advance. Instead I did some good old Internet searching in front of their eyes and pulled a solution from the results.

Now, everybody is able to copy/pasta a Stack Overflow reply &mdash; especially compared to an inexperienced intern &mdash; and since they saw the whole process I can't help but to ask myself what did they not understand in it?

Years later, it seems to me that the answer is actually that while I did not know the answer, I knew _what_ to look for. Here's the theory:

> The key to learning new things is to expect that they exist

Suppose that your designer hands you over this dropdown:

![](https://thepracticaldev.s3.amazonaws.com/i/76f6dpvrqxd0n0yiuvpa.png)

It is pretty complicated because it has an arrow that has a drop shadow and a rounded corner, which isn't doable in pure CSS (to my knowledge 😊). Some way or the other you're going to have to use a background image. But the content size is not known statically so there's also a need to stretch it. In short, the solution might not be obvious if you've never done it before. Do you:

- Look at the shape of it and scratch your head?
- Slice the background up Macromedia-style? (high five 2000's developers!)
- Browse MDN until you find [`border-image`](https://developer.mozilla.org/en-US/docs/Web/CSS/border-image)?

One of those solutions is much simpler than the others but if you don't know it from before you cannot really find it if you don't expect CSS to have this feature.

Expecting things to exist is what will make, in my opinion, the difference between stagnating after your first few months and learning on a daily basis.

But I'm quite interested to hear opinions on that theory. Does that resonate to you? Do you think it's right or wrong or incomplete? How do you grow your "sense of expecting"?
Do you pay for the photos you use as cover?
Tags: discuss, meta
Published: 2019-05-26 19:19:26

---
title: Do you pay for the photos you use as cover?
published: true
description: 
tags: discuss,meta
cover_image: https://thepracticaldev.s3.amazonaws.com/i/rjllt3pq9hqrkvmfzsx8.jpg
---

I have noticed that lots of you here on dev.to use cover photos on your articles.  Do you own or pay for those photos and do you credit the creator? (you should).

What is dev.to's policy on copyrights?

P.S. I only use my own photographs for my articles.
ReactJs Doubt
Published: 2019-05-26 18:30:35

hello everyone
I need your help 
After getting a successful response from API, I want to change the page/load a new component in the browser but didn't find the correct way to do so.
So please help regarding this.
Example-
axios.post('https://api.staging.goplannr.com/v2/user/otp/generate', this.state)

        .then(response=> {

            console.log(response);

            return(

                <div>

                    <OTP/>

                    </div>

            )

        }


OTP is my component but in the browser, it is not working and also not showing any response.
The Plain Gatsby starter
Tags: showdev, react, javascript, webdev
Published: 2019-05-26 17:12:45

Looking for a minimalist starter for your gatsby blog? Check out [this](https://github.com/wangonya/the-plain-gatsby) starter I made 😀

Inspired by [Heiswayi Nrird](https://github.com/heiswayi)'s [the-plain](https://github.com/heiswayi/the-plain).

![home-page-screenshot](https://i.postimg.cc/7YPxnrJM/Screenshot-2019-05-25-at-18-33-36.png)

![about-page-screenshot](https://i.postimg.cc/SK9qxyHq/Screenshot-2019-05-25-at-18-34-12.png)

![blog-page-screenshot](https://i.postimg.cc/CxzS9CNR/Screenshot-2019-05-25-at-18-34-00.png)

## Quick Start 🚀

**Create a Gatsby site.**

Use the Gatsby CLI to create a new site, specifying the default starter.

```sh
# create a new Gatsby site using the-plain-gatsby starter
gatsby new my-blog https://github.com/wangonya/the-plain-gatsby
```

**Start developing.**

Navigate into your new site’s directory and start it up.

```sh
cd my-blog/
gatsby develop
```

**Open the source code and start editing!**

Your site is now running at `http://localhost:8000`!

Note: You'll also see a second link: _`http://localhost:8000/___graphql`_. This is a tool you can use to experiment with querying your data. Learn more about using this tool in the [Gatsby tutorial](https://www.gatsbyjs.org/tutorial/part-five/#introducing-graphiql)._

Open the `my-blog` directory in your code editor of choice and edit `src/pages/about.md`. Save your changes and the browser will update in real time!

Edit `gatsby.config.js` to update site metadata.

Add blog posts in markdown in `src/pages/blog/`. Each blog should have a `title` and `date` frontmatter. Example blog posts have been provided.
Unattended Upgrades
Tags: linux, ubuntu
Published: 2023-01-06 02:01:47

---
title: Unattended Upgrades
published: true
date: 2019-05-26 16:52:03 UTC
tags: Linux,Ubuntu
canonical_url: https://brandonrozek.com/blog/unattended-upgrades/
---

I’m a big believer of reducing maintenance. One of the things that I didn’t bother setting up before but should’ve is _unattended upgrades_. The benefits of this is that you don’t have to repeatedly log into your sever to upgrade your system.

Why bother managing your own server in the first place? Well with a virtualized system you can set up any type of application that you like. You’re not limited to only hosting static sites or whatever applications the C-Panel instance allows.

Now there’s no need for me to reiterate what’s been done before, so here’s a [useful post from libre-software](https://libre-software.net/ubuntu-automatic-updates/) describing how to set it up so that a Ubuntu server updates itself automatically.
Computer Science Books
Tags: computerscience, webdev, education, programming
Published: 2019-05-26 16:10:03

---
title: Computer Science Books
published: true
description: 
tags: computerscience, webdev, education, programming 
---


Quick Announcement:

I am sharing my Google Drive folder which contains multiple computer science books (in PDF form). I've collected them over the past 4 years of college life. I've divided them according to their domains (web/mobile/desktop development, computer vision data science etc).

Feel free to explore and download them :)

[PDFs folder](https://drive.google.com/drive/folders/1SYVpF5GhBGMMsxE0a7Ydtn8tFUmjn79F?usp=sharing)
Classic snake game in Linux terminal
Tags: linux, teminal
Published: 2019-06-25 16:43:36

---
title: Classic snake game in Linux terminal
published: true
tags: linux, teminal
canonical_url:
---

![](https://cdn-images-1.medium.com/max/1024/1*x535NzzoXrs95BZLUVSfvg.png)

You must have played the classic snake game on feature phones like [Nokia 1100.](https://www.amazon.in/s/ref=as_li_ss_tl?_encoding=UTF8&camp=3626&creative=24822&fst=as%3Aoff&keywords=nokia%20mobile&linkCode=ur2&qid=1453365639&rh=n%3A976419031%2Cn%3A1805559031%2Ck%3Anokia%20mobile&rnid=976420031&tag=newbie42-21)  
Now you can again play the same game in Linux terminal.  
For this, you need to install nsnake package by running below command in terminal.

```
sudo apt-get install nsnake
```

After the package is installed, run the game by running nsnake command.

![](https://cdn-images-1.medium.com/max/584/1*8DGidl_R1sLrr3aNa09N7g.png)

Use the up and down arrow keys to change to game mode to Borders On and Borders Off.  
Use left and right arrow keys to change the speed.  
Press enter or space to start the game once you are done with settings.

You can exit the game by pressing _q_ key.

![](https://cdn-images-1.medium.com/max/587/1*LwcK6XtA-kSnCBSe0JQQUQ.png)

Rules are the same as they were in the classic game.

If you collide with yourself (snake), you die. Game over.

![](https://cdn-images-1.medium.com/max/592/1*qfV3vAPw0DqFZyfr9WDSJw.png)

[Download the latest version of this game from Github](https://github.com/alexdantas/nsnake).


![](https://cdn-images-1.medium.com/max/1/0*ZAXJ6c3TUq7rRTif)



**More from Author:**

- [**How To Host Django App On Pythonanywhere For Free**](https://www.pythoncircle.com/post/18/how-to-host-django-app-on-pythonanywhere-for-free/)
- [**Scraping data of 2019 Indian General Election using Python Request and BeautifulSoup and analyzing it**](https://www.pythoncircle.com/post/683/scraping-data-of-2019-indian-general-election-using-python-request-and-beautifulsoup-and-analyzing-it/)
- [**Text-based snake and ladder game in python**](https://www.pythoncircle.com/post/676/text-based-snake-and-ladder-game-in-python/)
- [**How to start with Python Programming — A beginner’s guide**](https://www.pythoncircle.com/post/671/how-to-start-with-python-programming-a-beginners-guide/)
- [**Automating Facebook page posts using the python script**](https://www.pythoncircle.com/post/666/automating-facebook-page-posts-using-python-script/)
Why I'd not use React Native right now
Published: 2019-05-26 16:05:29

React Native, and similar cross-platform frameworks are all the rage these days. However, while React Native makes cross-platform development easier, there are a few points to consider:

- React Native has still not reached v1.0 of release. It is still constantly evolving, and there may be breaking API changes, which would need work to incorporate.
- Cross-platform development using React Native isnt necessarily half the effort of doing Native development. Some effort needs to go into making the apps compatible with the Human Interface Guidelines and UX patterns of the respective platform.
- There exist a variety of components and libraries for implementing features. If however, we need to customise some aspect of these, we would either have to write custom native modules, or write our own. That will require diving into native code as well. This is something to consider especially from a maintenance point of view, as developers need to be familiar with native development as well, that too both Java and Objective-C/Swift.
- React Native communicates with the underlying native part of the app via a Javascript bridge. While this is not an issue in most cases, the overhead of communicating via the bridge does impose a slight performance penalty.

For these reasons, I would not choose to develop my own personal apps using React Native. It's definitely great for putting together a quick proof of concept though, and when resources are a constraint, it's a good choice.
One Way to Level Up Your Development Career
Tags: career, business, perception, empathy
Published: 2019-05-26 16:05:23

---
title: One Way to Level Up Your Development Career
published: true
description: How to boost your perception by being a good business player as well as a good team player.
tags: career, business, perception, empathy
cover_image: https://thepracticaldev.s3.amazonaws.com/i/a2so27jt68rxnpohnw1l.jpg
---
**Over the past few years** I’ve been asked a few times what’s the best way to ‘level up’ a development career.

As developers we primarily think in terms of the languages and frameworks we need to learn, how to go about utilizing best practice and being good, compassionate team players.

I think one of the best ways to level up is to spend time thinking about how what you and your team works on benefits the company or client you’re working for. 

**Sounds obvious right?** Your product manager, architect or team lead outlines what needs to be done and as a team or freelance developer you build and deploy that thing.

But where you can differentiate is reverse engineering the company’s vision and applying your technical skills to directly affect that vision. 

A non-technical CEO or manager will far more appreciate your value if you’re empathetic to the bigger picture than just operating in siloed sprints, features or bug-fixes that we’re used to in the day to day.

Demonstrating that you’re capable of thinking at those two distinct levels is a huge advantage. One of the most effective ways to do this is to think in terms of the **cost** of a specific decision. Sure, your manager or tech lead may have already decided on the best solution for a given problem but if you can display empathy for the same decision making process, they’ll see you as someone invested in helping them solve the same problems, someone operating on the same level, and someone who helps them do their job as well as your own.

**Having co-founded a startup**, I love it when our team suggests different ways of solving a problem taking cost into account. It may be the use of a different AWS service that benefits us over the long term, an admin function that gives extra visibility into a sensitive area, or use of a new framework that will save the team a ton of time.

In essence, they’re thinking holistically about how they can benefit the wider business before diving into technical details. 

In small companies and startups it’s a lot easier to do this because you’re so much closer to founding or ‘senior’ people, but if you’re in a larger company, demonstrating empathy to your manager is a great quality that will travel well in positive word of mouth.

Crucially it creates a lot of trust that you have the business’s best interests at heart. This often gets rewarded when businesses need to pivot or create new functions that need new leaders. 

**Be the first name that springs to your manager's mind when this happens!**
Scraping data of 2019 Indian General Election using Python Request and BeautifulSoup and analyzing…
Tags: beautifulsoup, python, webscraping, requestslibrary
Published: 2019-06-25 16:33:56

---
title: Scraping data of 2019 Indian General Election using Python Request and BeautifulSoup and analyzing…
published: true
tags: beautifulsoup,python,web-scraping,requests-library
canonical_url: https://www.pythoncircle.com/post/683/scraping-data-of-2019-indian-general-election-using-python-request-and-beautifulsoup-and-analyzing-it/
---



![](https://cdn-images-1.medium.com/max/700/1*Y8ypg1T4mAMOSeHPV856dw.png)

Do you know that:

Shankar Lalwani from Indore constituency got 1068569 votes which are highest votes any candidate got in this election season.

C. R. Patil from Navsari constituency won by highest margin i.e. 689668 votes.

Bholanath (B.P. Saroj) from Machhlishahr won by just 181 votes which is the lowest margin among all constituencies.

Total votes casted: 613133300

NOTA votes casted: 6514558

You can fetch much more information like above if you know how to fetch data and analyze it.

Refer below article to know how to Scrape 2019 Indian General election data and analyze it.

[**Scraping data of 2019 Indian General Election using Python Request and BeautifulSoup and analyzing it**](https://www.pythoncircle.com/post/683/scraping-data-of-2019-indian-general-election-using-python-request-and-beautifulsoup-and-analyzing-it/)
Add HMR to CRA using customize-cra 
Tags: react, hmr, cra, customizecra
Published: 2019-05-26 15:24:18

A little note about adding Hot Module Replacing to Create-React-App without ejecting.

Final project: [https://github.com/c01nd01r/hmr-for-cra-example](https://github.com/c01nd01r/hmr-for-cra-example)

Install packages:

```bash
yarn add -D react-app-rewired customize-cra react-hot-loader @hot-loader/react-dom
```

Change `package.json`: 
```json
  "scripts": {
    "start": "react-app-rewired start",
    "build": "react-app-rewired build",
    "test": "react-app-rewired test --env=jsdom",
    "eject": "react-scripts eject"
  },
```

Create a `config-overrides.js` file in the root directory.

Add `react-hot-loader/babel` and `@hot-loader/react-dom` (patched version of `react-dom` for supporting React Hooks) to `config-overrides.js`:


```js
const { override, addBabelPlugin, addWebpackAlias } = require('customize-cra');

module.exports = override(
  addBabelPlugin('react-hot-loader/babel'),
  addWebpackAlias({
    'react-dom':  process.env.NODE_ENV === 'production' ? 'react-dom' : '@hot-loader/react-dom',
  }),
)
```

Change `src/index.js`:

```js
import React from 'react';
import ReactDOM from 'react-dom';
import { hot } from 'react-hot-loader/root';
import './index.css';
import App from './App';
import * as serviceWorker from './serviceWorker';

const WithHotReload = process.env.NODE_ENV === 'production' ? App : hot(App);

ReactDOM.render(<WithHotReload />, document.getElementById('root'));

// If you want your app to work offline and load faster, you can change
// unregister() to register() below. Note this comes with some pitfalls.
// Learn more about service workers: https://bit.ly/CRA-PWA
serviceWorker.unregister();

```

That's all. Happy coding!
Checking out interest for topics
Tags: php, coding
Published: 2019-05-26 15:00:10

---
title: Checking out interest for topics
published: true
description: Basically, looking for feedback on ideas
tags: php, coding
---
Hello everyone. I am a developer. Doing it on a daily basis. Switched jobs recently and made a transit from eZ Platform to Pimcore. So I was wondering... Would the community at large like to read about some practices I stumbled upon in my experience? Basically, I'd be writing about Symfony and stuff. So... How about it? Share your thoughts, please.
How do you manage your time for multiple projects?
Tags: discuss, career, timemanagement
Published: 2019-05-26 14:28:51

---
title: How do you manage your time for multiple projects?
published: true
description: 
tags: discuss, career, time management
---

Currently I have two jobs, one is a part time as a NodeJS backend, and another full time as a frontend developer, the first one is light enough so I don't burst into flames on busy days.

The question is, sometimes I really feel overwhelmed by tasks I know I will do, for both jobs. It's like this feeling of running out of time that really makes me feel anxious to the point I need to stop, take a really long break and actually lose a lot of time. I know we need this breaks to clear our minds and keep going, but what I find strange (at least from personal experience) is the anxious state of _i'm really running out of time, I won't make it_.

For me this is stopping me from doing other things in my young career little Dev Bucket List (i.e take the time to learn/read new things, help an open source project and with this make a little bit of change to the community)

So...

## How do you guys manage this situations?
Create PyQt Desktop App with Python
Tags: pyqt, python
Published: 2019-05-26 14:20:19

---
title: Create PyQt Desktop App with Python
published: true
description: pyqt
tags: pyqt, python
---
You can make **desktop apps with Python**. One of the ways to do that is to use **PyQt**, a very professional building block.

**PyQt** gives you designer, you can design what your windows should look like simply with drag and drop.

<img src="https://proxy.duckduckgo.com/iu/?u=http%3A%2F%2Fwww.science.smith.edu%2Fdftwiki%2Fimages%2Fthumb%2F2%2F28%2FTutorialPyQt2.png%2F700px-TutorialPyQt2.png&f=1" alt="pyqt">

Then you can load the designs in Python. Link it all together using PyQt.

Many applications are made with Qt (PyQt), including the whole KDE desktop environment. You can make any desktop app you want, **run it on all popular platforms (Windows, Mac OS X, Linux)**.

Why not learn PyQt?

Does it sound more easy than you think it is? 

<a href="https://pythonspot.com/download-pyqt5-examples/">Check out tutorial below for an easy start.</a> It comes with an 1 hour video and over 80 examples.
eBay get access token with Axios don't work
Tags: javascript, node, axios, ebay
Published: 2019-05-26 13:57:45

---
title: eBay get access token with Axios don't work
published: true
description: When I execute the following code I get the following error message - grant type in request is not supported by the authorization server. What I am doing wrong?
tags: javascript, nodejs, axios, ebay
---

When I execute the following code I get the following error message: grant type in request is not supported by the authorization server
What I am doing wrong?

{% gist https://gist.github.com/sm-a/32f48e7b9170902dec5c3156c8a533d4.js %}
Dev wishes that...
Tags: discuss
Published: 2019-05-26 13:13:10

---
title: Dev wishes that...
published: true
description: Things I wish for as a developer!
tags: discuss
---

I wish there was a programming language that works like this;

```
$: what do you want to build?
$: I want a program to catalog images
$: checking database(100%); Confirm build Env (windows - 1) (OSX - 2) (*nix - 3)
$: 1 2 3
$: Writing Code (100%), default placeholder names will be used
$: Push to Github (1) Push to Gitlab (2) Local Save (3)
$: 3
$: code outputted at ~/path
```

I wish that instead of the current programming interviews, that test your ability to memorize code snippets and usage (especially if you have not had a reason to use such code in any capacity), companies give project based interviews, where the applicant is told to build something using the current tech stack in a limited time period.

I wish Wordpress makes a user-friendly plugin for manipulating the API. one that focuses on ease of usage.

I wish my girlfriend was a dev (life would be much simpler!).


Remember these are all wishes! what do you wish for? let me know...
React native dynamically show and hide Password Content Example
Tags: reactnative, android, ios, javascript
Published: 2019-05-26 13:12:52

---
title: React native dynamically show and hide Password Content Example
published: true
description: React native dynamically show and hide Password Content Example
tags: #reactnative #android #ios #js
---

Source : <a href="https://www.skptricks.com/2019/05/react-native-dynamically-show-hide-password-field-content.html" >React native dynamically show and hide Password Content Example </a>


This tutorial explains how can we dynamically show and hide password on button click in react native application. You may have seen this feature in various application like Google, Facebook, Twitter, Instagram etc. By default password field is in hidden mode and when user writes anything in password textfield, then it will display the encrypted value or asterisk symbol in text field box. but when user clicks on show button, then it will display the password field content in simple text format.

<a href="https://www.skptricks.com/2019/05/react-native-dynamically-show-hide-password-field-content.html" >React native dynamically show and hide Password Content Example </a>

<img src="https://1.bp.blogspot.com/-xDLigAcnIAE/XOp1U5YS6QI/AAAAAAAAC14/wHdyAoxJch8uKfRNJbtYqViNChrAfEGowCLcBGAs/s400/react-native-dynamically-show-hide-password-field-content.jpg" /> 

<a href="https://www.skptricks.com/2019/05/react-native-dynamically-show-hide-password-field-content.html" >Click here to read more... </a>