teleren/devto huggingface dataset:
Features of Magento Development Company That Everyone Loves
Tags: webdev, magento, programming, magentodevelopmentcompany
Published: 2022-07-18 07:23:11

The phenomenal growth of technologies and innovations in IT has brought a big change by bringing the entire shopping complex to the screens of laptops or even 4-inch screens of mobile devices. We at Webkul have been proven to be the best Magneto Design company to provide you with the best eCommerce Magento website development services for your clientele. Our designers' and developers' corporate knowledge and good technical skills make us one of the most updated and forward Magento development companies.


![Features of Magento Development Company That Everyone Loves](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/926tr1u1wmv7p3rheyu6.png)

### Magento Development Services That We Offer:

* **Magento Website Development:**
You can get a great eCommerce website and reputed Magento website development services if the webkul provider can give you that.

* **Responsive Magneto Website:**
To help you better serve your mobile users, we provide a responsive Magento development service and you will never lose your mobile users.

* **Magneto Module Development:**
To differentiate yourself from your competitors and build custom Magento 2 module development for your Magento online storefront, you can use our Magento module development.

* **Magento Theme Development:**
We can help you create great themes that will brighten up your business image and purpose and you will be able to customize your eCommerce website as well as custom Magento theme development.

* **Support and Maintenance:**
The best support and maintenance from the experts of webkul will make you believe in us more.

* **Custom eCommerce Solutions:**
All your needs will be intelligently considered by a competent engineer to create a custom eCommerce solution for your business.


### How Do We Act as the Best Magento Development Company?

By providing easy navigation and the availability of easy payment gateways, we make it easy for your customers to find their desired products online.

* The connection of social media portals will provide a great experience for your customers, this is the best design by our company.

* The experts here are specialized in all forms of Magento development services that meet the needs of its potential clients. The breadth of services has empowered us to keep an eye on and reach new avenues.

* The Magento developers at Webkul have years of expertise in the field of Magento website development and guarantee on-time delivery and paramount satisfaction.

### **Conclusion:**
Are you looking for a company that can provide the best Magento ecommerce development services? Then you have to connect with the expert Magento developers of Webkul, the top [Magento development company](https://webkul.com/magento-development/). Our top-notch developers leverage powerful Magento tools and their extensions to build optimized eCommerce stores and make sure to stack them with attractive features to boost conversion rates and generate more ROI.
JavaScript concepts to remember
Tags: javascript, programming, browser
Published: 2022-07-18 07:22:26

---
title: JavaScript concepts to remember
description: Learn useful javascript fundamentals that apply regularly when we write code 
published: true
cover_image: https://images.unsplash.com/photo-1456394555490-ef1bf0aedc46?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=870&q=80
---

This article is just a piece of my notepad that outlines some JavaScript concepts I don't necessarily forget but still have to check on just to be sure 😅. One reason for this post is because I am more likely to reach out for my device (and check the internet) than a physical notepad or even a note app and another reason is the ease of sharing with you.

## JavaScript Concepts
### 1. Memory Heap
An unstructured region of memory where global variables and objects are stored.
### 2. Event loop
This pulls functions out of the event or callback queue and places it in the call stack when it becomes empty.
### 3. Call Stack
This represents the single thread provided for JavaScript code execution and keeps track of the operations to be executed. Whenever a function is finished, it is popped from the stack. The stack operates in a LIFO queue where the last function call in a function gets executed first.
### 4. Event queue
This holds mostly async functions processed by the web APIs so that when they are ready to run, the event loop can pull from it and add to the callstack.

### 5. Closures
This occurs when a function is being declared and returned in another function and this is done so that the inner function can have access to the scope of the outer function even after the outer function has been executed.
### 6. Hoisting
This is the process where the JavaScript interpreter moves declaration of functions, variables or classes to the top o their scope prior to code execution
### 7. Lexical Scope
This is the region in which a block of code has access to the variables defined in that scope.
### 8. Promise
A promise is an object representing the eventual completion or failure of an asynchronous operation. It is a special JavaScript object that initially has a **pending state** with an *undefined* value which when resolved, becomes a **fulfilled state** with a *value* as the result or becomes a **rejected state** with an *error* as the result.
The promise object has methods like `then`, `catch` and `finally`.
### 9. Async/Await
These keywords make handling asynchronous code more readable. The `async` keyword makes a function return a promise while the `await` keyword suspends further JavaScript code execution until the promise resolves.
How to create a project template for visual studio
Tags: tutorial, template, productivity
Published: 2022-07-18 06:54:05

There is a (often) overlooked feature available in visual studio which lets you quickly create new projects from a template. I often create small console applications with some basic functionality and sometimes it's tedious to go over some basic steps over and over.

Some axamples that you could create a template for:
1. A console application with basic features such as a HttpClient or appsettings.json file.
2. A default headless-CMS with entity-framework
3. A more advanced default Angular application served with a .Net API



# How to create a template #
1. Create a new project
2. Modify the project
3. Export as a template
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9abage4ayo88br2pgje4.png)
4. Select 'Project Template' and press Next. Now enter a name and a description. I really suggest using an icon which represents what you have build. I will use a CMD icon I found on the internet.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/riunazjf2vgewsfp1ofi.png)

5. Click finish

# What did it create? #
It's important to know what exactly was created by visual studio, so let's take a look at this exported zip file. First of all, the project is located in: 
```
%USERPROFILE%\Documents\Visual Studio 2022\Templates\ProjectTemplates
```
You will find the newly created .zip file here


> For completionists sake, the default visualstudio templates are located in:
```
C:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\IDE\ProjectTemplates\CSharp
```

# The generated template #
Let's quickly dive into that .zip file shall we? One thing you can notice is the created `.vstemplate` file. It contains the summary and definition of the template you entered. If you have want to change the name/description/icon of the template you can do so here.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/svcq34r4nhvhyebfv2jr.png)
* Also note the `TemplateContent` fields. This contains a list with all items in your template. The `ReplaceParameters` tell the template that these files contain variable which need to be changed upon creating a new project.

Let's look at one of the `.cs` files, the `startup.cs`:
![bmp icon cmd](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5w7r1v5chv2kuo23gvad.png)

First thing you will notice is obviously the namespace: `namespace $safeprojectname$ `. This is a variable that the template will replace when you create a new project based off of this template.



# How to use the template #
Open a new Visual Studio window and simply click on `File > New > Project..`. Your new template should be at the top!

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

Select it and use it like you would use any of the microsoft default Projects!

Enjoy this time saving trick!

You can find the template code here: https://github.com/dotnetrule/Console-QuickStart

src: https://docs.microsoft.com/en-us/visualstudio/ide/how-to-create-project-templates?view=vs-2022
Some valuable lessons as a Developer
Tags: javascript, webdev, career, php
Published: 2022-07-18 06:42:29

I am in to development field, from quite few years and here are something I learned with my experience as developer.

- **Code should be written for humans**
Code is read way more often than is is written. Maintaining code is important. Reading code is a solid foundation to enable exactly this.
> Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live. - John Woods

- **Patience is your bestfriend**
Good things take time. Don't overstress yourself by trying to rush things or by even losing your temper.
Some things only work on the fifth try, and as long as they work in the end, it's fine.
If nothing works, better take a break or even call it a day.

- **Consistency is key**
Learning is best performed by doing certain things over and over again.
Putting in 20 hours once has far less benefits than putting in 30minutes each; for months.
By repeatedly applying your knowledge , you become better and better.

- **You will never know everything**
Technology as a domain is too broad. There are more topics and especially nuances than you could ever learn in life-time
It's fine to be specialist in a few things and refer to others for help with technologies you know less about.
You will still learn a few more new things when you really need them.

- **Frequent breaks are highly important**
Our brains only have a certain capacity. Development is a thought work - after a while, performance beings to degrade.
As soon as you realize your performance begins to degrade, take a break. Sometimes, even a 5minute break can already recharge your batteries.

- **Networking is important**
Knowing the right people at the right time can mean getting your dream job, an incredible opportunity, or many more things.
All it takes is talking to people, making new friends, and sharing experiences and knowledge.

- **There is always someone better you can learn from**
No matter how good you are, there is always someone better than you.
Use this as an opportunity to learn. You can share your experience, and you can learn from the experience of others.
There is no better way to save yourself from going through multiple failures.


Found this post useful? Share it with your friends and save it for later. Follow me @[Shshank](https://www.instagram.com/bhavshashank/)

Thank You
My journey with AWS
Tags: ec2, performancetesting, loadtesting, vm
Published: 2022-07-18 06:38:40

Just a quick intro to myself - I belong to Performance Testing and Engineering fraternity. My journey with AWS goes back to a decade wherein we've tried to develop a reporting framework for Open-source load testing tool Apache JMeter.  So the commercial tools were in the peak during that time and were quite dominating. However the potential and capabilities of open-source tools like JMeter were tremendous and who-ever realized early-on would be quite successful. One such example was BlazeMeter - which was recently acquired by Perforce.

So we were extensively using JMeter for many of the web-applications Performance Testing. However JMeter was not on par with the leading commercial tools (especially with respect to its Reporting capabilities). Hence there was a need for a better reporting framework. However there were couple of challenges. Most of our clientele were Global clients with different geographical presence. Hence instead of thick-client exe products, we've had thought of having a global portal which would address the need. Going a step ahead, we've built a portal which caters to all the phases of the PTLC (Performance Testing Life Cycle).

So essentially we've had built a portal which addresses the following needs:

1. **Requirements Gathering** - The client fills the Performance Testing questionnaire which helps in understanding and deciding the total number of users against which the application has to be tested. 
2. **Test Scripting** - Test Scripting could be offline - using the raw JMeter or tools like BlazeMeter.
3. **Test Executions** - This component is the core of the product (wherein based on the virtual user load gathered in the Requirements Gathering phase) - the required number of AWS EC2 VM's would be initiated. This module has inherent intelligence to calculate the EC2 VM configuration (based on the assigned Vuser Load).
4. **Test Reporting** - Leveraging multiple time-series database tools like InfluxDB and Grafana the portal displays all the live reporting metrics dashboards.

Thus began my open source journey along with AWS cloud.
1575. Leetcode Solution in cpp
Tags: cpp
Published: 2022-07-18 06:25:40

```
class Solution {
    long dp[101][201] = {}, mod = 1e9+7, finish;
    int dist(vector<int> &A, int a, int b) {
        return abs(A[a] - A[b]);
    }
    int dfs(vector<int> &A, int start, int fuel) {
        if (dp[start][fuel]) return dp[start][fuel];
        long ans = 0;
        if (start == finish) ans++;
        for (int i = 0; i < A.size(); ++i) {
            if (i == start || dist(A, start, i) + dist(A, i, finish) > fuel) continue;
            ans = (ans + dfs(A, i, fuel - dist(A, i, start))) % mod;
        }
        return dp[start][fuel] = ans;
    }
public:
    int countRoutes(vector<int>& A, int start, int finish, int fuel) {
        this->finish = finish;
        return dfs(A, start, fuel);
    }
};
```
#leetcode
#challenge
Here is the link for the problem:
https://leetcode.com/problems/count-all-possible-routes/
1071. Leetcode Solution in Java
Tags: java
Published: 2022-07-18 06:24:06

```
class Solution {
  public String gcdOfStrings(String str1, String str2) {
    if (str1.length() < str2.length())
      return gcdOfStrings(str2, str1);
    if (!str1.startsWith(str2))
      return "";
    if (str2.isEmpty())
      return str1;
    return gcdOfStrings(str2, mod(str1, str2));
  }

  private String mod(String s1, final String s2) {
    while (s1.startsWith(s2))
      s1 = s1.substring(s2.length());
    return s1;
  }
}

```
#leetcode
#challenge
Here is the link for the problem:
https://leetcode.com/problems/greatest-common-divisor-of-strings/
1117. Leetcode Solution in Java
Tags: java
Published: 2022-07-18 06:22:53

```
import java.util.concurrent.Semaphore;

class H2O {
    
    private Semaphore hSemaphore = new Semaphore(0);
    private Semaphore oSemaphore = new Semaphore(1);
    
    private int count;
    
    public H2O() {}

    public void hydrogen(Runnable releaseHydrogen) throws InterruptedException {
        hSemaphore.acquire();
        // releaseHydrogen.run() outputs "H". Do not change or remove this line.
        releaseHydrogen.run();
        count++;
        if ((count & 1) == 0) {
            oSemaphore.release();
        }

    }

    public void oxygen(Runnable releaseOxygen) throws InterruptedException {
        oSemaphore.acquire();
        releaseOxygen.run();
        
        hSemaphore.release();
        hSemaphore.release();
    }
}
```

#leetcode
#challenge
Here is the link for the problem:
https://leetcode.com/problems/building-h2o/
1493. Leetcode Solution in Cpp
Tags: cpp
Published: 2022-07-18 06:21:12

```
class Solution {
public:
    int longestSubarray(vector<int>& A) {
        int N = A.size(), prev2 = -1, prev = -1, ans = 0;
        for (int i = 0; i <= N; ++i) {
            if (i < N && A[i] == 1) continue;
            if (i == N && prev == -1) return N - 1;
            if (prev != -1) ans = max(ans, i - prev2 - 2);
            prev2 = prev;
            prev = i;
        }
        return ans;
    }
};
```
#leetcode
#challenge
Here is the link for the problem:
https://leetcode.com/problems/longest-subarray-of-1s-after-deleting-one-element/
1388. Leetcode Solution in Cpp
Tags: cpp
Published: 2022-07-18 06:20:09

```
class Solution {
public:
    int maxSizeSlices(vector<int>& slices, int l, int r){
        //l and r are inclusive
        int N = slices.size();
        int k = N/3; //we can take k pieces
        vector<vector<int>> dp(N, vector<int>(k, 0));
        
        for(int i = l; i <= r; i++){
            for(int j = 0; j < k; j++){
                /*
                1. don't take current piece
                2. take current piece, plus the value when we take (j-1)th piece of cake at position (i-2)
                */
                dp[i][j] = max((i-1 >= 0 ? dp[i-1][j] : 0), 
                    (((i-2 >= 0) && (j-1 >= 0)) ? dp[i-2][j-1] : 0) + slices[i]);
            }
        }
        
        return dp[r][k-1];
    };
    
    int maxSizeSlices(vector<int>& slices) {
        int N = slices.size();
        return max(maxSizeSlices(slices, 0, N-2),
                   maxSizeSlices(slices, 1, N-1));
    }
};
```
#leetcode
#challenge
Here is the link for the problem:
https://leetcode.com/problems/pizza-with-3n-slices/
Are PoW & PoS actually a Blockchain Consensus?
Tags: tutorial, programming, blockchain, web3
Published: 2022-07-18 06:18:11

Some words on the blockchain Consensus from an upcoming small book on Ethereum. If you have suggestions for any topics, please DM or comment.

## PoW & PoS

I've seen people talk about PoW & PoS are blockchain consensus algorithms, but aren't they Sybil Resistance mechanisms.

PoW & PoS are Sybil Resistance mechanisms that prevent from such attacks. Where as the consensus is an algorithm that is computed or mined.

## Consensus
We know there are thousands of nodes running on a blockchain, and every node could be engaged in some different computation. In order to reach a particular state of the blockchain, a mechanism is used called the consensus.

_Consensus algorithm used by Bitcoin is Nakamoto Consensus and EthHash in the case of Ethereum._

It is during the computation where nodes reach this consensus or agree on some single value or single state of the blockchain in a distributed process.

In public blockchains, this means that once the computation is completed all the other nodes will validate it, and once 51% of the nodes approve that particular computation, the computation is considered to be completed.

As we know in blockchain, data or transactions are stored in blocks but before storage they are computed by the nodes and the node that completes that computational (mathematical) problem first is said to be the author of that block. 

Now since people can create multiple addresses to run these nodes and get an advantage over other users or even try to manipulate the blockchain, as majority rules in blockchain, we have some algorithms/mechanisms called **Sybil resistance** algorithms/mechanisms, which are used and implemented in order to avoid these spamming. These mechanisms are helpful against Sybil attacks. 

The most popular Sybil Resistance mechanisms are:
1. Proof-of-Work (PoW).
2. Proof-of-Stake (Pos).

Sybil attack is when a single person creates multiple nodes or tries to flood the network with different identities to get an advantage over other nodes or use them to gain disproportionately larger influence on the blockchain.
AWS Developer Associate Certification Preparation
Tags: aws, cloud, cloudskills, devops
Published: 2022-07-18 06:18:00

**Short description:**

- Earners of this certification have a **comprehensive understanding of application life-cycle management**.
- They've demonstrated proficiency in writing applications with **AWS Service APIs, AWS CLI and SDKs, using containers and deploying with CI/CD pipeline**.
- Badge owners are able to **develop, deploy and debug cloud-based applications** that follow AWS best practices.

The exam validates two things

1. Understanding of core AWS services and uses.
2. Basic AWS architecture best practices.

Need to have a solid understanding of how to deploy, monitor and update code in the AWS cloud. 

Exam Logistics
- **65 questions**
- **130 minutes** to complete

Exam Contents based on Exam guide:

| **Domain** | **Percentage**|
| --------- |:---------:|
| Deployment | 22% |
| Security | 26% |
| Development with AWS Services | 30% |
| Refactoring | 10% |
| Monitoring and Troubleshooting | 12% |
| **Total** | **100%** |

To pass AWS Developer Associate certification need to score above **720** out of 1000.

Document is about:
 
1. **Understanding distributed systems**.
2. Using available features **to avoid wasting time and energy**.
3. Being **cost-effective, scalable, elastic and secure**.

Services need to know for Developer Associate Certification

- [**_AWS IAM_**](https://dev.to/sathish3sank/aws-iam-43hi)
- [**_AWS EC2_**](https://dev.to/sathish3sank/aws-ec2-513k)
- [**_AWS Lambda_**](https://dev.to/sathish3sank/aws-lambda-3cgf)
- [**_AWS EBS_**](https://dev.to/sathish3sank/aws-ebs-4n8o)
1528. Leetcode Solution in Cpp
Tags: cpp
Published: 2022-07-18 06:17:58

```
class Solution {
 public:
  string restoreString(string s, vector<int>& indices) {
    string ans(s.length(), '.');

    for (int i = 0; i < indices.size(); ++i)
      ans[indices[i]] = s[i];

    return ans;
  }
};

```
#leetcode
#challenge
Here is the link for the problem:
https://leetcode.com/problems/shuffle-string/
1537. Leetcode Solution in Cpp
Tags: cpp
Published: 2022-07-18 06:17:00

```
class Solution {
 public:
  int maxSum(vector<int>& nums1, vector<int>& nums2) {
    constexpr int kMod = 1e9 + 7;

    // keep running sum of nums1 and nums2 before next rendezvous
    // because nums1 and nums2 are increasing, move forward on the smaller one
    // to ensure we don't miss any rendezvous
    // when meet rendezvous, choose the better path
    long ans = 0;
    long sum1 = 0;  // sum of nums1 in (prev rendezvous, next rendezvous)
    long sum2 = 0;  // sum of nums2 in (prev rendezvous, next rendezvous)
    int i = 0;      // nums1's index
    int j = 0;      // nums2's index

    while (i < nums1.size() && j < nums2.size())
      if (nums1[i] < nums2[j]) {
        sum1 += nums1[i++];
      } else if (nums1[i] > nums2[j]) {
        sum2 += nums2[j++];
      } else {  // rendezvous
        ans += max(sum1, sum2) + nums1[i];
        sum1 = 0;
        sum2 = 0;
        ++i;
        ++j;
      }

    while (i < nums1.size())
      sum1 += nums1[i++];

    while (j < nums2.size())
      sum2 += nums2[j++];

    return (ans + max(sum1, sum2)) % kMod;
  }
};

```
#leetcode
#challenge
Here is the link for the problem:
https://leetcode.com/problems/get-the-maximum-score
938. Leetcode Solution in Python3
Tags: python
Published: 2022-07-18 06:15:18

```
class Solution:
    def rangeSumBST(self, root: Optional[TreeNode], low: int, high: int) -> int:
        # if low <= root val <= high, add to res
        if not root:
            return 0
        if low <= root.val <= high:
            return root.val + self.rangeSumBST(root.left, low, high) + self.rangeSumBST(root.right, low, high)
        elif root.val > high:
            return self.rangeSumBST(root.left, low, high)
        elif root.val < low:
            return self.rangeSumBST(root.right, low, high)
```
#leetcode
#challenge
Here is the link for the problem:
https://leetcode.com/problems/range-sum-of-bst/