teleren/devto huggingface dataset:
Cyber Security – “Are we Secure”
Published: 2022-07-08 13:37:01

CyberSecurity – “Are we Secure”

Imagine as Cyber Security Manager your CEO ask you, “are we Secure?”.  What should be your answer, and do you have effective measurement criteria to justify your response.

Most of Cyber Security Manager deploy Advance Security Solutions and Security Processes for implementing Cyber Security across the organization, but they fail to effective measure the actual implementation of these Solutions and Processes (i.e. are the Solutions and Processes working as expected). Measuring what you are implementing is the key to understand how Mature your organization is as per your Cyber Strategy and Objectives
Some of the Important Indicator which can be used to measure the maturity of your Cyber Security Program which can help you with your Audit, Compliance and to give a positive response to management that Cyber Security is under control and “YES” we are secure with current threat.

Some of The Important KPI to be used by Cyber Security Managers
GRC – KPI
1.    % Compliance with applicable regulations and Standards ( PCI-DSS, ISO 27001, QCSF, NIA, NIST)
2.    No of regulatory reporting within agreed SLA & no of SLA Missed
3.    Open Internal / External Audit Issues > then 90 Days
4.    No of Open High/Medium Open Risk without Compensating Control (Risk and not vulnerabilities to be reported to business Leaders)
5.    % of Staff Completed Security Awareness, % of Staff Passed Quiz, % of Staff Phished
6.    Projects which Exceeds Budget / Timelines - 10% (Budgets can exceed max 10% of planned budget and 10% of Planned Schedule)
7.    % of Successful and Unsuccessful changes, no of unapproved Changes
8.    % of Systems under contentious vendor Support and Systems without Support
Security Monitoring and Incident Response KPI
1.      No of Incidents Reported for the Month
2.      % of Incidents closed within SLA and Missed SLA
3.      % of Incidents caused actual breach/compromise
4.      No of Threat Hunting performed for the Quarter
5.      No of successful Incident Response Drill/Tabletop for the Quarter
Security Assurance KPIs
1.      % Systems complaint with Critical/High/Medium patches, % system with missing Patches (Patch Mgmt.)
2.      % of Open and Closed Critical / High Vulnerabilities on Systems (Vul Management)
3.      % of Vulnerable system without compensating controls (Virtual Patching)
4.      % of System & Network configures with Security Baseline
5.      % of Systems updated with latest Endpoint Protection (Antivirus, EDR, DLP, Device Control)
6.      Privilege Access Review for Critical Systems and Application (No of Unused IDs and Privileges)
7.      No of open Critical /High Application Security Issues (App Penetrating Testing

KPI Should cover acceptable criteria and Frequency and source data for validation
You don’t need to report all KPIs to Business Leaders, they will be interested in only few related to Open Risk, Open Audit Issues, Staff Awareness, Compliance with Regulations, and Budgets.
Appwrite Community Report #13
Published: 2022-07-08 13:31:28

Howdy everybody!👋Greetings from team Appwrite!  

Presenting before you this week’s community updates! 👀

**TLDR;** Sharing recent updates, bugs and issues fixed, community highlights and some resources. Stay tuned till the end 😉

---

## 📢  What’s new 
- This week we released [0.15.2](https://github.com/appwrite/appwrite/releases). Did you try it out yet?
- We just announced our second OSS Fund sponsored project - Oh-my-posh🤩
{% embed https://twitter.com/appwrite/status/1544358462926331908?s=20&t=8rJI6E5H57QrBsVM-dMHrQ %}
[OSS Fund](https://appwrite.io/oss-fund) is an initiative to support maintainers, applications are still open! 

---

## ✅ Issues solved

Our major focus this week was the 0.15.2 release, fixing bugs and issues. 

- Fixed Realtime Authentication for the Console
🔗[Link to PR](https://github.com/appwrite/appwrite/pull/3506)

- Fixed Collection Usage
🔗[Link to PR](https://github.com/appwrite/appwrite/pull/3505)
- Fixed `$createdAt` after updating document
🔗[Link to PR](https://github.com/appwrite/appwrite/pull/3498)
- Fixed Redirect after deleting Collection in Console
🔗[Link to PR](https://github.com/appwrite/appwrite/pull/3476)

---

## ⚒️ What we’re currently working on

- Addition of Podio OAuth provider
- Implementation of a function proxy that has info about all executors and forwards traffic using smart strategy
- Addition of MSG91 phone adapter by community member [@Dinesh Kumar](https://github.com/iamdineshkumar)
- Swapping of deprecated pedantic for lints by community member [@Agon Noga](https://github.com/noga-dev)

---

## 🗣 Discussions
What is your take on push notifications in Appwrite?
🔗[Join the discussion here](https://github.com/appwrite/appwrite/discussions/1623)

---

## 📘 Resources
- Learn about [Webhook Security](https://dev.to/appwrite/level-up-your-webhook-security-with-appwrite-015-50mo) in Appwrite
- Get started with Phone Authentication using Appwrite and Twilio
{% embed https://dev.to/appwrite/appwrite-phone-authentication-with-flutter-3jii %}
- Creating a [Custom Svelte store with Appwrite and Caching](https://dev.to/appwrite/custom-svelte-store-with-appwrite-and-caching-1m6d)
- Authenticating a dashboard in Vue Js using Appwrite and Auth0 by community member @amaraiheanacho 
{% embed https://dev.to/hackmamba/quickly-authenticate-a-dashboard-in-vuejs-using-appwrite-and-auth0-44hk %}
- Take up the [30 days learning challenge](https://30days.appwrite.io/) to get started with Appwrite
New Features Introduced from ES2022
Tags: javascript, webdev, programming, news
Published: 2022-07-08 13:29:35

As JavaScript keeps involving every year with ECMAScript specifications being released every year since 2015. 
Here are a 4 new features coming from ES2022 that you may find useful.


## 1. Top Level Await 
The await keyword previously couldn’t be used outside the async box. Now we can use await without async. 

> Top-level await enables modules to act as big async functions: With top-level await, ECMAScript Modules (ESM) can await resources, causing other modules who import them to wait before they start evaluating their body.

An example of this: 
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1jo7bl7y1cidrl1etdx0.png)
 
 

## 2. Error Cause 
Errors help us identify the unexpected behavior our applications may produce when things don't go the way they are planned, and help us react accordingly. 
Sometimes however, it is hard to determine the root cause of the nested errors, and how to handle them properly.

But now, we can pass the object {cause: err} to the Error constructor to 
to show us what caused the error to happen: 

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


## 3. **RegExp** match indices with the **d** flag
Regular expression matches are patterns that are used to find certain character combinations in strings.
Using **String.matchAll** and **RegExp.exec**, we can return a list of matches: 

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


**RegExp.exec** will deliver individual results. **String.matchAll** will return an iterator that can be used to iterate over all the matches. 

Thanks to ES2022, we can now use the **d** flag to specify starting and ending indices of the matches in the **RegExp** result:



 
## 4. **.at()** method for arrays.
Instead of slicing the array and getting its length until we get what we want. This feature will help you get what you want in a line of code. Perfect for readability and less code.

It provides an easy access to any index of an array or string, either positive or negative: 

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7nl5ovsj690ktdw8xm6c.png)
682. Leetcode Solution in Java
Tags: java
Published: 2022-07-08 13:11:44

```
class Solution {
    public int calPoints(String[] ops) {
        List<Integer> list = new ArrayList<>();

        int length = ops.length;
        for (int i = 0; i < length; i++) {
            int size = list.size();
            char[] chars = ops[i].toCharArray();
            char first = chars[0];

            switch (first) {
                case 'C':
                    list.remove(size - 1);
                    break;
                case 'D':
                    list.add(list.get(size - 1) * 2);
                    break;
                case '+':
                    int sum = list.get(size - 1) + list.get(size - 2);
                    list.add(sum);
                    break;
                default: // [1]
                    int flag = 1;
                    int val = 0;
                    for (char c : chars) {
                        if (c == '-') {
                            flag = -1;
                            continue;
                        }
                        val *= 10;
                        val += c - '0';
                    }
                    list.add(val * flag);
                    break;
            }
        }

        int ans = 0;
        for (int i : list) {
            ans += i;
        }
        return ans;
    }
}
```
#leetcode
#challenge
here is the link for the problem:
https://leetcode.com/problems/baseball-game/
171. Leetcode Solution in CPP
Tags: cpp
Published: 2022-07-08 13:04:06

```
class Solution {
 public:
  int titleToNumber(string s) {
    return accumulate(begin(s), end(s), 0,
                      [](int a, int b) { return a * 26 + (b - 'A' + 1); });
  }
};

```
#leetcode
#challenge
here is the link for the problem:
https://leetcode.com/problems/excel-sheet-column-number/
657. Leetcode Solution in CPP
Tags: cpp
Published: 2022-07-08 13:09:03

```
class Solution {
 public:
  bool judgeCircle(string moves) {
    int right = 0;
    int up = 0;

    for (const char move : moves) {
      switch (move) {
        case 'R':
          ++right;
          break;
        case 'L':
          --right;
          break;
        case 'U':
          ++up;
          break;
        case 'D':
          --up;
          break;
      }
    }

    return right == 0 && up == 0;
  }
};

```
#leetcode
#challenge
here is the link for the problem:
https://leetcode.com/problems/robot-return-to-origin/
671. Leetcode Solution in CPP
Tags: cpp
Published: 2022-07-08 13:08:08

```
class Solution {
 public:
  int findSecondMinimumValue(TreeNode* root) {
    if (!root)
      return -1;
    return findSecondMinimumValue(root, root->val);
  }

 private:
  int findSecondMinimumValue(TreeNode* root, int mini) {
    if (!root)
      return -1;
    if (root->val > mini)
      return root->val;

    const int leftMin = findSecondMinimumValue(root->left, mini);
    const int rightMin = findSecondMinimumValue(root->right, mini);

    if (leftMin == -1 || rightMin == -1)
      return max(leftMin, rightMin);
    return min(leftMin, rightMin);
  }
};

```
#leetcode
#challenge
here is the link for the problem:
https://leetcode.com/problems/second-minimum-node-in-a-binary-tree/
819. Leetcode Solution in CPP
Tags: cpp
Published: 2022-07-08 13:06:22

```
class Solution {
 public:
  string mostCommonWord(string paragraph, vector<string>& banned) {
    string ans;
    int maxCount = 0;
    unordered_map<string, int> count;
    unordered_set<string> bannedSet{begin(banned), end(banned)};

    // make paragraph to lowercase and empty punctuations
    for (char& c : paragraph)
      c = isalpha(c) ? tolower(c) : ' ';

    istringstream iss(paragraph);

    for (string word; iss >> word;)
      if (!bannedSet.count(word))
        ++count[word];

    for (const auto& [word, freq] : count)
      if (freq > maxCount) {
        maxCount = freq;
        ans = word;
      }

    return ans;
  }
};

```
#leetcode
#challenge
here is the link for the problem:
https://leetcode.com/problems/most-common-word
6 tricks to boost your website performance
Tags: webdev, website, websitedevelopment, webdesign
Published: 2022-07-08 12:54:37


**Wanna improve the performance of your website or client's website?**

In this article, we will discuss best practices for web designing, which will make web designing easier, faster, and more effective.

We have discovered some useful guidelines for web designing and applied the same while designing our website and achieved surprising results.

Today, I would like to share those useful tips with you guys. You can apply them to your website design.

**Here are 6 tips that will help you boost your website performance.**

1. Use a structural approach (Design component-wise)
2. Start with a rough design
3. Mobile-first design approach
4. Use less CSS and be more productive
5. Spare some time to think of images
6. Testing

To read full version of this article, navigate to the [canopas blog](https://blog.canopas.com/6-tricks-to-boost-your-website-performance-9f886a47b6aa).
Matrix time
Tags: javascript, matrix, webdev
Published: 2022-07-08 12:50:06

Wanted to __look__ like your hacking the matrix.

Well now you can with a small unnessecery project I spent time on.

[Check it out!](https://github.com/imagineeeinc/matrix-rain#readme)

The idea of this initially came from me wanting to add some interactivity and motion to my [portfolio](https://imagineee.web.app). So, I decided to add a matrix background but instead it's my theme colour which is `#000014`.

So I went searching the internet for a matrix animation to borrow, and found [this](https://codepen.io/yaclive/pen/EayLYO) on codepen which a was a great implemention.

So, I forked it and made some adjustments, and copied it to my website, added some reactivity to mouse movements.

I then thought people might want to use this as a standalone background.

So, I copied the code and pasted it in somewhere else added some controls to ustomize it a bit, and published it. Great 1 Hour of my life, helping Making the world a better place.
Understanding Stateless and Stateful Widgets
Tags: flutter, programming, mobile
Published: 2022-07-08 12:47:17

There is really nothing much difference between a stateful and a stateless widget other than the ability to change when a user interacts a component in the screen. 
   Stateless widgets are widgets that does not require mutable state. It describes part of the user interface by building a constellation of other widgets that describe the user interface more concretely.

```
   Icon(
      Icons.beach_access,
      color: Colors.blue,
      size: 36.0,
    )
```

 A Stateful Widgets are dynamic widgets. They can be updated during runtime based on user action or data change. They have an internal state and can re-render if the input data changes or if Widget's state changes.

```
   Checkbox(
      value: this.value,
      onChanged: (bool value) {
        setState(() {
          this.value = value;
        });
      },
   )
```

**Differences Between Stateless and Stateful Widget**
**Stateless Widget:**
Stateless Widgets are static widgets.
They do not depend on any data change or any behavior change.
Stateless Widgets do not have a state, they will be rendered once and will not update themselves, but will only be updated when external data changes.
For Example: Container, Text, etc are Stateless Widgets. 
 
**Stateful Widget:**
Stateful Widgets are dynamic widgets.
They can be updated during runtime based on user action or data change.
Stateful Widgets have an internal state and can re-render if the input data changes or if Widget’s state changes.
For Example: Checkbox, Radio Button, etc are Stateful Widgets
Get started:
https://docs.flutter.dev/get-started/codelab


Anticipate for more future posts like converting a prototype to a Flutter App



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

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0bjqzqugrs1jzutsctg8.jpg)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wwb1eb97wjktcyxmvoy4.jpg)


Twitter:  https://twitter.com/AtuohaA
LinkedIn: https://www.linkedin.com/in/atuoha-anthony
Github:   https://github.com/Atuoha
Need help and suggestions about career
Tags: help, career, discuss
Published: 2022-07-08 12:33:57

Hi everyone, My name is Muhammad Ahsan. I'm final year student of Computer Engineering and I started programming during my 2nd year. Till now I do my best to learn something new e.g new Programming concept or some syntax etc.

But due to gap and not practicing much for sometime now I feel completely lost.

I want to be a ML Developer and also did a 3 month internship in startup and been in Python for sometime.
Here's my GitHub: https://github.com/Muhammad-Ahsan-Rasheed

Now please suggest something because I'm completely lost and can't focus.

How can I resume again need suggestions from seniors.

Thanks in advance for your kind help.
Clean Code Tip: Tests should be even more well-written than production code
Tags: cleancode, testing, beginners
Published: 2022-07-08 12:13:56


You surely take care of your code to make it easy to read and understand, right? RIGHT??

Well done! 👏

But most of the developers tend to write good production code (the one actually executed by your system), but very poor test code.

**Production code is meant to be run, while tests are also meant to document your code**; therefore there must not be doubts about the meaning and the reason behind a test.
This also means that all the names must be explicit enough to help readers understand **how** and **why** a test should pass.

This is a valid C# test:

```cs
[Test]
public void TestHtmlParser()
{
    HtmlDocument doc = new HtmlDocument();
    doc.LoadHtml("<p>Hello</p>");
    var node = doc.DocumentNode.ChildNodes[0];
    var parser = new HtmlParser();

    Assert.AreEqual("Hello", parser.ParseContent(node));
}
```

What is the meaning of this test? We should be able to understand it just by reading the method name.

Also, notice that here we are creating the HtmlNode object; imagine if this node creation is present in every test method: you will see the same lines of code over and over again. 

Thus, we can refactor this test in this way:

```cs
 [Test]
public void HtmlParser_ExtractsContent_WhenHtmlIsParagraph()
{
    //Arrange
    string paragraphContent = "Hello";
    string htmlParagraph = $"<p>{paragraphContent}</p>";
    HtmlNode htmlNode = CreateHtmlNode(htmlParagraph);
    var htmlParser = new HtmlParser();
    
    //Act
    var parsedContent = htmlParser.ParseContent(htmlNode);

    //Assert
    Assert.AreEqual(paragraphContent, parsedContent);
}
```

This test is definitely better:

* you can understand its meaning by reading the test name
* the code is concise, and some creation parts are refactored out
* we've well separated the 3 parts of the tests: Arrange, Act, Assert (we've already talked about it [here](https://www.code4it.dev/cleancodetips/aaa-pattern-for-tests/ "AAA pattern for tests: why is it important?"))

## Wrapping up

Tests are still part of your project, even though they are not used directly by your customers.

Never skip tests, and never write them in a rush. After all, when you encounter a bug, the first thing you should do is write a test to reproduce the bug, and then validate the fix using that same test. 

So, keep writing good code, for tests too!

Happy coding!

🐧
Introduction to Devtron
Tags: appops, devtron, kubernetes, opensource
Published: 2022-07-08 12:05:07

One of the hottest keywords in the DevOps space is `AppOps`. As the DevOps ecosystem matures, the focus shifts from **automation** and **continuous delivery** to enriching the developer experience. 

AppOps takes an `application-centric` approach that enables developers to use `self-service tools` to build, deploy, and operate their applications on the latest cloud-native platforms. 

Over the past few years, we've seen a variety of great open source tools to reach some of this goal, creating a `seamless experience` that spans CI / CD, security, cost management, and observability. 

## Overview of Devtron

Devtron is an `open-source tool` that pulls together a number of popular components such as `ArgoCD, Clair, external secrets, and minio` to bootstrap a fully managed application delivery platform on Kubernetes. 

Underneath the hood, it leverages `GitOps principles` to create sample CI/CD pipelines, integrated with security scanning and observability tools via a slick application dashboard. 

For teams looking to adopt Kubernetes at scale, Devtron offers a quick way to provide developers and platform teams a way to onboard their applications onto Kubernetes without having to fumble with various YAML files and piecing together complex tools. 

## Devtron's Advantages 

- Devtron makes some `unique design decisions` about what your cloud-native application delivery workflow will look like. 
- It comes with `preconfigured templates` for automating the construction, publishing, scanning, and deployment of Docker processes using several built-in guardrails. 
- This is ideal for teams struggling to manage all  Kubernetes tools or wanting to adopt a `Kubernetes workflow with minimal overhead`. 
- The console makes it easy for both developers and DevOps teams to repeatedly onboard new applications. 

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
Dokku: Self-hosted Heroku
Tags: dokku, webdev, deployment
Published: 2022-07-08 12:02:06

Like many other developers, I tried to deploy [Heroku](https://heroku.com), and the whole process from setting up the database to push to deploy was a real wow moment. The only negative and quite crucial is the price, which is several times higher than the comparably powerful VPS servers at DigitalOcean, Vultr, Linode and others.

Fortunately, there is a solution called [Dokku](https://dokku.com) that provides Heroku UX on its own server in docker containers.

## Main features

- Apps and addons concept same as Heroku
- Support for [Buildpacks](https://devcenter.heroku.com/articles/buildpacks) from Heroku
- Easy to use CLI interface mirroring Heroku CLI
- Set of first party plugins/addons mantained by creators of Dokku
- Support for multi server deployment with [Kubernetes or Nomad plugins](https://dokku.com/docs/advanced-usage/schedulers/alternate-schedulers/)
- And of course price, which comes in form of a bill from your favorite VPS provider

## Apps

Apps can be configured throw CLI interface and deployed on git push to server. The build of the app is managed by Heroku Buildpacks and configuration files stored inside of your git repository like app.json and Procfile.

You can also deploy any docker image additionally to Heroku Buildpacks. This can be quite useful in combination with plugins, where you can link your custom docker container with the database plugin, expose it to a specific domain and protect it with Let's Encrypt HTTPS certificate. All manages by Dokku runtime.

## Plugins

Dokku comes with a set of ready-to-use addons with can be linked or modify apps in some sanse. Plugins I use are:

- PostgreSQL
- Redis
- Mongo
- Elasticsearch
- Let's Encrypt
- And more

All database plugins come with the ability to backup themselves periodically to your AWS S3 bucket.

## Conclusion

Dokku is a great money saver. You can have the identical environment and CLI UI as Heroku with a radically lower price just with a little bit of Linux knowledge.