teleren/devto huggingface dataset:
Select Tag Helper in ASP.NET Core MVC
Tags: csharp, webdev
Published: 2020-06-12 01:45:35

In the article, we use **Select Tag Helper in ASP.NET Core 2.1**, I went online and saw many people also asking about how to use this, now I share with everyone how to use it.
**Example :**  We already have a **Categories** table that alreadly has data available, and have create a **Category.cs** class in Models folder, you can the article previous:
[Create Database using Code First in ASP.NET CORE 2.1](https://dev.to/skipperhoa/create-database-using-code-first-in-asp-net-core-2-1-1pf)
The first, you need add **using Microsoft.AspNetCore.Mvc.Rendering** in Controller file , Okay, go to Cotrollers folder, **click right->add new->Controllers-> create ProductController.cs** , after then add **(Microsoft.AspNetCore.Mvc.Rendering)**
Create Action CategoriesList() in ProductController.cs file
```csharp
public ActionResult Create()
        {
            CategoriesList();
            CategoriesList2();
            return View();
        }

 private void CategoriesList(object selectCategory=null)
        {
            ViewBag.categories = new SelectList(_db.Categories.ToList(), "idCategory", "Name",selectCategory);
        }

private void CategoriesList2()
        {
            var data = _db.Categories.ToList();
            List<Category> list = new List<Category>();
            foreach(var item in data)
            {
                list.Add(new Category
                {
                    idCategory = item.idCategory,
                    Name = item.Name
                });
            }
            ViewBag.Categories2 = list;
        }
```
+ **_db.Categories.ToList():** read data from Categories table in Database
+ **SelectList():** if you use SelectList(), you can insert library (using Microsoft.AspNetCore.Mvc.Rendering) in ProductController.cs file
Okay, we need to **Views/Product/** folder, create **Create.cshtml** file
```csharp
<div class="form-group">
                    <label>Select Category</label>
                    <select asp-for="idCategory" asp-items="@ViewBag.Categories" class="form-control">
                        <option>Select one</option>
                    </select>
                </div>
                <div class="form-group">
                    <label>Select Category</label>
                    <select asp-for="idCategory" asp-items="@(new SelectList(ViewBag.Categories2,"idCategory","Name"))" class="form-control">
                        <option>Select one</option>
                    </select>
                </div>
 ```
If you want to use it for Edit.cshtml, it is similar to Create.cshtml:
Add Action Edit(int id) to ProductController.cs file
```csharp
public ActionResult Edit(int id)
{
      CategoriesList();
      CategoriesList2();
      return View(_db.Products.Find(id));
}
```
The Article : [Select Tag Helper in ASP.NET Core MVC](https://hoanguyenit.com/select-tag-helper-in-aspnet-core-mvc.html)
One major thing you need as a software developer.
Tags: career, software, softskill, showdev
Published: 2020-06-12 01:36:16

---
title: One major thing you need as a software developer.
published: true
description: 
tags: career, software, softskill, showdev
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/asrsfp4yx9xyyerz3ek6.jpg
---
![Image of computer](https://dev-to-uploads.s3.amazonaws.com/i/asrsfp4yx9xyyerz3ek6.jpg)

When it comes to programming, consistency is key.

Maybe you started programming or a project in the past but you are not consistent in it. Or you stopped after some days.

The truth is -- it is normal not to be consistent sometimes. Consistency is not a process, it is a result.

It is the result of several trials and failures.

If you are not consistent with what you do now, I want you to know that it is normal but what is bad is not trying again.

If you are not consistent in coding today, make sure you are consistent in trying again until you achieve consistency.

Get knocked down - get back up.

That is how to achieve consistency as a programmer.

Consistency is a result not a process.

Stay safe and stay connected.
When not to use Memoization in Ruby on Rails
Tags: memoization, thread, ruby
Published: 2020-06-12 01:34:42

Memoization is a wonderful concept in programming world. It helps in writing clean code which execute faster.

Link: https://blog.joshsoftware.com/2020/06/08/when-not-to-use-memoization-in-ruby-on-rails/
How To Become A Tech Professional by Finding The Right Udemy Courses
Tags: vue, css, html, javascript
Published: 2020-06-12 01:25:13

When I wanted to make the switch from being an Electrical Engineer to tech, I found it very difficult to decide what was right for me and how to go about it.

I did not have any experience with programming or writing code and did not know where to begin. Luckily for me, I had an idea where to start. I had worked with Macromedia Dreamweaver and Joomla way back when I was a kid so I knew about HTML and CSS. So I decided to start with learning HTML and CSS so I could start from designing web apps. This was in July, 2019.

I got on Udemy and Coursera and started surfing around to find what courses I could pay for to get me started. I got lucky fast enough and landed on the course “Build Responsive Real World Websites with HTML5 and CSS3” by Jonas Schmedtmann. I was a newbie to the world of tech and web development and this course was just the right stepping stone I needed to be introduced to Javascript and web development. He took his time to explain every detail and we built a website which I tweaked and deployed on my own.

I have now gone on as a stepping stone from that course to learn advanced Javascript and other higher order functions. I have been able to chart a path in web development that made me learn the right things at the right time and when I was fully ready to comprehend them. I learnt jQuery and then moved on to the backend to learn NodeJs and deployed a full web app. I have then gone on to learn React and Vue and they all became coherent because I was fortunate enough to follow the ‘right’ path to grasping all of the essential libraries.

It is because of the problems I encountered when I was getting into tech that I decided to create a Google Chrome extension to help anyone who wants to get into a particular field to be able to just select that field from the dropdown and relevant Udemy courses will be displayed to make it easier for you not to get confused in a web full of a lot of information and courses. These are not my own courses but courses of great tutors like Brad Traversy, Maximilian Schwarzmüller, Jose Portilla, Angela Yu etc. who helped me when I began as a novice and I believe if they did a good job with me, then they must be good enough to recommend.

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

So from the image, there are categories such as FrontEnd Web Developer, BackEnd Web Developer etc. to choose from and depending on your choice, a list of course will show up when you click on Search. You can then click on Go To Course, and it will take you directly to the Udemy course page and then you can watch the preview videos and buy the course if you like them. It’s as simple as that. You can watch a video below to see how it works.

{% youtube d4TfJEW74gg %}

You can download extension [here.](https://chrome.google.com/webstore/detail/udemy-course-finder/bpbcbabopnpbjhdfjcmkhjohlddhldle)
Subindo seu repositório no GitHub através da linha de comando
Tags: github, repositorio, comando, projeto
Published: 2020-06-12 00:53:06

### Um passo a passo rápido para quem pretende subir o seu repositório no GitHub!


1. Tenha certeza que o seu git está instalado. No terminal ou prompt de comando cheque através do comando `git -v`

2. No GitHub, crie um novo repositório. Na tela onde pede para fazer upload ou criar aquivos, guarde o link HTTPS que será gerado ![GitHub](https://i.imgur.com/LiDhHSW.jpg)

3. Abra o Git Bash ou terminal na pasta onde está o seu projeto

4. Inicie a pasta como um repositório do Git através do comando:
`git init`

5. Em seguida, adicione os arquivos de configuração para preparar o commit:
`git add .`

6. *Opcional:* Adicione um arquivo readme caso não tenha iniciado o repositório com ele:
`git add README.md`

7. Crie um novo commit para os arquivos que irá subir para o repositório:
`git commit -m "first commit"`

8. Suba seus arquivos utilizando a URL gerada no passo 2 no seguinte comando:
`git remote add origin URL-GERADA-PELO-PASSO-2-AQUI`

9. Autorize o upload com seu login e senha:
`git push -u origin master`

---
Se este link lhe foi útil, deixe seu ❤️.
Mid Meet Py - Ep.11 - Interview with David Lord
Tags: python, flask, chat, podcast
Published: 2020-06-12 00:27:31

---
title: Mid Meet Py - Ep.11 - Interview with David Lord
published: true
description: We meet in the middle of the day in the middle of the week to chat about Python. This week we have David Lord - lead dev Flask joining us.
tags: python, flask, chat, podcast
---
PyChat:
  [PyData Festerval Amsterday](https://www.eventbrite.com/e/pydata-festival-amsterdam-2020-tickets-105751621948)
  [Zen of Python song!](https://twitter.com/pumpichank/status/1264340179902332928)
  [pyOpenSci community call today](https://twitter.com/pyOpenSci/status/1270004163234144257)
  [Python Packaging Guide](https://dev.to/shyams1993/python-packaging-guide-25i6)
  [PyLadies Call for Speakers](https://twitter.com/PyLadiesDub/status/1269963641518018568)
  [Python Ireland call for speakers](https://twitter.com/PythonIreland/status/1268607953080397825)


Mid Meet - Hall of Fame:
  David Lord - lead dev Flask and related libraries on @PalletsTeam. Meetup organizer @SanDiegoPython
  [Follow David on Twitter](https://twitter.com/davidism)


PyPI highlights:
  [Make yourself a cartoon](https://github.com/minivision-ai/photo2cartoon) - They use this: [face-alignment](https://pypi.org/project/face-alignment/)
  Create representations of large DS - [datashader](https://datashader.org/)

[Listen to MidMeetPy podcast](https://anchor.fm/midmeetpy)
How do you take screenshots?
Tags: discuss, webdev
Published: 2020-06-12 00:00:23

---
title: How do you take screenshots?
published: true
description: 
tags: discuss, webdev
//cover_image: https://direct_url_to_image.jpg
---
In the past I've tried different methods from PrintScreen key to [Lightshot extension](https://chrome.google.com/webstore/detail/lightshot-screenshot-tool/mbniclmhobmnbdlbpiphghaielnnpgdp?hl=lv) in the browser. Tho, in first way I ended up using image editor to crop, in second - I was limited to browser only.

Since I'm on Win10, lately I use Win+Shift+S shortcut, select the area and image gets saved in Clipboard. If that's enough, I paste it and done. If not - I use [PasteIntoFile](https://github.com/EslaMx7/PasteIntoFile/releases) to create a local image file without any image editor.

Any other methods you would recommend to try, considering quickness, ease of use and image accessibility after the capture?
How to split and join strings in JavaScript?
Tags: javascript
Published: 2020-06-12 00:00:00

---
  title: How to split and join strings in JavaScript?
  published: true
  tags: JavaScript
  date: Fri Jun 12 2020 05:30:00 GMT+0530 (India Standard Time)
  canonical_url: https://melvingeorge.me/blog/split-and-join-strings-javascript
  cover_image: https://melvingeorge.me/_next/static/images/main-da0a783158a30e9b538d0a9215372da4.jpg
  ---
  [Originally posted here!](https://melvingeorge.me/blog/split-and-join-strings-javascript)
  
The `split()` method splits a large string into an array of strings and the `join()` method joins an array of elements into a string.

---

## `split` method

```javascript
const str = "How are you ?";
```

Let's say you have a string like this. Let's separate this string using the `split` string method.

The `split` method takes a separator as an argument.

```javascript
const str = "How are you ?";

str.split(" "); // Result: ["How","are","you","?"]
```

- The `split` method separates the strings when it encounters the separating string, in this case, a blank space.
- It returns an array of strings.
- This is a string only method.

## `join` method

```javascript
const nameArray = ["John", "Helen", "Roy", "Lily"];
```

The elements of `nameArray` can be joined using the `join` method.

```javascript
const nameArray = ["John", "Helen", "Roy", "Lily"];
nameArray.join(); // Result: John,Helen,Roy,Lily
```

- If nothing is provided as an argument into the `join` method, it uses `,` (comma) as the default separator.
- It returns a string.
- This is an array only method.

Let's now use `-` as a separator in the `join` method and see the result.

```javascript
const nameArray = ["John", "Helen", "Roy", "Lily"];
nameArray.join("-"); // Result: John-Helen-Roy-Lily
```

### Feel free to share if you found this useful 😃.

---
Stick to your stack
Tags: programming, tools
Published: 2020-06-17 09:13:42

---
title: Stick to your stack
published: true
date: 2020-06-12 00:00:00 UTC
tags: programming,tools
canonical_url: 
---

In the book, the pragmatic programmer, there is a section where the author compares a programmer to a craftsman. The craftsman or artisan mindset is a great way of thinking about our work. An artisan stands by her choices and work just like we must. Every artisan needs her favorite tools to do their finest work, as we programmers need our favorite programming languages, our editors and our stack.

But, we programmers are fickle creatures and our whole industry is always gawking at another next best thing which is supposed to solve every programmer itch. Every day, we have ten new frameworks (and not enough good libraries). This trend makes us question our own choices so much that if we don’t take up anything new in a few months, it feels like we are getting left behind.

Don’t get me wrong, we need to stay on top of the current technology. But it’s pointless to try and catch up to every new popular thing. What’s more important is, using a stack that you know well, will not let you forgive yourself when you cut corners or make bad structure choices. By allowing us to try new things every time, we start to think that a project is more about learning and less about perfection. And, we let ourselves off the hook and not hold us accountable for the quality of the project.

I know your usual stack may feel boring and stale, the new thing surely looks very fun. It’s good to have fun and learn. There’s always a small chance that a new technology is better for you and for the things you are making right now. But you should know the tradeoffs.

Always staring at documentation for the new thing you are trying out of FOMO is just not productive.
How to delete multiple buffers in Vim
Tags: vim
Published: 2020-10-15 14:03:11

---
title: How to delete multiple buffers in Vim
published: true
date: 2020-06-12 00:00:00 UTC
tags: vim
canonical_url: https://tech.serhatteker.com/post/2020-06/how-to-delete-multiple-buffers-in-vim/
---
Let assume that  I have multiple files opened as buffers in Vim. The files are `*.py`, `*.md` and some `*.html`.

I want to close all the __HTML__ files with `:bd *.html`.  However, Vim does not allow this; It throws an error: `E93: More than one match for *.md`.

So how can we achieve this?

### 0. Basic Way
The basic way would be writing all file names and using `:bd[elete]`:

```vim
:bd file1.html file2.html file3.html
```

### 1. Exe Way
You can use _buffer_ numbers:

Execute `:ls`, which lists all buffers, then pick the buffers that you want to close. For instance:

```vim
:2,7bd[elete]
```
deletes buffer range from 2 to 7.

### 2. Vim Way (Preferred method)
If you _exe_ `:bd *.html` and then press `<C-a>` it completes all file matches.

### 3. Vim Script Way
If you usually execute `:bd` and don't want to use [Vim Way](https://dev.to/serhatteker/how-to-delete-multiple-buffers-in-vim-20km#2-vim-way-preferred-method) then you can write a `vim script`:

```vim
function! s:DeleteBufferByExtension(ext)
  let buffers = filter(range(1, bufnr('$')), 'buflisted(v:val) && bufname(v:val) =~ "\.'.a:ext.'$"')
  if empty(buffers) |throw "no *.".a:ext." buffer" | endif
  exe 'bd '.join(buffers, ' ')
endfunction

command! -nargs=1 DeleteBufferByExtension :call s:DeleteBufferByExtension(<f-args>)
```

This _function_ takes _file extenstion_ as an _arg_, find files with this
_extension_ and execute `:bd`. It can be run like below:

```vim
:DeleteBufferByExtension html
```

You can map this _function_ to a _key_  as well.


All done!
94/100 100daysofcode Flutter
Tags: 100daysofcode
Published: 2020-06-11 22:57:39

day 94/100 of #100daysofcode #Flutter
Learning Flutter , courses Udemy from
@maxedapps

Today learn what is firebase notification and arcitecture and sintalling
https://github.com/triyono777/100-days-of-code/blob/master/log.md
Angular Libraries : Adding New Components in 10 minutes
Published: 2020-06-11 22:42:52

In this post we are going to show how to add new components, compile and make your library ready for importing with all the new changes!

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

The new component's selector was:

```typescript
@Component({
  selector: 'lib-my-component',
  templateUrl: './my-component.component.html',
  styleUrls: ['./my-component.component.css']
})
```
The cmp2.module.ts became:

```typescript
import { NgModule } from "@angular/core";
import { Cmp2Component } from "./cmp2.component";
import { MyComponentComponent } from "./my-component/my-component.component";

@NgModule({
  declarations: [Cmp2Component, MyComponentComponent],
  imports: [],
  exports: [Cmp2Component, MyComponentComponent],
})
export class Cmp2Module {}
```

Finally, the public-api.ts became:

```typescript
/*
 * Public API Surface of cmp2
 */

export * from "./lib/cmp2.service";
export * from "./lib/cmp2.component";
export * from "./lib/cmp2.module";
export * from "./lib/my-component/my-component.component";

```

Now we need to compile the library to pick up new changes. 

>
**Note**
>
✔️ When you compile libraries they compile with [AOT](https://angular.io/guide/aot-compiler) compiler, this is why these components will run faster in your application.

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

To run the ng build command on your library, you need to be at the root of the folder structure. 

The angular.json file, located in that root directory, is used for ng build. It contains a Projects section with each project configuration. Ng build looks in there to determine how to compile the Projects listed there.

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

**Add the HTML**
 
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/2hqqdqh8b5oyc06f7akm.png)

Save and observe the new changes.

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

**The DIST Folder**
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/qzpvmtnq5vqocus002we.png)

It pays in more ways than one to have importable modules from your own Angular custom library. You will eventually be able to double your production by just reusing components. Your customers will like the fact that the time to render is vastly improved.


JWP 2020 [Angular Libraries](https://angular.io/guide/creating-libraries) Adding New Components
Why I hate Endless Scrolling!
Tags: endlessscroll, infinitescroll, userexperience, ux
Published: 2020-06-11 22:34:41

---
title: Why I hate Endless Scrolling!
published: true
description: My rant about how terrible endless/infinite scrolling feels
tags: #EndlessScroll #InfiniteScroll #UserExperience #UX
cover_image: https://miro.medium.com/max/1000/0*m8gTKrfSB7IT52i-
---

So many websites and blogs nowadays implement what is called endless or infinite scrolling.

For those who might not know...endless scrolling means just as the name suggests...you just keep scrolling to the bottomless page...there's literally no end unless you don't give up.

I have no idea what is the design principle behind endless scrolling. If you make a website or a blog...you want people to be able to access the information delightfully. If I feel as if there is no way I am going to find out where something is, of course as a user I will be frustrated. 

Now here is normally a scenario...you visit a blog and a few posts interest you and you wonder how many posts are in this blog. In infinite scroll...there is no way you will know how many posts or articles are in the said blog. So you begin scrolling and scrolling and scrolling and scrolling...yes you see so much information but for the curious like me...wouldn't you like to know where this scrolling end? How many more posts or articles here that I might be interested in? So you continue scrolling only to find out you have already wasted like 5 minutes and the scroll bar now is like a quarter of an inch...you give up! Frustrated of course for not satisfying your own curiosity...Or if you accidentally open one post...you're back to square one because infinite scrolling won't remember where you last were.

YouTube had the same problem a few years ago, in the recommended/suggested videos...you could scroll till you were tired. Right now I think they have lowered the number of the suggested videos.

**So what's the solution?**

For a blog, please put down page numbers (pagination). This will allow a user to know how many pages are there or how many posts...I can just navigate from page 1 to page 2 or I can go all the way to the first post ever created. As a user I will feel as if I am in control...plus I can easily save that specific page and revisit it later...something which is impossible with endless scrolling.

*Stop making online experiences with endless scrolling! They're terrible for the user.*

Can you imagine if Google had endless scrolling? It would have been terrible! ...They know better that's why they show you pages at the bottom of the search...to give you an idea of how many pages are there. And in doing so they save you so much time...because an average user will normally be satisfied with the results on the first page.

That's my rant!
My Goal For My Youtube Channel :)
Tags: gamedev, unity3d, csharp, beginners
Published: 2020-06-11 22:30:53

Hi everyone, i'm a 15 year old gamedev. My goal for my channel is to reach 350 subscribers. If you enjoy the videos you can subscribe cause that helps me a lot :)

Here's the channel: https://www.youtube.com/channel/UC8Kqr21rinohnhoUkp3lGWw