teleren/devto huggingface dataset:
Experience transitioning from React Native to Flutter
Tags: flutter, dart, reactnative
Published: 2022-07-07 05:21:08

Transitioning from React Native to Flutter for Cross Platform Mobile Development can be a little tough owing to the fact that you've accustomed all your energy to learning React Native to a level that can yield you high walls of confidence but don't be afraid you are not alone.

>There must be a reason and that reason is what everything

Flutter is really very easy to move into. There's absolutely no hidden behind the gates just Widgets; Stateless and Stateful Widgets and the Docs are really cool to read. I transitioned from React Native to Flutter a year ago and although I saw React Native intriguing a year ago due to my awesome knowledge on React but I left it all for Flutter even though I had to learn a completely new knowledge which is Dart. I wasn't compelled much because of the new knowledge to be learnt. I made countless research on Dart and figured out that it is easy to delve into if you've ever worked with Javascript, C++, Java or.... I felt at home due to Javascript which was there. Building Apps with Flutter has been amazing and I know the fear of learning a new language to build awesome ideas with Flutter wasn't a barrier I explored. 
React Native is cool and this writing is not a medium to kill the awesome infrastructure it is built with. React Native is cool but I think Flutter is more cool 👀😲
   Flutter documentation is awesome and easy to understand without falls. You can always explore new options because Flutter is insanely amazing ✨....

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

  
ALL APPS I'VE BUILT USING FLUTTER 
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jfd5v9bzfowilw8e8og1.jpg)

A Shopping App developed using Flutter and Dart making use of Provider, Carousel Library, Google FireStore. It's featuring standard modern shopping app UI
Source Code: https://github.com/Atuoha/shoppie
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g0lipbswgza80qamacvy.jpg)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ef0kmis081sw86ok5qda.jpg)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cup55b6s9g8h3m2tgiid.jpg)
How does BLST work
Tags: blst, businesslogic, logicattack, api
Published: 2022-06-23 00:47:11

## Process of BLST

Business logic attacks provide more information, higher impact, and perfect working comfort. Each logic attack is unique since it has to exploit a function or feature that is specific to each application.

PFB an example of a logic attack.

If you purchase 10 units of the same item, the online store will give you a big discount.

1. The discount is applied when an attacker adds 10 items to the cart.
2. The attacker took 9 items from the cart.
3. The attacker gets the discount because the system hasn't checked if there are still enough items in the cart.

Many developers forget to implement `sanity-checks` like these in many places because this example is easy to enforce. There are more `complicated logic attacks`out there.

`Logic attacks` are very common and are unique to each application and feature. The properties make it hard to find using automated tools.

## How different is BLST ?

BLST helps service providers adjust their operations and react quickly to changing demand with its **application-centered algorithms**.

In terms of learning the traffic, this algorithm is unique. Their **Artificial Penetration Tester** product is able to work with any kind of web application because it learns the results after simulating attacks on the application.

A number of methodology products are combined into one to save time and effort.

## How Business Logic is protected by BLST ?.

BLST provides a solution that helps the App Sec and DevOps teams understand the business logic attack flows and allows them to work more efficiently and ship better and more secure code faster. BLST uses an `artificial intelligence model` that learns the usage of users in the system and begins to simulations of business logic attack flows before the system hits production.

**Attacker**

Early in the integration phase, Attacker mimics business logic attack flows. It can help you find business logic attack flows that could lead to the exposure of sensitive data.

**Decider**

The BLST Decider can detect a wide range of threats. The Decider can differentiate between `normal and abnormal behavior` in the system and give you the ability to observe each abnormal case that has happened.

**Runtime Validation**

BLST compares the logs from the runtime to the OpenAPI specification to see if there are differences between the specification and what's running in production. A clear image for every use case suggests an easy path to quick remediation.

Gratitude for perusing my article till end. I hope you realized something unique today. If you enjoyed this article then please share to your buddies and if you have suggestions or thoughts to share with me then please write in the comment box.


Above blog is submitted as part of 'Devtron Blogathon 2022' - https://devtron.ai/
Check out Devtron's GitHub repo - https://github.com/devtron-labs/devtron/ and give a ⭐ to show your love & support.
Follow Devtron on LinkedIn - https://www.linkedin.com/company/devtron-labs/ and Twitter - https://twitter.com/DevtronL/, to keep yourself updated on this Open Source project.
844. Leetcode Solution in CPP
Tags: cpp
Published: 2022-07-07 05:00:50

```
class Solution {
 public:
  bool backspaceCompare(string S, string T) {
    return backspace(S) == backspace(T);
  }

 private:
  string backspace(const string& s) {
    string stack;

    for (const char c : s)
      if (c != '#')
        stack.push_back(c);
      else if (!stack.empty())
        stack.pop_back();

    return stack;
  }
};


```

#leetcode
#challenge
here is the link for the problem:
https://leetcode.com/problems/backspace-string-compare/
Oh my posh on all windows terminals (vs code integrated terminal too!!)
Tags: windows, powershell, vscode
Published: 2022-07-07 05:00:34

---
title: Oh my posh on all windows terminals (vs code integrated terminal too!!)
published: true
description: set up oh my posh on all windows terminals, including the vs code integrated terminal
tags: windows,powershell,vscode
# cover_image: https://direct_url_to_image.jpg
# Use a ratio of 100:42 for best results.
---
![vs code integrated terminal with oh my posh](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/im0wkykzvia9eqzooiwl.png)
## First install the 'oh my posh' on your windows machine, by either visiting [this](https://ohmyposh.dev/docs/installation/windows) or use the below command.
```
winget install JanDeDobbeleer.OhMyPosh -s winget
```

## Install fonts
- go to https://github.com/ryanoasis/nerd-fonts/releases
- search for 'Meslo.zip' and download it
- unzip it and select all, right click and install all

> NOTE - you can try any font but 'Meslo' worked well for '1_shell' theme

## Install the theme - [[official documentation](https://ohmyposh.dev/docs/installation/customize)]
- for example I'll use '1_shell' theme
- open the terminal and run the following command
```
oh-my-posh init pwsh --config ~/.1_shell.omp.json | Invoke-Expression
```
- restart the terminal

## Create a profile for your terminal [[official documentation](https://ohmyposh.dev/docs/installation/prompt)]
- open the terminal
- create a new profile by running the following command 
```
notepad $PROFILE'
or
New-Item -Path $PROFILE -Type File -Force
```
* this will create a file, so add the below line to it, and save it
```
oh-my-posh init pwsh | Invoke-Expression
```

## Modify the settings.json of the terminal
- open the terminal as an admin user
- press CTRL + SHIFT + ,
- this will open or prompt to select your favorite editor for the 'settings.json'
```
"profiles": 
    {
        "defaults": {
            "font":
            {
                "face": "MesloLGM NF"
            }
        }
    ...
```
- save it

## Modify the settings of VS code integrated terminal
- go to File -> Preferences -> Settings 
- search for @feature:terminal font
- add the font 'MesloLGM NF'
- save it (CTRL + S)

That's it, now you are a 10X developer :stuck_out_tongue_closed_eyes:
Get started on Flutter
Tags: flutter, dart
Published: 2022-07-07 04:56:10

Flutter and Dart is a very nice and wonderful technology to use for mobile app development when compared amongst other technologies which seem wonderful too but many things are very unique about it. Being a Flutter Developer from React Native as taught me valuable reasons I’ve embraced the lines of Flutter to other technologies and it’s being worth it since then.

How To Get Started

To start your journey into Flutter and Dart and you’ll need the following

Your Mindset to learn
Little knowledge about the basics of Dart Programming Language
The list is short right…? Yeah! That’s pretty all you need to get started. Flutter and Dart unlike other technologies for Cross Platform Mobile App Development has a very easy-to-read-and-understand syntax which makes the programmer able to sketch Apps using few pieces of Code.

Flutter can be learnt using many means

Flutter Official Documentation https://docs.flutter.dev/ and https://dart.dev/guides
Online Learning Platform like Udemy, Coursera, LinkedInLearning
Youtube
Blogs and Podcast
Communities

You can kickstart with the smallest projects


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

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ed0kcofoi8qbba639djr.png)
 
Source code https://github.com/Atuoha/flutter_quiz
97. Leetcode Solution in CPP
Tags: cpp
Published: 2022-07-07 04:54:13

```
class Solution {
 public:
  bool isInterleave(string s1, string s2, string s3) {
    const int m = s1.length();
    const int n = s2.length();
    if (m + n != s3.length())
      return false;

    // dp[i][j] := true if s3[0..i + j) is formed by the interleaving of
    //             s1[0..i) and s2[0..j)
    vector<vector<bool>> dp(m + 1, vector<bool>(n + 1));
    dp[0][0] = true;

    for (int i = 1; i <= m; ++i)
      dp[i][0] = dp[i - 1][0] && s1[i - 1] == s3[i - 1];

    for (int j = 1; j <= n; ++j)
      dp[0][j] = dp[0][j - 1] && s2[j - 1] == s3[j - 1];

    for (int i = 1; i <= m; ++i)
      for (int j = 1; j <= n; ++j)
        dp[i][j] = dp[i - 1][j] && s1[i - 1] == s3[i + j - 1] ||
                   dp[i][j - 1] && s2[j - 1] == s3[i + j - 1];

    return dp[m][n];
  }
};

```

#leetcode
#challenge
here is the link for the problem:
https://leetcode.com/problems/interleaving-string/
How to set up Ant tool for Salesforce deployment ?
Tags: java, salesforce, devops, webdev
Published: 2022-07-07 04:54:00

Here is  the process to set up Ant tool for Salesforce deployment.
Steps:
**1) Install JDK**
https://www.oracle.com/java/technologies/downloads/#java16

Location where JDK to be installed:
C:\Program Files\Java

Setting up environment variable
Variable = JAVA_HOME
Value = C:\Program Files\Java\jdk-16.0.1\bin

**2) Set up ant tool**
http://ant.apache.org/bindownload.cgi

Variable = ANT_HOME
Value = C:\ANT_HOME\apache-ant-1.10.10

**3) Need salesforce jar file and sample folder**

https://developer.salesforce.com/docs/atlas.en-us.daas.meta/daas/forcemigrationtool_install.htm

Download the .zip file of the Spring '21 Ant Migration Tool

Sample folder + salesforce ant jar
Copy the sample folder to location
C:\ANT_HOME\apache-ant-1.10.10

Salesforce jar file
C:\ANT_HOME\apache-ant-1.10.10\lib

**4) Create new Windows path variable**

%ANT_HOME%\bin
Vue Js Binding text and HTML
Tags: webdev, vue, programming, discuss
Published: 2022-07-07 04:46:03

Vue uses an HTML-based template syntax that allows you to declarative bind the rendered DOM to the underlying component instance's data.

## Text Interpolation

The most basic form of data binding is text interpolation using the "mustache" syntax (double brackets):

```
<span>Message: {{ msg }}</span>
```

## Raw HTML

Double mustache interpret data as plain text, not HTML. To display native HTML, you need to use the v-html directive:

```
<p>Using text interpolation: {{ rawHtml }}</p>
<p>Using v-html directive: <span v-html="rawHtml"></span></p>
```

## Attribute Bindings

Mustache cannot be used in HTML attributes. Use the v-bind directive instead:

```
<div v-bind:id="dynamicId"></div>
```

- **Shorthand**

Because v-bind is so commonly used, it has a dedicated shorthand syntax:

```
<div :id="dynamicId"></div>
```

- **Boolean Attributes**

Boolean attributes are attributes that can indicate true / false values by its presence on an element. 

For example, disabled is one of the most commonly used boolean attributes.

```
<button :disabled="isButtonDisabled">Button</button>
```

- **Dynamically Binding Multiple Attributes**

If you have a JavaScript object representing multiple attributes

```
data() {
  return {
    objectOfAttrs: {
      id: 'container',
      class: 'wrapper'
    }
  }
}
```

## Using JavaScript Expressions

So far we've only tied a simple property key in our template. But Vue actually supports the full power of JavaScript expressions across all data bindings:

```
{{ number + 1 }}

{{ ok ? 'YES' : 'NO' }}

{{ message.split('').reverse().join('') }}

<div :id="`list-${id}`"></div>

```

## Directives
Directives are special attributes that start with v-. Vue comes with a number of built-in directives, including v-html and v-bind, which we introduced above.

```
<p v-if="seen">Now you see me</p>
```

  

>  ## [Become a sponsor to PLBhoi](https://github.com/sponsors/priteshbhoi?o=esb)
👨‍💻 Best keyboard for programming in 2022 — Will change your mind. 👨‍💻
Tags: programming, productivity, webdev, beginners
Published: 2022-07-07 04:38:46

Some links may be affiliate links. This means if you click on the link and purchase an item we may receive a commission at no extra cost to you.

As developers we don’t need many tools to work, many would say that we just need a laptop or computer, and even though that’s true, there’s a difference between having the minimum required to work to have the tools that you need to work comfortably, productive and healthy.

Today we are going to discuss keyboards that you would love as a developer. The list I present is in no particular order, and I’m giving you my personal opinion on the keyboards and some facts.

What are the best keyboards for programming? The one that works best for you!

With that said, let’s jump right into the list.

## 8 Best keyboards for programming in 2022(updated)

### 1. SteelSeries HP Gaming Keyboard ###

  A gaming keypad is a small, auxiliary keyboard designed only for gaming. It this the priority of every gamer or programmer to buy it.

It has a limited number of the original keys from a standard keyboard, and they are arranged in a more ergonomic fashion to facilitate quick and efficient gaming key presses.
The commonly used keys for gaming on a computer are the 'W', 'A', 'S', 'D', and the keys close and adjacent to these keys.
This keyboard has 2 USB ports that connect two devices at a time.

This item is SteelSeries HP Omen X7Z97AA#ACJ Gaming Keyboard (Black). Zebronics Zeb-Transformer Gaming Keyboard and Mouse Combo (USB, Braided Cable). These are the best mechanical keyboard for coding in India.


### 2. Apple Magic Keyboard ###
### 3. HyperX Alloy FPS Pro Gaming Keyboard ###
### 4. Das Keyboard 4 ###
### 5. Kinesis Freestyle Edge ###
### 6. Microsoft Sculpt Keyboard ###
### 7. CORSAIR K70 Gaming Keyboard ###
### 8. Logitech MX Keys ###


[Click Here to get the details of all the keyboard](https://cmsinstallation.blogspot.com/2021/04/best-keyboards-for-programming-in-2021.html?utm_source=extension&utm_medium=click&utm_campaign=muzli)
A Simple C++ Odd or Even Checker
Tags: cpp, beginners, programming, tutorial
Published: 2022-07-07 04:37:03

Making a simple C++ Odd or Even Checker.

For more Source Codes visit [here](https://xcattx.com/cpp-odd-even/).

Create the basic c++ program format using header file iostream and namespace std.

```c
#include <iostream>
using namespace std;

int main() 
{
   return 0;
}
```
After this create a integer variable n, and output a message and let the user enter a number.

```c
   int n;
   cout<<"Enter number: ";
   cin>>n;
```
Now using if and else we will see whether the entered number is divisible by two, if it is then its a even number otherwise an odd number.

```c
   if(n%2==0)
     cout<<n<<" It is an Even Number";
   else
     cout<<n<<" It is an Odd Number";
```
You can now complete the program and run it in any compiler to check its working.

```c
#include <iostream>
using namespace std;

int main() 
{
   int n;
   cout<<"Enter number: ";
   cin>>n;
   if(n%2==0)
     cout <<n<< "\nIt is an Even Number";
   else
     cout <<n<< "\nIt is an Odd Number";
   return 0;
}
```
Exporting Angular Gantt Chart with Complete Customization
Tags: webdev, angular
Published: 2022-07-07 04:33:48

Learn how easily you can export a Syncfusion [Gantt Chart](https://www.syncfusion.com/angular-ui-components/angular-gantt-chart) to PDF and Excel in an Angular application. This video also explains how to customize file name, footer, theme, predecessor in the documents and export them. 

**Product overview**: https://www.syncfusion.com/angular-ui-components/angular-gantt-chart

**Download the example from GitHub**: https://github.com/SyncfusionExamples/exporting-angular-gantt-chart-with-complete-customization

**Check out online examples**: https://ej2.syncfusion.com/angular/demos/#/bootstrap5/gantt/exporting

{% youtube ZMrqS35sIII %}
Eager load for getting role name in spatie/permissions
Tags: webdev, backend, laravel, spatie
Published: 2022-07-07 04:25:20

at first im using this method to show role name in blade view

```
		<td>
		@if(!empty($user->getRoleNames()))
			@foreach($user->getRoleNames() as $role)
				<label class="badge bg-primary">{{ $role }}</label>
			@endforeach
		@endif
		</td>
```

but when i see in clockwork, there are many query from role, yes its a n+1 problem


so i use eager load for this

in **UserController** i added this
`$data = User::with(['roles']);`

so when i query User table, roles table will join it

and in blade view i added this

```
@if(!empty($user->roles))
			@foreach($user->roles as $role)
				<label class="badge bg-primary">{{ $role->name }}</label>
			@endforeach
		@endif
```

if you have another way, feel free to discuss
How Do You Decide It Is Time to Move On?
Tags: career
Published: 2022-07-06 19:39:54

It is not always easy to know when it is the right time to move on from your current role. For me it was honestly really hard.

The decision to start interviewing again happened kind of organically for me. I had a FAANG recruiter reach out to me out of the blue and I decided it wouldn't hurt to just interview in order to gain the experience. It wasn't until I was denied after the technical interview that I got bit by the curiosity bug. I started wondering what it may be like working for another company, on a different product, in a different industry. This is when I really started to contemplate whether it was time for me to move on.

I can honestly say that the decision to leave the company I worked for and dive into another job search was not an easy one for me for many reasons.

1. I genuinely liked my coworkers.
2. I had a *rough* initial job search when looking for my first role (feel free to checkout my many other posts about that job search).
3. Interviewing just makes me incredibly anxious and I honestly think it always will no matter the years of experience I have under my belt.

Despite all of these reasons, I decided it was time to start interviewing again because I sat down and asked myself the hard questions. Is there possibility for promotion at my current role? How likely, if so? Am I feeling fulfilled? Am I feeling challenged still? Do the company's values still align with my own? Is my manager helping me progress professionally? etc.

I ultimately listened to myself and my instincts and did what was best for me. 

**How do y'all decide it is time to move on from your current role and start interviewing again?**
Amazon EBS Storage Types
Tags: aws, ebs, blockstorage, storage
Published: 2022-07-07 03:46:00

**What is an EBS Volume?**
     An EBS (Elastic Block Store) is an easy to use, scalable and high-performance and low latency block storage service that provides persistent block level storage for Amazon EC2 instances.

When dealing with EBS Volumes, customers have the choice to pick and choose between several types of block storages to meet the needs of various types of workloads. 

   SSD Backed Volumes are best suited for transactional workload like enterprise applications, relational and NoSQL databases, virtual desktops or boot volumes 

  HDD Backed Volumes on the other hand are best for throughput intensive workloads such as Bigdata applications, log processing, data warehouse applications.


## SSD Based Volumes

**General Purpose SSD |gp3 and gp2 |** These are general purpose SSD volumes that balance price and performance for a wide variety of workloads and are recommended for most workloads.

 They provision capacity and performance for your application with a sustained baseline performance of 3,00 IOPS at any volume size.

 Thanks to their cost effectiveness, general purpose SSD allow customers to meet the IOPS requirement for most of their application such as MS SQL servers Virtual Desktops and any latency sensitive applications as well as 
dev/test environments.

 They are also optimized for transactional workloads involving frequent read/write operations with small I/O size, where the dominant performance attribute is IOPS.

- You can increase the size of the IOPS up to 16,000 and the throughput up to 1,000 MB independently 
- Baseline of 3,000 IOPS and a throughput of 125 MB/s
- Size of the volume and the IOPS are linked with a max IOPS of 16,000
- Small gp2 volumes that can burst up to 300 IOPS


![General Purpose SSD](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/poe2e8p4tjn9pdwm0odq.JPG)

**Provisioned IOPS SSD|** These are the highest performance SSD. They are suitable for mission critical or low latency high throughput workloads. 
 They Provides high performance for mission-critical, low-latency, or high-throughput workloads

- Size of the volume and the IOPS are linked with a max IOPS of 16,000
- Small gp2 volumes that can burst up to 300 IOPS
- Max IOPS of 64,000 for AWS Nitro EC2 instances and up to 32,000 for the other
- IOPS can be increase independently of the storage size 
- Io2 has offers more durability and IOPS per BG 


![provisioned ](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ieyjqayq9fa64z7xguiw.JPG)

## HDDD Based Volumes
 **Throughput Optimized HDD St1 & Cold HDD Sc1 |**HDD Backed Volumes on the other hand are best for throughput intensive workloads such as Bigdata applications, log processing, data warehouse applications.


![HDD](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1i6xx71zk11npt8bpwpx.JPG)
Leetcode: Best Time to Buy and Sell Stock II in JavaScript
Tags: javascript, tutorial, algorithms, beginners
Published: 2022-07-07 03:31:43

You are given an integer array prices where prices[i] is the price of a given stock on the ith day.

On each day, you may decide to buy and/or sell the stock. You can only hold at most one share of the stock at any time. However, you can buy it then immediately sell it on the same day.

Find and return the maximum profit you can achieve.

```js
var maxProfit = function(prices) {
    const profit = prices.reduce((acc, curr, index) => {
        const next = prices[index+1]
        
        // if there isn't a next price you're already on the last day, so return the current profit
        if(!next) {
            return acc
        }
        
        // if the stock is higher on the next day it means you'll have a profit
        if(next > curr) {
            acc += next - curr
        }
        
        return acc
    }, 0)
    
    return profit
};
```