teleren/devto huggingface dataset:
Substrings of Size Three with Distinct Characters
Tags: leetcode, dsa, theabbie
Published: 2022-06-13 09:00:45

A string is **good** if there are no repeated characters.

Given a string `s`​​​​​, return _the number of **good substrings** of length **three** in_ `s`​​​​​​.

Note that if there are multiple occurrences of the same substring, every occurrence should be counted.

A **substring** is a contiguous sequence of characters in a string.

**Example 1:**

**Input:** s = "xyzzaz"
**Output:** 1
**Explanation:** There are 4 substrings of size 3: "xyz", "yzz", "zza", and "zaz". 
The only good substring of length 3 is "xyz".

**Example 2:**

**Input:** s = "aababcabc"
**Output:** 4
**Explanation:** There are 7 substrings of size 3: "aab", "aba", "bab", "abc", "bca", "cab", and "abc".
The good substrings are "abc", "bca", "cab", and "abc".

**Constraints:**

*   `1 <= s.length <= 100`
*   `s`​​​​​​ consists of lowercase English letters.

**SOLUTION:**

    class Solution:
        def countGoodSubstrings(self, s: str) -> int:
            n = len(s)
            if n < 3:
                return 0
            dist = 0
            ctr = [0] * 26
            for i in range(3):
                ctr[ord(s[i]) - ord('a')] += 1
            for i in range(n - 3):
                if max(ctr) == 1:
                    dist += 1
                ctr[ord(s[i]) - ord('a')] -= 1
                ctr[ord(s[i+3]) - ord('a')] += 1
            if set(ctr) == {0, 1}:
                dist += 1
            return dist
My First Introduction To The Cloud
Tags: cloud, azure
Published: 2022-06-13 08:50:36

While reading the book “Cloud Native Infrastructure”, and on getting to page 34-35, I read the words “In July of 2014 an open source tool that embraced the idea of a higher level abstraction for infrastructure as code was released. The tool, called Terraform, has been fantastically successful. It was released at the perfect time, when configuration management was well established and public cloud adoption was on the rise. Users began to see the limitations of the tools for the new environment, and Terraform was ready to address their needs.”

This made me pause to think, when did I first hear about the cloud? In retrospect, I was surprised to recall that sometime in 2013/14 there was a talk around Microsoft Azure back in FUNAAB.

I can’t accurately remember the hall we used for the event, but oh, I remember there were Azure stickers.

(Somebody spoke about building a news app by consuming APIs. This must have been a tech conference, no idea)

There was this thing about free Azure credits for students, however, the cloud was vague for a lot of us at the time. Folks just wanted to learn to write code and build apps. There was no immediate benefits for these young undergrads who at the time were more in need of internet data to download C++ and PHP tutorials. To us, the cloud was way ahead of it’s time.
Introducing Padmat: A side project
Tags: php, webdev, showdev
Published: 2022-06-13 08:32:23

## What exactly is Padmat?
In short it's just a publishing service that allows you to write rich content and publish on 1 click.

## Why Padmat?
1. Wanted to add another tool to my side projects
2. An easy service that let's you write for free without any charges or account.
3. You could write all the content in 1 place and share them!

## Tool Link
[https://padmat.ga](https://padmat.ga)

## Confused?
Head over to [https://padmat.ga/welcome](https://padmat.ga/welcome) to learn more

## Who can use?
Absolutely no restrictions! Use it for whatever you want, just remain mindful :).

## If you liked the tool do drop a word about it to your fellow mates!
Merge Intervals
Tags: leetcode, dsa, theabbie
Published: 2022-06-13 08:30:37

Given an array of `intervals` where `intervals[i] = [starti, endi]`, merge all overlapping intervals, and return _an array of the non-overlapping intervals that cover all the intervals in the input_.

**Example 1:**

**Input:** intervals = \[\[1,3\],\[2,6\],\[8,10\],\[15,18\]\]
**Output:** \[\[1,6\],\[8,10\],\[15,18\]\]
**Explanation:** Since intervals \[1,3\] and \[2,6\] overlap, merge them into \[1,6\].

**Example 2:**

**Input:** intervals = \[\[1,4\],\[4,5\]\]
**Output:** \[\[1,5\]\]
**Explanation:** Intervals \[1,4\] and \[4,5\] are considered overlapping.

**Constraints:**

*   `1 <= intervals.length <= 104`
*   `intervals[i].length == 2`
*   `0 <= starti <= endi <= 104`

**SOLUTION:**

    import bisect
    
    class Solution:
        def merge(self, intervals: List[List[int]]) -> List[List[int]]:
            points = []
            for l, r in intervals:
                bisect.insort(points, (l, 1))
                bisect.insort(points, (r + 1, -1))
            p = 0
            prev = None
            intervals = []
            for x, diff in points:
                p += diff
                if p == 0 and prev != None:
                    if diff == 1:
                        intervals.append([prev, x])
                    else:
                        intervals.append([prev, x - 1])
                if p == 1 and p - diff == 0:
                    prev = x
            return intervals
Lizard Engine, A new engine to be?
Tags: gamedev, javascript, programming, webdev
Published: 2022-06-13 08:30:03

Hello everyone, hope you are having a amazing day

Today I'm deciding to tell you all about something cool I'm working on.

I am working on a game engine utilizing WebGL BUT there will be support for making desktop apps via tauri.

There will also be a visual editor for it sometime in the future.

The goal of lizard engine is to be strong engine made for smaller games that can also be utilized for bigger games.

The game engine is built directly on top of WebGL with no other frameworks (aside tauri for desktop apps when support for that is added).

Aside from that i would love to see some of you contribute on the project or even just take a look, _And maybe start it ;)_.

Anyway the repo can be found on github [here](https://github.com/FunkyEgg/LizardEngine)

Have a good day everyone
What Happens When You Visit http://localhost - A Closer Look
Tags: localhost, network, webdev
Published: 2022-06-13 08:22:39

Say you're developing a web application or running an http server of some sort on your local computer, you will most likely access that app (or server) by going to the url http://localhost:[SOME-PORT].

Localhost is a top level domain name (TLD) just like `com` as in example.com or `gov` as in example.gov, org, etc. It is reserved by the Internet Engineering Task force (IETF) for *loopback* purposes and as such, domain registrars cannot sell to you a domain name with the localhost TLD e.g., `mybilliondollarblog.localhost`.

**What do we mean by loopback?**
When your computer is connected to the internet for example, electric signals are routed through the physical network interface, the physical network card installed on your computer then through computers on the internet to the destination computer that holds whatever content you require. The loopback mechanism 

The browser first (this has been in my draft for about 2 years, who knows when is finish writing it 😞)
Want a better Cloud Native career? It's more than just Kubernetes
Tags: cloudnative, kubernetes, cloud, career
Published: 2022-06-13 08:19:42

Hi! I am a Cloud Native Engineer at Container Solutions, helping global companies become cloud native.

**What is Cloud Native?**

The Cloud Native Computing Foundation (CNCF) in it's v1.0 definition states that:

> Cloud native technologies empower organizations to build and run scalable applications in modern, dynamic environments such as public, private, and hybrid clouds. Containers, service meshes, microservices, immutable infrastructure, and declarative APIs exemplify this approach.

These definition puts a spotlight on clouds, containers, microservices, etc.

Cloud Native is a relatively new field and members of the community have been asking the golden question:
> What is Cloud Native?

In the Honeypot Kubernetes documentary ([Part 1](https://www.youtube.com/watch?v=BE77h7dmoQU) and [Part 2](https://www.youtube.com/watch?v=318elIq37PE)), the early engineers on the Kubernetes project explained that 
 
The CNCF was founded in 2015 after the release of Kubernetes documentary has since evolved. and that definition did not sit well with everyone.

This question led to the creation of a newsletter from Container Solutions titled "WTF is Cloud Native".


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

Members of the cloud native community kept asking, what is cloud native … (might complete this  post later)




Inspired by: https://about.gitlab.com/blog/2022/03/17/want-a-better-devops-career-learn-the-business/
How to use Laravel Facades safely
Tags: laravel, programming, beginners, php
Published: 2022-06-13 08:17:43

It's not exactly clear in the [Laravel documentation](https://laravel.com/docs/9.x/facades), but there's one thing the Facades do that might introduce accidental bugs in your system:

**Facades are like singletons.**

Unlike traditional service container bindings with anonymous functions, Facades **retain** the resolved instance and use that in future Facade calls.

[In this article](https://arunas.dev/laravel-facades-gotcha/) I explain why this is happening, and offer a couple solutions to prevent this bug in your code.

Let me know what you think!
#2.Basic algorithms problems for frontend developers.
Tags: javascript, algorithms, frontend, webdev
Published: 2022-06-13 08:14:31

FizzBuzz algo problem.
1 in 4 interview questions on solving algorithms, is about the fizzbuzz pattern.

It sounds so fancy but all what it is, just finding out how many times a number is included in a bigger number.

In other words if a number is a multiple of another number.

JavaScript has the % module operator which tells you exactly that.

For example, 10 % 2 will be 0, because 2 is included 5 times in 10.

Instead, if we had 11 % 2, the answer will be 1. Which means is not a fizzbuzz result ;)

```
const num = 20;
/* FizzBuzz question:  Find out which number
 between 1 and a given number is a multiple
  of 5 and a mutiple of 4!
 If num is multiple of 5 and multiple of
  4 print 'fizzbuzz' to the console.log
if num is multiple only of 4 print 'fizz'. 
If instead is multiplwe only of 6 print 'buzz'. */

const fizzbuzz = n => {
  /* loop trough the number starting from 
  1 (because 0 will give us falsy values) */
  for (let i = 1; i <= n; i++) {
    // if 5 and 4 are multiples of i, print fizzbuzz
    if (i % 5 === 0 && i % 4 === 0) {
      console.log(i, 'fizzbuzz');
      // if only 5 is multiple of i print 'fizz'
    } else if (i % 5 === 0) {
      console.log(i, 'fizz');
      // if only 4 is multiple of i print 'buzz'
    } else if (i % 4 === 0) {
      console.log(i, 'bizz');
      /* if nither 5 or 4 are not multiple 
      of i print 'no fizz and no buzz here' */
    } else {
      console.log(i, 'no fizz and no buzz here');
    }
  }
};

fizzbizz(num);```
Data Analysis with Python
Tags: python, beginners, tutorial, datascience
Published: 2022-06-13 08:01:58

Data Analysis with Python
In these comprehensive video courses, created by Santiago Basulto, you will learn the whole process of data analysis. You'll be reading data from multiple sources (CSV, SQL, Excel), process that data using NumPy and Pandas, and visualize it using Matplotlib and Seaborn,

Additionally, we've included a thorough Jupyter Notebook course, and a quick Python reference to refresh your programming skills.
Generate Parentheses
Tags: leetcode, dsa, theabbie
Published: 2022-06-13 08:00:48

Given `n` pairs of parentheses, write a function to _generate all combinations of well-formed parentheses_.

**Example 1:**

**Input:** n = 3
**Output:** \["((()))","(()())","(())()","()(())","()()()"\]

**Example 2:**

**Input:** n = 1
**Output:** \["()"\]

**Constraints:**

*   `1 <= n <= 8`

**SOLUTION:**

    class Solution:
        def generate(self, s, ctr, rem, ans):
            if rem == 0 and ctr == 0:
                ans.add(s)
            if rem > 0 and ctr >= 0:
                if ctr < rem:
                    self.generate(s + '(', ctr + 1, rem - 1, ans)
                if ctr > 0:
                    self.generate(s + ')', ctr - 1, rem - 1, ans)
        
        def generateParenthesis(self, n: int) -> List[str]:
            ans = set()
            self.generate("", 0, 2 * n, ans)
            return list(ans)
Today's Daily Dose of Programming Humor
Tags: jokes, dailydeveloperjokes
Published: 2022-06-13 08:00:07

---
title: "Today's Daily Dose of Programming Humor"
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/5e1258a87ad7e.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:
___!false___

It's funny 'cause it's true.
 -->
Why Bother With Web3?
Tags: web3, discuss, watercooler
Published: 2022-06-13 07:47:27

I still don't have a clear opinion on Web3, but I am trying to read about the pros and cons of potential use cases.

I think many of the proposed use cases are poor examples. So here I am seeking for opinions.

In [Web3/Crypto: Why Bother?](https://continuations.com/post/671863718643105792/web3crypto-why-bother) the author proposes that "_A blockchain [...] has one dimension along which it is radically different. No single entity or small group of entities controls it _".

That is clear and probably the core concept of Web3. 

However, that makes me think of several aspects:

### Follow the money 

Some business models like [UniSwap](https://uniswap.org/) collect fees as part of their operations. Other models make money when users invest in the platform, like [Steemit](https://steemit.com/). 

In the case of Steemit, investing in the platform means that their posts can be seen by a larger audience, thus getting more votes, which translate into more money. 

I am not sure this can be the standard, but I see the potential. I also see how this could be done with Web2, though.

### Governance

People can vote. In principle, this is great! 

In practice, we built countries delegating (some) power to others so they can take decisions on our behalf. When is the last time you took the time to read some law before voting on it? 

I don't think I would want to make a decision every time a platform wants to change something. Do I even understand the choices and the implications? 

Decisions are expensive.

### My Conclusions (so far)

Here are my thoughts so far, but I am very open to reflecting on different points of view.
- Some Web3 companies will make it big 
- Many more companies will fail. Mostly, because of poor business models. Not bacause of the technology.
- Some businesses might be inherently better with web2. 
- Distributed governance works well in small groups. At scale, people and businesses delegate power. Enough delegation creates control power in the hands of the few. This might be good or bad.

As I said, I am looking forward to reading your opinions. I am not married to any of the aforementioned points yet:)
Scheduling Jobs on Heroku
Tags: heroku
Published: 2022-06-13 07:41:46

[Heroku Scheduler](https://elements.heroku.com/addons/scheduler) is a free Heroku add-on that runs any command that can be run in your application at scheduled time intervals, similar to cron jobs in a Linux server.


## Installation

The add-on is free but you will need to use it on a verified Heroku account. You can verify your account by adding a credit card to your account. To install using the Heroku CLI, run this command in your application folder:

```bash
$ heroku addons:create scheduler:standard
```

The add-on can also be installed from the 'Resources' section in the Heroku application dashboard. Just search for 'Heroku Scheduler' and follow the prompts to install the add-on.

## Usage

Once installed, the add-on can be accessed from the Resources section. Click on 'Heroku Scheduler' from your listed add-ons and it will navigate to a new page where you can create your first job.

![Scheduler start page](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8t7clymji75w94n7gh70.png)

This page can also be accessed from from the CLI 

```bash
$ heroku addons:open scheduler
```
Clicking on 'Create job' opens a form to the side

![Job editor](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zxbtipda2too8llhdo21.png)

Suppose we have a script called `emailUpdates.js` that sends a daily email to users of our app at 6 PM. We can run this script using the scheduler by

1. Set schedule to 'Every day at...' 6:00 PM (The default timezone is UTC so you'll need to offset this to your desired time)
2. Set command to `node emailUpdates.js`. Heroku suggests placing your scripts in a `bin` folder so if your script is located there, the command would be `node ./bin/emailUpdates.js`. 
3. Click save job

The job to run can be any command that can be run in your application. In a node.js app, this could be a script defined in the `scripts` section of your `package.json` file.


## Limitations

Scheduled jobs are meant to execute short running tasks or enqueue longer running tasks into a background job queue. Anything that takes longer than a couple of minutes to complete should use a [worker dyno](https://devcenter.heroku.com/articles/background-jobs-queueing) to run.

A dyno started by scheduler will not run longer than its scheduling interval. For example, for a job that runs every 10 minutes, dynos will be terminated after running for approximately 10 minutes.

So that's how schedule simple tasks on Heroku. For more details, you can view the official documentation [here](https://devcenter.heroku.com/articles/scheduler).
Maximum Difference Between Increasing Elements
Tags: leetcode, dsa, theabbie
Published: 2022-06-13 07:30:40

Given a **0-indexed** integer array `nums` of size `n`, find the **maximum difference** between `nums[i]` and `nums[j]` (i.e., `nums[j] - nums[i]`), such that `0 <= i < j < n` and `nums[i] < nums[j]`.

Return _the **maximum difference**._ If no such `i` and `j` exists, return `-1`.

**Example 1:**

**Input:** nums = \[7,**1**,**5**,4\]
**Output:** 4
**Explanation:**
The maximum difference occurs with i = 1 and j = 2, nums\[j\] - nums\[i\] = 5 - 1 = 4.
Note that with i = 1 and j = 0, the difference nums\[j\] - nums\[i\] = 7 - 1 = 6, but i > j, so it is not valid.

**Example 2:**

**Input:** nums = \[9,4,3,2\]
**Output:** -1
**Explanation:**
There is no i and j such that i < j and nums\[i\] < nums\[j\].

**Example 3:**

**Input:** nums = \[**1**,5,2,**10**\]
**Output:** 9
**Explanation:**
The maximum difference occurs with i = 0 and j = 3, nums\[j\] - nums\[i\] = 10 - 1 = 9.

**Constraints:**

*   `n == nums.length`
*   `2 <= n <= 1000`
*   `1 <= nums[i] <= 109`

**SOLUTION:**

    class Solution:
        def maximumDifference(self, nums: List[int]) -> int:
            mdiff = float('-inf')
            minSoFar = nums[0]
            for num in nums:
                minSoFar = min(minSoFar, num)
                mdiff = max(mdiff, num - minSoFar)
            if mdiff > 0:
                return mdiff
            return -1
A Webpage Accessibility Survey for Website Developers
Tags: webdev, html, a11y, discuss
Published: 2022-06-13 07:29:34

I'm a graduate student and now doing some rearch about webpage accessibility. I'd like to ask web developers some simple questions and really hope you guys could do me a fovor. Here are the questions:

1. Are you aware of web accessibility or WAI-ARIA attributes?

2. Have you ever taken actions to make your webpage more accessible?

3. How would you make choice between appearance and accessibility of webpage?

4. How much effort would you be willing to spend on webpage accessibility?

I would really appreciate it if web developers in this community could take a few minutes to answer these questions. You can either leave a comment below or send me a e-mail to 'yanz20@mails.jlu.edu.cn'.

Thank you guys so much!
Instagram Profile Picture Telegram Bot!! 🤖
Tags: javascript, telegram, bot
Published: 2022-06-13 07:28:00

**So Instagram Doesn't Allow Users To Download/View Full Size Profile Pictures/DP**

So I Created A Telegram Bot For Downloading High Quality Profile Pictures From Instagram!

Link :- https://t.me/dpdownloaderbot
Tutorial Video :- https://www.youtube.com/v/qhAdo3N1D7U

Do You Love It, Comment Down Below!!!
InfoSec jobs at remote-first companies
Tags: security, jobs, career, remote
Published: 2022-08-07 09:28:18

---
title: InfoSec jobs at remote-first companies
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n6obh5q2aipe2kwg7w7q.jpg
published: true
date: 2022-06-13 07:26:44 UTC
tags: Security, Jobs, Career, Remote
canonical_url: https://insights.infosec-jobs.com/infosec-jobs-at-remote-first-companies/
---

The ratio of [remote jobs on our site](https://infosec-jobs.com/) during May this year was about 36.3% of all job openings published, compared to 31% during the same month in 2021. That’s quite an increase and a clear sign that remote working is here to stay and becoming quite common for at least one third of applicants that find their new role in the Cyber Security space through our site.

Now there are different kinds of companies out there that hire remotely. For example the ones that have been forced to go remote during the past two years for obvious reasons. Many of them now seem to adapt a hybrid working model with some time remote and some time on-site/in the office. Others already had some staff working remotely before the pandemic, mostly engineers, developers or contractors. And then there are companies that have either been fully remote since their inception or simply canceled their office lease within the last year or two, sent everyone home and never looked back.

The latter is what we commonly refer to as **remote-first companies**. Many are 100% remote, so they don’t even have a real office anywhere, and all employees are free to chose where to work from, although often within timezone or country restrictions. Some still maintain office space somewhere but consider being physically present optional – hence the term remote-**first**.

## New remote-first attribute for employers

We wanted to take the growing presence of these companies on our plattform into account and added a remote-first label to make it a little easier to spot them. By scanning job descriptions for indicators of a remote-first employer we now have a list of remote-first companies that are hiring in the Cybersecurity space: [https://infosec-jobs.com/remote-companies/](https://infosec-jobs.com/remote-companies/)

This list also includes companies that are partially remote-first with only a division or some teams (e.g. dev teams) being fully remote and the rest maybe not so much. But usually the jobs listed on our platform are part of their fully remote team and embedded in a remote-first environment.

![Remote-first badge on GitLab company page](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vovkw9av265ltfo9ux4a.png)

A ‘Remote-first’ badge also appears on a company page for those that promote themselves as a remote-first company or 100% remote team, etc. in their job ads.

We’re also considering adding a search filter for this attribute so looking for jobs at these companies could become a little easier in the future. Until then, stay tuned!