teleren/devto huggingface dataset:
How important is sleep to your productivity?
Tags: discuss, productivity, career, beginners
Published: 2020-07-22 11:00:16

---
title: How important is sleep to your productivity?
published: true
description: Curated answers to the question from the Code Connector community Slack channel.
tags: #discuss #productivity #career #beginners
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/j4whoa2gte40h805djki.png
---
1. **Sleep is crucial for productivity.** People can claim to operate off no sleep, and that may work for them but there are mountains of new data that show that sleep is REQUIRED for moving things from short term to long term memory. It affects your immune system, your mental health, and your ability to concentrate.

2. **At first glance I thought this question was kinda obvious but thinking on it, it's really not.** If I get the recommended sleep for an adult every night I will not advance in my career. At best, I will be stagnant which is totally not what I'm trying to do. On the other hand, if I'm burning the midnight oil every night something is going to suffer during my normal 9-to-5 time. So for me, I have to find that balance. This week is a good example already. I went hard Sunday night on some learning and research. Monday night I was in before 11. I popped up at the crack of dawn today before my alarm clock so tonight I'll probably go hard again. This is all so I can advance. I know where I am, what I know, and I'm learning daily what I don't know. So in me trying to get somewhere in this tech space, I do make periodic sacrifices with sleep because there's just so many hours in the day, and we all get the same.

3. **Keep in mind that if you are employed as a developer that learning and advancing are part of your daytime responsibilities.** It was mentioned yesterday about taking on extra responsibilities and some of those extra responsibilities MUST include learning. DO NOT force all of your learning to be outside of the 9-5. That's going to burn you. If you have some stuff that has to be done outside of business hours then you should define how long that you are allowed to do this. That means setting a bedtime (even if it is an unhealthy one) and a deadline for when you MUST return to a normal routine.

4. **Sleep is extremely important to not just productivity, but everything.** There was a time in college I didn't get much sleep. Working til 1 in the morning,just to be back at work the next morning. Days would drag and nothing was done. When I quit that job I started to sleep in since classes were at 11:30 every day. Productivity and grades shot through the roof.

5. **My productivity crashes when I start to doze off at the keyboard.** So its VERY important. That being said, I'm usually good as long as I get 7 hours.

Contributors: Walker Laury, Corey McCarty, Dennis Kennetz, Lawrence Lockhart
Python Dev Environment Part 2: Testing with pytest
Tags: python
Published: 2020-07-22 10:54:45

In [Part 1], we built a Python distribution package. It worked. However, we are not done without writing tests.

## Activate virtual environment

Making sure that `pygreet` from [Part 1] is the current working directory, activate the environment if it is not active already, using `source ./venv/bin/activate` (Bash) or `.\venv\Scripts\Activate.ps1` (PowerShell).

## Create `tests` directory

Once we create a `tests` directory, the directory tree should look something like this:

```bash
pygreet/
├── setup.py
├── src
│   └── greet.py
├── tests
└── venv
```

## Install pytest

Let's install [pytest] to make writing tests easy.

```bash
pip install pytest
```

This should result in pytest and several dependent packages being installed.

## Write tests

With [pytest], any functions that start with `test_` in a file with a name that starts with `test_` and is in the `tests` directory will run by default.

So, we create a `test_greet.py` file in the `tests` directory:

```python
import greet

def test_greet():
    result = greet.greet()
    assert "Hello" in result
``` 

In this file, we import greet, then, in a test function (note the naming scheme, beginning with `test_`), call the function we want to test. The `assert` statement will fail if not true.

## Run the test

If `pygreet` is the current working directory, then run

```bash
pytest
```

Hopefully, the result includes:

```
tests/test_greet.py .                                     [100%]

======================= 1 passed in 0.01s =======================
```

## Dev environment thus far

At this point, our dev environment looks something like this:

```bash
pygreet/
├── setup.py
├── src
│   └── greet.py
├── tests
│   └── test_greet.py
└── venv
```

While simple, this basic structure should serve you well as a foundation for your next Python project. Write more tests, write more code, [segment and organize the code](https://dev.to/bowmanjd/python-module-vs-package-4m8e), and enjoy yourself.

You may also enjoy [Part 3], an introduction to Python dependency management with `install_requires` and `requirements.txt`.

[Part 1]: https://dev.to/bowmanjd/python-dev-environment-part-1-setup-py-venv-and-pip-22gd
[Part 3]: https://dev.to/bowmanjd/python-dev-environment-part-3-dependencies-with-installrequires-and-requirements-txt-kk3
[pytest]: https://docs.pytest.org/
Ultimate Guide Services
Published: 2020-07-22 10:41:08

Search engine optimization (SEO) is the process of helping your customers connect with your business online.

A modern SEO services, backed by the best digital practices, to increase your traffic & rankings for vetted keywords and long-tail phrases that drive business to your site. 
 
 
 
What makes our SEO Services work?

Great content = better rankings and better user experience SEO Services There are hundreds of ranking factors that search engines take into account when choosing where to place web pages in the search results. But at the top level, the three core SEO (search engine optimization) practices fall under: content generation, links, and technical optimizations.

When it comes to gaining top rankings in search engine results, content is king. Search engines are driven by complex algorithms that reward user-friendly, quality websites with high rankings.
This means to be successful online, websites need to contain current, useful information including regular updates, blog posts and links to and from other high authority sources.

Getting the wrong links to your website can be detrimental to results. Building a fantastic network of links will be a key part of ranking top for any target search phrases.

There are also technical elements of a website that need to be right. Our technical team will look under the hood at the code that Google sees.
Comprehensive monthly reports keep you in the know SEO Reports Optimizing a website for search engines takes time, however, we believe in being accountable to our customers throughout the entire SEO process.

We provide every one of our clients with detailed monthly reports including traffic analysis, keyword rankings and even what device visitors to your site have used.
Your monthly report from your account manager, allows you to view the most popular pages people visit and the route they take while using the website. The search phrases they used to discover your website and where they are based are also information we can provide.
Look no further than our results for proof of our award-winning SEO Services.

Here at SEO Works, we don’t make empty promises- we deliver results. To date, we have helped our UK customers achieve over 1000 number 1 rankings and over 10,000 top 3 Google search term rankings. We’ve won 14 industry awards and have been finalists at a further 10 – proof of our success. 

read more information 

https://www.inventive9.com
Java: The datatypes. {}
Tags: java, tutorial, codenewbie, computerscience
Published: 2020-07-22 10:36:46

# 🎯 What is a data type?
Wikipedia says "_In computer science and computer programming, a data type or simply type is an attribute of data which tells the compiler or interpreter how the programmer intends to use the data. Most programming languages support basic data types of integer numbers (of varying sizes), Floating-point numbers (which approximate real numbers), characters, and Booleans. A data type constrains the values that an expression, such as a variable or a function, might take. This data type defines the operations that can be done on the data, the meaning of the data, and the way values of that type can be stored. A data type provides a set of values from which an expression (i.e. variable, function, etc.) may take its values._"

# 🎯 Types:
There are 2 types of data types in **Java**: **Primitive** and **Non-Primitive**. In simple words, primitive data types are predefined whereas non-primitive data types are user defined.

# 🎯 Primitive Datatypes:
A primitive data type specifies the size and type of variable values and has no additional methods. There are 8 primitive data types in Java: **byte, short, int, long, float, double, boolean, char**. Let us see how to initialize them below.

Byte
```java
byte x=10;
```

Short
```java
short x=10;
```

Int
```java
int x=10;
```

Long
```java
long x=10000000;
```

Float
```java
float x=10f;
```

Double
```java
double x=10.1010;
```

Boolean
```java
boolean x=1;
```

Char
```java
char c ='s';
```

# 🎯 Non-Primitive Datatypes:
Non-primitive data types are called reference types because they refer to objects. There are many non-primitive data types in Java: **arrays, strings, classes etc**. Let us see how to initialize an array and a string.

Array
```java
int[] array = new int[10];
```

String
```java
String s = "hello world";
```

Since now we know what data types are, it is important to learn the usage of these data types so that we know where to use them to solve a problem.

...To be continued! 🎉
keep learning, keep coding!💖
Experimenting with directNavigation()
Tags: tutorial, javascript
Published: 2020-07-22 10:36:14


In an early build of [are.na](http://are.na), you could click on the channel name to edit it. Although it was a little hard to discover this feature and it was ultimately removed. It always felt rather delightful to edit content without the need for clicking on an icon or opening an editor.

So I experimented a bit with how to apply this concept to my wiki and created a new way to navigate. If I want to change pages on my wiki, I just click the page title (which is actually an input field) and enter the page path.



{% glitch direct-navagation app %}

That's where my experiment with directNavagation currently stands but in the future, it would be fun to try:
- Adding in Search + autocomplete instead of needing to know the page paths.
- Creating better cursor hover effects similar to mouse support in iPadOS.
- Creating a way for this to be discovered organically.
- Add a hover state which also allows you to go back to the home page.


If you have ideas about how to make the code cleaner or any next steps, please let me know. I'm always looking to get better at coding best practices. In the meantime, a demo lives on [Glitch](https://glitch.com/~direct-navagation).


_I have been using my [wiki](https://gndclouds.cc) as a way to try out mini code experiments and have been documenting my process on [futureland](https://futureland.tv/gndclouds/gndclouds-cc)._
How to integrate GraphQL at the backend of NextJS
Tags: react, nextjs, graphql, javascript
Published: 2020-07-22 10:34:22

Since version 9 of NextJS it's now possible to setup express api routes for your application. You can export a express instance from the `/api` route.

It's relatively easy to implement GraphQL as your backend service. All you need is `apollo-server-micro` package from npm.
```bash
npm i apollo-server-micro --save
```

Put following contents in `/pages/api/index.js`:
```js
import { ApolloServer, gql } from "apollo-server-micro";

const typeDefs = gql`
  type Query {
    hello: String!
  }
`;

const resolvers = {
  Query: {
    hello: () => {
      return "welcome!";
    },
  }
};

const apolloServer = new ApolloServer({
  typeDefs,
  resolvers,
  context: () => ({}),
});

export default apolloServer.createHandler({ path: "/api" });

export const config = {
  api: {
    bodyParser: false,
  },
};

```

Now npm run dev your project and you will see the Apollo GraphQL playground running at `http://localhost:3000/api`.
How to center align a div horizontally and vertically both.
Tags: html, css, webdev, tutorial
Published: 2020-07-22 10:32:11

Let's say you have a code 
```
<div id='parent'>
   <div id='child'>hello</div>
</div>
```
and you want to make the child element to be centered horizontally and vertically both. How will you do that??
Actually it's pretty simple. 

```
#parent {
    display: grid;
    place-items: center;
}
```
and it's done. Bbye..
Keep every Glitch.com-Project up
Tags: node, javascript
Published: 2020-07-22 10:31:55

## How it works

The HTTP-Listener below opens a Port. So if a user send a HTTP-Request to your Page, this Listener will answer.
A normal free Glich.com Project shutdown automatically when 5 minutes no Request will send to the App.

Method 1: Go to this page every 5 minutest with your browser, to keep your project alive.

But, we all know, it's not a very good method.

So, this tool up will send automatic using [`crontab`](https://en.wikipedia.org/wiki/Cron) every 5 Minutes a HTTP-Request to your Listner.

So your server needs just every 5 Minutes a very small progess, and your NodeJS-Application runs 24/7 with the Performance from the Glitch-Servers.

It's just a small server needed, if you don't have a server, i suggest a [Raspberry Pi](https://www.raspberrypi.org/) or ask a friend! :D

I will update this article, if i find better soulutions. But the old, works too.

## Setup

### `HTTP-Listener`: Set to your NodeJS Applicaion

> Just add to your `server.js` this code. No config is **here** needed.

```javascript
let express = require("express"),
    http = require('http'),
    app = express();

app.use(express.static("public"));
app.get("/", function(request, response) {
  response.sendStatus(200); // Status: OK
});

let listener = app.listen(process.env.PORT, function() {
  console.log("Your app is listening on port " + listener.address().port);
});

setInterval(() => {
  http.get(`http://${process.env.PROJECT_DOMAIN}.glitch.me/`);
}, 280000);
```

### `Automatic HTTP-Request`: Run on your Server

> Run this commands in the Bash. But: Change in the First Line the `my-example-nodejs` to your Project Name.

```bash
PROJECT=my-example-nodejs

echo "5 * * * * curl https://$PROJECT.glitch.me/" > /etc/cron.d/glitch-up
service restart cron
```
I'm a coder with 10 years of experience and I made a video about why programming is the coolest job in the world.*
Tags: video, job, experience, motivation
Published: 2020-07-22 10:30:15

{% youtube MN1pwtRLXP0%}

Some of these things may not be obvious until after a while, so I wanted to share my view after being able to experience this job for a good few years now. Feel free to add whatever benefits you see in coding (or disagree with me wholeheartedly!)

Happy Thursday everyone <3 

*IMHO
Debugging in Programming using Visual Studio Code
Tags: webdev, tutorial, vscode, javascript
Published: 2020-07-22 10:28:57

[Debugging JavaScript (Google Chrome and Visual Studio Code) - YouTube](https://www.youtube.com/watch?v=AX7uybwukkk&list=WL&index=2)

[Debugging Visual Studio Code (Create React App) - YouTube](https://www.youtube.com/watch?v=OlwIDANNpOc)

[Debugging Visual Studio Code (Node) - YouTube](https://www.youtube.com/watch?v=yFtU6_UaOtA)

## Debugging steps and mindset as a Developer
1. Use Debugging tools
2. Read the documentation API
3. Google search and Stackoverflow
4. Ask another developer in the office
5. Discord and Slack Groups

## Debugging Tools
* Debugger in VS Code and in the web browser (console.log replacement) plus the `debugger;`  statement
* Web browser developer tools (console, sources, network tabs etc…)
* Developer browser extensions like React, Redux and Vue

## TDD/BDD
* TDD/BDD: Jest and Enzyme/React Testing Library and Mocha and Chai
* Linting: ESLint
* Type Checking: TypeScript
* Code Formatting: Prettier
* CI/CD: GIT, GitLab, BitBucket, CircleCI, Travis CI, Jenkins, Heroku, Netlify, Now, Docker
Create a static website using Dev.to, Github, stackbit in less than 10 minutes.
Tags: webdev, html, react, github
Published: 2020-07-22 10:27:48

[Dev](https://dev.to), [Github](https://github.com) are one of the largest and favourite websites for developers to develop awesome tools. Do you know that you can also create your static website using Dev and Github by static site generator?

**What You need**

- A [Dev](https://dev.to) account
- A [Github](https://github.com) account

**step by step guide**
1. Create A Dev account and write your 1st post with It.
2. Go to settings > intergrations > **[Create New Stackbit Site](https://app.stackbit.com/create?ref=devto)**
3. Select Your Favourite theme( Fjord recommended for Blogging)
4. Select Static Site Generator [Gatsby](). It uses React
5. connect your GitHub account and Deploy it.
 
That's All

**Advantage of using [Dev](https://dev.to)**

- all of your [Dev](https://dev.to) posts will be published directly to your website.

- You can also purchase a custom domain name for your website.

- Dev has community support.

- It will be created using React.js

- You can modify your website through CMS panel or Git Repository.

- If you got stuck And you need help you can contact me in the comment section.

React ❤️ to encourage Author.
XcodeGen––Collaboration Made Easy
Tags: ios, xcode, xcodegen, swift
Published: 2020-07-22 10:11:48

---
title: XcodeGen––Collaboration Made Easy
published: true
description: 
tags: iOS, Xcode, Xcodegen, Swift
cover_image: https://cdn-images-1.medium.com/max/1600/1*qBfH49vEk5H9JblUy7YHdA.png
---

iOS devs, if you work on a team, I'm sure that many times, you've encountered conflicts with the .xcodeproj file while merging your code. 😩 

Check out this article to learn how to fix that 👍 

https://medium.com/dev-jam/xcodegen-collaboration-made-easy-9d1fdef548de
Hello!
Published: 2020-07-22 10:06:31

Hello, I’m new to DEV so I wanted to take a moment to introduce myself. I’m Chris, and I’m currently working on teaching myself Web Development. They say the best way to learn is to teach someone else so I plan on writing about the things I learn along the way.

If you are new or just want to connect don’t hesitate to reach out to me. I’m excited to meet and connect with others in this community.
Logon Scripting with Powershell
Tags: powershell, scripting, automation
Published: 2020-07-22 09:48:24

Hi,

Trying out some solution for logging to a website with a powershell script and downloads the contents in a file to the specified location.


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

Just put the url of the website login page and the id's which can be obtained by the developer tools.

Edit valid username and password in the script.
Your file will be downloaded at the specified location which is D:\powershell here.



You can get the script here.

https://github.com/DhiraNegi/powershell

HAPPY LEARNING :smile:
File System (High Level Explanation)
Tags: computerscience, linux, bash
Published: 2020-07-22 09:40:18

This is in no way a perfect explanation but I will be providing you a very high level explanation(100ft) to paint the right picture needed to study this topic deeper. I will be keeping it as simple as possible.

File system is a software or a library used by an operating system to handle data related operations such as storage, arrangement, deletion and so on.


##**Need an Analogy?**

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/3rvqypndumgx9s9qlq4c.jpg)

You just bought your first house, your room is quite empty with only a bed and few things. You need to get something to put your clothes, shoes and accessories in a nice orderly manner making it easy to reach for them when needed.



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

You go ahead to get a closet which contains different compartments for storing your needed items and also in an orderly manner.


##**Interpreting this analogy**
The person in concern which is you is the kernel, the file system is the closet and your room is the storage device.

The kernel uses a file system to provide a sense of arrangement and availability of data written to storage devices.

This explains the statement mounting a storage device using a particular file system.

This simply means using a particular file system to handle data operations on that storage device. Such as displaying a file.

Another way to understand file system is by interpreting as " how do you want your data arranged on this storage device?"

##**Conclusion**
A file system provides a level of abstraction to make sense of different data operations going on within a computer and how they get stored in a storage device making it easily available when needed. Without them processes such as saving a file on Microsoft word will not be as easy as typing *Ctrl + s*, as there will be extra commands required by the operating system to ensure the file is saved to the intended storage device on the computer.

**A file system to a storage device is what your closet is to your room.**

I hope you found this helpful?
Each Operating system has its filesystem.
Go ahead and study it at a much deeper level.
What you Need to Pass the Certified Kubernetes Administrator Exam 
Tags: kubernetes, serverless, devops
Published: 2020-07-22 09:35:03

Until recently, there was no official accreditation that engineers could receive for becoming competent with the Kubernetes platform. The Cloud Native Computing Foundation (CNCF) recently established a certification program (Certified Kubernetes Administrator) to help develop the Kubernetes ecosystem and it is now recognised as an essential accreditation to obtain Kubernetes engineers.



My name is Garreth Davies and I am a cloud engineer here at Mobilise. I recently passed the Certified Kubernetes Administrator program and would like to share my experience with you.

If you haven’t already, it would be best to start with the Kubernetes 101 blog to get a general understanding of Kubernetes before proceeding.

https://www.mobilise.cloud/certified-kubernetes-administrator-certification-what-you-need-to-pass-the-exam/
GlucoFlow Review
Published: 2020-07-22 09:23:28

"There are many other similar products available on the market that claim to offer 100% effective solutions to your health problems. But most of them are scams. Therefore, it can be difficult to determine which product will deliver the actual results. In fact, using the wrong product can cause other health problems and worsen your current condition.

In this <a href="https://www.phdsc.org/glucoflow-review">GlucoFlow Review</a> , learn how GlucoFlow supplements help balance blood sugar and naturally improve overall health."
New Traefik Training Course
Tags: tutorial, devops, traefik, learning
Published: 2020-07-22 09:18:51

I'm excited to announce our new Traefik Course covering Traefik Architecture, Deployment, Configuration, and Operations. 

We are finishing up the last few sections so sign-up to get informed when it launches. 

By completing this course you will have the skills to deploy Traefik from 0 to Production.

[Traefik Training Course](https://www.thebyte.io/traefik-training)