teleren/devto huggingface dataset:
nopCommerce CLI
Tags: nopcommerce, cli, ecommerce, dotnet
Published: 2021-09-27 13:56:06

<h1 align="center">The modern web developer's tool.</h1>
 
<p align="center"> 
  <i>nopCommerce CLI is a development tool for build plugins for nopCommerce Solutions.</i>
</p> 
 
<hr>
  
## Development Setup

### Prerequisites

- Install <a href="https://nodejs.org/es/download/">[node.js] </a>
- Install <a href="https://dotnet.microsoft.com/download">[dotnet core]</a>
- Clone <a href="https://github.com/nopSolutions/nopCommerce">[nopCommerce]</a>

### Setting Up a Plugin of nopCommerce

Install the nopCommerce CLI globally:

```
$ npm install -g nopcli
```

Create plugin:

```
$ nopcli new -g=[GROUP NAME] -p=[PLUGIN NAME]
```

Build the plugin:

```
$ nopcli build -g=[GROUP NAME] -p=[PLUGIN NAME]
```

nopCommerce CLI is cross-platform, fast, scalable, has incredible tooling, and is loved by millions.
<p>
	<a href="https://www.paypal.com/donate/?hosted_button_id=VM4NMF6PY4SMG">
	<img  src="https://raw.githubusercontent.com/DiogenesPolanco/nopCommerce-cli/development/src/assets/images/badge.svg" alt="Badge"/>
	</a>
	<br><br>
	<b>🙌 Use <a href="https://www.npmjs.com/package/nopcli">donations</a> to help support <b>this</b> project! 🙌</b>
	<br> 
	<br> 
	<b>Love <a href="https://github.com/DiogenesPolanco/nopCommerce-cli">nopCommerce CLI?</a> Give our repo a star :star: :arrow_up:.</b>
</p>
How to Turn your Data Science idea into a Funded Project

Tags: datascience, beginners, fundraising, writing
Published: 2021-09-27 13:43:39

All the Data Scientists hide at least on Data Science idea in their heart. However, due to time constraints or lack of money, they do not transform their ideas into a project.
In this article, I propose a strategy to turn your idea into a Data Science project. The adopted methodology is based on the following steps:
* Write a draft of the project proposal
* Search for partners and collaborators (optional)
* Search for funds

Adapt the project draft to the funder template and Submit it

# 1 Write a draft of the project proposal
The first step towards funding your project involves writing a first draft your project. While writing the full draft, try to answer to the following questions:
Which topic does my project cover?
Which problem does my project solve?
Usually, a project proposal, is composed of the following items:
* Summary
* Objective of the project
* Similar Projects
* Project architecture
* Workplan
* Impact on Society
* Description of the actors of the project
* Gantt Diagram

## 1.1 Summary
The summary is an overview of the project. If your project deals with Data Science, the summary should contain the most important keywords related to Data Science, such as Machine Learning, Data Analysis, Data Visualisation, Artificial Intelligence and so on.
In order to build a successful proposal, the project should also deal with at least one of the hot topics related to Data Science, such as those described int this interesting article by 
ODSC - Open Data Science.

The summary should resume all the parts of the project, including a description of the context, the objectives, the impact for the society and so on.

## 1.2 Objective of the project
Your project should solve at least one problem, otherwise it will not be funded. For example, as a data scientist, you could propose a new algorithm for Machine Learning, implement a new interesting dashboard for storytelling, or build a Data Journalism story. Anyway, the objective of your project should be very clear.

In general, while writing this section, you should focus on two kinds of objectives:
general objectives, such as providing a dashboard for storytelling specific objectives, such as exploiting the proposed dashboard to understand the behaviour of ants over time.

This section should be very clear and no ambiguity should appear.

[https://towardsdatascience.com/how-to-turn-your-data-science-idea-into-a-funded-project-f919dbaff104](https://towardsdatascience.com/how-to-turn-your-data-science-idea-into-a-funded-project-f919dbaff104)
A community-led mentorship opportunity for Hacktoberfest 2021
Tags: hacktoberfest, github, githunt, mentorship
Published: 2021-09-27 13:40:49

:wave: Do you know? The No-shave November campaign started with the aim of raising awareness and funding for cancer prevention, research and education. Such an innovative way right! 

What are we developers waiting for then? Buckle up and let's get ready for “**Hacktoberfest'21**”. Let’s make “**Open Source October**” a ritual for every open-source contributor! This October let's contribute, collaborate and educate ourselves and others about open-source!

To do so, I along with a few other [amazing folks](https://github.com/vinitshahdeo/Hacktoberfest2021/blob/main/MENTORS.md) have decided to mentor newbies in kickstarting their open-source journey.

{% twitter 1440342986143895565 %}


## Project Maintainers

If you happen to be an experienced person in the field of programming and maintaining projects, you might have a few beginner-friendly issues that can be taken up by beginners. So, we are calling out project maintainers to add issues to the repository. Also, go through the [blog post](https://vinitshahdeo.dev/beginner-friendly-issues-for-hacktoberfest-2021) for a complete understanding of our initiative. :raised_hands:

- Add beginner-friendly issues to [`ISSUES.md`](https://github.com/vinitshahdeo/Hacktoberfest2021/blob/main/explore/ISSUES.md)
- Add your repositories to [`PROJECTS.md`](https://github.com/vinitshahdeo/Hacktoberfest2021/blob/main/explore/PROJECTS.md)
- [Join us](https://github.com/vinitshahdeo/Hacktoberfest2021#mentoring) as a mentor

## Beginners

If you happen to be a beginner in this space, don’t scratch your head my friend we got your back! We’ve tried to compile a list of handpicked [beginner-friendly issues & repositories](https://vinitshahdeo.dev/beginner-friendly-issues-for-hacktoberfest-2021). Get your hands dirty on them, try to resolve a `first-timers-only` issues and if you face any difficulties the [mentors](https://github.com/vinitshahdeo/Hacktoberfest2021/blob/main/MENTORS.md) will guide you. What are you waiting for? [Get on board](https://forms.gle/GJSUTPBJ4Rw4DTMk9) now. And also, don't forget to introduce yourself in the [discussions](https://github.com/vinitshahdeo/Hacktoberfest2021/discussions/127) section. 

{% twitter 1442289500034535426 %}

**Open Source October is a vibe and we are all set to groove and code!** 

{% github vinitshahdeo/Hacktoberfest2021 no-readme %}

Happy Hacktoberfest! :tada:

[![Join our Discord](https://img.shields.io/badge/Join-Discord-8CA1A5?logo=discord&logoColor=white)](https://discord.gg/MgA48yUjVK)
C# - Enums and Bug Resilience
Tags: csharp
Published: 2021-09-27 13:20:30

Our domain is made of sets. Some sets are trivial such as all integers (`int`) or all booleans (`bool`) but often we are dealing with sets that are more narrow, for example the possible states of an order (`Incomplete`, `Unpaid`, `Paid`, `Shipped`, etc.).

In our database we assign a number or a string that represents each possible value, and in our code we use an `Enum` for that. This is good, but if we are not careful, then at some point in the future, when we change the composition of the set (for example by adding another state `Received`), we might create hard to debug errors in our program.

We want to always use `switch` when dealing with these sets, so that when the set changes, the compiler automatically warns us about all the places where code might need to be changed.

However there's one case where this is tricky: when dealing with the database. For example, we have a query in our code that fetches all orders that are paid, so our LINQ condition could be something like this:

```c#
where order.status == OrderStatus.Paid ||
      order.status == OrderStatus.Shipped
```

But what happens when we now add the new `Received` state? This query is now broken because received orders are also paid, but the compiler doesn't have any way of knowing that!

We need to somehow add a `switch` to this operation to make it safe. What we must do is filter all the elements of the enum by our condition:

```c#
IEnumerable<OrderStatus> GetOrderStatusValuesWhichArePaid() {
    static bool IsPaid(OrderStatus orderStatus) => orderStatus switch {
        OrderkStatus.Incomplete => false,
        OrderkStatus.Unpaid => false,
        OrderkStatus.Paid => true,
        OrderkStatus.Shipped => true,
        _ => throw new ArgumentOutOfRangeException(nameof(orderStatus))
    };

    return Enum.GetValues<OrderStatus>().Where(IsPaid);
}
```

And we can use it in our LINQ query:

```c#
var paidStatusValues = GetOrderStatusValuesWhichArePaid();
var query = from order in Orders
            where paidStatusValues.Contains(order.status)
            select order;
```

Now when we add the new `Received` state, the compiler can warn us that the switch statement in the function `IsPaid` is not covering all cases properly.
Thinking twice before writing IF
Tags: react, codequality
Published: 2021-09-27 13:19:26

Recently I come across a very healthy discussion with my manager about writing **IF condition** 

so whenever you are writing if condition as a developer we open a decision tree (for example yes and no) and when the codebase increases more branching of decisions paths are introduced in the code resulting in difficulty to read and debug the code.

To avoid we can use Composition where we are directly passing the render component to child components from the parent as shown in the above image. This way we are also using dumb components to avoid side effects in the children components.

PS. I know it is not worthy to replace every IF the condition from your codebase. I also don't do that. that is why the blog title is Thinking twice before writing if and still, you feel you cant work without if go on use **IF condition**
CWE-89
Tags: webapplicationsecuri, cybersecurity, applicationsecurity, softwaresecurity
Published: 2021-10-19 22:52:01

---
title: CWE-89
published: true
date: 2021-09-27 13:02:34 UTC
tags: webapplicationsecuri,cybersecurity,applicationsecurity,softwaresecurity
canonical_url: https://blog.shiftleft.io/cwe-89-d3b7f914ee79
---

#### CWE-89: Improper Neutralization of Special Elements used in an SQL Command (‘SQL Injection’)

![](https://cdn-images-1.medium.com/max/640/1*a3m4hYxc7U3STRG2XM51pA.png)

SQL injection occurs when an end-user leverages the client-side interface to provide input that is then used as part of a SQL command that the application executes.

### Why SQL injection vulnerabilities are problematic

With SQL injection attacks, an unauthorized user could:

- Read from the database
- Modify the database
- Execute administrative operations against the database (e.g., drop tables)
- Gain control of the operating system for the workstation on which the database is hosted

### How SQL injection vulnerabilities occur

SQL injections can occur if the application accepts user input and uses it to create a SQL command. Areas where users can supply input include form fields and search bars.

If the user-provided input isn’t escaped or sanitized, they may provide unexpected input that changes the application’s behavior. For example, if the application asks for the user’s name, but the user provides the following instead:

myName’ UNION SELECT \* FROM users —

Then the command that’s executed against the database is:

SELECT firstName FROM users WHERE user\_name = ‘myName’ UNION SELECT TOP 100 \* FROM users —

What results is that the user gains data instead of the application accepting the person’s name as expected.

### Mitigating SQL injection vulnerabilities

To reduce exposure to SQL Command injection vulnerabilities:

- Escape user-supplied input that will be used in a SQL statement
- Create an allowlist of acceptable input and check all user-supplied input against this list
- Use prepared statements with parameterized queries to handle data and ensure that a malicious party cannot change the intent of the SQL query
- Use stored procedures to parameterize input before they’re used in SQL queries automatically
- Create an account with limited privileges that the application uses to run SQL queries (e.g., this account does not need database administrator privileges)
- Use libraries or frameworks to implement functionality alongside protection against SQL injection attacks

### TL;DR

CWE-89 refers to SQL injection attacks, which occur when raw user input is used to create a SQL query, allowing a malicious party to change the query’s intent. SQL injections are easily found and commonly exploited.

* * *
Pure waterfall development model
Tags: programming, productivity
Published: 2021-09-27 12:42:58

In the waterfall model, a project progresses through an orderly sequence of steps from the initial software concept through system testing. The project holds a review at the end of each stage to determine whether it is ready to advance to the next phase. If not, it remains in the same phase.
![WhatsApp Image 2021-09-27 at 9.32.39 AM](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3oosvmrzhnibvjysillq.jpeg)
 


The pure waterfall model performs well for product cycles in which you have a stable product defination and when you are working with well understood technical methodologies. In such cases, the waterfall model helps you to find out errors in the early, low cost stages of the product. It provides the requirements stability that developers crave. If you are building a well defined maintenance release of an existing product or porting an existing product to a new platform, a waterfall lifecycle might be the right choice for rapid development

The pure waterfall model helps to minimize planning overhead because you can do all the planning up front. It doesn't provide tangible results in the form of software until the end of the lifecycle, but to someone who is familiar with it, the documentation it generates provides meaningful indications of progress throughout the lifecycle. The waterfall model works well for projects that are well defined, well understood and complex, because you can benifit from tackling complexity in an orderly way. It works well when quality requirements dominate cost and schedule requirements. Elimination of midstream changes eliminates a huge and common source of potential errors.

The waterfall model works especially well if you have a technically weak staff or an inexperienced staff, because it provides the project with a structure that helps to minimize wasted effort.

The disadvantages of the pure waterfall model arise from the difficulty of fully specifying requirements at the beginning of the project, before any design work has been done and before any code has been written.

**The major problem with the waterfall model is that it is not flexible. You have to fully specify the requirements at the beginning of the project.**


_Notes and images from [Rapid Development: Taming Wild Software Schedules by Steve McConnell](https://www.amazon.com/Rapid-Development-Taming-Software-Schedules/dp/1556159005)_
var, let, const: declaring variables in JavaScript
Tags: javascript, beginners
Published: 2021-09-27 12:28:52

In Javascript we can declare variables using **var**, **const** and **let** keywords


## var
var is the old way (pre es6/es2015) of declaring variables. It's a "weak" variable declaration because it doesn't help us understanding if binding could change durign execution.


## let
We use let to declare bindings that could chage during execution (eg. a loop counter, or a variable used in math).


## const
const stands for constant. We use const for bindings that will not change during execution.

Pay attention: this means that identifiers declared with const cannot be re-assigned, but in case of objects we can change its attributes after binding:
```
const str = "foobar"
str = "barfoo"
Uncaught TypeError: Assignment to constant variable.

const obj = { foo: 'foo', bar: 'bar' }
obj = { foo: 'foo2', bar: 'bar2' }
Uncaught TypeError: Assignment to constant variable.
obj.foo = 'foo3'
obj
{ foo: 'foo3', bar: 'bar' }
```


## Scoping
Variables declared with <strong>var</strong> are only function-scoped or globally-scoped.

On the other end, the scope of variables declared with **const** and **let** is the enclosing block (code between curly braces { } ) and not the whole function.

## Global object (window)
Variables declared outside functions (aka in the top level of program) with <strong>var</strong> become properties of the global object (window), while variables declared with **let** or **const** don't.
```
var foo = "foo";
let bar = "bar";
window.foo
"foo"
window.bar
undefined
```


## Conclusion
* I don't use **var** anymore
* I use **let** only when it's required that binding can change during execution (eg. loop variables)
* I use **const** almost for everything
Reducers: Confusing Yet Convenient
Tags: react, redux, javascript, rails
Published: 2021-09-27 12:22:21

When I was first introduced to Redux, Reducers were extremely difficult to wrap my head around. They seemed like an unnecessary source of headaches and confusion. I quickly learned how wrong I was.

See, Reducers are actually beautifully simple. At its core, a Reducer is a function that accepts the current ` state ` and an `action` as arguments, and returns a new `state` in result.

```
(state, action) => newState
```

An important note here is that Reducers must not mutate the initial or current state - they always produce a new state following an action.

A Reducer can therefore be the perfect way to help with any CRUD functionality you might need. Simply call one of the `case`s defined in your Reducer through a function defined in an `actions` file
VSCode-nGQL, nGQL extension for VSCode
Tags: opensource, database, devops, github
Published: 2021-09-27 12:12:27

nGQL extension VSCode is built to integrate the Nebula Graph with VSCode for an awesome developer experience.

**VS Code nGQL Syntax Highlight**
![alt text](https://cdn-images-1.medium.com/max/1600/0*qQi2u49FDZ9A_h7-.gif)

Download
Search ngql from the market or click [here](https://marketplace.visualstudio.com/items?itemName=wey-gu.vscode-ngql).

Features
Highlighting all Keywords, Functions of a given .ngql file
Release Notes
0.0.1
Initial release, only .ngql Syntax is supported.

0.0.2
Lower supported vscode version till ^1.50.1

Reference
https://docs.nebula-graph.io/
https://github.com/vesoft-inc/nebula-graph/blob/master/src/parser/scanner.lex
Today's Daily Humor For Devs - Daily Developer Jokes
Tags: jokes, dailydeveloperjokes
Published: 2021-09-27 12:00:15

---
title: "Today's Daily Humor For Devs - Daily Developer Jokes"
description: "Check out today's daily developer joke! (a project by Fred Adams at xtrp.io)"
series: "Daily Developer Jokes"
published: true
tags: #jokes, #dailydeveloperjokes
---

Hi there! Here's today's Daily Developer Joke. We hope you enjoy it; it's a good one.

![Joke Image](https://private.xtrp.io/projects/DailyDeveloperJokes/public_image_server/images/5e125997196ca.png)

---

For more jokes, and to submit your own joke to get featured, check out the [Daily Developer Jokes Website](https://dailydeveloperjokes.github.io/). We're also open sourced, so feel free to view [our GitHub Profile](https://github.com/dailydeveloperjokes).

### Leave this post a ❤️ if you liked today's joke, and stay tuned for tomorrow's joke too!

_This joke comes from [Dad-Jokes GitHub Repo by Wes Bos](https://github.com/wesbos/dad-jokes) (thank you!), whose owner has given me permission to use this joke with credit._

<!--
Joke text:
___Q___: Why are keyboards always working so hard?

___A___: Cause they have two shifts!
 -->
How to sort lists alphabetically in Python?
Tags: python, programming, beginners, tutorial
Published: 2021-09-27 11:58:46

In this short tutorial, we look at how to sort list alphabetically in Python. We look at the various methods and discuss their use cases.

This tutorial is a part of our initiative at [Flexiple](https://flexiple.com/), to write short curated tutorials around often used or interesting concepts.

### Table of Contents
- [How to sort lists alphabetically in Python?](#how-to-sort-lists-alphabetically-in-python)
- [Using the sort() method](#using-the-sort-method)
- [Using the sorted() method](#using-the-sorted-method)
- [Closing thoughts](#closing-thoughts)

## How to sort lists alphabetically in Python?
Lists are used to store a collection of items and quite often it may contain data in an unpredictable order. This could largely be due to the order they have been added by the user. Due to this, when it comes to user input data there is no way they can be ordered. Hence it is important to have a couple of methods that can be used to sort a list.

Lists can be sorted using two methods, the sort() and the sorted() method. The former permanently sorts the list whereas sorted() is used to sort the list temporarily.

Let us take a closer look at both the methods below.

## Using the sort() method:
As aforementioned, the sort() method can be used to sort a list alphabetically in Python. However, this method permanently changes the order of the items in the list. In practice use cases this might not be a problem, however, while dealing with real-world data there might be instances where the order of the list must be preserved.

### Code & Explanation:
```python
letters = ["e","f","g","h","c","a","b","d"]

letters.sort()
    
print(letters)
```
The above code snippet outputs the following value:
```python
['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h']
```

As you can see we have used sort() to sort the list in alphabetical order in Python. We then print the original list and the values have been changed permanently.

## Using the sorted() method:
In case you want to sort the list alphabetically in Python but want to preserve the original list, the sorted() method can be used. This method sorts and displays the list but does not change the original list.

### Code and Explanation:
```python
letters = ["e","f","g","h","c","a","b","d"]

print(sorted(letters))
print(letters)
```

As you can see in the above code snippet, we have first sorted and printed the list after which we have printed the original list and this is the output.
```python
['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h']
['e', 'f', 'g', 'h', 'c', 'a', 'b', 'd']
```
  
As you can see here, the list was sorted but the original list was not affected.

## Closing Thoughts:
We have covered two methods to sort a list and discussed their use cases. Although our examples use alphabets, they can be used to sort lists based on numbers as well.

As a next step, I would recommend trying to sort an alphabetical list containing items in various cases.
How to Deploy Vue PWA on Heroku
Published: 2021-09-27 11:44:43

To deploy a Vue Js Progressive Web Application (PWA) on Heroku is quite easy, but very different from how generic Vue Js applications are deployed on Heroku. 
Here's what I gathered when I recently deployed one:

* First, have your PWA ready locally.
* Install the Static CLI Plugin using:
`heroku plugins:install heroku-cli-static`
* Create an app on Heroku:
`heroku create`
Take note of the name assigned to your app.
* We need a buildpack to serve our static assets. To set it, run:
`heroku buildpacks:set https://github.com/hone/heroku-buildpack-static`
* Define your static configuration file:
```
{
  "root": "dist",
  "clean_urls": false,
  "routes": {
    "/**": "index.html"
  }
}
```
* Build your PWA locally using `npm run build`
* Deploy using `heroku static:deploy`
* Open deployed app using `heroku open`

**PS:** I was using this explanation [here](https://gist.github.com/hone/24b06869b4c1eca701f9), but the last steps did not work for me, so I devised this to help me out, and all has been fine this far! However, if you followed it and were successful, please let me know where I might have gone wrong.