teleren/devto huggingface dataset:
Why should I switch from Python to Go? 
Tags: go
Published: 2020-05-05 16:01:35

It depends on what you are doing. For some reasons Python may be better than Go, for others Go may be better than Python. Let me give you some examples.

Some reasons to go for <a href="https://golang.org/">Go</a>:

* Anything involving massive <a href="https://golangr.com/concurrency/">concurrency</a>, like network programming
* Writing a high-performance **web back-end**
* You work in a domain that the Go ecosystem supports

Some reasons to go for <a href="https://python.org">Python</a>:

* Scripting stuff like automation. Python is a lot more flexible 
* Numeric computing or <a href="https://pythonprogramminglanguage.com/python-machine-learning/">Machine Learning</a>, in this area Go is no match
* You're doing web stuff and need MVC model and the like. Python comes with <a href="https://pythonbasics.org/flask-tutorial-hello-world/">Flask</a>, <a href="https://djangoforbeginners.com/hello-world/">Django</a> and other modules.

Now you can use either of them, it depends on the job you have to do. Go isn't for everything and neither is Python.

So what you get with Go is:

* A <a href="https://en.wikipedia.org/wiki/Concurrency_(computer_science)">concurrent</a> (imperative) programming language that can be mapped to multiprocessor machines as well as, I believe, distributed systems.
* True concurrency, no GIL
* A very efficient mechanism for synchronization and communications
* Stronger typing.

Some packages are not available in Go compared to Python, because Python has been around for a few more decades compared to Go.  

Go also isn't OOP (object oriented) in the same way Python is. Go relies more on structs, where Python relies on the traditional OOP model.

If you have enough performance with Python, why would you change? Especially if you have a very large code base.

**Related links:**
* <a href="https://golangr.com/">Go tutorial</a>
* <a href="https://pythonprogramminglanguage.com/">Python tutorial</a>
Devops Shorts 001 - Tobias Kunze
Tags: operations, devops, reliability, podcast
Published: 2020-05-05 15:52:46

---
title: "Devops Shorts 001 - Tobias Kunze"
published: true
description: "Devops Shorts 001 - Tobias Kunze"
tags: operations, devops, reliability, podcast
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/ydmnzmx73bjoe4cvd01e.jpeg
---
![tobias](https://pbs.twimg.com/profile_images/1243291207674912768/cZG5lBew_400x400.jpg)
# Nurture over Nature 

A-a-a-nd, we're rolling!
The first episode of **DevOps Shorts** is out! 

I'm so glad that [Tobias Kunze](https://twitter.com/tkunze) happened to be my first guest!
Tobias is the CEO of [Glasnostic](https://glasnostic.com/) - a startup with a unique approach to application resilience.

I first encountered Glasnostic (and immediately loved the post-Soviet reference of its name) due to my involvement with service mesh technology. Their company blog has a number of deep finely-written technical posts on meshes and service communication resilience patterns.

Tobias is a true visionary and talking to him was profoundly engaging.

Listen to the show to learn:
- Why developers aren't the kingmakers anymore
- Why musicians love IT
- The difference between the horizontal and vertical domains of software
- Why operations are a key differentiator

The full [transcript of the interview is available on Glasnostic Blog](https://glasnostic.com/blog/devops-shorts-podcast-episode-tobias-kunze)

And on a personal note  - I'm so happy I started this! 
I'm learning as I go, loving every moment of it and I believe in the end I'll be a great host.

The show is live on:

- [Anchor.fm](https://anchor.fm/devops-shorts)

- [Spotify](https://t.co/r13O1CpTlH)

- [Youtube](https://www.youtube.com/watch?v=bT9Hmas65cU) - also embedded at the bottom of this post.

Watch out for new episodes!

_And this is the place to state that the show is made possible by my company_ - 
[Otomato Software Ltd.](https://otomato.io) - _providers of Cloud-Native DevOps Knowledge and Services._
_Get in touch for:_
- _Developer Advocacy and Product Strategy_
- _Cloud Native Infrastructure Services and Training_
- _DevOps Acceleration_

To watch DevOps Shorts 001:

{% youtube bT9Hmas65cU %}
GatsbyJs: Pros and Cons
Tags: help, javascript, gatsby, react
Published: 2020-05-05 15:48:51

Hello everybody,

I'll soon start to work on a static website project using Strapi for the back-end. But I wonder if working with Gatsby for the front-end is relevant. That's why I'm looking for people's opinion/experience of Gatsby because I can't figure it out by myself... 
So, if you could help me to make my choice, it would be great :D

Cheers!
How to implement 'Show Password' feature in Angular and React?
Tags: angular, react, javascript, webdev
Published: 2020-05-05 15:44:14

Hello Everyone 👋, I hope you're doing great!

##In Angular
{% stackblitz angular-gscmgr %}


##In React
{% stackblitz react-v9drbz %}

##Explanation
We can toggle show/hide password by toggling input's type attribute.
Add an event listener to toggle button and change input's attribute value accordingly. 
**To show password, change input type value as password.**
**To show text, change input type value as text.**

#Bonus Tip🚀

Generally browsers will automatically save passwords for forms. Whenever you open website, browser will automatically fill the details including password. But sometimes we forget password and depend on browsers autofill. 
To view the password which is automatically filled by browser, follow below steps:

**Open Browser Development Tools  ➡️  Select password's input element ➡️ Change input type password to text**

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

**Tada!!!! You can see your password now.**

Thank you for your time. [Please visit my profile to know more about web technologies](https://dev.to/akashvarma9)
Interfaces in Typescript with an Example
Tags: typescript, javascript, oop
Published: 2020-05-05 15:38:13

The interface is a great Typescript feature and helps to write clearly structured and explicit code.

The interface helps you to describe a structure like fields without values or methods without implementation and also to force objects, class to have.

### Interface as Type
The interfaces are created with *interface* keyword and contain the blueprint of an object, for example, Subscription, contained properties and methods.

And also allow mark as optional properties or methods adding a question mark after the method name or property.

```javascript
interface Subscription {
	readonly: id;
	url?: string;
	name: string;
	sign() ?: string;
}
```

__Using the interface as a type.__

```javascript
let  subscriptionFrench : Subscription = {
	id: 1
	name: 'Paris',
	sign(): string {
		return "Bonjour"¨;
	}
}
```

### Implement interfaces in classes

The interface also helps to force your classes or your objects to have a structure and to clearly describe how an object should look like.

Using implement keyword after the class name and the name of the interface the class will implement the interface and must have every field defined into the interface.

Also, the class can implement more than one interface, separate by commas it an advance over normal inherits.

The IDE and compiler will raise an error if it doesn't fit with the interface.

```javascript
interface NetflixPremium  {
  allMovies: number;
}
class Spain implements NetflixPremium, Subscription {
    price: Number = 10.99;
    allMovies: number = 100;
    constructor(public name: string) {

    }
    sign(): void {
        console.log(`Thanks for signup ${this.name}.`)
    }
}

let spainSubscriptions = new Array<Spain>();
let bcn = new Spain("bcn");
let madrid = new Spain("madrid");

spainSubscriptions.push(bcn);
spainSubscriptions.push(madrid);

spainSubscriptions.forEach(element => {
    element.sign();
});

```

### Extends interfaces

A better way to implement multiples interfaces in a single class is by extending interfaces using the extends keyword and the name of the interface to be extended.

```javascript
interface NetflixPremium extends Subscription {
  allMovies: number;
}
```

The interface NetflixPremium contains every related to Subscription and the class Spain only needs to implement a single interface.

```javascript
class Spain implements NetflixPremium {
    price: Number = 10.99;

    constructor(public name: string) {

    }
    sign(): void {
        console.log(`Thanks for signup ${this.name}.`)
    }
    allMovies: number = 100;

}
```

## That's it!

Hopefully, that will give you a bit of help with interface in Typescript. If you enjoyed this post, share it.

Photo by <a href="https://unsplash.com/@cytonn_photography?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Cytonn Photography</a> on <a href="https://unsplash.com/s/photos/contract?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Unsplash</a>
How i got the GitHub Student Developer Pack.
Tags: github, studentdeveloperpack, python
Published: 2020-05-05 15:26:46

They created the GitHub Student Developer Pack with some of their partners and friends: to give students free access to the best developer tools in one place so they can learn by doing.

One fine day, I was checking out the daily updates at LinkedIn. Suddenly I came across a post by one of my friends that GitHub is providing Student Developer pack to some of the students.

At first, Honestly, I was not aware of it but then I started researching it. And then I came to know that Github is providing a Student developer pack in which they will provide free subscription and access to various great platforms so that we can learn better by hands-on experience.
There were many things on the list and hence I decided to apply and did so.

After some days, I got a mail from Github and BOO-OO-OOM they gifted me the Student Developer Pack.
I was very excited to see what I got. So, here is the list:- https://education.github.com/pack.
If they are still accepting the applications, just go for it.

The most interesting thing for me is Free GitHub Pro while I am a student.
So, if you also wanna gain this pack just apply for it.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/gnzjwm5o8tcvp2lbtc77.png)
Laravel SOAP Client
Tags: laravel, php
Published: 2020-05-05 15:23:54

[Comment]: # (All of this is placeholder text. Use this format or any other format of your choosing to best describe your project.)

[Reminder]: # (Make sure you've submitted the Twilio CodeExchange agreement: https://ahoy.twilio.com/code-exchange-community)

[Important]: # (By making a submission, you agree to the competition's terms: https://www.twilio.com/legal/twilio-dev-hackathon-terms)

Hey together,

i have builded a new laravel package for handling soap requests. It has the same features like laravel 7 Http just for soap.
Feedback welcome & have fun with that package

## Link to Code
https://github.com/CodeDredd/laravel-soap
How to Become a Professional Programmer?
Published: 2020-05-05 15:16:50

This is an enormous one. When tons of individuals began to find out programming , many of them aren't even aware initially what git and GitHub are and why they're important. If you build a foundation on this stuff from the beginning , you're far more likely to succeed further on down the road. Open up terminal, learn commands, and build a robust foundation from there platforms like Learn.co are good at integrating that from that start.

Make sure that you simply code a day . albeit it's only for an hour — something is best than nothing. it'll help keep you sharp. If you are a beginner, this is often especially crucial. you will be taking tons of latest information in directly , and practicing regularly will keep you from losing the talents you only built. Maybe meaning setting time aside on your calendar everyday to figure on a particular project outside of labor , or even meaning fixing a hackathon with a lover to code together. However you opt to try to to it, just don't let the habit elapse the wayside. it is your single most vital tool in becoming a successful developer.

Learn with a community
This could mean various things depending where you're in your learning process. If you are a professional developer, hopefully you have already got a community of individuals with whom you're employed . If you're new learning, this might be more of a struggle. Regardless, there are a couple of belongings you can do to enhance upon that by reaching bent a community. Attend Meetups in your area for developers and attend regular presentations, find a Slack community where you'll get support and help, or confirm that subsequent program you select has that inbuilt so you are not just going it alone. Also you creat this thpes or c++ projects click.. https://www.codeboks.com/c-projects/
RailsConf 2020 Couch Edition Is Out! What Are You Watching?
Tags: watercooler, rails, discuss, ruby
Published: 2020-05-05 15:15:26

---
title: RailsConf 2020 Couch Edition Is Out! What Are You Watching?
published: true
description: RailsConf 2020 videos are all online. What videos have you watched? What did you learn? What surprised you?
tags: watercooler, rails, discuss, ruby
---

![](https://railsconf.com/assets/social/feature-e1d23c61b7791bb8369d66a8262b94c2086e2566ca86be0e6180e4b2dd386f5d.jpg)

[RailsConf 2020](http://railsconf.org/) was supposed to be in Portland, Oregon this year, but then COVID-19 happened. The organizers went back to the drawing board and came up with *RailsConf Couch Edition*, and today all the videos were released!

Have you seen any of the videos yet? What did you think? Did you learn something new? Did something surprise you? Is there a presentation you want to highlight?

I found DHH's Q&A keynote presentation fascinating, thought-provoking and hilarious all at once, and shared my thoughts as I watched it on Twitter:

{% twitter 1257569917504716800 %} 

Share your thoughts. Let's discuss together!
5 Ways to Splat in Ruby
Tags: ruby, beginners
Published: 2020-05-05 15:14:28

_Originally posted on [Hint's blog](https://hint.io/blog/5-ways-to-splat-in-ruby)._

In honor of it being 5/5 today (aka Cinco de Mayo), I thought we'd continue the pattern and take a quick look at 5 different ways to use Ruby's infamous splat (`*`) operator.

Let's hop right into it! 

![hopping rabbit](https://dev-to-uploads.s3.amazonaws.com/i/2pz65r7o47iw8oyvtjlw.png)

## 1. Interpolate Into an Array

Splat can be used to expand the contents of one array into another:

```ruby
middle = %i(bar baz)
[:foo, *middle, :qux]

# [:foo, :bar, :baz, :qux]
``` 

## 2. Capture an Argument List
 
You can use splat to capture a list of arguments into an Array. Below, we're capturing the entire list of arguments being passed to `foo` into an Array named `bar`:

```ruby
def foo(*bar)
  "#{bar.class.name}: #{bar}"
end

foo(:a, :b, :c)

# Array: [:a, :b, :c]
```

## 3. Capture First/Last or First/Rest Values

Splat can also be leveraged to split up an array into parts. Kinda like pattern matching:

```ruby
arr = [1, 2, 3, 4, 5]
first, *, last = arr
puts first # 1
puts last # 5

first, *rest = arr
puts first # 1
puts rest # [2, 3, 4, 5]
```

## 4. Coerce a Value Into an Array

If you want to ensure the thing you are dealing with is an Array, you can splat it.

```ruby
foo = 1
bar = *foo
puts bar # [1]

foo = [1, 2, 3]
bar = *foo
puts bar # [1, 2, 3]
```

## 5. Convert an Array Into a Hash

Lastly, splat can convert an Array into a Hash. Your Array needs to contain an even number of elements for this to work. If the Array were grouped into pairs, the first element in each pair will become a key in your Hash, and the second element of the pair will be the corresponding value.

```ruby
arr = [:foo, 1, :bar, 2, :baz, 3]
Hash[*arr]
# { foo: 1, bar: 2, baz: 3 }
```
First Unique Character in a String
Tags: string, unique
Published: 2020-05-05 15:13:44

---
title: First Unique Character in a String
published: true
description: Leet Code Beginnner problem
tags: string, unique
---

For a given string, what's the best way to figure out first unique character in a string

1. Create a object or map that holds the count of characters in a string
2. Loop through the string and update the charObj
3. Loop through the string again and check charObj and return the index when a character count is 1
4. If there is no unique character at the end return -1

here's the code

```
let charMap = new Map()

for(let i = 0; i < s.length; i++) {
	if(charMap.has(s[i])) {
		charMap.set(s[i], charMap.get(s[i]) + 1)
	} else {
		charMap.set(s[i], 1)
	}
}

for(let i = 0; i < s.length; i++) {
	if(charMap.get(s[i]) == 1) {
		return i
	}
}

return -1
```

Thanks for reading 😍
Daily Developer Jokes - Tuesday, May 5, 2020
Tags: jokes, dailydeveloperjokes
Published: 2020-05-05 14:55:15

---
title: "Daily Developer Jokes - Tuesday, May 5, 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=Tuesday%2C%20May%205%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/5e12593b1b51e.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:
A programmer was arrested for writing unreadable code. They refused to comment.
 -->
🚨 Live Tonight: Build an Accessible React Component #3
Tags: a11y, react, webdev, livecode
Published: 2020-05-05 14:52:25

---
title: 🚨 Live Tonight: Build an Accessible React Component #3
published: true
description: Join me on Twitch and we'll build a third accessible React component together.
tags: a11y, react, webdev, livecode
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/7qcv8l2f30lzke3rl6f8.png
---

Last week, we built an accessible Listbox component. [The video](https://www.twitch.tv/videos/605571335) is still on Twitch (I'm moving it to YouTube soon) and I'm currently working on the associated blog post. It'll be released ASAP! 🙏

Tonight, at 7PM EDT, we're building another random component! We'll spin the widget wheel as stream starts and let fate decide which one for us. The link you need is below, and it's the same link you can go to in order to follow me if you want to be notified when I go live!

🌐 Twitch Link: https://twitch.tv/ashleemboyer

Hope to see you there! 🤗

---

Did you know I have a newsletter? 📬

If you want to get notified when I publish new blog posts or make major project announcements, head over to [https://ashleemboyer.com/newsletter](https://ashleemboyer.com/newsletter).
Passing objects between Activities using RxAndroid
Tags: android, kotlin, rxandroid, reactivex
Published: 2020-05-05 14:50:31

Want to pass data easily between activities? Tired of making classes `Parcelable`, or reluctant to make them `Serializable`? Good news — there is a way (among many other ways) to transfer objects between two Activities, and it’s pretty damn simple (well, of sorts!)

> This article assumes you to have implemented `RxAndroid` in your project. If you are new to ReactiveX for Android, [here is an article](https://medium.com/@kurtisnusbaum/rxandroid-basics-part-1-c0d5edcf6850) that will help you to understand it better and help you set you up! 

> Note: All code snippets are in Kotlin language

## Creating a communication medium
In order to communicate between two Activities, we first create a Bus class with a static `BehaviorSubject` object that can be accessed from anywhere.
```kotlin
class AndroidBus {
    companion object {
        val behaviorSubject = BehaviorSubject.create<Any>()
    }
}
```
## Sending data from the source activity
From the source activity, you can get the `BehaviorSubject` object and push your data model into the bus as follows:
```kotlin
val myAwesomeDataModel = AwesomeDataModel()
AndroidBus.behaviorSubject.onNext(myAwesomeDataModel)
```
## Receiving data at the destination activity
In the destination activity, simply subscribe to the `BehaviorSubject` and retrieve the object. Just to be safe, make sure the object is of the same type that you’re expecting.
```kotlin
var myAwesomeDataModel: AwesomeDataModel? = null

AndroidBus.behaviorSubject.subscribe {
    if (it is AwesomeDataModel) {
        myAwesomeDataModel = it
    }
}

if (myAwesomeDataModel != null) {
    // do stuff with your data model
```
And that’s all! No `Parcelable` implementations, no making classes `Serializable` and losing performance, no `Intents`, no bundle keys, nothing! Isn’t `RxAndroid` wonderful?

## What about sending multiple objects?
You can always add multiple objects into a `HashMap`, pass it using the above method and use the keys of individual objects to retrieve them back.
What are the best ways to make GUIs in Python?
Tags: python
Published: 2020-05-05 14:48:30

There are many modules that you can use to build GUIs. They have different widgets and features. What is best ultimately depends on your business requirements. I suggest trying them all out and seeing what works for you.

One of the standard GUI modules is <a href="https://pythonbasics.org/tkinter/">Tkinter</a>, which is quite good but limited in the number of widgets that are available.

<a href="https://pythonprogramminglanguage.com/pyqt/">PyQt</a> is a popular choice, it has loads of widgets and works on many platforms. It comes with a drag and drop designer that saves you a lot of time. But it's not native.

![designer](https://dev-to-uploads.s3.amazonaws.com/i/tmmn2jvkbc5hbl0dmq76.png)

<a href="https://pythonspot.com/wx/">wxPython</a> is a module that is native, you get the native OS widgets on every platform. But the downside of this is that those widgets may be available on one platform but not the other. It also has less support.

<a href="https://www.jython.org/">JPython</a> gives Python access to Java, this is something you could use if you like. That way you can run Python from Java or Java from Python.

There's [Kivy](https://kivy.org/#home), which is designed around touch interfaces and thus doesn't really have the desktop look.

![kivy](https://dev-to-uploads.s3.amazonaws.com/i/xec1iextq6b6l8jpnwuf.png)

Another option is to go the Web App route with a module like <a href="https://pythonbasics.org/flask-tutorial-hello-world/">Flask</a>. The good thing here is that you have all the web available and it will look the same everywhere, downside is you need to run a server.