teleren/devto huggingface dataset:
If you want to learn how to code but are afraid to start
Tags: learning
Published: 2020-04-21 04:12:50

---
title: If you want to learn how to code but are afraid to start
published: true
description: Programming is not something that only someone else can do.
tags: learning
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/iqz4eneu0lncbep7ikf6.jpg
canonical_url: https://www.kirillvasiltsov.com/writing/post/if-you-want-to-learn-how-to-code-but-are-afraid-to-start/
---

Are you afraid to start learning to code? I have good news for you - by the end of this post you probably won't be. I will not tell you **THE SECRET**. There isn't one. Instead I am going to reason a little bit.

I want you to do a very simple thing. Something you already can do.

Look at your friends who already make their living coding. If you don't have friends who code, just look at random people who post about programming on the Internet. Seriously, go look at their photos. Look at their Twitters.

Do you notice something? 

These people are just like you. It is very easy to imagine each of them doing something completely different. This person could be a barista and that person could be a dentist. Maybe YOU are a barista who is reading this post. 

In other words, people who can code are not some [galaxy brain](https://knowyourmeme.com/memes/galaxy-brain) superhumans who know THE SECRET or have powers that you don't. Don't believe me? Well who do you think wrote this post? Look at my profile pic - I swear I didn't just steal some random dude's photo from Google.

If they could do it, you can do it. 

It is as simple as that. But it is a very powerful thought that I want you to entertain. How do I know this? Well, I was afraid to start too, a few years ago. In fact, I even managed to start once and then gave up. I gave up because even after I started to learn programming, some things were so confusing that I lost all confidence halfway through. And I lost it because I didn't internalize this simple mindset - if someone can do it, then you can do it too.

Ever since I realised this, everything has been smooth sailing.

This is why I want you to bear this in mind even after you start. In fact, this idea extends to other activities as well. Maybe you want to start learning drums. Or writing. Or whatever. Unless there are very objective walls in front of you, you can do it.

If for some reason this is not enough, you can use a trick. This is a trick I sometimes use to do the first step, which is the hardest.

Imagine that you are someone else. This person can be your role model, or your friend who codes, or even someone who doesn't exist. All you know is that this person is very confident and doing the first step for him is super easy. He's almost like some badass movie character that just happens to succeed. 

And then do it.

After that, you can go back to normal you. The hardest part is over. I hope this helps you as much as it helped me.
How I could be updated in web programming (JavaScript, css, php and html)
Tags: css, html, javascript, php
Published: 2020-04-21 04:03:11

Hi everybody This quarantine give the possibility to stop and make me think about what I want to my life to my family 
I have some technologies project but I   Haven’t started really good anyone.
And I take that time to reflect about that.
I don’t have the possibility to stop before for a lot of things and now I’m learning web design.
But I have a simple question which one could be the order for the languages mention above and how may I be updated
Python Microservices, Part 1: Choices, Key Concepts, and Project setup
Tags: tutorial, python, microservices, programming
Published: 2020-04-21 03:57:55

*Evaluate languages and frameworks, learn asyncio and layered design, and setup lint, test, code coverage tooling from the very beginning.*

---

At SlangLabs, we are building a platform for [programmers](https://www.slanglabs.in/developers) to easily and quickly add multilingual, multimodal [Voice Augmented eXperiences (VAX)](https://www.slanglabs.in/blog/what-are-voice-augmented-experiences) to their mobile and web apps. Think of an assistant like Alexa or Siri, but [running inside your app and tailored for your app](https://www.youtube.com/watch?v=TMhGGIAc0f0).

The platform consists of:

- **Console** to configure a [buddy](https://docs.slanglabs.in/slang/digging-deeper/building-buddies) for an app,
SDKs for [Android](https://docs.slanglabs.in/slang/getting-started/for-android-apps) and [Web (JavaScript)](https://docs.slanglabs.in/slang/getting-started/for-web-apps) providing voice-to-action capabilities,
- **Microservices** that SDKs invoke to infer the intent inherent in the voice utterance of an end-user, and extract associated [entities](https://docs.slanglabs.in/slang/digging-deeper/building-buddies/entities-and-entity-types), and
- **Analytics** to [analyze end-user behavior](https://docs.slanglabs.in/slang/digging-deeper/understanding-analytics) and improve the experience.

This blog post is to share the best practices and lessons we have learned while building the microservices.

(Based on a PyCon India 2019 tutorial)

[Continue reading »](https://www.ml4devs.com/articles/python-microservices-tornado-01-asyncio-lint-test-coverage-project-setup/)
I built a 2D RPG Game in GO [GoLang]
Tags: gamedev, go, showdev
Published: 2020-04-21 03:50:34

All I did in my last 9 years web development was use JavaScript and javascript only. But I wanted to learn something new.

I was confused between Rust or GO. Rust is definitely faster than GO, Go is easy to learn and easy to write and maintain. (in my personal opinion)

And so I choose **GO**


{% youtube XBQ6jMGGk_Y %}

I recently started learning Go (GoLang) and I thought why not start learning by making a 2D game.

I'm using [PixelGL](https://github.com/faiface/pixel) which is almost identical to Raylib.

so far my game has;
- State Machine (for changing between different maps, anime state, enemies)
- Storyboard for creating animations (also included AnimationController, Tween)
- load sound, play sound on certain actions (above video is not updated)
- Welcome Title Menu screen
- Game Over screen
- In Game Menu
- Selection Menu, Tooltips
- Combat Arena
- Attack Options (Attack, Item, Magic, Flee)
- Attack randomizer (e.g. Miss, Critical, Dodge)
- Load Town Map (world map)

Im not saying its a good game or its perfect.
All I'm saying is I'm enjoying learning GO. And somehow developing games is more addicting than playing one.


I just hope more people start using GO for game development its way way Better than __Python__ and 1000x times better than __Java__
Task-Manager RESTFul API: Demystifying Abstract concepts in Node.js and MongoDB
Tags: node, mongodb, restapi, postman
Published: 2020-04-21 03:39:17

## What is Node.JS?
>Node.JS is a JavaScript runtime built on **Chrome's V8** JavaScript engine. It uses an event-driven, non-blocking I/O model that makes it lightweight and efficient to build fast, adaptive, and network applications. 

## What is an API?
>Application Programming Interface is a piece of software that can be used by another piece of software, in order to allow applications to talk to each other with a set of defined rules. 
> REST decides how the API looks like. It stands for “Representational State Transfer”

## Program Overview
>It is a task manager application built using NODE JS and MongoDB. It follows a RESTFul API design architecture. The app sends an email notification upon registration and deactivation of the user's account. It's richly built with a simple scientific technique and best practices in the world of API design. 

## Features 
- Sending Emails
- Authentication and Security
- Sorting, Pagination, and Filtering
- Avatar upload

## Hosted Domain Link

* [Task Manager API](https://kater-task-manager-api.herokuapp.com/)

## Postman Collection Link

* [Task Manager API Shared Postman documentation](https://documenter.getpostman.com/view/7972459/Szf82npY)

## Github Repository 
* [Task Manager API](https://github.com/akeren/task-manager-api)

## Further Reading 
* [RESTFul API Guidelines](https://hackernoon.com/restful-api-designing-guidelines-the-best-practices-60e1d954e7c9)
* [Understandding and Using Rest-API](https://www.smashingmagazine.com/2018/01/understanding-using-rest-api/)
how is everyone holding up?
Tags: personal, chat, discuss, mentalhealth
Published: 2020-04-21 03:34:28

---
title: how is everyone holding up?
published: true
description: it’s been a long time since i posted. how are you all? how has Dev changed in the last year? i’d love your perspective.
tags: personal, chat, discuss, mentalhealth
---

hey folks. turns out having a soul crushing job and lack of interesting projects to work on can really decrease your blogging output. also, I had a very bad mental health 2019.

i was laid off at the end of march due to covid related sales pipeline issues, leading to a lack of cash in hand, and it turns out to have been the best thing to happen for me in months. don’t get me wrong, it was incredibly nerve wracking but i didn’t realize how drained i was until I didn’t have to go in to work anymore. i start my new job next monday and i’m feeling more empowered and excited than i have in a while.

one thing i wasn’t expecting about my job search is that, because i’d done so little quality coding over the last few months, i was terrified of coding exercises in the job process. my job search probably took longer than it needed to because i would just stare at those codility emails in fear, wondering how badly i was about to screw up my future. 

good news- once i started doing them it jumpstarted my brain and i was like  “oh, i know how to do this. this isn’t so scary.” so for anyone out there who is also job searching amid the layoffs and procrastinating due to fear of failure, know 1. you’re not alone and 2. it’s unlikely to be as bad as you think. the waiting is the hardest part. 

anyhow, that was a whole lot of rambling but i missed Dev and the community here, so i thought i’d dip my toe back in and see what’s up. what’s changed since i’ve been on hiatus? how are you holding up through everything happening with covid? come say hi in the comments. we’re all in this together.
Vietnamese Alphabet rewrite to FriendlyUrl for .Net Core and .Net Framework
Tags: dotnet, csharp, webdev, github
Published: 2020-04-21 03:11:28

**Rewrite Url from VietnameseString for Web Application (WebPage, MVC, .Net Core, .Net Framework)**

*Project site:*
{% github baoduong-dev/VietnameseUrlRewrite no-readme %}

*Using:*
```
UrlWrite.Url(string);
```

*Example:*
```
public IActionResult Index()
{
    string a = "Đây là Url bài viết số n";
    string b = UrlWrite.Url(a);
    return Content(b);
    /// Result: "day-la-url-bai-viet-so-n"
}
```

## How do I use it?

1. Install ["VietnameseUrlRewrite"](https://www.nuget.org/packages/VietnameseUrlRewrite) via [NuGet](http://nuget.org)

```
Install-Package VietnameseUrlRewrite -Version 1.0.1
```

2, In your controller code or Razor page, call **UrlWrite.Url(string)** if you want to convert string to url.

## Using .Net Standard 2.0
Use .net Standard should be suitable for all projects .Net Framework and .Net Core

## Authors

* **Bảo Dương** - *Initial work* - [baoduong-dev](https://github.com/baoduong-dev)

## License

Licensed under the [MIT License](http://www.opensource.org/licenses/mit-license.php).
Ruby's attr_reader and attr_writer
Tags: ruby, basics, beginners, introduction
Published: 2020-04-21 03:09:38

---
title: Ruby's attr_reader and attr_writer
published: true
description: The power of attr methods in Ruby
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/ux82pf77clusj9xww63y.png
tags: ruby, basics, beginners, introduction
---

Imagine you are writing a program to help your local cat animal shelter, so you start by defining a Cat Class in Ruby 😺

```ruby
class Cat
  def initialize(name)
    @name = name
  end

  def name
    @name
  end
end
```

Now you go ahead and make a call to create a new Cat with a name:
```ruby
cat = Cat.new
cat.name = "Telemakhos" #=> NoMethodError
```

You run into `NoMethodError` 🙀. Well, that is expected since we haven't written a method to define a cat's name. We've just written the _getter_ method. We also need to write a _setter_method.
 
### What is a getter and setter method?
**Getter** methods are used to retrieve the value of an instance variable from an object and **Setter** methods are used to set the value of an instance variable. In many languages, you can read and write the value of an instance variable directly but in Ruby you have to specify a getter and setter.

Let's have a second pass at our Cat Class. Say you create a new instance of Cat attached to a variable `tabby`:


```ruby
class Cat
  def initialize(name)
    @name = name
  end

  def name #getter method
    @name
  end
  
  def name=(name) #setter method
    @name = name
  end
end

tabby = Cat.new('Telemakhos')
puts tabby.name #=> "Telemakhos"
```
With our new getter and setter methods, we can now _get_ and _set_ the name of a cat 😼

Now imagine if you had more properties to a Cat than just `name`
```ruby
class Cat
  def initialize(name, age, breed, weight)
    @name = name
    @age = age
    @breed = breed
    @weight = weight
  end
end
```
If you wanted to **get** or **set** any of those properties, it would require *eight* more getter and setter methods! 😿

### There is a better alternative: **attr_reader** and **attr_writer**!

`attr_reader` and `attr_writer` are Ruby methods that can be used to replace getter and setter methods and mimic the accessing of instance variables seen in other languages such as TypeScript. Using `attr_reader` and `attr_writer` is especially useful when you want to read and manipulate the values of a Class that has many instance variables.

Here is an example of it's utility in depth:


```ruby
# cat.rb
class Cat
  attr_reader :name, :age, :breed, :weight
  attr_writer :name, :age, :breed, :weight
  def initialize(name, age, breed, weight)
    @name = name
    @age = age
    @breed = breed
    @weight = weight
  end
end

cat = Cat.new("Julie", 3, "Tabby", 8)
puts cat.name # => "Julie"
puts cat.age # => 3
puts cat.breed # => "Tabby"
puts cat.weight # => 8
cat.weight = 10
puts cat.weight # => 10

```

In conclusion, `attr_reader` and `attr_writer` can replace a bunch of getter and setter methods in just a single line! 😻
Pro Flutter Navigation
Tags: flutter
Published: 2020-04-21 03:09:21

Navigation from one page to other is vital part in mobile app development.
Flutter comes with very easy solutions for navigation using 🥰Navigator🥰 class.

In this post I am going to cover two types of navigation in flutter.

1) Simple navigation
2) Named navigation

Our scenario is to move to the second page on button pressed, we were taking two pages
1) Home page
2) Second page

*also we are passing a string to second page.*

#Simple navigation
Simple navigation can be achieved by using Navigator push method

{% gist https://gist.github.com/Prakash-Selvaraj-Ash/5ad662138c7717ffeff750f841e7c8e2 %}

the syntax for Navigator push is 
'*Navigator.push(context, MaterialPageRoute(builder: (context) => Widget()));*'

Seems simple isnt it, See below for code snippet.
{% gist https://gist.github.com/Prakash-Selvaraj-Ash/4067ceee6fd7ca0806cb5160af16dc6d %}

#Named navigation
I would say this is the best way to handle navigation, you will find the answer soooon 😉

Named navigation is using routing concept, now you get it why it is the best way ahhh 😇

All the navigation routes are isolated/dedicated in one place, so we don't need to worry about instantiating class in our dart code.

lets jump into the code.

Flutter Material app comes with function callback for generating the App routes
####*onGenerateRoute*####

We can define our routes in a function and set it to *onGenerateRoute*, so that flutter knows where to go on navigation.

{% gist https://gist.github.com/Prakash-Selvaraj-Ash/ed1b37f5d6a0560999b63bfe20e6fbf8 %}

Syntax for named routing using navigator: 
*Navigator.of(context).pushNamed('/route', arguments: args);*

even simple isn't it??

See below code snippet
{% gist https://gist.github.com/Prakash-Selvaraj-Ash/978b70d5d55774fc1d73ce25b77e0c8e %}

for full sample please find in the [Github repo link](https://github.com/Prakash-Selvaraj-Ash/prakash.selvaraj-outlook.com/tree/master/named_router)

Happy fluterring 😇😇!!
I write technical blogs, Ask me anything!
Tags: ama
Published: 2020-04-21 02:33:44

---
title: I write technical blogs, Ask me anything!
published: true
description: 
tags: ama
---

- I have been working on backend systems for the past 4 years
- Started blogging in 2018
- Initially, it was hard, and had a lot of people to help along the way
- By the end of 2019, I have about 70+ blogs published.
- I can share what I learned over this period

You can find my blogs at [Bhavani's Blog](bhavaniravi.com/blog) and [My medium account](medium.com/@bhavaniravi)

I have a few questions answered here, but that shouldn't stop you from ask your version of the question

{% twitter 1141922992307310597 %}
Is it good to use events like “onkeyup” to make requests?
Tags: javascript
Published: 2020-04-21 01:59:36

## Why are we using events like "onkeyup"?
Well, It’s better from UX (user experience) side, You just hit the letters and walah here is you result.
But there is an issue here…

## First of all let’s see how to make a request with __“onkeyup”__ event? 
### _Let’s fetch some dad jokes…_
---

```html
<input type="search" id="search-box">
<ul id="search-result"></ul>
```

```javascript
let searchBox = document.querySelector("#search-box"),
    searchResult = document.querySelector("#search-result");
let config = {
  headers: {
    Accept: "application/json"
  }
};

searchBox.onkeyup = function(e) {
  if(e.target.value.trime().length > 0) {
    let searchText = e.target.value;
    fetch("https://icanhazdadjoke.com/search?term=" + searchText, config)
      .then(res => res.json())
      .then(data => {
        searchResult.innerHTML = '';
        data.results.forEach((joke) => {
          searchResult.innerHTML += "<li>" + joke.joke +"</li>"
        })
      })
  }
} 

```

_cOo0O0ol all things go just fine._
__But__ when you type a letter and type another one no matter how fast you are (_except if you are faster than eminem_)there are two requests have been sent and you actually just want the last one but the first one maybe is pending in the background and maybe it isn’t completed yet and that is not a good thing for performance.

##So what can we do to abort the previous request?
__We can use AbortController__
A controller is an extremely simple object.
It has a single method abort(), and a single property signal.
When abort() is called:
abort event triggers on controller.signal
controller.signal.aborted property becomes true.

##so we will make a little change in the code
we will add this line before the function
```javascript
let controller = null; 
```

and we will add this if statement on the function to abort the previous request if the controller is not null
```javascript
searchBox.onkeyup = function(e) {
  if (controller !== null) {
    controller.abort();
  }
  // the rest of the code
}
```
Then we will add last two lines of code after if statement
```javascript
searchBox.onkeyup = function(e) {
  if (controller !== null) {
    controller.abort();
  }
  controller = new AbortController();
  config.signal = controller.signal;
  // the rest of the code
}
```
now when we type a letter and type another one before the first request done, the first request will be canceled
![the first request canceled](https://drive.google.com/uc?export=view&id=1IQkV5an89ZHvaBTyQ3jZlvSf3vpOja0l)
Today I Learnt: Git Submodules
Tags: git, github
Published: 2020-04-21 01:44:03

It often happens that while working on one project, you need to use another project from within it. For that, we can make use of git submodules.

Submodules are a reference to another repository withing a parent repository. You can make a submodule point to any arbitrary revision of the other repo.

Today I learned how messy git submodules could be! 😾

Using submodules needs many disciplines. Every developer using repo always need to update submodules using git submodule update --init --recursive. Failing to update can lead to very hard to debug and silent errors. And that's not all if you forget to update the submodules, then git commits the old version of the submodule. This effectively undoes the submodule update done by another developer. And git log doesn't even show such an update 😓.

Submodules need references to the URL that git should fetch. We all use SSH authentication in git. To make submodules experience frictionless, we point submodules using another SSH URL. When you start consuming this repo in CI such as Jenkins, which uses https to clone, everything breaks 😢 , so either you force your CI to clone ssh and set up its authentication or force your ci to pull everything in https, which is not possible in all scenarios. Now we are left with a decision to choose between frictionless CI or frictionless development experience. 😕

Also, there are many stories about submodules getting lost during merge conflicts, submodules not supported by some UI tools, etc. which makes them pure evil.

Some people say submodules are "Sobmodules." 🤣

Originally Posted at https://todayilearnt.xyz/posts/nancy/git_submodules/
Docker on mac vs Linux
Tags: docker, linux
Published: 2020-04-21 01:41:10


🐳Docker is different on Mac and Linux systems. Docker directly leverages the kernel of the host system on Linux. On the other hand, Mac does not provide a Linux kernel, so Docker runs on a small Linux VM running on a mac. Due to this, there are many differences. 

### Cannot access container IPs directly

On Linux let's try to inspect a running docker image : 

```
ubuntu@primary:~$ sudo docker ps
CONTAINER ID        IMAGE               COMMAND              CREATED             STATUS              PORTS               NAMES
a230855dd7d2        httpd               "httpd-foreground"   17 seconds ago      Up 16 seconds       80/tcp              determined_saha
ubuntu@primary:~$ sudo docker inspect determined_saha

```

Let's curl the IP : 

```
                   "IPAddress": "172.17.0.2",
                    "IPPrefixLen": 16,
                    "IPv6Gateway": "",
                    "GlobalIPv6Address": "",
                    "GlobalIPv6PrefixLen": 0,
                    "MacAddress": "02:42:ac:11:00:02",
                    "DriverOpts": null
                }
            }
        }
    }
]
ubuntu@primary:~$ curl 172.17.0.2
<html><body><h1>It works!</h1></body></html>

```

However on mac when hitting the IP address of the container we get : 

```
➜ curl 172.17.0.3
curl: (7) Failed to connect to 172.17.0.3 port 80: Operation timed out

```
Curl times out because the container is running inside the VM and not sharing the network with the mac.