teleren/devto huggingface dataset:
The Importance of Mentors: A Vets Who Code Story
Tags: beginners, career
Published: 2020-01-14 15:11:30

Regardless of the time served, a single tour, or an entire career of twenty years. Each service member must leave the military, and in most cases, this involves re-entering the civilian workplace, regardless of circumstances changing jobs can be challenging for anyone.
	
I served as Infantryman at Fort Campbell, KY, for four years with a lifelong fascination with computers, technology, and motorsports. I had a strong desire to enter the technology career field, however, with no specific plan of how. For several months after leaving college, I attempted to teach myself how to program using various open-source materials such found online with little success. Luckily, I discovered Vets Who Code through and its founder, Jerome Hardaway, while listening to a podcast hosted by Scott Hanselman. Shortly after that, I applied to the Vets Who Code program, and I quickly found a community of individuals who all had experienced the uncertainty of leaving the military as I had. 

These individuals were eager to mentor me and guide my learning towards the goal of becoming a software developer. With a large number of languages, platforms, frameworks present in the modern software field, a newbie can become quickly lost in a mess. With Vet Who Code’s supportive and knowledgeable network of developers, I was able to obtain the necessary skills, be held accountable to industry standards, and received guidance on how to build a portfolio to start building a new career.

With the skills I obtained through Vets Who Code, I recently successfully interviewed with a software company in Nashville, TN and was offered a position as a front end developer under the Department of Defense career skills program. I plan on taking this opportunity to launch my career into software development full-time, also with aspirations to study computer science at the graduate level. I owe so much of my preparation for this opportunity on the numerous mentors I’ve met through Vets Who Code. 

My best advice for new developers, if getting into tech, is your goal for 2020 is to get involved with the developer community and find a mentor. Whether in person or online, at your local code meet up, the comments section of Dev To, or even a subreddit. There are plenty of amazing people willing to help you along with your journey, regardless of where you are starting.
 
Moving into the future, I’m looking forward to giving back to the community that has helped me so much by being an instructor in the upcoming Vet Who Code cohort starting in March 2020. If you are a veteran or within six months of transitioning active duty service and are interested in getting into tech, we would love to help you! Find out more information in the link below. Thanks for reading and happy coding in 2020!

https://vetswhocode.io/
How to achieve the same look and feel across multiple devices in React Native
Tags: reactnative
Published: 2020-01-14 15:09:31

I used react-native-size-matters.

<!--more-->

#### Problem I'm trying to solve:

Working with % is not always easy if you are styling nested components.
Since devices have different width and height, once your app is styled for a particular device, the app might not have the same look on the other devices.

> This is how 370 x 370 square looks on several devices.

![on iOS](https://mobiledev.netlify.com/img/portfolio/2/1.jpg)
![on Android](https://mobiledev.netlify.com/img/portfolio/2/2.jpg)


```javascript
const componentStyles = StyleSheet.create({
  regularBox: {
    width: 300,
    height: 300,
    backgroundColor: 'cyan',
  },
});
```

As you can see the ratio is different across the devices.

#### How can we solve this?

I used [react-native-size-matters](https://www.npmjs.com/package/react-native-size-matters).

```console
rohan@~/prj/rn>> npm i --save react-native-size-matters
```

```console
rohan@~/prj/rn>> cd ios
```

```console
rohan@~/prj/rn/ios>> pod install
```

![With size matters on iOS](https://mobiledev.netlify.com/img/portfolio/2/3.jpg)
![With size matters on android](https://mobiledev.netlify.com/img/portfolio/2/4.jpg)

```javascript

import {verticalScale, scale} from 'react-native-size-matters';

const size = {
  vs40: verticalScale(40), // calculates againt vh
  s300: scale(300),        // calculates agains vw
};

const componentStyles = StyleSheet.create({
  regularBox: {
    width: 300,
    height: 300,
    backgroundColor: 'cyan',
  },
  sizedBox: {
    width: size.s300,
    height: size.s300,
    backgroundColor: 'cyan',
  },
});

```

This makes development easy because we don't have to open multiple simulators and test how it looks on different devices.


If your implementation is aligning with the design in a iPhone X Simulator it will look the same on the other devices as well.

#### Result is:

![sample](https://mobiledev.netlify.com/img/portfolio/2/0.jpg)
![sample](https://mobiledev.netlify.com/img/portfolio/2/5.jpg)
Refactoring jQuery
Tags: jquery, vanilla, javascript, refactor
Published: 2020-01-14 15:04:29

---
title: Refactoring jQuery
published: true
description: 
tags: jquery, vanilla, javascript, refactor
---
A few months ago I posted <a href='https://dev.to/edlinkiii/recovering-from-jquery-26fg'>Recovering From jQuery</a> about learning Vanilla JavaScript. I have been working on that, but found some of the code a little cumbersome to try to refactor.

I ended up creating a little collection of helpers to simplify the code. Most of these will act as direct replacements for jQuery. Typically all that will be required is changing <code>$()</code> to <code>$q()</code>.

This is not a total replacement for jQuery. However, it was enough to get rid of 95% of my jQuery dependence. I honestly prefer <code>addClass()</code> to <code>classList.add()</code>.

<a href='https://github.com/edlinkiii/js-query'>js-query</a> on GitHub

There are a lot of jQuery methods I could add (and probably will), but these are the bulk of what was being used in the project I'm working on now.

Please don't rake me over the coals too bad for the <code>ajax()</code> function, remember, I was trying to replace <code>$.ajax()</code>.
Daily Challenge #162 - Taxi Dispatching
Tags: challenge
Published: 2020-01-14 14:37:35

---
title: Daily Challenge #162 - Taxi Dispatching
published: true
series: Daily Challenge
description: Manage taxi schedules as a dispatcher in this coding challenge. 
tags: challenge
---
###Setup:
You work as a taxi dispatcher. People will contact you to order a taxi, informing you of their pickup and drop-off times. Taxis can only service one customer at a time. They can pick up a new customer 1 time unit after it has dropped off a previous customer. What is the minimum number of taxis you need to service all requests?

Constraints:
Let *N* be the number of customer requests:
*N* is an integer in the range [1, 100k]
All times will be integers in range [1, 10k]
Let *PU* be the time of pickup and *DO* be the time of drop-off
For each request: *PU* < *DO*
The input list is NOT sorted.

###Examples:
Two customers, overlapping schedule. Two taxis needed.
requests = [(1, 4), (2, 6)]
min_num_taxis(requests) # => 2

Two customers, no overlap in schedule. Only one taxi needed.
requests = [(1, 4), (5, 9)]
min_num_taxis(requests) # => 1

###Tests:
1: [(1,4)]
2: [(1,4), (5, 9)]
3: [(1,4), (2, 9), (3, 6), (5, 8)]

Good luck and have fun!
***
_This [challenge](https://www.codewars.com/kata/5e1b37bcc5772a0028c50c5d) comes from Scopula on CodeWars. Thank you to [CodeWars](<https://codewars.com/>), who has licensed redistribution of this challenge under the [2-Clause BSD License](<https://opensource.org/licenses/BSD-2-Clause>)!_

_Want to propose a challenge idea for a future post?  Email **yo+challenge@dev.to** with your suggestions!_
Harmonize basic set up with Ansible, part 3
Tags: devops, automation, ansible, redhat
Published: 2020-01-14 14:27:44

*This post was originally published at [thbe.org](https://www.thbe.org/posts/2020/01/05/Harmonize_basic_set_up_with_Ansible-Part_3.html).*


The last open part is, how does this look in action and where do I find the code. Before we start and in case you missed it, here are the previous two posts about this topic:

* [**Harmonize basic set up with Ansible, 1/3**](https://dev.to/thbe/harmonize-basic-set-up-with-ansible-part-1-eb)
* [**Harmonize basic set up with Ansible 2/3**](https://dev.to/thbe/harmonize-basic-set-up-with-ansible-part-2-27fg)

First, I set up some minimal virtual machines that should act as target nodes for this demonstration. I used different distributions to demonstrate how flexible Ansible could be configured:

![List of virtual target hosts](https://thepracticaldev.s3.amazonaws.com/i/uqag0en8n6id0oz9s08b.png)

In the next step I will execute the configuration run:

```shell
$ ansible-playbook -i production.yml common.yml
```

Ansible now connects to target nodes and start its magic. It will go through the list of defined tasks and execute them. When Ansible finishes, the screen will look like this:

![Result of Ansible run](https://thepracticaldev.s3.amazonaws.com/i/1pn5jd50twl5t0qh4wjd.png)

Ansible in fact does, in the end, two different things, it set the desired state and it checks the desired state. This is quite important because it means if the Ansible detects a wrong state, it will correct it to the desired state. It protects the IT landscape against configuration drifts (small fixes or enhancements performed on one node but not the rest of the nodes).

This finally means that all nodes look pretty much the same, even on different distributions (not everything is equal, Debian distributions still use ``dpkg`` instead of ``rpm`` etc., but most of the things will be the same):

![Harmonized target nodes](https://thepracticaldev.s3.amazonaws.com/i/gla18sztxrvmiitck0jd.png)

This is it for the moment, I've shown how the role-based approach for Ansible look like and what you can achieve. If we look forward we still need to extend the role-based approach with roles for specific applications like web-servers, but I hope the basic idea is clear. If you would like to see the full Ansible code that I had used for this demo, you need to check out my corresponding ``Github`` project:

* [https://github.com/thbe/ansible-demo](https://github.com/thbe/ansible-demo)
Smooth Scroll with one line of CSS
Tags: css, smooth, scroll
Published: 2020-01-14 14:25:21

---
title: Smooth Scroll with one line of CSS
published: true
description: How to create a smooth scrolling effect using only one line of CSS
tags: css, smooth, scroll
---

I made a short, straight to the point video tutorial in which I'll show you how to create a 

**Smooth Scroll** effect using only one line of **CSS**.

Enjoy! 😊

{% youtube BpU_ajZ_lpw %}
How to be successful at anything
Tags: beginners, codenewbie, webdev, career
Published: 2020-01-14 14:02:06

---
title: How to be successful at anything
published: true
description: 10 tips will help you to create success in 2020 
cover_image: https://thepracticaldev.s3.amazonaws.com/i/ck29mx1bsine9jrqpo31.jpeg
tags: beginners,codenewbie, webdev, career
---

Here are my 10 short tips:

1. Show your work to the world instead of keeping in your head💆.

2. Do the work consistently👌

3. Respect your work🥰

4. Don't postpone your work

5. Make mistakes 🔥🔥🔥

6. Don't live in your head 💆

7. No need to wait for an assurance

8. You are enough to make a change

9. Set a long term goal 🏘️ and work 🏋️on it

10. Don't compare yourself with the people already successful in your niche because they are already crossed hard times⚡⚡


This was originally posted in my twitter account

{% twitter 1217065533612285952 %}


You can also share your tips, in below comments section


Find me on [twitter](https://twitter.com/saigowthamr)
The Road Ahead
Tags: javascript, learning, discuss
Published: 2020-01-14 13:59:09

---
title: The Road Ahead
published: true
description: Mapping out a plan for the next year
tags: Javascript, learning, discuss
---

Hello again. 

After some careful consideration I’ve decided to withdraw from my Business Admin/Accounting program to focus on leveling up my full-stack development skills. My first order of business is going to be learning Javascript deeply. I really want to dig in and understand this evolving language. 

Please drop a comment about your best Javascript resources that helped you understand the language more fully.
Bubble sort
Tags: algorithms, sorting, javascript, computerscience
Published: 2020-01-14 13:22:24

Bubble sort is a sorting algorithm that works by repeatedly looping over a list that need to be sorted, comparing the current item and the one immediately following it. If they are in the wrong order, the values positions in the list are swapped. This is done repeatedly until no swaps are required, indicating that the list is sorted.

## Implementation

Below we can see an example implementation of bubble sort using JavaScript.

```javascript
function bubbleSort(input) {
  const output = [...input];
  const length = output.length;

  for(let outer = 0; outer < length; outer++) {
    for(let inner = 0; inner < length; inner++) {
      const next = inner + 1;
      if (output[inner] > output[next]) {
        const temp = output[inner];
        output[inner] = output[next];
        output[next] = temp;
      }
    }
  }

  return output;
}
```

In this implementation we loop the array which is to be sorted into a new array which initially contains the items of the `input` array, this is assigned to the variable `output`. We run a nested loop to compare each item in the `output` array to all other values of the `output` array. If the current item is _greater than_ the next item, we swap their positions in the `output` array. We do this until the loop exits and returns the final sorted array. Below you will find a visual example of bubble sort in action:

![Bubble Sort Algorithm Visualisation](https://media.geeksforgeeks.org/wp-content/uploads/20190704131909/bubblusort.gif)

## Use Case and Performance

The performance of bubble sort depends on 2 factors, namely:

1. How large is the input array?
2. How _unsorted_ is the input array?

The second factor applies to almost every sorting algorithm but is still valid. The first factor is an important one though since bubble sort has a [Big O time complexity](https://en.wikipedia.org/wiki/Big_O_notation) of `O(n²)` on average. This means that the time it takes to run the algorithm is the square of the size of the input array, otherwise known as [Quadratic Time](https://en.wikipedia.org/wiki/Quadratic_time).

Let's look at some example runtimes from given input sizes:

| Input size | Time complexity (Big O)  |
|------------|--------------------------|
| 10         | O(10²) = O(100)          |
| 100        | O(100²) = O(10,000)      |
| 1000       | O(1,000²) = O(1,000,000) |

## Conclusions

As we can see, the larger the input array is, the worse the performance becomes. This being the case, if we use bubble sort, we want to do it on small arrays and collections to maximise performance.
Docker-compose Elixir Phoenix && Elm && Nginx && Redis 
Development environment
Tags: docker, elixir, elm, nginx
Published: 2020-01-14 13:17:28


# Docker Phoenix 開発環境構築
- バックエンドはElixir Phoenix 
- フロントエンドはElm
- WebサーバはNginxで生成されます。

ものすごくざっくり説明なのでご容赦を


## Git Clone
ProbremaResolt Github
https://github.com/ProblemaResolt/Problema

`git clone https://github.com/ProblemaResolt/Problema`


## Docker Build
 `docker-compose -f "docker-compose.yml" up -d --build`

## Phoenix 構築
内部に入る
`docker-compose exec api sh`

### Phoenix 立ち上げ
option などは公式を参考にしてください。

https://hexdocs.pm/phoenix/Mix.Tasks.Phx.New.html#content

`mix phx.new . --no-html --no-brunch `

 Local は以下のフォルダが生成されます。

 /web/

 色々聞かれるのですが基本Yesで大丈夫です。

### ライブラリインストール
`mix deps.get`

dapter の{:plug_cowboy, "~> 1.0"},を追加　

config/mix.exs内へ追加
```
[中略]
  defp deps do
    [
      ~
      {:plug_cowboy, "~> 1.0"},　#追加
      ~
    ]
  end

[中略]
```
### DevDB 接続
\config\dev.exs の書き換え

```
[中略]
config :web, Web.Repo,
  adapter: Ecto.Adapters.Postgres,
  username: "postgres",
  password: "postgres",
  database: "api_dev",
  hostname: "db",
  pool_size: 10
[中略]
```

### DB Migrate
DB情報を更新

`mix ecto.create`

### Phoenix 起動
Phoenix server を起動します。
`mix phx.server`

※ docker-compose.yml command に仕込んでおけば `dockr-compose up -d` の際に起動してくれるようになります。

### Env 設定
ちょっとまって...

## Elm 構築
`docker-compose exec assets sh`

elm project 作成します　聞かれたらYで応答してあげてください。

```
/opt/app/assets #　elm init
Hello! Elm projects always start with an elm.json file. I can create them!

Now you may be wondering, what will be in this file? How do I add Elm files to
my project? How do I see it in the browser? How will my code grow? Do I need
more directories? What about tests? Etc.

Check out <https://elm-lang.org/0.19.1/init> for all the answers!

Knowing all that, would you like me to create an elm.json file now? [Y/n]: y
Okay, I created it. Now read that link!
```


```
/opt/app/assets # elm reactor
Go to <http://localhost:8000> to see your project dashboard.
```

するとブラウザに表示されます！

/assets/src に elm file を作成して設置すると表示してくれます。

とりあえずここまで

# 参考資料
API
- Phoenix 公式
  https://hexdocs.pm/phoenix/

  - Phoenix入門 （第14章 Mix Tasks その１）
    https://www.tech-note.info/entry/phoenix-14-mix-tasks-1

  - ElixirでSI開発入門 #4 本番パスワードを環境変数に持たせる
    https://qiita.com/tuchiro/items/4ccba7e210c596c383af#%E6%9C%AC%E7%95%AA%E7%92%B0%E5%A2%83%E8%A8%AD%E5%AE%9A%E3%81%A7%E5%8B%95%E3%81%8B%E3%81%97%E3%81%A6%E3%81%BF%E3%82%8B

  - Redis関連参考
    PhoenixでRedisを使った簡単ランキングの実装
    https://qiita.com/koyo-miyamura/items/b5c123fa40685b9f8073#ランキングロジックを作る

Assets
- Elm 公式
   https://guide.elm-lang.jp/


# Docker 関連
  - docker-compose コマンド概要
    http://docs.docker.jp/compose/reference/overview.html

  - コマンド一覧（Docker Compose編）
    https://www.wakuwakubank.com/posts/354-docker-command-compose/

  - Compose ファイル・リファレンス
    http://docs.docker.jp/compose/compose-file.html
Daily Developer Jokes - Tuesday, Jan 14, 2020
Tags: jokes, dailydeveloperjokes
Published: 2020-01-14 13:00:29

---
title: "Daily Developer Jokes - Tuesday, Jan 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=Tuesday%2C%20Jan%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/5e1259823aa3b.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:___ Why do assembly programmers need to know how to swim?

___A:___ Because they work below C level.
 -->
Serverless tips & deployment best practices
Tags: todayilearned, serverless
Published: 2020-01-14 13:00:21

*TL;DR notes from articles I read today.*

### [Tips & tricks for developing a serverless cloud app](http://bit.ly/2t7bDxU)

- When going serverless, focus on limiting the scope of your functions.
- Communication between your functions is important to exchange data within your app. You can either directly call another Lambda function from within a Lambda function or upload data to a service and let this service trigger another Lambda function.
- Protect your code from malfunctioning by setting up a queue, or buffer requests if necessary for uniform scalability when working with numerous services.
- Your functions have 15 minutes to run before they time out. So, the execution time for your app should be under that timeframe.
- The more memory you allocate, the more CPU power you have. The same is true for network and I/O throughput.

*[Full post here](http://bit.ly/2t7bDxU), 5 mins read*

---

### [Serverless deployment best practices](http://bit.ly/2tT8wcW)

- Keep your secret out of your source control and limit access to them. Use separate secrets for different application stages when appropriate.
- When you create IAM policies for your services, limit the roles to the minimum permissions required to operate.
- Restrict deploy times by locking down your deployments during periods you don’t want to be disturbed.
- Use a single region or a subset of regions that suit your needs to offset inconsistencies with a geographically distributed team.
- Create consistent service names for your Lambda functions. It will help you to find relevant functions easily and to tie multiple functions with a particular service faster.

*[Full post here](http://bit.ly/2tT8wcW), 6 mins read*

---

###[Serverless for startups - it’s the fastest way to build your technology idea](http://bit.ly/35TRyIy)

- With serverless, you pay for what you use - the hidden infrastructural support for scaling is also built into the final bills. 
- Scaling is handled for you. You don’t have to worry whether a function is run once a day or a million times a day.  
- Startups often need to change system concept and functionality mid-way and the agility serverless structure offers is perfect for this use case. 
- It allows startups to dedicate all the engineers to solve business problems and not spend time on server management & infrastructure.
- Serverless gives startups a chance to deliver quickly, and use speed and agility to their advantage.

*[Full post here](http://bit.ly/35TRyIy), 7 mins read*

---

*[Get these notes directly in your inbox every weekday by signing up for my newsletter, in.snippets().](https://mailchi.mp/appsmith/insnippets?utm_source=devto&utm_medium=post08&utm_campaign=is)*
DEV.TO | Telegram  Posts
Tags: help
Published: 2020-01-14 12:58:37

Today, I received one message on telegram channel of `dev.to` with a link to operator mono font which links to `cufonfonts`.

I wonder if it is legitimate. I checked Operator mono website and they don't have the font free for personal use as far as I know.

But `cufonfonts` says, it is free for personal use. Now, following are my concerns/points:

1. Is it legitimate?
2. If not, shall `dev.to` post such message in the channel which will increase the piracy?

Thoughts?

Please leave your opinion in the comment section below.
Python's Folium to create choropleth maps
Tags: python, beginners, todayilearned, tutorial
Published: 2020-01-26 07:00:05

---
title: Python's Folium to create choropleth maps
published: true
date: 2020-01-26 18:00:00 AEDT
tags: python, beginners, todayilearned, tutorial
canonical_url: https://www.nagarajbhat.com/post/folium-visualization/
cover_image: https://www.nagarajbhat.com/post/folium-visualization/featured.png
---

Folium is a built on top python and of leaflet.js. It is used to visualize data through interactive maps, choropleth visualization, as well as parsing markers on data.

For ipython notebook code, checkout my [github](https://github.com/nagarajbhat/folium-visualization)

## What will be covered in this blog?

- data preparation - merging, sorting, grouping using pandas. 
- barplot visualization using seaborn 
- creating maps using python's folium - tiles, circle marker, choropleth map, and geojson. 
- creating labels on the choropleth map using GeoJsonToolTip. 
- Displaying multiple data views on the same map using feature group and control layer.
- Create markers and use custom icons. 

Check out the full blog here : [Python's Folium to create choropleth maps](https://www.nagarajbhat.com/post/folium-visualization/)