teleren/devto huggingface dataset:
Today's the Day!
Published: 2020-08-03 22:20:53

I'm going to be honest with you. I've been pretty lazy my whole life. I like things easy and secretly hope that things will work it out themselves. But there came a point in my life when I realized that everyone that I aspired to be didn't let the days pass and wait for something to happen. They made things happen. So about a month ago, I did just that. I made something happen. I quit my job! This was my first step into a new world. 

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/d0hpnsbzrdaubb5smsmg.jpg)It's always scary for me to step out of my comfort zone. I like what I know because I'm good at it. I've been in the pharmaceutical field for quite awhile and worked my way up to Program Director at one of the local private colleges in my area. It was a pretty awesome job. I've never found a job in my field that I've loved so much. 

So what changed? Nothing--the funny thing is, nothing changed. I just realized something that I've always had and always wanted. I got to where I was because I am organized, creative and good at solving problems. What I realized is that my position didn't offer what I wanted to do with my skills. Build.

My first computer was a Windows 95. My first basic code was  on a floppy disk and I've loved tech since. It was just so fascinating. So many innovations and ideas coming to life. I wanted to do that one day.

Although pharmacy was my parents' obvious choice for me after high school, I struggled so hard with that decision because my mind was always gravitating towards tech and design. Fast forward a decade later, with the support from my family and friends, I gave into my tech craving.

So . . .

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/a5ucrez3cwadjcau9rjj.png)
Hello Tech World! I'm very excited to say that today's the day that I start my journey with you! I can't wait to learn, build and create things with code. I thought I knew things, but it turns out that I'm outdated and have very little coding experience. I'll be back here every week to share my experiences and document my coding progress. I'd love to hear of yours too. Your journey and advice is what inspires me to keep going and reminds me that I have a friend in all this. 

My coding starter pack:
 - freecodecamp.org to learn
 - DEV.to to share

On my mind:
 - How many people are just starting out?
 - What did you do to get the wheels turning?
 - I'm always looking for good mobile apps to learn on the go. Any great finds?



Until next week!
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/696ic2e904n5ycir6g4g.png)

*** Special shout out to @chrisoncode & @kapehe_ok for being my mentors and guiding me. And to Mikki for always believing in my skills. I won't let you down. ***

Follow me on Twitter @freddilynne :)
Day 187: Magic
Tags: hiphop, code, coding, lifelongdev
Published: 2020-08-03 22:18:53

_liner notes_:
- Saturday : Didn't really do much. Worked on the side project and had the radio show! The recording of this week's show is at https://kNOwBETTERHIPHOP.com

![Radio show episode image of Kwame Ture in front of a crowd with the words August 1st 2020, RIP Malik B](https://dev-to-uploads.s3.amazonaws.com/i/knoegotvp906kqx8evmu.jpg)

- Sunday : There was a Tropical Storm warning for Florida. It wasn't too bad. Just some wind and rain. Worked on my side project. (I have to rework some things because the way I constructed my application, the API doesn't really work like that, haha I may have found a way though. We'll see). Did the post radio show promo work. I watched about half of the new season of "The Umbrella Academy" on Netflix. Pretty good.

- Professional : So, I'm writing tests for the bug fix I did for the Web Component I made. The main issue I'm running into that I had to find a way around was that I'm getting a TypeError when I try to set the selectionStart on a text area element. Even though I've seen multiple examples of it being done. I think it's because the Web Component I'm using for the text area in my Web Component only has selectionStart as a getter and no setter, so it's breaking my test. I'll have to figure out a way around it. Other than that, had a meeting with my manager which went well. Also, tomorrow starts our Team retreat thing. Normally we all would travel to a city. It was Miami earlier this year, but these aren't normal times so we'll be doing it online. Part of that includes an internal hackathon. I'll be teaming up with co-workers to do something with the game "Magic: The Gathering". Never played it so we met quickly so I could see a round of the game being played. There's A LOT happening. haha. Should be a cool project to work on for the next few days.

- Personal : The project we'll be working on will include OCR on a video feed. Found a pretty interesting library to look into.

![A wooden walkway along a lake surrounded by pine trees and a mountain in the distance. ](https://dev-to-uploads.s3.amazonaws.com/i/az5tdbsqyam8hwbnwcpw.png)


So the Google Pixel 4a came out today and after watching a few reviews on YouTube, I decided to pre-order it. It has a headphone jack!!! My main use for it is so I can get a Google Fi phone plan when I'm living in the van. With the same amount I'm paying for my home internet, I can get unlimited data, text and calls to a bunch of countries. In the US, it uses a few different carriers, so hopefully I'll be able to get a good signal wherever I am. Supposed to come in later this month. Going to see if I can figure out this blocker on my side project and finish watching "The Umbrella Academy".

Have a great night!

peace piece
Dwane / conshus
https://dwane.io / https://HIPHOPandCODE.com
{% youtube bEFDQT7mJhE %}
Enumerating Through Lists in a Django Template
Tags: django, python
Published: 2020-08-03 22:11:38

# Environment
python 3.6.5
django 2.1

===============

# Enumerating in a Django Template

I recently had a problem where I had to enumerate through a list passed from the view to the template. You can use these methods below.

|  variable  | definition |
| ---- | ---- |
| `forloop.counter`  |  enumerating, index starting from 1  |
| `forloop.counter0`  |  enumerating, index starting from 0  |
| `forloop.revcounter`  |  enumerating, index starting from the tail  |
| `forloop.revcounter0`  |  enumerating, index starting from 0  |
| `forloop.first`  | true when index is at 0  |
| `forloop.last`  | true when index is at tail  |
| `forloop.parentloop`  | enumerates through the parent loop  |

An example of the `forloop.counter` will be:

```
{% for person in listlike_var %}
    {{ forloop.counter }} : {{ person.name }}
{% endfor %}
```

Output:

```
1: sally
2: bob
3: john
```

For `forloop.counter0` it will be:

```
{% for person in listlike_var %}
    {{ forloop.counter0 }} : {{ person.name }}
{% endfor %}
```

```
0: sally
1: bob
2: john
```

As for the length of a list, `listlike_var|length` can be used.

```
{{ listlike_var|length }}
```

```
3
```
How to healthcheck wireguard connection?
Tags: wireguard, help
Published: 2020-08-03 22:07:30

I have recently experimented with making my own management client for #wireguard VPN connections.

The client would run on a devices for which I cannot control the power nor can you ssh into them, hence I need a reliable healthcheck that I can run on devices to trigger fix-up code in case the tunnel is down.

Of course, using a ping would help me get an idea if my outgoing network is working at all, but it won't tell me if the traffic goes through the tunnel.

Also, I know that there is a #wireguard interface created on system. How can I tell if that interface is operational and configured to allow for traffic to go through?

I doubt it would be as simple as forcing the same ping go through the wireguard typed interface?

Maybe, if I also check that the #wireguard interface actually exists and has UP as well as LOWER_UP as state flags set would do the trick?

But then, I believe one can still mis-configure routing table that makes traffic to not go through tunnel. Do I need to ensure my healthcheck also measures this?

Guess needs more looking... but maybe someone else has first hand experience on how to do this or not do this?
How to create a sticky navbar with CSS & JavaScript
Tags: webdev, css, javascript
Published: 2020-08-03 21:56:37

[ [CodePen Demo](https://codepen.io/michaelburrows/pen/wvGwzEw) | [Original Article](https://w3collective.com/sticky-navbar/) ]

Sticky navbar’s allow users to access a website’s navigation even when they’ve scrolled down the page.

In this example we’ll be creating a sticky navbar that also shrinks in size when the nav becomes fixed.

Let’s get started by creating the HTML:

```html
<header id="header"></header>
<nav id="nav">
  <ul>
    <li><a href="#"><img src="https://img.icons8.com/color/96/000000/javascript.png" height="96" /></a></li>
    <li><a href="#">Documentation</a></li>
    <li><a href="#">Tutorials</a></li>
    <li><a href="#">Blog</a></li>
    <li><a href="#">Community</a></li>      
  </ul>
<article> 
  <h1>Lorem Ipsum Dolor</h1>
  <p>Consectetur adipiscing elit. Praesent vulputate elit felis, quis efficitur tortor viverra a. Quisque fermentum enim et enim imperdiet vestibulum at vitae tortor. Cras auctor scelerisque odio at varius. Nullam rhoncus nibh ut sem dignissim fringilla. Fusce dapibus nulla sed ipsum commodo molestie ut ut mauris.</p>  
  <!-- repeat as required -->
</article>
</nav>
```

Next for the CSS:

```css
#header {
  height: 30vh;
  background: url(https://images.pexels.com/photos/1089440/pexels-photo-1089440.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940);
  background-size: cover;
}
#nav {
  background-color: #000;
  top: 0;
  width: 100%;
}
#nav ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
}
#nav li {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}
#nav ul li a {
  color: #ffd600;
  transition: all 0.4s;
}
#nav ul li img {
  height: 96px;
  transition: height 0.4s;
}
```

This create's a header image and full width navbar with each of the `<li>` elements disturbed evenly apart.

Now for the JS that detects when the navbav has reached the top of the browser and adds a fixed class:

```javascript
const nav = document.querySelector('#nav');
let navTop = nav.offsetTop;

function fixedNav() {
  if (window.scrollY >= navTop) {    
    nav.classList.add('fixed');
  } else {
    nav.classList.remove('fixed');    
  }
}

window.addEventListener('scroll', fixedNav);
```

Finally the CSS for when the navbar has the fixed class activated:

```css
#nav.fixed {
  position: fixed;
  box-shadow: 5px 5px 19px 0px rgba(0, 0, 0, 0.5);
}
#nav.fixed ul li img {
  height: 36px;
}
#nav.fixed ul li a {
  font-size: 14px;
}
```

As we have transitions on the `<img>` and `<a>` elements when the fixed class is applied they’ll scale smoothly.

This is however is optional as you could just add the fixed positioning for a sticky navbar without any scaling.
Developer analysis of programming languages used in the United States 2020


Tags: python, javascript, sql, bash
Published: 2020-08-03 21:54:15

Hello, fellow developers here are some analysis of programming languages used in the United States as per 2020 based on the Stackoverflow’s 2020 Annual Developer Survey.

Let's dig into the analysis

* What are the most common programming languages in the United States?
* Demanding programming languages in the United States?
* What are the most popular roles in the United States?

# What are the most used programming languages in the United States?

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

We can see that languages like JavaScript, HTML/CSS, SQL, and Python are still in the top positions.

We can see that in 2020 python has risen a lot compared to other languages in the survey

# Demanding programming languages in the United States?

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

We can see that Python has grown tremendously rather then other languages. This is probably happening because it’s a programming language that is very versatile and has been used extensively in data-related areas.

Because now we are seeing more interest in machine learning and data science

# What are the most popular roles in the United States?
We can see that Full Stack developer is the most popular role among the United States.

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

Back-end developer, Front end developer is the most popular occupation among participants after 2020.

The mobile developer is the popular role among participants in 2019, whereas in 2020 its trend is slowing down.

# Conclusion

In this article, we took a look at what were the most popular programming languages, according to Stackoverflow’s 2019 and 2020 Developer Survey data.

We have seen that programming languages like as JavaScript, SQL, and Python still dominates the industry

And we can see that Python has grown tremendously rather then other languages. This is probably happening because it’s a programming language that is very versatile and has been used extensively in data-related areas.

Back-end developer, Full-stack web developer, Front end developer is the most popular role among participants after 2020.

To see more about this analysis, see the link to GitHub repo here

https://github.com/manisaiprasad/Dev-analysis-sof-2020

# References
Stackoverflow Developer Survey Data: https://insights.stackoverflow.com/survey
MongoDB cross DB update
Tags: mongodb, springdata, multitenant
Published: 2020-08-03 21:38:48

#Why?
I found myself in funny situation:

1. Spring Data for MongoDB adds **_class** field to anything
2. I use interface as a property in some cases
3. Interface relies on **@JsonSubTypes** from **Jackson** so I can easily have anything in DB as that property and let Jackson and Spring do the rest
4. **I refactored code changing package names**
5. Why write about it here? I need somewhere to put this piece of code so I don't have to Google if I do the same mistake again.

#The problem
First of all, problem wasn't in the fact that aggregating class had different package name. No, in fact it works with main class easily as it's linked to a *collection* and there's only 1 specific class used for that particular collection. Issue is with this dynamic property supporting many different implementations while Spring is unable to detect what to instantiate since the **_class** field contains incorrect value. I got something like this:
```java
org.springframework.data.mapping.model.MappingInstantiationException: Failed to instantiate com.your.old.package.name using constructor NO_CONSTRUCTOR with arguments
```

I did spend a lot of time trying to guess what was updated and what to change in **code** and somehow, it clicked. I forgot how I remembered it but I know that I just went straight to DB and started changing some values. It's easy for 1 collection in 1 database you put in 
```javascript 
db.someCollection.updateMany(...)
``` 
and viola. But I have multitenant system. And yes I do use DB(s) per customer. Good thing only Mongo was affected by this as I do have more than 1 DB system for each customer.

So I wanted to update all of this by just one single command (not line necessarily)

#The solution
Minimal version 4.2 for updateMany() with $set option
```javascript
db.adminCommand( { listDatabases: 1 } ).databases.map(x => x.name).forEach(dbn => {
	let dbc = db.getSiblingDB(dbn)
	dbc.geoJsonFeature.updateMany(
		{"dynamicProperty._class": {$regex : /.*redp\.GeoPolygon.*/}},
		{$set: { "dynamicProperty._class": "some.package.name.ImplementingClass"}}
	)
})
```
Let's break it down a bit
* *db.adminCommand( { listDatabases: 1 } )* will return object containing list of databases so adding *.databases* will list databases as simple objects.
* map the name only
* use the for each to loop through all names
* *db.getSiblingDB(dbn)* will switch which DB is used
* updateMany with $set because replaceAll and replaceOne are from 4.4 version

It's a bit nasty "solution" but if you need to update multi tenant system where you need something trivial and all tenants have same schema for a certain collection this is quick and dirty solution for it.

You can also combine it with
```javascript
db.getCollectionNames().forEach(c => {
    db.getCollection(c)...
})
```
to go wild :D.

That's all
Balls To Code
Tags: react, javascript, soccer, developer
Published: 2020-08-03 21:31:35

I just had my badge through that I’ve been a member for a year. I am delighted that I am able to be part of this awesome community and read all your inspiring, creative and helpful posts. 

A year ago is also pretty much when I started my coding journey.

I have always been interested in computers and technology, so coding just felt like the logical next step. 
Some background about me: My name is Bobby and I am former professional footballer, currently living in the U.K.  I have recently decided to change careers(aged 33) and decided to get into coding full time. 
I’ve been studying on the side whilst playing football and I felt like now (with “the Rona” amongst us) was the right time to call it a day. 
I’m really excited for the journey ahead and I am so looking forward to all the challenges that lie ahead. It will be a complete 180 degree switch but I am determined to make this work. 
Thank you all once again for your amazing contributions and this amazing website. I’m hoping to be able to contribute more in the future and share what I learn and what my transition from balls to code is like. 

Thank you and speak soon.
Bobby
which job-position would you choose?
Tags: discuss, career, javascript, framework
Published: 2020-08-03 21:26:34

I am about to make a decision in my career as a developer and would be happy to hear your advices. 
I had last week 3 interviews and I got confirmation from three of them. Unfortunately I couldn't find an open position as React developer in my area, that would make my decision easier, as I have experience with React.

- The first position is in a startup, very young and dynamic team developing a very innovative application. They are using Vue.js. 
- The second position is in a agency with 10-15 members. In team are very experienced developers. They are building an in-house application, in order to sell as a product. And developing web and mobile application for customers. They are using Ember.js
- The third position is in a very small agency with 4 developers. Te small team has given me a very good impression. They get their contracts from another agencies oder big companies and develop for them. They are using Angular.

With which framework would you like to work? In which team you think, you can learn the most?
Flutter Animation Tutorial
Tags: flutter, futteranimation, mobiledev, tutorial
Published: 2020-08-03 20:47:24

{% youtube OtrWXLfGtqE %}

A few weeks ago I started playing around with animations in Flutter & it wasn't straight forward at first. But once you know your Animation Controllers from your Animation Builders, Flutter animations can be really fun to work with - so I decided to make a short tutorial series about how to use them.

[Full series on YouTube](https://www.youtube.com/watch?v=OtrWXLfGtqE&list=PL4cUxeGkcC9gP1qg8yj-Jokef29VRCLt1) | [Code on GitHub](https://github.com/iamshaunjp/flutter-animations)
Using the update_attribute() API using the rails console
Tags: rails, beginners
Published: 2020-08-03 20:47:10

I had a task at work to add data from the rails console after generating migrations and was puzzled on how to do it. After spending some time on the problem, I asked for help and this is what I got:

```
object=Model.first
object.description = "Lorem Ipsum"
object.save
```

The problem was, it returned `false` which I had a hint that it didn't work.

I checked the frontend and it didn't show the data I entered and ran reload on the rails console again but it still didn't update the data.

I knew I had to check the docs and figure out how to do it. 

I found [this](https://stackoverflow.com/a/29747855) answer on SO which helped me with my problem.

```
object=Model.first
object.update_attribute(:book_description, "Lorem Ipsum")
object.save
```
This updated the data on the frontend which was the goal of the task.
GitHub Codespaces FTW
Tags: github, vscode
Published: 2020-08-03 20:44:58

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

Just got access to GitHub Codespaces - love, love, love it!  Can't wait to dig in deeper.  Used the default Codespace for a simple repo (MD only), worked like a charm.

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

Will continue to post as I learn more...

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/t7fuow42okcdw6znu2g9.png)
My top terminal commands
Tags: beginners
Published: 2020-08-03 20:37:43

I was recently watching a video that was walking beginners through terminal commands and they listed over 50 commands that you should use. 50!? Who uses more than 10 terminal commands?

The ones that I use (off the top of my head)
### 1) `pwd`
The command `pwd` stands for "print working directory" which gives your current location in terminal
![pwd](https://dev-to-uploads.s3.amazonaws.com/i/n7irrwsoapkjufi1qmu8.png)

### 2) `cd` `directory`
The command `cd` stands for "change directory" which allows you to navigate through the terminal.
![cd](https://dev-to-uploads.s3.amazonaws.com/i/1ynrh1mprbe9trkus8oc.png)

### 3) `ls`
The command `ls` will list all the computer files in your current directory.
![ls](https://dev-to-uploads.s3.amazonaws.com/i/umrv91gm0y81s95lv1gz.png)

### 4) `mkdir` `folder`
The command `mkdir` will create a new folder in your current directory.
![mkdir](https://dev-to-uploads.s3.amazonaws.com/i/72q31138jd99cm8uhndy.png)
### 5) `clear`
The command `clear` will... you guessed it, clear your terminal.

### 6) `🐈` aka `cat` file
The command `cat` will return the contents of a file.
![cat](https://dev-to-uploads.s3.amazonaws.com/i/xdj7cfgzwc181c1vzbtb.png)
If you `cat` command a directory it will let you know that as well.
![catDir](https://dev-to-uploads.s3.amazonaws.com/i/1v2kcpchbjsodwbijnem.png)

### 7) `touch` `file`
The command `touch` file will create a new file in your current directory.
![touch](https://dev-to-uploads.s3.amazonaws.com/i/je1dsyg74sdsqyerh761.png)

### 8) `rm` `file`
The command `rm` file will remove the file from your current directory
![rm](https://dev-to-uploads.s3.amazonaws.com/i/q4lgot9ri3mvdw83j1b2.png)

There are some special options that you can pass into some of these commands but for now, the basics are all that is needed to be a hacker! 

Some honorable mentions - these are commands that I use here and there. 

* `mv` - move files or rename files
* `sudo` - "SuperUser Do", this enables admin/root permissions, only use this if you know what you are doing
* `grep` - search for something in a file
* `ping` - check your connectivity status to a server.
* `echo` - used to move data into a file
Youtube tsuki moji text generator
Published: 2020-08-03 20:35:17

I was using a website to make tsuki moji text, but that website goes offline when it's night (in japan). I am however in Europe. So I made my own version that isn't locked by nighttime. It is located on github here: https://github.com/Ben-0-mad/Youtube-text-to-emoji-generator.

I suggest using this code in Jupyter notebooks as that's what I intended it for (I'm not sure emojis work in a terminal or command prompt).