teleren/devto huggingface dataset:
For a beginner in Python, which web framework would be the best to start learning first? 
Tags: python, flask
Published: 2020-02-14 15:53:05

Did you know you can make web applications with Python? 

You need a web framework or web module to do so. There are many frameworks available for this purpose: <a href="https://palletsprojects.com/p/flask/">Flask</a>, <a href="https://www.djangoproject.com">Django</a>, <a href="https://www.tornadoweb.org/">Tornado</a>, <a href="https://bottlepy.org/">Bottle</a>

Any of these frameworks will do, but the learning curve and popularity is very different. Picking the right framework is an essential decision, because it's easier to change a framework before you start a project than after you have 100s of code files.

Yes, you can do everything without a framework (<a href="https://pythonbasics.org/webserver/#Webserver">manually</a>), but for beginners that's not recommended and for professionals that's usually a waste of time.

Before learning a web framework, you should <a href="https://pythonbasics.org">learn Python</a>.

## Popularity

You want to use a popular framework, because of available jobs, rich community and wide support and maintenance of the framework. See this survey (2009) from stackoverflow (not all are Python frameworks):
 
![framework popularity](https://dev-to-uploads.s3.amazonaws.com/i/yevxbqq5vdtq0wqzoiej.png)

Flask and Django are the most popular Python frameworks. While Tornado and Bottle are simple, you probably want to go for the first two.

## Django

Now Django isn't really suited for beginners in my opinion, it takes a lot of time to setup, but it's a good framework if you know what you are doing. There is a lot of documentation for the framework available <a href="https://www.djangoproject.com/start/">[1]</a><a href="https://pythonspot.com/django-tutorial-building-a-note-taking-app/">[2]</a>

Django is a more complete framework that is best suited for heavy back-end and thin front end (JavaScript) sites. It makes a lot of decisions for you, like by default it uses an ORM.

## Flask 

Flask on the other hand lets you start quickly and you'll gain an understanding of routing, templating, macros, and the markup language used in the Python web framework.

You can build large sites with Flask, for example the popular website <a href="https://pinterest.com">Pinterest</a> was created with Python Flask.

Flask is an extremely lightweight web framework. I would recommend <a href="https://pythonbasics.org/what-is-flask-python/">learning</a> this, because not only it will gain you an understanding of we frameworks but you will learn more about Python than if you use larger projects like Django.

**Related links:**
* <a href="https://gum.co/IMzBy">Create Web Apps with Flask (course)</a>
* <a href="https://palletsprojects.com/p/flask/">Flask Web module homepage</a>
* <a href="https://www.djangoproject.com">Django Web Framework</a>
Publishing my first web application - intro
Tags: webdev
Published: 2020-02-14 15:51:50

##Motivation

In the life of a (web) programmer comes a moment, when they make an application which they want to share with a wider public. In my case it was after two years of learning how to make app, coding, improving, testing, with the help of one user - the person I wrote this app for.
I was pretty confident I have covered the most critical functions with tests. I was comfortable in deployment, so I wanted to let everyone know they can use my app. But...

I realized that the app used by the general public must follow some law requirements. And as a programmer, I have little to no idea what these are. So I started searching for laws, explanations, tools and manuals.

In this article, I want to summarize what I found out and help other programmers, who happen to be in the same position as I am.

##Disclaimer

My app is (currently) made for users from Czechia (Czech Republic), so I searched for solutions and laws based here. Thus, you should look into your local rules carefully.

I try to inform whether my solution is only applicable to Czechia or is based on rules of the European Union.

If you find any mistakes, please inform me so I can improve this text.

##Overview

I will try to look into some base law requirements - cookies, terms and conditions and protection of personal data (GDPR).
Then I’m also interested in various topics of app security - risks of dependencies, comparison of languages, private vs public code, security auditing, app usage monitoring (to find potentially malicious uses and security breaches), dealing with passwords and comparison of different deployment and hosting options.
I only have part of that by now, so I cannot ensure this series of post will look into everything.

##Overview of my app

My app is a calculator for ketogenic diet. Source code is [here](https://github.com/janmpeterka/ketocalc).
It’s built in Python framework - Flask. Uses MySQL for database.
It has user registration, and users save info about ingredients, recipes, and diets.

##What now?
In next part of the serie I will write about cookies and GDPR.

As this is my first most, your feedback is most welcome!
How do you get new starters acquainted with your codebase?
Tags: beginners, career, hiring, discuss
Published: 2020-02-14 15:28:26

Do you often have new starters join the team?

How do you help them get a project up and running on their machine for the first time?

I've met some teams that use a fully automated process (e.g one shell script), and others that use a mixture of automated steps and manual steps.

Happy Friday!
@ALL DEV users please check your SMN & BMN links
Tags: smn, bmn, links
Published: 2020-02-14 15:02:32

did you know that about 1 in 5 DEV users have a broken github, insta or twitter links which makes it very hard for me to be super friendly and follow them back on all their SMN & BMN :)

ok so i should use the DEV api to msg the guilty but wouldnt that be too creepy ?
How to draw a heart ♥😻❤❣
Tags: svg, javascript, css
Published: 2020-02-14 15:02:17

---
title: How to draw a heart ♥😻❤❣
published: true
description: How to draw an SVG path
tags: svg, javascript, css
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/ha96vwkk5skvo5gy8kig.png
---
## Let's go
Drawing an SVG path couldn't be easier, especially with the [`pathLength`attribute](https://developer.mozilla.org/en-US/docs/Web/API/SVGGeometryElement/pathLength).  If you are supporting older browsers, click through to the link to see if your browser is supported.

So let's get an SVG path that we can draw.
![Image of heart](https://dev-to-uploads.s3.amazonaws.com/i/a5js38jey1i7z5w6ao9v.png)

Check out the [Codepen](https://codepen.io/PaulRyan17/pen/ZEGQMRo) here which has the SVG included.

The first trick is to add the `pathLength` property to our `path`.
```
<path ..... pathLength="1" />
```

Doing this makes the animation much easier as we now know the length (i.e. 1).  Before you had to calculate the length which was a massive pain!

The next thing we need to do is use `stroke-dasharray` and `stroke-dashoffset`.  We will set both to 1, this essentially makes our SVG disappear so we can draw it.  I don't want to delve into these but you can read about `stroke-dashoffset` [here](https://css-tricks.com/almanac/properties/s/stroke-dashoffset/) and `stroke-dasharray` [here](https://css-tricks.com/almanac/properties/s/stroke-dasharray/).  Just know you can set `pathLength` on any `path` that you want to draw so once you set it to `1` you can set `stroke-dasharray` and `stroke-dashoffset` to `1` everytime!! 😇

So in the CSS panel add the following:
```
svg path {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}
```

So the heart has disappeared, that is what we want as we are about to draw it back.

We need to create an animation that will animate `stroke-dashoffset` back to 0.
```
@keyframes draw {
  from {
    stroke-dashoffset: 1;
  }
  to {
    stroke-dashoffset: 0;
  }
}
```

One last thing, just add the `draw` animation to our path.
```
svg path {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: draw 5s linear alternate infinite;
}
```

Our animation is `infinite` and also will `alternate` so it will draw back and forth.

Believe it or not but we are now done.  You should have the following:
![Heart drawing](https://i.gyazo.com/9e36b68a388196a7bed24dfd2b4a8596.gif)

Complete pen is [here](https://codepen.io/PaulRyan17/pen/wvaMExg).


## Conclusion

Any questions on the above, feel free to contact me on my socials!  
    
| :guardsman: [Insta](https://www.instagram.com/paulryantipp/) | :eyes: [Twitter](https://twitter.com/PaulRyan7) | :speech_balloon: [Github](https://github.com/PaulRyan17) | :thought_balloon: [LinkedIn](https://www.linkedin.com/in/paulryan9/) | :collision: [Youtube](https://www.youtube.com/channel/UCf4AtM9ldMfBsO0_bbYWvfw?view_as=subscriber) |:mailbox_with_no_mail: [Website](https://www.paulryancodes.com/)
| -- |--| --| -- | -- | -- |
Recommendations for Learning More About Responsive Images?
Tags: webdev, webperf, advice
Published: 2020-02-14 14:59:14

---
title: Recommendations for Learning More About Responsive Images? 
published: true
description: Looking for help understanding Responsive Images
tags: #webdev, #webperf, #advice
---

I am looking for help understanding Responsive Images and how to work with them.

I run the website [RinkAtlas](https://rinkatlas.com), a directory of 4,700 North American hockey arenas.

We also have almost 1,800 published photos of those arenas, ranging in size from 11 Kilobytes to 13 Megabytes in size. I know that displaying photos with sizes in excess of 5 Megabytes is inefficient and unnecessary for our web application.

I’ve spoken to a few friends who are also web developers and mobile app developers, but none of them have been too involved in building a Responsive Image management function into their apps.

I’ve tried looking for guidance at other developer resource sites such as [Stack Overflow](https://stackoverflow.com). One of the big issues with question/answer sites like that is that open-ended questions are frowned upon; In my experience, you have to have a concise, well-phrased question in mind in order to get any value out of it.

I started searching here on Dev.to, and a bit of a breakthrough came when I searched for “Image Management”.

I found a post  [JPEG, GIF, PNG OR SVG - Which should You use?](https://dev.to/sarah_chima/jpeg-gif-png-or-svg---which-should-i-use-1o8o), which referred to a course on “Responsive Images”. Before I started searching, I didn’t even know what term to use to characterize the solution I was seeking.

So, I started searching the web for “responsive images course”.

I found:

* a [Responsive Images course at Udacity](https://www.udacity.com/course/responsive-images--ud882),
* a [Responsive Images course at Lynda.com / LinkedIn Learning](https://www.lynda.com/CSS-tutorials/Responsive-Images/372539-2.html),
* a [Responsive Design course at Coursera](https://www.coursera.org/learn/responsivedesign), and
* a [Responsive Images course at Treehouse](https://teamtreehouse.com/library/responsive-images).

Have you taken any of these courses and gotten the knowledge you needed?

Have you taken more than one of these courses and found one better than the other, or reviewed any of these courses for your corporate training needs?

Do you have any other suggestions?
A trick with Ruby anonymous classes
Tags: ruby, rails, testing
Published: 2020-02-14 14:47:12

Since everything in Ruby is an object it is only normal that classes are objects too. Which means they just have regular constructors with initializers, as any other object would do.

```ruby
Class.new do
  def hello
    puts "Hello world!"
  end
end.new.hello

# prints -> Hello world!
```

### What can I use it for?

Anonymous classes are an amazing candidate for testing mixings.

```ruby
# callable_test.rb
# run it with:
# ruby callable_test.rb

module Callable
  def call(*args)
    new(*args).call
  end
end

require "minitest/autorun"

class TestCallable < Minitest::Test
  def setup
    @klass = Class.new do
      extend Callable

      def initialize(arg1, arg2)
        @arg1 = arg1
        @arg2 = arg2
      end

      def call
        [@arg1, @arg2]
      end
    end
  end

  def test_same_return
    assert_equal @klass.new(1, 2).call, @klass.call(1, 2)
  end
end

# Run options: --seed 3295
#
# # Running:
#
# .
#
# Finished in 0.000605s, 1651.9615 runs/s, 1651.9615 assertions/s.
# 1 runs, 1 assertions, 0 failures, 0 errors, 0 skips
```

There's a caveat though... You need to be aware that anonymous classes have no name (they are anonymous after all ;) ) so any call to `Class.new.name` will return `nil`.

Classes only acquire a name when you assign them to a constant. That is:

```ruby
klazz = Class.new
klazz.name
# => nil

MyClass = klazz
klazz.name
# => "MyClass"
```

So, if you need to test things which depend on the class name you can't use anonymous classes, although they still have a benefit over regular declarations on tests, which is that they can be assigned to variables, while regular `class...end` declarations can't.

```ruby
my_class = class MyClass; end
my_class
# => nil

other_class = OtherClass = Class.new
other_class
# => OtherClass
```

So, if you need a class with a name on a test you can still use this, only remember to remove the constant on your test's teardown.

```ruby
Object.send(:remove_const, :MyClass)
```

If you're on a Rails app and use RSpec, it even has a helper to test things with anonymous controllers: https://relishapp.com/rspec/rspec-rails/v/3-9/docs/controller-specs/anonymous-controller, which is especially useful to test things like login/logout flows independently.
Disabling Swagger' button *try it out* 
Tags: todayilearned, javascript, tutorial, showdev
Published: 2020-02-14 14:45:26

We all know how important is to document and expose your services. 

Swagger (https://swagger.io/) makes it easy to configure a way to expose your services and permit the user to execute them. 

But sometimes, we do not want to enable the *Try it Out* button, for security reasons, for example. 

I've found out 2 workarounds (not sure they're the best solutions to everycase, though):

1 - Change the host parameter, so Swagger will execute the service not in the same host of the service:

```java
Swagger swagger = new Reader(new Swagger()).read(getClasses());
if (envProduction) {
  swagger.setHost("host.i.want.the.services.to.be.executed");
}
```

So, if my 'service' is being hosted in 'http://host.com/context/api/service', when Swagger' button 'Try it out' is pressed, it will call 'http://host.i.want.the.services.to.be.executed/context/api/service'.

2 - Add a plugin via Javascript do disabled the button, edit index.html where SwaggerUIBundle is created:

```javascript
<script>
  window.onload = function() {
    const DisableTryItOutPlugin = function() {
      return {
        statePlugins: {
          spec: {
            wrapSelectors: {
              allowTryItOutFor: () => () => false
            }
           }
         }
       }
     }

     const ui = SwaggerUIBundle({
       url: window.location.protocol + "//" + window.location.host + "/boletos/servicos/documentacao",
       dom_id: '#swagger-ui',
       deepLinking: true,
       validatorUrl: null,
       presets: [
         SwaggerUIBundle.presets.apis,
         SwaggerUIStandalonePreset
       ],
       plugins: [
         SwaggerUIBundle.plugins.DownloadUrl,
         DisableTryItOutPlugin
       ],
       layout: "StandaloneLayout"
     })
   
     window.ui = ui
   }
</script>
```

Do you know a better way do disable that button? Let me know in the comments! I'd love to learn more!

Thanks!
OOWLON 2020 #cloud #devops #conf #expo in review
Tags: oracle, cloud, blockchain
Published: 2020-02-14 14:40:54

Well Oracle Open World London 2020 has finished ! So what were the highlights and lowlights ?

highlights
* 84 way raspberry pi cluster running oracle unbreakable linux for arm and seti
* mv2oac
* epaper codecard
* $300 + bonus $200 oracle cloud evals
* blockchain as a service (BAAS) 
* saving the worlds bees one bee at a time (hint dont drink almond milk)
* mysql cupcakes
* pwc jellybeans
* unlimited free illys coffee

lowlight
* booking dot com STILL use mysql after 15 years !

surely a massive embarrassment to oracle sales since i would have thought the oracle db is fast enough to handle booking 1M hotel nights a day and surely the 'cost' of the the 'unbreakability' of oracle db should be a nobrainer to the booking dot com CTO !

what incentive is there for any startup to even consider oracle db if a dot com is using mysql ? (booking claim to have been operating for over 15 years so how can they claim to be a startup ?) 

WHAT AM I MISSING HERE ?

you can find more #oowlon instas and tweets here
* https://www.instagram.com/explore/tags/oowlon/
* https://twitter.com/search?q=oowlon&src=typed_query
Why you should get a good, international domain for yourself
Tags: career, advice
Published: 2020-02-14 14:23:44

---
title: Why you should get a good, international domain for yourself
published: true
description: 
tags: career,advice
cover_image: https://s3.amazonaws.com/aviaryan/email/good-domain.jpg
---

I see many new developers and even some senior developers going by a `.in` or even a `.tk` for their websites.

But this is short-sighted. Why?

Because you might move out of India. Or you might work for US and UK companies remotely. In that case, `.in` is not the ideal TLD you want for your domain. And `.tk` is not even worth a mention. It’s available for free and it doesn’t make a good impression of you.

Get a `.com` if possible. If your name is too common, get a `.io` or `.tech` or `.co` or `.net`. Anything less than that is selling yourself short.

Saving $7/year by getting a `.in` instead of a `.com` might look like a deal when you are starting as a developer but after a few years, you will regret saving $28 by not getting a `.com`. 

So do it right whilst you still have time (SEO!) and get a proper domain.

Otherwise, you will be like me, renewing your `.in` domain every year (aviaryan.in) till the end of the universe so that you can permanently redirect its traffic to your `.com` domain.

----

This article was first posted to [my newsletter](https://aviaryan.com/letters/get-good-domain).
React *Cannot read property 'addEventListener' of undefined*
Tags: react, javascript
Published: 2020-02-14 13:59:01

Another problem with react. I trying to convert vanilla js to react. I have error and i do not have enough knowledge to change it.

*Cannot read property 'addEventListener' of undefined*

*input.addEventListener("keyup", function() {*


https://codesandbox.io/s/cocky-shirley-75p85
Adobe XD to HTML Full Process
Tags: webdev, beginners, html, design
Published: 2020-02-14 13:46:41

I will cover the full process of taking an Adobe XD design and developing it with HTML and CSS.
{% youtube DaQx3ULPLRw%}
In this video I cover:
* Exporting basic elements like IMG's, SVG's, etc
* Preparing and building the Header, Menu, Sections and Footer
* Using CSS to ensure the styling of the sections fit the design
* Explaining and showing the process of how some items that need to be converted don't always work and need some extra time to get things right.

Hopefully, this video will help those looking to see the process behind developing sites in day to day business. In the next article, we might take a look at importing this into WordPress, adding in Responsive Design, etc.

## Follow and support me: 
Special thanks if you subscribe to my channel :)
* [Youtube](https://www.youtube.com/channel/UCvM5YYWwfLwpcQgbRr68JLQ?sub_confirmation=1)
* [Patreon](https://www.patreon.com/adriantwarog)
* [Twitter](https://twitter.com/twarogadrian)

## Want to see more:
I will try to post new great content every day. Here are the latest items:
* [Full Tutorial on how to use SASS to improve your CSS](https://dev.to/adriantwarog/full-tutorial-on-how-to-use-sass-to-improve-your-css-57on)
* [4 Simple CSS Hover Transitions for your Elements Background](https://dev.to/adriantwarog/4-simple-css-hover-transitions-for-your-elements-background-4mlg)
* [How to implement Dark Mode with CSS new media call: prefers-color-scheme](https://dev.to/adriantwarog/how-to-implement-dark-mode-with-css-new-media-call-prefers-color-scheme-3h65)
* [Creating a Mobile Design and Developing it](https://dev.to/adriantwarog/creating-a-mobile-design-and-developing-it-5c4o)
Free Voice and Video Chat Library
Tags: voice, video, android, chat
Published: 2020-02-14 13:36:30

Hi,
I just want to ask ,,If  voice and video chat must depend on payed libraries
and there is no any free way to deal with Voice and Video Chat 
I build text Chat App in Kotlin depend on Firebase.
but until Now Firebase not support voice or video Chat
in my search I found this libraries 
1- webRTC
2- CametChat
3- QuickBlox
I need more advice about this problem 
best regards
☕ Getting Started with Spring Boot 2 
Tags: java, devops, opensource
Published: 2020-02-14 13:34:25

Learn how to build real-world applications using Spring Framework 5 and Spring Boot 2

Key Features

* Learn the latest techniques for building Spring MVC applications using Spring Boot 2 
* Build a real-world project 
* Learn how to deploy your project into production 

What You Will Learn

* Get started in seconds using Spring Initializr
* Build anything - REST API, WebSocket, Web, Streaming, Tasks, and more
* Simplified Security
* Rich support for SQL and NoSQL
* Embedded runtime support - Tomcat, Jetty, and Undertow
* Developer productivity tools such as live reload and auto restart
* Curated dependencies that just work
* Production-ready features such as tracing, metrics and health status
* Works in your favorite IDE - Spring Tool Suite, IntelliJ IDEA and NetBeans

To be continued...
Daily Developer Jokes - Friday, Feb 14, 2020
Tags: jokes, dailydeveloperjokes
Published: 2020-02-14 13:00:07

---
title: "Daily Developer Jokes - Friday, Feb 14, 2020"
description: "Check out today's daily developer joke! (a project by Fred Adams at xtrp.io)"
series: "Daily Developer Jokes"
cover_image: "https://private.xtrp.io/projects/DailyDeveloperJokes/thumbnail_generator/?date=Friday%2C%20Feb%2014%2C%202020"
published: true
tags: #jokes, #dailydeveloperjokes
---

Generated by Daily Developer Jokes, a project by [Fred Adams](https://xtrp.io/) ([@xtrp](https://dev.to/xtrp) on DEV)

___Read about Daily Developer Jokes on [this blog post](https://xtrp.io/blog/2020/01/12/daily-jokes-bot-release/), and check out the [Daily Developer Jokes Website](https://dailydeveloperjokes.github.io/).___
### Today's Joke is...
![Joke Image](https://private.xtrp.io/projects/DailyDeveloperJokes/public_image_server/images/5e1259316ab83.png)

---
*Have a joke idea for a future post? Email ___[xtrp@xtrp.io](mailto:xtrp@xtrp.io)___ with your suggestions!*

*This joke comes from [Dad-Jokes GitHub Repo by Wes Bos](https://github.com/wesbos/dad-jokes) (thank you!), whose owner has given me permission to use this joke with credit.*

<!-- 
Joke text:
___Q:___ What are the three hardest problems in computer science?

___A:___ Naming things and off-by-one errors
 -->
Deploying Machine Learning Models with mlflow and Amazon SageMaker
Tags: opensource, tutorial, machinelearning, aws
Published: 2020-02-14 13:34:00

---
title: Deploying Machine Learning Models with mlflow and Amazon SageMaker
published: true
date: 2020-02-14 12:44:39 UTC
tags: opensource,tutorial,machinelearning,aws
canonical_url: https://medium.com/@julsimon/deploying-machine-learning-models-with-mlflow-and-amazon-sagemaker-dac2b8244224
---

In this video, I first train an XGBoost model on my local machine (I use PyCharm), and visualize results in the [mlflow](https://www.mlflow.org/) UI. Then, I deploy the model locally, and predict test data. Next, I create a Docker container, push it to Amazon ECR, and use it to deploy my model on [Amazon SageMaker](https://aws.amazon.com/sagemaker).

Happy to answer any question you may have!

{% youtube jpZSp9O8_ew %}

Code: [https://gitlab.com/juliensimon/sagemaker-automation/-/tree/master/mlflow/direct-marketing-xgboost](https://gitlab.com/juliensimon/sagemaker-automation/-/tree/master/mlflow/direct-marketing-xgboost)

Documentation: [https://www.mlflow.org/](https://www.mlflow.org/)