teleren/devto huggingface dataset:
How to gitignore a file when committed to remote repository
Tags: git, github
Published: 2021-10-24 19:21:36

Sometimes as a new programmer or developer we pushed our local committed files to remoted repository. So, as a new programmer or developer need to understand which files should commit and which shouldn't committed. 

for security and others issues we shouldn't commit and push such files and folders (directories) like <b>noude_modules</b>, <b>.env</b>, <b>npm packages</b>, <b>yarn.lock</b> and many more depend on which project and development you're work on.

Suppose, if you mistakenly committed and push a file that you get warn from GitHub or GitLab or have security vulnerable that should remove at any possible way. 

Then the git command you need to apply is: <code>git rm -r --cached <file name></code>

By this command you can remove your desired file from the commit and when you <code>git add .</code>, <code>git commit</code> and <code>git push</code> then you can able to remove that file from remote repository.

You can add these file to <code>gitignore</code>, so that these file will never commit and push to remote repository.
Handling Exception in Java
Published: 2021-10-24 19:18:07

# What is exception handling?
An exception is an abnormal condition that disturbs the normal flow of the program. Exception handling is used in handling the runtime errors and maintains the continuity of the program.

## Java exceptions
* Checked
* Unchecked
* Errors

## Try Block
The statements which throw an exception are to be placed under try block

**It is suggested not to write unnecessary statements in the try block because the program terminates at a particular statement where an exception occurs.**

## Catch Block
It is used to handle the exception by declaring the type of exception within the parameter.

**Single or multiple catch blocks can be used after each single try block.**

### Syntax of try-catch :'
```
 try{    
   //code that may throw an exception    
    }catch(Exception_class_Name ref){} 
``` 
#### Program using Try-Catch :
```
public class TryCatch {

public static void main(String[] args) {  
    try  
    {  
    int arr[]= {2,4,6,8};  
    System.out.println(arr[10]);    
    }  

    catch(ArrayIndexOutOfBoundsException e)  
    {  
        System.out.println(e);  
    }  
    System.out.println("Program continues"); 
}
}
```
#### Output

`java.lang.ArrayIndexOutOfBoundsException: 10
Program continues`

#### Program Using multiple catch blocks :
```
public class Multiple {

public static void main(String[] args) {  

       try{    
            int a[]=new int[5];    

            System.out.println(a[10]);  
           }    
           catch(ArithmeticException e)  
              {  
               System.out.println("Arithmetic Exception occurs");  
              }    
           catch(ArrayIndexOutOfBoundsException e)  
              {  
               System.out.println("ArrayIndexOutOfBounds Exception occurs");  
              }    
           catch(Exception e)  
              {  
               System.out.println("Parent Exception occurs");  
              }             
           System.out.println("Program Continues");    
}  
}
```
#### Output

`ArrayIndexOutOfBounds Exception occurs
Program Continues`

## Finally Block
The block of statements that are used to execute the important code. It is always executed whether an exception is handled or not.

#### Program using finally block :
```
public class Finally{

public static void main(String args[]){

try{

int data=25/0;

System.out.println(data);

}

catch(ArithmeticException e){
System.out.println(e);
}

finally{
System.out.println("finally block is always executed");
}

System.out.println("Program continues");

}

}
```
#### Output

`java.lang.ArithmeticException: / by zero
finally block is always executed
Program continues`
First time publishing a library and an article, I'm really satisfied with the results!
Tags: android, mobile, tutorial, github
Published: 2021-10-24 18:42:51

I've recently written an Android library called [TabSync](https://github.com/Ahmad-Hamwi/TabSync), and I've written an article over its usage and usecases.

I'm thrilled to say that my very first article to be publishing is now featured on [ProAndroidDev](https://proandroiddev.com/) publication on [Medium](https://medium.com/)!

That was my first time writing and publishing it, it took me about a week in order to finish every little detail about the library and the article, and now the feedback that I have received is amazing and quite satisfying! The library repository now has a couple of stars and I'm really happy with that!

I hope I can continue publishing more useful content in the future.

- Here's the article link if anyone intrested:
https://proandroiddev.com/synchronize-recyclerview-with-tablayout-3c5da4f3b18b
Trello rules - sure does
Tags: programming, productivity
Published: 2021-10-24 18:10:45

Trello is a project management SaaS and lately has been coming up so many cool things which we may missed out on.

## PowerUp: Umble Card Numbers

Power ups are more like plugins which you can add to your project to extend its functionality. Umble card numbers is like a ticket number. You can install this plugin from https://trello.com/power-ups/5fdb4577d8a01b48cbca0a6b/umble-card-numbers

How I use it is I try to link these up with branch names in github. So you have a branch with every ticket. 

Now whenever you add a card you will find a ticket number with it. It looks like this - 

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3lv2z5yzlpwure05l556.png)

## Rules 

Rules are like commands you can use to automate certain tasks on your board. For e.g. I have a rules that "when someone adds a new card to my TASKS list, it will add a due date of tomorrow and create a checklist named 'ToDo' inside it"

See it in action - 

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2oczk815v7jljwx8pmtk.gif)


Happy coding !!!
Vite + React + TailwindCSS - Simple and Clean Starter
Tags: vite, react, tailwindcss, javascript
Published: 2021-10-24 18:04:37

I know some of you faced issues while using create-react-app and tailwindcss together. I also faced some issues. That's why I trying to find out a good solution for react-tailwind projects. and I made it with vitejs

here is my vite-react-tailwind starter github repo: [https://github.com/moinulmoin/vite-react-tailwind-starter](https://github.com/moinulmoin/vite-react-tailwind-starter)

just simply clone it and use it

if it helps you, then don't forget to star the repo

Thank you 💖
Coding Challenge #0
Tags: programming, discuss, database
Published: 2021-10-24 17:35:36

In these challenges I ask you a question which you answer and I give shoutouts to correct answers. This is the first challenge, but for us devs it is 0th.

## Rules and Instructions
1. You need to solve the question within 24 hours of posting. However you can try it out even if you are late, just that you wouldn't get a shoutout here, but you will improve your knowledge.

2. You can use any technology or programming language you like, but need to write code, no website/app builders allowed. 

3. Please try to submit a github or any other vcs hub repo instead of embedding code here. 

4. To get the shoutout your answer should be correct and submitted within 24 hours of publishing of this post. 

## Task(Difficulty: Easy) 

Write some code (Use classes, structs, interface or functions) to create models for a course based application in which a user can be a student or instructor or admin. Courses should have a thumbnail image, video lessons with descriptions divided into sections, and also price. You can add as many features as you like but these features are minimum.

All the best... 

## Shoutouts
#### Shoutouts will come here
Created a Python page on instagram page.
Tags: python, showdev
Published: 2021-10-24 17:30:05

Created a Python page on instagram for python tricks and tutorials.
Added a few embeds:
{% instagram CVaxQ8BB2XZ %}
{% instagram CVXw_twp_i_ %}
INSTAGRAM: https://www.instagram.com/pythonzen/

Here I will post tricks and easy shortcuts related to python programming language.
Heap Data structure
Tags: heap
Published: 2021-10-24 17:17:17

A Heap is a special Tree-based data structure in which the tree is a complete binary tree. Generally, Heaps can be of two types:

1. Max-Heap: In a Max-Heap the key present at the root node must be greatest among the keys present at all of it’s children. The same property must be recursively true for all sub-trees in that Binary Tree.
2. Min-Heap: In a Min-Heap the key present at the root node must be minimum among the keys present at all of it’s children. The same property must be recursively true for all sub-trees in that Binary Tree.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qj24gertyom1vuyzetsp.png)

What are heaps used for?
Heaps are used in many famous algorithms such as Dijkstra's algorithm for finding the shortest path, the heap sort sorting algorithm, implementing priority queues, and more. Essentially, heaps are the data structure you want to use when you want to be able to access the maximum or minimum element very quickly.

What are the three main properties of heap?
1.Ordering. Nodes must be arranged in an order according to values. The values should follow min-heap or max-heap property.
2.Structural. All levels in a heap should be full.
3.Methods or Operations of Heap. find - in order to find an item in a heap.
4.Implementation. Heaps are usually implemented in an array.
Made a Keyword Generator for youtube or other social media in Python
Tags: python, showdev
Published: 2021-10-24 17:02:04

{% youtube nbXOfoCzg_A %}
![Screenshot of the program running..](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4ncnkm701bw6mdb1onla.png)

Created a  Keyword Generator for youtube or other social media in Python


Generates a List of keywords seperated using commas that you can directly paste it.

Source Code: https://rebrand.ly/pythonkeywordgensrc
Append method with URLSearchParams
Published: 2021-09-14 01:41:02

Just for the sake of learning and not to forget, 
I am sharing this chunk of code of the implementation of Append method with URLSearchParams.


```javascript
async getCategoryMains() {
    const params = Object.assign(this.search, {
      size: this.options.itemsPerPage,
      page: this.options.page,
      categoryType: "VIDEO",
      appPublishId: [1,2]
    });
    const response = await getAllCategoryMains(params);
    if (response.status === 200) {
      this.categoryMainData = response.data
      this.categoryMainCount = Number(response.headers["x-total-count"]);
      this.handleSetCategoryMainId();
    }
  }
```

Api code

```javascript
export const getAllCategoryMains = async (search) => {
  const params = new URLSearchParams();
  params.append('page', String(search.page - 1));
  params.append('size', search.size);
  
  getSearchParams(params, search);
  // @ts-ignore
  const response = await Vue.axios.get(
    `/${env}/contents/api/category-mains?sort=id,desc`,
    {
      params,
      headers: {
        Authorization: "Bearer " + session.get("access_token"),
      },
    }
  );
  if (response && response.status === 200) {
    return response;
  }
  return response;
};


const getSearchParams = (params: any, search: any) => {
  if (search.sort) {
    params.append("sort",search.sort);
  }
  if (search.appPublishId !== "" && search.appPublishId !== undefined) {
    if(typeof search.appPublishId != 'number'){
      search.appPublishId.forEach(id => {
        params.append("appPublishId.in", id);
      })
    }
    else {
      params.append("appPublishId.equals",search.appPublishId)
    }
  }
  if (typeof search.name ==='string' && search.name !== "") {
    params.append("name.contains",search.name);
  }
  if (typeof search.activated ==='string' && search.activated !== "") {
    params.append("activated.equals",search.activated);
  }
  if (typeof search.categoryType ==='string' && search.categoryType !== "") {
    params.append("categoryType.in",search.categoryType);
  }
  if (typeof search.category ==='string' && search.category !== "") {
    params.append("tagId.in", search.category);
  }
};
```

I'm a junior frontend developer with 5 months of work experience, so if you know any better suggestions for rewriting this code please leave comments.
Why you need a boiler plate
Tags: programming, productivity, beginners, devops
Published: 2021-10-24 16:19:12

We all have the startup bug inside of us where we think we have a great idea in a split second and then we lose it all together the next. 

Well since we are programmers, it always feels to have a project ready so that we can jump right in to start developing our idea. 

This is less of a post and more of a trick to save time. Just create a boiler plate with the required folder structure and file names and packages you are damn sure gonna use in your next project. You can host this on github or somewhere else and have branches and other merging strategies ready too. 

So next time all you have to do is clone the project and you are on your way. 

P.S. This also helps when you feel the idea is not going to work since you did not spend too much time tryng to setup your project. 

Here is a sample of an app project which I use frequently. 

https://github.com/vjnvisakh-boilerplate/flutter

I promise to keep adding to it so that I have to spend the least time setting it up next time. 

If you are like me and like to use a project management SaaS to track progress you can have a look at this Trello template - https://trello.com/b/PaMbIsjb/template


Happy coding !!!
About Me
Published: 2021-10-24 16:06:09

 
#### Hello, my name is **Julie**. 
I want to start by introducing myself and why I started my journey into the tech world. To start off with, I am a nerd, like most in this industry. My whole family are nerds, so I come by it honestly, although my family has many different types of nerds and I would be the first to get into programming. I'm from Texas, and my motto is "Go big, or go home." My motto may be a little bit of an ultimatum, but it's what propels me to continue moving forward and succeed. I have another saying that I also use, but not as much, which is "It doesn't hurt to try." I get motivation here as well, because it can be daunting when stepping into uncharted territory, but what's important is trying first?

I began learning code when I was in high school. I took a class called "Web Design" where I learned the basics of HTML and CSS. I enjoyed that class so much. I was always one or more steps ahead of the pace the class was set at, and I had many pet-projects on the side where I played around with the things I learned. I seemed to be the most enthusiastic one out of my class, to the point where I was the *teacher's pet*. I felt a little alone despite being in a class of 30. The rest of the class seemed to treat the assignments begrudgingly, while I was a glutton who wanted to learn as much as possible. At the time there wasn't a class after which to continue my education in coding, so I put it aside and moved on.

After which, I graduated High School and went on to College. I ended up focusing on learning Linguistics, Anthropology, and Japanese. I had enjoyed all of the classes and topics I learned about in College, but I had completely forgotten about coding and how much I had enjoyed learning it. It wasn't until after I had graduated and was trying to find my calling, with little success, that it came like an epiphany. A spark of a moment that came out of nowhere, I remembered about coding and my love for it. I felt a little disappointed that I had forgotten so completely about something I enjoyed so much. I also felt excited because my gut was telling me that this might be *it*, the thing I had been searching for all these years, what I wanted to invest myself in and pursue as my career.

Now that I have graduated from College and working towards making my career, I thought that now was the opportune moment to try to get back into coding and to go into programming. It felt like fate, and I went with my gut decision to go for it. I haven't had a single important life decision where I went with my gut that I have regretted. If anything, my deep love of Linguistics and anything Language, which I explored in College, can propel me forward and be applied to tech as well. Because what is a programming language but just another language.
On impact-effort prioritization
Tags: productmanagement
Published: 2021-11-09 01:57:25

---
title: On impact-effort prioritization
published: true
date: 2021-10-24 15:58:43 UTC
tags: productmanagement
canonical_url: 
---

For a lot of people, the impact-effort matrix is a quick way to work out what they should – or shouldn't – focus their efforts on.

This is how it's typically done:

1. Make a list of things you want to work on
2. Get a bunch of people together.
3. Ask everyone to estimate how much effort it will take to do each item in the list, and how much impact it will have.
4. Pick the things that most people agree have the most impact for the least effort.
5. “Just do it”

On the face of it, this seems straightforward enough. Here's what doesn't happen between steps 3 and 4:

3a. Ask everyone to put a confidence number on their estimate for the effort (because [planning is hard](https://en.wikipedia.org/wiki/Planning_fallacy)) 
3b. Ask everyone to present data that supports their idea of how much impact each thing will have (because without data, all you have is an opinion) 
3c. Ask everyone to specify who will be impacted, and how (because if you're comparing things that impact completely different sets of audiences, you'll end up comparing apples to oranges) 
3d. Consider whether, over time, the effort required to produce the desired value will increase, go down, or stay the same (because when was the last time you planned for a feature to be delivered in 2 months, and it got delivered in 2 months?)

If you aren't doing 3a – 3d, what are you really doing with your prioritization?
Tools for turning code snippets into images
Tags: webdev, beginners, programming
Published: 2021-10-24 15:52:03

## 1. [Ray.so](https://ray.so/)
![Ray.so](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c81enaqxxxszkysps72l.PNG)
Ray.so is an online tool that lets users create a beautiful code snippet image with gradient backgrounds.
You can highlight up to 50+ programming languages.

## 2. [Snappify](https://snappify.io/)
![Snappify](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/q8t6ctd10xypcezt3u08.PNG)
Snapify comes with 6 predefined styles to create aesthetically pleasing snapshots of your code without spending hours on styling.

## 3. [CodeKeep](https://codekeep.io/home)
![CodeKeep](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xl8mioqkft24oqkj4j9b.PNG)
## 4. [Codeimg](https://codeimg.io/)
![Codeimg](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2fd7u76s0fq7jxyp169d.PNG)
CodeImg is a wonderful tool for preparing code snippets to be displayed in images.

## 5. [Carbon](https://carbon.now.sh/)
![Carbon](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ci7rigsy4ibojmqbgltw.PNG)
Create and share beautiful images of your source code. Start typing or drop a file into the text area to get started.

## 6. [SRC to PNG](https://team411.github.io/src2img/)
![SRC to PNG](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bujj8s8ojvouvl3hszos.PNG)

My Blog:- [Beginner Developer Blog](https://beginners-developer.blogspot.com)
Angular: Confirm Password Validation Custom Validator
Tags: angular, forms, typescript
Published: 2021-10-24 15:45:17

**Note:** You need a basic understand of Angular reactive forms for this.

There is not a custom validator in Angular for confirm passwords, so I found one [here](https://stackoverflow.com/a/55929868/271450). I don't want to have to rewrite the code in my component, so here is my version that just 'works' out of the box.

Create a file called `form-validators.ts` with this:

```typescript
export function matchValidator(
  matchTo: string, 
  reverse?: boolean
): ValidatorFn {
  return (control: AbstractControl): 
  ValidationErrors | null => {
    if (control.parent && reverse) {
      const c = (control.parent?.controls as any)[matchTo] 
        as AbstractControl;
      if (c) {
        c.updateValueAndValidity();
      }
      return null;
    }
    return !!control.parent &&
      !!control.parent.value &&
      control.value === 
      (control.parent?.controls as any)[matchTo].value
      ? null
      : { matching: true };
  };
}
```

Then, in your formgroup, add your validators like so (note: the other validators are optional):

```typescript
password: ['', [
  Validators.required,
  Validators.pattern('^(?=.*[0-9])(?=.*[a-zA-Z])([a-zA-Z0-9]+)$'),
  Validators.minLength(6),
  Validators.maxLength(25),
  matchValidator('confirmPassword', true)
]],
confirmPassword: ['', [
  Validators.required,
  matchValidator('password')
]],
```

Notice the `matchValidator` uses the true input to see if it is the **reverse** node. This means, put `true` on the item that needs to be checked, and don't put true where you want the error message to display.  So in this case, the error message is only displayed on the `confirmPassword` field, while it is checked on the `password` field as well.

The error code will be `matching`, so you can use this in your `mat-form-field` input:

```typescript
<mat-error *ngIf="confirmPassword.hasError('matching')">
Password must match.
</mat-error>
```

**Note:** If you want the form to update immediately while typing, you can use a custom [errorStateMatcher](https://stackoverflow.com/a/47670892/271450).

Now, you can reuse the matching validator across your app without writing custom functions.

If you enjoy these articles, give me a thumbs up here and on [stackoverflow](https://stackoverflow.com/a/69698646/271450), as I use these points to debug my applications.

Thanks,

J
Common Lisp et les fichiers
Tags: lisp, commonlisp, file
Published: 2021-10-24 15:40:44

* `(with-open-file (in "filename") (read-line in))` 
  permet de lire la première ligne d'un fichier


* `(with-open-file (out "filename" :direction :output)
   (format out "solenodon"))` 
  pour écrire  dans un fichier


* `(uiop:read-file-string "filename")` 
  permet de lire tout le contenu d'un fichier sous forme de string


* `(uiop:directory-files "dirname")` 
  permet de lister les fichiers du dossier dirname
Lab 04 and Git Remote
Tags: opensource, javascript, github
Published: 2021-10-08 21:48:17

Hey,

My partner for this lab was Mizuho Okimoto, my goal was to add a feature that would be able to receive a config file.txt and read the flag values from it.

---

## Implementing The Code
She is also using JavaScript to make her SSG, so implementing it was fairly simple. The process was the following: 
-	Open an issue on her repo [My issue]( https://github.com/MizuhoOkimoto/pajama-ssg/issues/19)
-	Fork her repo and clone it to my machine
-	Make a topic branch with the issue number
-	Create a new flag on yargs: -c and –config.
-	Receive a cfg file, read the values from it using fs.
-	Parse the information to JSON.
-	Extract the flags from it.
-	Test it.
-	Test it more.
-	Commit my changes.
-	Make my pull request. [PR](https://github.com/MizuhoOkimoto/pajama-ssg/pull/20)

---
## Reviewing the code
The guy working on my Repo was Andre Willowmitzer.
After he did his changes on my code and made the pull request.
Using the git remote I cloned his repo and tested it to make sure everything was working.
```
git remote add andre andre-repo.url
git fetch andre
git checkout -b config-support andre/config-support
```
I was surprised to see that merging his code on mine automatically closed the PR. This way is way easier than entering github and pressing the merge button there.
This lab was really informative and git remote is very useful.