teleren/devto huggingface dataset:
How I think Discord's new slash commands could be improved
Published: 2021-07-28 10:10:06

## Introduction
While I do believe that usage of bot commands need some improvements, I don't think the current implementation Discord has would work well. Discord is trying to move all bot commands under the slash prefix (`/`) but I don't think this is the best way. In my opinion, when there are enough bots in your server there can be a lot of clutter with just one prefix. Additionally, if multiple bots have the same command under the same prefix, this might cause confusion.
## Available Bots Menu
In my opinion, there should be a button in the message box to open up a list of each bot in the current Discord server. As for the built-in Discord commands, the user could change the prefix they want to use locally. My graphics design skill is on the level of "graphics design is my passion" but you should still get the point.
![Available Bots Menu](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/od1iugf3rl387pr02pz5.png)
## Command List
Once you type out the prefix, the list of commands would show just like the current slash commands pop-up. If you already know how to use each command, you should be able to toggle the command list by clicking the bot commands button again.
## Ease of Use for New Users
For users who are new to Discord and may not want to type out each command, there should be an option in the command list to autocomplete the command for you.
## Conclusion
By implementing the new command system this way, I feel that there would be less clutter, and it would be easier for new users.
Some interesting facts about javascript
Tags: javascript, webdev, beginners, codenewbie
Published: 2021-07-28 10:23:17

We all know that javascript is one of the most popular programming languages now-a-days. Javascript is a very strange language in deed. One reason is it has got syntax similar to `C`, `C++` and `Java` but semantically this is not similar which makes developers confused. Another weird thing to mention is its `prototype inheritance` which can be achieved similarly using es6 class. Let us discuss some interesting facts about this very language.

- Many programming languages use semi colon at the end of a statement. Javascript does so but you can also use semi colon at the beginning of a statement.
```
;var a = 2
;console.log(a)
```
The above code snippet will display 2 in the console without throwing any error!

- In javascript you can add a number with a string. The result will be a string without any error.
```
var b = 5 + '9';
console.log(b);
```
The above code snippet will display "59" in the console!

- In javascript the comparison operators act really weird in many cases. Lets see some examples:
```
NaN == NaN // -> false
NaN === NaN // -> false
[] == true // -> false
[] === true // -> false
[] == false // -> true
[] === false // -> false
{} == {} // -> false
{} === {} // -> false
{} >= {} // -> true
{} > {} // -> false
```
Things got a bit messed up, right? 

- Javascript has a nice feature named **Immediately Invoked Function Expression** where a function can be executed just after it has been defined without being called explicitly.
```
(function() {
  console.log('works well');
})();

function() {
  console.log('generates syntax error');
}();
```
Here the first function works fine as it is a **IIFE** but the second one generates `SyntaxError`.

- In javascript the difference in parenthesis position can make two functions different.
```
function f1() {
   return
   {
      grade: 'A+'
   }
}
function f2() {
   return {
      grade: 'A+'
   }
}
typeof f1() === typeof f2(); // -> false
```

- In javascript `undefined` is not a reserved word although it a has a special meaning. This is the only way to determine whether a variable is undefined but the following code snippet looks quite weird.
```
undefined = "I am defined now!";
var c;
console.log(c == undefined); // -> false
```
Ebook : Membela Habib Munzir dan Guru Sekumpul (Persoalan Melihat Nabi SAW dalam Keadaan Jaga)
Tags: ebook, wahabi, habibmunzir, gurusekumpul
Published: 2021-07-28 10:03:19

Wahabi mempunyai sikap beragama merasa diri paling benar, begitu mudah memvonis muslim lainnya dengan vonis sesat , bidah , syirik dan lainnya. Peringatan maulid, yasinan, tahlilan divonis bid`ah oleh mereka. Tidak hanya itu, Habib munzir dan guru sekumpul menjadi korban dari sikap beragama wahabi ini.  

Habib munzir bin fuad al musawa adalah salah satu habib kharismatik di jakarta, beliau merupakan murid dari Habib Umar bin Hafidz dan merupakan santri angkatan pertama darul muststhafa, Tarim, Yaman Selatan , Beliau mendirikan majelis rasulullah , majelis rasululah merupakan majelis pemuda terbesar dijakarta.  

Guru sekumpul atau guru ijai meruapakan panggilan  untuk ulama kharismatik tanah banjar yaitu KH. Muhammad Zaini bin Abdul Ghani. Haul guru sekumpul dihadiri jutaan orang tiap tahun. Wahabi tidak percaya bisa bertemu dengan Nabi Muhammad Shalallahu Alaihi Wassalam dalam keadaan jaga (sadar).  

Salah seorang ustadz wahabi bernama firanda andirja mengingkari pengakuan habib munzir dan guru sekumpul yang telah bertemu Nabi Muhammad Shalallahu Alaihi Wassalam dalam keadaan jaga, ia menulis sebuah tulisan dengan judul "Ternyata Ada Sahabat Nabi dari Indonesia !!!".  

Benarkah bertemu  Rasulullah Shalallahu Alaihi Wassalam dalam keadaan jaga/sadar adalah sesuatu yang tidak benar dalam agama? tentu tidak.  Ebook  "Membela Habib Munzir dan Guru Sekumpul" akan menjawab syubhat syubhat wahabi yang tidak percaya akan kebenaran melihat Nabi Muhammad Shalallahu Alaihi Wassalam dalam keadaan jaga. Silahkan Klik link diakhir tulisan untuk mendapatkan ebooknya

Terima kasih sudah berkunjung, jangan lupa untuk share koleksi ebook kami, agar keluarga kita, agar orang terdekat kita, agar orang orang yang kita cintai terhindar dari paham wahabi, paham yang mudah memvonis, bid`ah,sesat,syirik dan kafir kepada muslim diluar kelompok mereka.  Mereka katanya adalah kelompok yang ingin memberangus bid`ah tapi malah datang dengan bid`ah mereka yaitu membagi tauhid jadi 3 (pembagian yang tidak pernah dilakukan baik itu Rasulullah Shalallahu Alaihi Wassalam, sahabat, Tabi`in, Tabi`in, imam 4 mazhab maupun ulama muktabar lainnya), Wassalam.

Source: https://ebookantiwahabi.blogspot.com/
Short checklist to decide when to useReducer & useState hook in the components
Tags: react, javascript, webdev
Published: 2021-07-28 09:53:54

useReducer() & useState() hooks, both of them are state management hooks which add interactivity in the app & component.

But sometimes, it can be complicated to distinguish which hook we should use and in which cases we should consider useReducer or useState. So here are some things which you can use to distinguish what to use:

### For useState:
1. Use it when you are dealing with JavaScript primitives as a state.
2. Use it when you have simple logic to change the state.
3. Use it when you don't want to separate business logic from the component.
4. Use it when you have small applications. For example, taking input from the search field and then add it to the current state.
5. Use it when you have different properties that don't affect each other or don't change each other in a correlated way.
6. Use it when you have different state properties that can be managed by multiple state hooks easily, like a form submission.

### For useReducer:
1. Use it when you have JavaScript objects & arrays as the state.
2. Use it when you have complex logic to change the state.
3. Use it when you have a medium-sized application.
4. Use it when you have different properties that are tied together then, these should be in one state object like a library management function (adding, issuing & removing book details)
5. Use it when you have very complex business logic and hard to be done in component alone (help to avoid unnecessary deep nesting in the app component).
6. Use it when you want to make the state more predictable.

### Note (my views): 
Reducer function in useReducer is like a functional programming paradigm because of several reasons:
1. Pure function, takes input and always give an output
2. Always return new state object, does not mutate the current state object (immutability)
3. Outputs are predictable
4. Binary in nature, takes two arguments (current state & action object) and return one state object as output
Updated: The Best Way to Learn Python. Fact.
Tags: tutorial, python, programming
Published: 2021-07-28 09:49:12

There has recently been an update to the best way to learn Python. Now, it is better than ever. With detailed tutorials that walk you through how you do it, with practicals and hands-on projects. This is the best way to learn python. The best thing is that: it's completely free. No sign-in or whatsoever, you could view it anywhere, anytime. Way better than SkillShare or so. Check it out now!
{% github MatthewTamYT/LearnPython %}
Creating vite vue ts template: Setup pre-commit.ci
Tags: precommit, ci, vite, vue
Published: 2021-07-28 09:12:27

## Configure pre-commit.ci

1. Open https://pre-commit.ci
1. Sign in
1. Add an installation
1. Select project
   ![Authorize project](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yuexfkz6q01ozrhpw1b6.png)
1. Add badge to the top of `README.md`
    ```
    [![pre-commit.ci status](https://results.pre-commit.ci/badge/github/imomaliev/vue-ts/main.svg)](https://results.pre-commit.ci/latest/github/imomaliev/vue-ts/main
    ```
1. `git add -u`
1. `git commit -m 'add pre-commit.ci badge'`

## Links

-   https://pre-commit.ci

## Project

{% github https://github.com/imomaliev/vue-ts no-readme %}
HOW TO CREATE BACKGROUND SHAPES FROM CSS?
Tags: css, html
Published: 2021-07-28 08:59:36

Today we will Learn How to Create a Background Shape from CSS. It will have all types of Shapes like Triangle Shape, Circle Shape , Rectangle Shape, Close Shape, Star Shape and other Shapes which are as follows.

Let us see one by one how to create Background Shape with the help of CSS

Looking at this blog, I think you will get an idea of ​​how to create a Background Shape.

<a href="https://www.myprograming.com/how-to-create-background-shape-from-css/">MORE..... </a>
LetsGrowMore Web Development Internship Experience
Tags: html, css, react, javascript
Published: 2021-07-28 08:48:00

Hello everyone, I have successfully completed the web Development Internship at LetsGrowMore by completing the Task-1 and Task-2 assigned by them.

**Task-1:**Single-Page Website
**Technologies used:**HTML,CSS,javascript
**Code Editor:**Visual Studio Code
**Github Link:**https://github.com/Sasirekha-123/LGMVIP-WebDev

**Task-1 Experience:**
 I have learnt HTML,CSS and javascript for designing this website. I have learnt so many new things about CSS and its purposes. This Internship helped me to know more about javascript. I faced issues in coding for alignment of pictures. It was a great learning experience. I have learnt how to sort out the alignment issues. This website has no database linked in it for responsive data storage. It is a simple website that will let you know about the theme of website when you click on the responsive button that I have designed.  

**Task-2:**Web Application Using Create-React-App
**Technologies Used:**HTML,React js,Javascript,CSS
**Code Editor:**CodeSandBox
**Github Link:**https://github.com/Sasirekha-123/LGMVIP-WebDev

**Task-2 Experience:**
  I have learnt React JS to complete this Web Application. In this I have used HTML,CSS to design the layout and the responsive part is made of React js. I have used API link to fetch the data and to display. This is a simple web application to display the users of brand while clicking in the get users button. It was a great learing experience. On the whole I have learnt React js completely while doing this task.

**Conclusion:**
  I thank Mr.Aman Kesarwani and LetsGrowMore for giving me this opportunity to work on the projects based on Web Development. Through this Internship I have learnt and gained a lot of practical knowledge in the field of Web Development.
  To know more about LetsGrowMore Internships visit the site https://letsgrowmore.in/ and https://letsgrowmore.in/vip/
How to get Thread dump from Heap dump
Tags: java, jvm, tooling
Published: 2021-07-28 08:25:05


Recently I was debugging some nasty deadlocks and as one does in this kind of situation I needed to look into thread dumps. Unfortunately for me, the only thing I had was heap dump. Do not get me wrong heap dumps contain much more information, including the needed thread info. But heap dumps are also very big (can be gigabytes) so they are not very practical if you want to share them with a co-worker or upload them to online analyzer tools like [FastThread](https://fastthread.io/). All I wanted was a simple text file with the thread dump. 

I started to google and my surprise I was not able to find easy to use tool that can do this. Most heap dump analysis tools can show you the thread data, but cannot export it in the format that is associated with thread dumps. I accepted my faith and continue. Until I noticed this nice button in VisualVM that did exactly what I wanted.

## Step by step

### Open VisualVM

[VisualVM](https://visualvm.github.io/) is a JVM troubleshooting tool, it was bundled with JDK 6,7,8 and is a standalone free tool. It can help you with JMX, profiling, memory monitoring, taking and displaying thread and heap dumps and so much more. If you do not have it on your local machine, download it and learn how to use it. I will definitely improve your troubleshooting capabilities. 

### Open your heap dump in VisualVM

It's straightforward. Open the heap dump (hprof file) via the Load Snapshot button.

### Switch to the thread view

After the heap dump is loaded in the top left corner of the tab is a dropdown. Switch it to Threads.

### Switch the thread view to HTML moved

This is named confusingly, but it will do exactly what you need. 

Next to the dropdown is a couple of buttons to switch how the thread view is displayed. The first one is the fancy UI and the second one (confusingly named HTML) will convert the thread info into a thread dump text format. This operation will take some time as VisualVM is converting the thread info into the format. 

### Copy and paste

Now you can copy the text and enjoy your thread dump.

### One image instead of 1000 words

![VisualVM with thread info](https://ppolivka.com/images/thread-dump.png)

---

For more tips like this, you can follow me on [Twitter](https://twitter.com/pavel_polivka).
Day 155
Tags: 100daysofcode, programming
Published: 2021-07-28 08:22:41

Day 155/200 of #200DaysOfCode #100DaysOfCode 

- Solved four problems on Codewars.

1 -  Can you keep a secret? (6 kyu)
2 -  Javascript filter - 3 (6 kyu)
3 -  Javascript filter - 2 (6 kyu)
4 -  Javascript filter - 1 (7 kyu)
Input type “file” returns EMPTY in Laravel php
Tags: laravel, php, challenge
Published: 2021-07-28 07:57:40

Suppose
We have some photos that need to be updated
The user wants to delete one of the files while editing,
How do you know  user has sent a NULL input file or not changes?
becuse Input type “file” returns EMPTY ,
So we have two similar state,
for example:
if($request->hasFile('filename')) {
//here is!!! ok you update the file 
}else{
//but here not ok,
if you check input exist ,it does not solve the problem
}


how you handle this!
Execution Context in Javascript
Tags: javascript, programming, tutorial
Published: 2021-07-28 07:38:14

The execution context in javascript is an environment. Usually when we run a function, it is executed in the execution context.

Confusing? Don’t worry, consider the below code:

```js
var c= 5;
function random() {
   return 10;
}
function  multiply() {
   return c * random()
}
multiply();
```

Take a look at the above code. When the javascript engine starts executing the above code, it creates the Call Stack in memory.

## We might ask what is a call stack and how it is related to execution context in Javascript?

Think of it as a simple stack. This stack contains the function blocks one after another in a bottom up approach.

During execution, when the compiler gets any new function, it pushes the function in the call stack.

One after another, the code blocks will be pushed in the stack. These code blocks are the execution contexts.

Now, the question is, how does the engine distinguishes each block of code?

It is not actually the lines of code. When the compiler encounters a new function call or code block it creates an execution contexts in javascript.

Execution context in javascript can be any of the three types below:

**Global Execution Context:** This is the default execution context. It contains the global variable declarations and function calls. Global execution contexts are unique and always the starting point of execution.

**Function Execution Context:** The code, inside a function definition or the function body itself.

_Whenever the global or functional context encounters another function, a new execution context is created in call stack._

**Eval:** The code, inside an eval expression.

![Execution contaxt](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l7avn35tb8ua5fl4gnoh.png)

Each execution context has 2 stages. A creation stage and an execution stage.

### Creation stage in execution context:

- In creation stage, javascript scans the code and declares all variables and assigns undefined as the value of those variables.
- Creates the scope chain.
- Set value of this object.

### Execution stage in execution context: 

- Javascript engine scans the code and assigns value to all variable objects.
- Along with that it executes the code line by line.

**Below is the order of execution context creation in call stack for above code.**

![Execution stages](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pqpk282e9f5v8lgqfs4t.png)
How do you handle Code Reviews?
Tags: codereview, productivity, discuss
Published: 2021-07-28 07:36:29

That’s the question I asked my colleagues and the result was, well … not so surprising.

Many teams have a __chat channel__ where they post the link to their merge request.

If someone does a review for a MR, they add an `eyes` 👀  emoji to the message, if it’s approved they add a `checkmark` ✅ and if there are questions they add a `speech bubble` 💬 or `cross mark` ❌ .

Other teams only __assign people directly__ in GitHub or GitLab and the ticket system.

And some do a mix of both of them (like my team). If __nobody reacts__ to a MR in our chat, we __pick one__ 🤗

What is interesting: In some teams the __reviewer merges__ the MR, in others the __person who wrote the code__.

> Pressing the merge button is a success experience and we wanted to leave that to the person who wrote the code

But you could also say: Who merges the code is responsible for breaking the pipeline 😅

**So how are you doing it?**

Message in a channel? Assigning your Team Lead? Or something completely different (drawing straws)? Let me know in the comments.
GitLab - skip pipeline on push
Tags: git, gitlab, pipeline, cicd
Published: 2021-07-28 07:32:44

If you have configured a GitLab [CI/CD pipeline](https://docs.gitlab.com/ee/ci/pipelines/) well then on each `push` to the repository result in execution of the pipeline. Sometimes it is not desirable to launch the pipeline immediately on the push or you may want to execute the pipeline using a [schedule](https://docs.gitlab.com/ee/ci/pipelines/schedules.html), in such case you can pass additional [push option](https://git-scm.com/docs/git-push#Documentation/git-push.txt--oltoptiongt) to instruct GitLab to skip the pipeline execution. To do so, the command would be:
```
git push -o ci.skip
```

But if you are using any [GUI client](http://git-scm.com/downloads/guis/) for `git` then you will not be able to pass this additional argument to the push command. In that case, you can configure the `push.pushOption` instead as:
```
git config --local --add push.pushOption ci.skip
```
<sup>*</sup> Make sure to remove this configuration when you no longer want to skip the pipeline on `push`. To do so, use the `--unset` option:
```
git config --local --unset push.pushOption
```

If you prefer git **CLI** over **GUI** then you can create alias for such case:
```
git config --local --add alias.skipPipeline "push -o ci.skip"
```
Now you have choice:
* to skip pipeline use command: `git skipPipeline`
* normal push with pipeline execution: `git push`

I hope you may find this information useful. Feel free to leave your feedback/opinion in comments.
Write Your First Python Program
Tags: python, beginners, tutorial, programming
Published: 2021-07-28 07:30:28

#### Write your first python program

```Python
print("Hello World!")
name = input("What is your name? ")
print("Nice to meet you,", name)
```

#### Write your first function in python

```Python
def main():
    print("Hello World!")
    name = input("What is your name? ")
    print("Nice to meet you,", name)

if __name__ == "__main__":
    main()
```

**Python doesn't automatically look for a function named `main` when the program starts. So we need to write this condition**

```Python
if __name__ == "__main__":
    main()
```

##### Why do we need to do this?
Because in Python you might be executing your code as a program, but you might also be including this code as a module in another program. And if this was executed from the terminal or the command line, then you want the main function to be called.

Now, if the code was included as a module in another program, then you wouldn't want all my code just to start running when it was imported into the other program, because that would cause problems.

So these two lines help distinguish between when a Python file is being included in another program, or when that Python code is being executed as its own program.
Semantic Versioning
Tags: programming, api
Published: 2021-07-28 07:27:54

[Semantic Versioning 2.0.0 | Semantic Versioning](https://semver.org/)

## In a nut shell

Semantic Versioning is a simple set of rules and requirements that dictate how version numbers are assigned and incremented
⇒ Easy to understand what has been modified from the way they change one version to the next 🙌

![Image 2021-07-28 at 4.07.40 PM](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/77wpz4c00xtbkfq0mc1l.jpg)
 
1. **MAJOR version** when you make incompatible API changes
2. **MINOR version** when you add functionality in a backwards compatible manner
3. **PATCH** version when you make backwards compatible bug fixes

## Some points from the spec(I picked very few 🙇🏻‍♂️)

- No leading zero
    - Good: 1.0.0
    - Bad: 01.0.0
- Major version zero (0.y.z) is for initial development
- When the major version is incremented, the patch and minor will be reset to 0
- When the minor version is incremented, the patch will be reset to 0

## Details

Please refer to this official site [Semantic Versioning 2.0.0 | Semantic Versioning](https://semver.org/)
I want to be a javascript developer but i am not good at css?
Tags: react, node, javascript, webdev
Published: 2021-07-28 06:43:23

 I like react and i am familiar with nodejs and mongodb. Is css necessary to getajob? And if it is necessary then how much? I am familiar with margin padding border text-align etc? I am really confused I created a website using nodejs which has file upload, video upload and a small chat system using ajax it is not perfect. I used grid fs(library) to develop the upload part. I took the help of my friend who is good at css to develop the frontend part of my website but only the design part whereas frontend validation was done by myself.