teleren/devto huggingface dataset:
Project in Python
Tags: python, beginners
Published: 2020-06-26 21:32:48

I can’t tell you how many videos and books and articles I’ve consumed on Python. At first I was driving myself even crazier because I was also doing the same for Swift code. But I stopped Swift and have been focusing on Python. Unsure if I’m making progress. Not really, no.  I’ll follow along with a video, do the code on my mac or iPad, and all is good. I’ll tweak it here and there and watch what happens. But generally it’s all not sinking in. I tried to take some killer Notion apps, like I see on YouTube. But I cannot access Notion the 8 hours I’m in an office, and the internet is sometimes too slow to access it on my MBP or iPad when I’m out of the Operations Center and its lame computer/network.  Earlier I had Googled for some beginner projects. I liked the one for choose your own adventure. I did a simple choice last week where it asked about pineapple and pizza. This time I started from scratch and started to move down a path.  One thing that is strange to me is that when I put in this:  

```
name = input("What is your name?").strip()

print(name, ", before you is an old gate. It appears to be quite old, with vines snarled around the bars so thickly that you cannot see through to the other side.") 
```

 I get a space after the name variable when I have it in a string.   

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

That little space after my name and before the comma drives me nuts. But I’ll hold off on that detail. For now I’m pressing on. Let’s add some loops. I saw in one video how you can add the .lower() and it will take a YES or Yes and convert it all to a lowercase ‘yes’. Otherwise, I’d have to write some code checking for this in the loop. Neat trick.   

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

I’ll admit that I goofed when I made this at first. I was testing it with each step of the way, and before I wrote the else at the end, it was an infinite loop and kept printing the last sentence a bazillion times and crashed Safari. HA! I added the else and it fixed it.  I wanted a way to keep track of progress, and right off the top of my head I named it block and gave it a value of 1. I used a simple += 1 with it and figured that I could do some while loops for various values of the block. Because this was a local variable, I had to use the global keyword. Not that I’m smart here, but I didn’t know how else to increment the variable up one as a result of a choice, but also have that variable defined outside of the function. This seems to work just fine.
Creating code screenshots using vscode extension
Tags: vscode, extension, code, screenshot
Published: 2020-06-27 07:37:35

* Hey Developers, I have found a nice extension to create code screenshots in vscode.
* Using this extension, you can generate (.png) screenshot that will make your blog more informative.

## Extension
*  Link - https://marketplace.visualstudio.com/items?itemName=adpyke.codesnap

-----

### Sample screenshots

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

### Other Alternatives ways are:
* Using Polacode vscode extension.
  * Link : https://marketplace.visualstudio.com/items?itemName=pnp.polacode
* using Carbon website - Link - https://carbon.now.sh

### Support Me
* Youtube Channel -https://www.youtube.com/channel/UC0hmXRqXYVO0mocVt5D3GkQ

* Github - https://github.com/vuelancer

* Scrimba - https://scrimba.com/@selvakumardhivakar

* Patreon - https://patreon.com/vuelancer
import keyword with example in Python
Tags: python
Published: 2020-06-27 09:31:41

Python **import** keyword: so you can know about the **import keyword with example**.

Its used to get modules and a module is like a building block: it has many functions available. You can use <a href="https://pythonbasics.org/how-to-use-pip-and-pypi/">pip</a> to install modules.

## Python import keyword

**import** is a python keyword used to import module in a script

**Syntax of import keyword**    
    
        import module_name
    

**Python Example:**    
    
        import math
        # this will load the math module    

### Python examples of import keyword

Import the math module in this script and call a function
    
    
    import math
    num = 5
    
    # call function in module
    result = math.factorial(num)
    
    # print output
    print("The factorial of ", num, " is = ", result)
    

The program above outputs this:    
    
    The factorial of  5  is =  120
    

**Example 2:** 

Module load datetime and name the present day, month and year

   
    import datetime
    
    # create date object
    dt = datetime.datetime.now()
    
    # get day, month and year
    print("day  : ", dt.day)
    print("month: ", dt.month)
    print("year : ", dt.year)
    

The program above outputs this:    
    
    day  :  27
    month:  7
    year :  2020
    
You can use modules to add all kinds of functionality to your program. Using modules could create a <a href="https://python-commandments.org/tkinter-canvas/">canvas</a>, <a href="https://pythonpyqt.com/">gui with pyqt</a>, <a href="https://gitpress.io/u/1282/bmi_gui">bmi calculator</a>, <a href="https://pythonprogramminglanguage.com/python-flask-framework/">web app</a> etc. You can <a href="https://pythonspot.com/python-modules/">create modules</a> if you want.
Learn Flask for Webdev
Tags: python
Published: 2020-06-27 09:49:10


Flask is a Python framework that you can use to make Web Apps with Python. Python doesn't have to be only in the terminal, you can create any web app with Python Flask.

This is a collection of articles to help you get started with the Python Flask framework.

## What is Flask?

* <a href="https://pypi.org/project/Flask/">Flask framework</a>
* <a href="https://pythonbasics.org/what-is-flask-python/">What is Flask?</a>
* <a href="https://pythonprogramminglanguage.com/python-flask-tutorial/">Flask tutorial</a>
* <a href="https://pythonprogramminglanguage.com/python-flask-example/">Flask example</a>
* <a href="https://pythonprogramminglanguage.com/python-flask-framework/">Flask framework</a>

## First Apps

* <a href="https://pythonbasics.org/flask-tutorial-hello-world/">Hello world</a>
* <a href="https://pythonbasics.org/flask-tutorial-templates/">Templates</a>
* <a href="https://pythonbasics.org/flask-tutorial-routes/">Routing</a>
* <a href="https://pythonspot.com/flask-web-app-with-python/">Create epic app</a>
* <a href="https://pythonprogramminglanguage.com/python-flask-rest-api/">Flask API</a>
* <a href="https://pythonspot.com/flask-web-forms/">Flask web forms</a>

## Advanced

* <a href="https://pythonprogramminglanguage.com/python-flask-vs-django/">Flask vs Django</a>
* <a href="https://pythonprogramminglanguage.com/python-flask-websocket/">Flask Websocket</a>
* <a href="https://pythonprogramminglanguage.com/python-flask-docker/">Flask docker</a>
Spring Boot Introduction
Tags: java, springboot, springframework, html
Published: 2020-06-27 10:54:27

#What is the Spring Boot?
Spring is a powerful java-based open-source framework that is widely used for enterprise web applications. It is developed by Pivotal Team and is utilized to construct stand-alone and production prepared spring applications. Spring Boot may be a portion of the spring framework and contains all the highlights and ideas of the spring framework. In Spring Boot, everything is auto-configured, and there is no requirement for XML configuration and server (e.g. Tomcat) to create a spring boot web application.

What do we need to know?
- Core Java
- Basic knowledge of Spring Framework
- MVC pattern

#Advantages of Spring Boot
- We can create a stand-alone application and production-grade spring-based application easily.
- It reduces a lot of development time and we can quickly create web applications and microservices.
- It is easy to understand.
- It is no need to configure XML because it is configured and wired automatically.
- Spring boot provides production-ready features such as metrics,health-checks, and externalized configuration.
- It is easy to customize application properties and dependency.

#Spring Boot Flow Architecture
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/ne3oi81rawpgef1up502.png)
- The client makes the HTTP requests (POST or GET).
Please refer to the HTTP request methods in the following link.
[HTTP Request Method](https://dev.to/reytech-lesson/http-request-method-k7p)
- The request is forwarded to the controller, and it maps the request and processes it. 
- If needed, it also calls a service layer.
- All the business logic will be performed in the service layer and it performs the logic on the data and is mapped to JPA with model classes.
- If there is no error has occurred, the web page (JSP, HTML) is returned to the user.

#Goals of Spring Boot
The main goal of Spring Boot is to reduce development, unit test, and integration test time and to ease the development of Production-ready web applications very easily compared to existing Spring Framework, which really takes more time.

- To provide the Opinionated Development approach

- To avoid defining more Annotation Configuration

- To avoid confusing XML configuration and manual lots of import statements

#What can we create if we can do Spring Boot?
　　　　You can develop a great web application like below.  A famous service using Spring Boot is described in the following table.

| URL | Description
| --- | ---
[SAP Customer Review and Stories](http://hybris.com/en/customers)| SAP's Hybris eCommerce platform uses Spring
[Yatra](http://www.yatra.com) | Indian travel website Yatra.com is made in spring MVC (backend services)
[Every Dollar Budgeting App](http://everydollar.com) | Uses Spring Boot on the back end ReactJS on the front end.

References:

https://www.tutorialspoint.com/spring_boot/spring_boot_introduction.htm

https://www.geeksforgeeks.org/introduction-to-spring-boot/

https://www.javatpoint.com/spring-boot-tutorial

https://dzone.com/articles/introducing-spring-boot

https://www.geeksforgeeks.org/introduction-to-spring-boot/
Backend Wrap Up
Tags: webdev
Published: 2020-06-27 15:43:19

Last week, we covered the last missing pieces to complete the most basic version of our backend.

Due to the length of the series header, I am going to end this series here and start a new one covering frontend topics.

# Topics in this series

* Generating a basic rails backend with basic models.
* Writing a *very* rudimentary test suite to help automate testing.
* Generating base GraphQL objects and types.
* Writing basic GraphQL queries.
* Building basic GraphQL mutations.
* Authentication using a sessions controller and JWT.

# Incomplete Topics

* Proper authorization. At the moment, we have a very rudimentary authorization system that simply blocks all unauthenticated requests to the GraphQL endpoint.
* A complete test suite, including controller testing.
* More advanced GraphQL queries and mutations, including a detailed explanation of how to do polymorphic queries in GraphQL.

All of the topics above should receive a more complete coverage than I've been able to give due to time and space constraints.

If you want me to write in greater detail about one of the topics above, simply let me know in the comments, and I will consider writing about it.

# What’s next
Starting next week, I will be covering frontend development. We will start by breaking down mock ups to create a component hierarchy. We will be building the frontend using React. If you want more details, checkout [my initial post][start] for details about what the next part of the series will cover.

{% post https://dev.to/speratus/build-a-forum-app-from-code-to-deploy-3lcc %}

As always, you can view the code for the backend up to this point in [this GitHub repo][code].

{% github speratus/miniforum %}

Thanks for sticking with me for so long, and I hope to be back with a more detailed post next week.

The next series starts with this post:

{% post https://dev.to/speratus/wireframes-and-component-hierarchy-53np %}

[code]: https://github.com/speratus/miniforum/tree/part4-graphql-2
[start]: https://dev.to/speratus/build-a-forum-app-from-code-to-deploy-3lcc
Newbies and Documentation
Tags: cybersecurity, pentesting, infosec, beginners
Published: 2020-06-27 17:36:06


<p>As a cybersecurity "student", I've discovered quickly that you are NEVER truly secure. You gain understanding and minimize the damage. There is no true prevention though. This is with anything in life actually. </p>

<p>The amount of material, resources and tools can be dangerous to use. Your life and others may be changed in ways that you cannot even begin to imagine.  What's my point in all of this? As a "student", documentation is crucial. Tell us how to use these items CLEARLY.</p>

<p>The lack of clear documentation has been a consistent frustration for me. For example, if I join an intro course to learn, it will say to connect to OpenVPN and test your connection. I download OpenVPN, then... what do I do next? How do I safely and accurately connect while also making sure that I'm working within my Virtual Machine and etc? The goal for some students is proceeding with confidence that they (myself included) are not exposed while learning tools that help others to remain safe. Don't get me wrong, playing bad guy with permission is a lovely perk too. You have to be able to break into it, fix the route you used to break into it, and make the "it" more secured. </p>

<p>Back to what I was saying, if you are a course creator, instructor, or sharer of knowledge, please make sure that the documentation is clear. Make sure the documentation doesn't assume that certain knowledge is already present. Provide a section of commonly asked questions with answers. Provide resources that link to acquiring more info that may be needed for setup, for troubleshooting, and for a community that is trustworthy and can get you pointed in the right direction. </p>

<p>Just a few tips from my mind to yours </p>

<p>Now, how do I make sure I am connected to OpenVPN? How do I make sure that Kali Linux is installed on my VMware? And how do I make sure both of those are working together so I can install a package to the Kali Linux Machine? Come on, you knew there was motivation behind this post 😊</p>

I'm also going to share this post on my personal blog so I can get more feedback. Never can have too much info.
OpenSource - The Guaranteed Funding Program – Now Accepting New Applicants
Published: 2020-06-28 13:04:47

At xs:code, we’ve made it our mission to connect open source developers with the software companies that use their projects. With more and more companies using xs:code to find paid solutions, support and licensing for the open source components they use – we aim to help as many open source developers discover the potential of offering paid products and services on top of their free code, and turn their open source projects into steady sources of revenue.
Read More:https://blog.xscode.com/833/the-guaranteed-funding-program-for-exceptional-open-source-projects/
How mindfulness has helped me solve problems
Tags: programing, development
Published: 2020-06-29 00:06:58

I looked away from my IDE to see the time on the top corner of my laptop screen. I’d been staring deep into my work for longer than I’d planned. Sometimes this is a good thing where all of the pieces are coming together and you enter a blissful state. When you are pleasantly reminded why you love what you do. This was not one of the times. 

This was a time when my body felt tight. My eyes were heavy and hurt. In the back of my mind negative self talk about missing deadlines and busted estimates ran through like the ticker on the bottom of a cable news screen.

I tried to walk my code into working little by little. Frantically searching the docs of the library I was using. Skimming tutorials. Still nothing. It felt like I was trapped in a tunnel. The tunnel dug by my concentration. But I didn’t have a shovel. 

A lot of folks on the internet talk about taking a walk when you get stuck. Get up, make some coffee, do something else. My problem was I entered this mental state long before I realized that I need to get up and take a walk. 

I wanted a way to not enter that metal space in the first place. It felt like entering a tunnel and every time a line changes and I hit run I’d hope it would mean I could come up for air. It wasn’t how I wanted to approach my work, my hobbies, my side projects. I had to find a different way to point my attention when things got tough. 

I started and stopped meditating many times. Like many positive “habits” I would fall in and out of it. After a couple of years of this cycle, I finally set time aside first thing in the morning. I get up, I walk to the room I meditate in, and I do it. 

 I also started looking into some things to shape my perspective. Taoism, Buddhism, Stoicism, and the like. I found that in order to get out of that feeling of being in a tunnel I had to not enter it at all. I starting trying not to let my mind wander as much. I set aside time to think of ideas but didn't let it ruminate over problems I can’t fix. 

I still mess up sometimes. I still fall into being hyperfocused but not actually stepping back and solving the problem at hand. But on the whole, it has been such a value-added for me.  I feel in control when I’m trying to problem-solve. I try to be kind to myself while I work through things and think about what I need to do as opposed to judging how I’m doing. What’s more, I actually recharge my mind when I’m away from my computer. 

When I’m mindful it feels like I can actually look for a solution. I can stop to think while I solve problems and approach things without my mind running commentary in the background.
Making Django App Publicly Accessible With Ngrok
Tags: python, django, testing, webdev
Published: 2020-06-28 18:14:22

Sometimes when developing our Django application, we need to make it publicly accessible or use https, for example when testing OAuth authentication sometimes https is enforced, or when testing Shopify webhooks (where the request is executed on Shopify server, so we need to make it publicly available), or simply when we want to share it with a friend without deploying it live.

To achieve it We can use ngrok to redirect what you are running on localhost to publicly available ngrok URL. Let’s get started.

## Installing ngrok

on mac, we can install it simply with brew.

```cli
brew cask install ngrok
```
For windows we can download it from [here](https://ngrok.com/download).

## Running ngrok
o start ngrok we simply type “ngrok http [port]“, in our case we use port 8000, because it’s the default Django development server port.

```cli
ngrok http 8000
```
you will see the ngrok screen, and your ngrok URL, in my case it’s http://5cedabab7730.ngrok.io, you also have https connection available.

![ngrok running](https://dev-to-uploads.s3.amazonaws.com/i/imo5v2a5tpqh2abnb1gt.png)

Now go to settings.py and add 5cedabab7730.ngrok.io to ALLOWED_HOSTS. Run your Django development server.

```cli
python manage.py runserver
```

Now your Django App is available to the world under https://5cedabab7730.ngrok.io you can test external APIs, authentications, or share what you working on with your friends.
Getting started with JavaScript - Atom autocomplete using ternjs
Tags: beginners, techtalks, career, javascript
Published: 2020-06-28 21:21:09

This is a beginner JavaScript Series from Scratch - step by step ,
The first few series we would be installing plugins needed for JS like ternjs which would give us auto-completion , in our next tutorial we would set up a package to help us console or run our JavaScript code on atom
atom link: https://atom.io
autocomplete-plus: https://atom.io/packages/autocomplete-plus , please remember to subscribe, YouTube link bellow
https://youtu.be/h0o-PTjPnnQ
Do you recommend quitting a 9-5 to learn web development full time?
Tags: career, discuss, watercooler, webdev
Published: 2020-06-29 04:02:22

---
title: Do you recommend quitting a 9-5 to learn web development full time? 
published: true
description: Why or why not? 
tags: career, discuss, watercooler, webdev
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/rt832jkgufpfw9f6f7i2.png
---

There is a choice many of us can be confronted with, sticking to our 9-5 job and learning web dev part time, or fully investing in web development. What are your stories and tips for someone struggling to decide?
[Advanced HTML & CSS] Duomly coding challenge # 1: Dashboard
Tags: challenge, beginners, codenewbie, css
Published: 2020-06-29 07:40:20

Hey guys,
we created a coding challenge that you can complete to test your skills and build a coding portfolio.

Today's info:
- Code the design into the HTML&CSS layout
- You can use bootstrap or another framework that you know
- Create git repository with name Duomly challenge #1
- Push the code to the GitHub and share a link to the repository in the comments

Layout to code:
![Duomly challenge](https://dev-to-uploads.s3.amazonaws.com/i/atgxfgwiklc29uauddz6.jpg)

HELP:
-Bootstrap tutorial:
https://www.blog.duomly.com/bootstrap-tutorial/
-HTML&CSS course:
https://www.duomly.com/course/html-and-css-basics-course/

Let's start!

Radek from Duomly