teleren/devto huggingface dataset:
Leetcode 5 - Longest Palindromic Substring
Tags: algorithms, java, programming, computerscience
Published: 2021-08-21 05:08:40

## Problem Statement

Given a string s, return the longest palindromic substring in s.

## Test Cases

Example 1:

Input: s = "babad"
Output: "bab"
Note: "aba" is also a valid answer.
Example 2:

Input: s = "cbbd"
Output: "bb"
Example 3:

Input: s = "a"
Output: "a"
Example 4:

Input: s = "ac"
Output: "a"
 
## Constraints

1 <= s.length <= 1000
s consist of only digits and English letters.

## Code 

```java
class Solution {
    private int resultStart;
    private int resultLength;
    public String longestPalindrome(String s) {
        if (s == null || s.length() == 0) {
            return "";
        }
        if (s.length() == 1)
            return s;
        int length = s.length();
        for (int start=0; start<length-1; start++) {
            widerange(s, start, start);
            widerange(s, start, start+1);
        }
        return s.substring(resultStart, resultStart + resultLength);
    }
    
    public void widerange(String s, int start, int end) {
        while (start >= 0 && end < s.length() && s.charAt(start) == s.charAt(end)) {
            start -= 1;
            end += 1;
        }
        if (resultLength < end - start - 1) {
            resultLength = end - start - 1;
            resultStart = start + 1;
        }
    }
}
```

{%github Rohithv07/LeetCode %}
My Learnings in LGMSoC’2021
Tags: letsgrowmore, opensource
Published: 2021-08-21 05:03:03

## WHAT IS [LET'SGROWMORE](https://letsgrowmore.in/)?
LetsGrowMore is a community of the students, for the students and by the students.

## WHAT IS LGM-SOC?
LGM – SOC is an online program designed to encourage student participation in open source software development under the guidance of mentors from the open source community. As it’s the present demand and students need, so we come with LGM – SOC.

## HOW DOES IT WORK?
* Open source projects apply to be mentor organizations.
* LGM chooses the organization interesting in participating.
* Students submit project proposals to mentor organization.
* Mentor organizations choose the students they’d like to accept.
* Students are paired with a mentor for required guidance.
* Now coding begins! Students work under their mentors over 10 weeks.

## ELIGIBILITY
* All you need to be is a student ready to grab learning opportunity.
* Accepted into or enrolled in a graduate program by the students acceptance date.
* Eligible to work in the country you reside.

## MY LEARNINGS
I contributed to one of the open source repositories namely [awesome-portfolio-websites](https://github.com/forkbikash/awesome-portfolio-websites). The project is aiming to provide a full-fledged template that anyone can use to build and put out their website within an hour.
I am one of the top contributors of the project. Written modularized code to add some features to the [website](https://portfolio.smaranjitghose.com/), fixed bugs and raised some critical issues throughout the journey. Our mentors [@smaranjitghose](https://github.com/smaranjitghose) and [@anushbhatia](https://github.com/anushbhatia) helped me a lot in improving the style of coding. I would like to thank them for their contributions in my journey.

I am glad to be a part of LGMSOC community. Looking forward to more events and learning opportunities like this.

If you want to know more about the program, head over to their [website(letsgrowmore.in)](https://letsgrowmore.in/).

I hope this helps someone out there.

**If you liked this post, you can find more by:**
* Following me on Twitter: [@forkbikash](https://twitter.com/forkbikash)
* Following me on GitHub: [@forkbikash](https://github.com/forkbikash)
* Following me on this beautiful platform: @forkbikash 


<a href="https://twitter.com/share?url=https://dev.to/forkbikash/my-learnings-in-lgmsoc-2021-2hkg">**Tweet this post**</a>
<a href="https://twitter.com/forkbikash?ref_src=twsrc%5Etfw">**Follow me on Twitter @forkbikash**</a>
seedbox
Tags: seedbox
Published: 2021-08-21 04:50:48

Our seedbox service gives you a high speed, anonymous connection to our servers so you can download torrents in complete privacy. Our seedbox service is used by people all around the world to download and stream files like movies, tv shows, music, ebooks, software and much more.
<a href="https://evoseedbox.com/">seedbox</a>
Create a Netflix clone from Scratch: JavaScript PHP + MySQL Day 26
Tags: php, javascript, webdev, tutorial
Published: 2021-08-21 03:25:05

Netflix provides streaming movies and TV shows to over 75 million subscribers across
the globe. Customers can watch as many shows/ movies as they want as long as they are
connected to the internet for a monthly subscription fee of about ten dollars. Netflix produces
original content and also pays for the rights to stream feature films and shows.


In this video,we will be creating Testing for sendToMail method

{% youtube DWGRNFADJVQ %}

In this video,we will be creating verify account functionalities
{% youtube NR9q5MTxvJw %}


If you like my work, please consider
[![Buy me a coffee](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jm11knj7d8zwcvo150q2.png)](https://www.buymeacoffee.com/cglikpo)
so that I can bring more projects, more articles for you

If you want to learn more about Web Development, feel free to [follow me on Youtube!](https://www.youtube.com/c/ChristopherGlikpo)
Using code to lift my spirit
Tags: code, depression, mentalhealth, building
Published: 2021-08-21 02:25:04

---
title: Using code to lift my spirit
published: true
description: How coding for fun can keep my mind from straying to darker thoughts
tags: code, depression, mentalHealth, building
cover_image: https://img.freepik.com/free-vector/blank-blue-halftone-background_53876-99003.jpg?size=626&ext=jpg
---
It's been a tough year (and a half) for all of us and sometimes you can find relief in the weirdest places. I've been dealing with mild depression since before this whole pandemic came to be and it only made it worse. When work used to be a place where my mind could be distracted and the social interaction made it all less lonely. The lock down took away so much from me and don't get me wrong I was lucky, still had job and I could work without much danger to myself. As time went on it got harder to feel motivate to do anything other than the minimum. And believe me if I spend the whole day on Zoom, I really don't want to talk to a therapist through Zoom as well. 

But one day while working from home and researching to create a new API for work it hit me! The reason I love what I do is that I'm creating something. I'm the architect, engineer and contractor of my ideas that turn into code and then to a product for my clients. The rush I feel when planning things out and then figuring out how to do it. The research, the trial and error brings so much joy and excitement. 

Why couldn't I use this in my personal life to make me feel better. Not just as work but as therapy in a sense. So I went home and looked up courses online related to the languages I already knew. What could I do to keep me entertained and happy? I took some time ( a lot of unfinished courses/projects ) to find something that was light enough for me to pick up and put down as needed. Something that tickled my fancy but help me grow as professional. I found myself feeling more engaged and less sad after work. I wanted to do more and hopefully feel like I could step outside and interact with other people that are like minded.

In a sense code (and music, cause who develops without a soundtrack, right?) saved me. And while I might still not be a world class developer, I'm heading to be a happier developer. For example, I'm learning python (been a Java girl for last 10 years) and as part of a course I'm trying to finish I had to make a simple terminal script and then blog about it (which is why I'm here). I decided to make a simple quote fetcher to help me have a motivating quote on demand, also to learn how to make REST calls in python. While the assignment was not supposed to be an emotional blog on how I feel, it lead me to this and I feel like it helped. I hope it helps someone else... here's the [Github](https://github.com/Rukato/python-game.git) 

Be kind to one another and keep coding,

GAJR
Having a favourite tool might mean you don't use the best tool (100 Bytes Of Wisdom: Day 66)
Tags: career, journey, advice
Published: 2021-08-21 01:59:40

---
title: Having a favourite tool might mean you don't use the best tool (100 Bytes Of Wisdom: Day 66)
published: true
description: Bytes of Wisdom is a project by Sam Jarman that brings together snippets of advice for software engineers
tags: career, journey, advice
//cover_image: https://direct_url_to_image.jpg
---

![Having a favourite tool might mean you don't use the best tool](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/crvj7bh78vd2gweicf29.png)


Bad engineering is going into a problem solving phase with a bias towards your favourite potential solution. This is absolutely absurd yet it happens all the time, especially in software engineering and especially online. This is becoming too common online, and it’s super super sad to see. I want to say its bad engineering to even like a technology or tool. If you like it, you’ll have bias towards it when it comes to problem solving, and you’ll be a worse problem solver (aka engineer) for it. This field is for problem solvers, not solution users.

Heads up: As with any terse bit of advice, there will be exceptions of course, and subtleties and nuance that can't possibly be captured in a Byte of Wisdom. This has been what I've experienced, I'd love to hear yours in the comments too!

You can catch up with all the other bytes at http://bytesofwisdom.com/
How does Redux work? ^-^
Published: 2021-08-21 01:25:41

The way Redux works is quite simple.

The states of the components of interest are held in a separate central store.

The states in the store are passed as props to those components. This makes them immutable.

Building Blocks: actions -> reducers -> store

i. Actions are events(JS objects with "type" field) through which data are sent from the application to the Redux store. The data can be from user interactions, user inputs, API calls, or even form submissions.

The action get dispatched into a reducer;

ii. Reducers are pure functions in which based on the actions dispatched into them take the current state, update if necessary and return a new state. These new states are stored as objects.

iii. The store gets updated with the new state, components that are interested listen to those changes and make the necessary changes.
Deep dive into z-index
Tags: codesandbox, css, frontend
Published: 2021-08-21 00:47:26

## Without Z-index (Default order)

Reference: [Stacking without the z-index property - CSS: Cascading Style Sheets | MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Positioning/Understanding_z_index/Stacking_without_z-index)

The number(#) is the order of appearance in the HTML
![Image 2021-08-21 at 9.20.15 AM](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dd14c52j6zjbz04g0fn0.jpg)

### Main points

- Elements are rendered in the order of appearance in the HTML
- Positioned elements come on top of non-positioned elements
(#5 comes the very bottom)

## Using Z-index

Reference: [Using z-index - CSS: Cascading Style Sheets | MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Positioning/Understanding_z_index/Adding_z-index)

![Image 2021-08-21 at 9.26.04 AM](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2f90r6e762icemjn52fl.jpg)

### Main points
- The higher `z-index` elements comes on top
- If the z-index of element doesn't have a positioned element(*), `z-index` does NOT have an effect => No stacking context is created(More on the next section)

(* ☝️ above is not precise. flex item and grid item don't need to be positioned to use z-index. Please refer to [this link](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Positioning/Understanding_z_index/The_stacking_context#the_stacking_context) for when the stacking context is created)
- No `z-index` means `z-index: auto`

## The stacking context

Reference: [The stacking context - CSS: Cascading Style Sheets | MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Positioning/Understanding_z_index/The_stacking_context)

{% codesandbox ykwt6 %}

### Main points

- Elements are grouped into stacking contexts
- `z-index` value is only compared against other elements in the same context
=> (DIV#4 has the highest z-index of all DIVs, but it is compared within the same stacking context)

## References

- [Stacking without the z-index property - CSS: Cascading Style Sheets | MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Positioning/Understanding_z_index/Stacking_without_z-index)
- [Using z-index - CSS: Cascading Style Sheets | MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Positioning/Understanding_z_index/Adding_z-index)
- [The stacking context - CSS: Cascading Style Sheets | MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Positioning/Understanding_z_index/The_stacking_context)
A GitHub issue report which makes you happy
Tags: github, typescript, react, hookstate
Published: 2021-08-20 23:29:19

I have processed many tickets in various issue tracking systems in my life. I prefer to categorize tickets to one or more of the following types:

- **Feature request**: for an open source project it is a great indicator that a project is wanted and new features drive the growth. No new features are added without an effort.
- **Bug report**: well, it has to be addressed. And I follow the philosophy that bug reports should be addressed at higher priority than features. No bugs are fixed without an effort.
- **Question** (or *Misunderstanding* reported as a bug): these usually highlight gaps in documentation (or unintuitive API / behavior). Users have to be guided and usually questions are answered by directing to an existing documentation, or documentation is improved as a result of a ticket. I do not like to receive the same question multiple times, so I try to improve documentation at higher priority than features. This type of ticket also requires the effort and time of a developer.

All of the above types of tickets require attention of project developers, and time and effort to address.

However, today I received an issue report which did not require me to do anything about. It does not fall in any of the above categories. At the same time, I was happy this was submitted. The ticket is [#220 for Hookstate library](https://github.com/avkonst/hookstate/issues/220), which I believe is one of the best state management libraries for React. And the ticket's title is "Just want to share how much I love this library and how much time it has saved me".

Fortunately, GitHub issue tracker does not have a mandatory field "Close reason", like (most of?) all JIRA-based trackers. So, I can just close it.

However, I think closing it without an action would be rude :) So, I have decided to give it time in the form of writing this little post.

How do you categorize tickets of a similar kind? And what action do you take before closing them?
Deleting a Firestore Document in Flutter
Published: 2021-08-22 05:00:30

---
title: Deleting a Firestore Document in Flutter
published: true
date: 2021-08-20 22:30:00 UTC
tags: 
canonical_url: https://mukhtharcm.com/delete-firestore-document/
---

There is no need for a huge story here. Deleting a Firestore document is a straightforward thing.

We just have to point to a doc and call `delete` on it.

```
final _db = FirebaseFirestore.instance;
await _db.collection("notes").doc("note1").delete();

```

That’s it.

The pointed document will be deleted by the above function.
Testing Go WebAssembly code on Github actions
Tags: github, go, webassembly, testing
Published: 2021-08-20 22:29:11

This small post will run you through how to setup Github actions to run tests for Go code targeting WebAssembly.

[OK, take me straight to the complete setup!](#complete-setup)

Here is the most [basic configuration suggested by Github for Go repositories](https://github.com/actions/starter-workflows/blob/main/ci/go.yml):

```yaml
name: Go

on:
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]

jobs:

  build:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2

    - name: Set up Go
      uses: actions/setup-go@v2
      with:
        go-version: 1.17

    - name: Build
      run: go build -v ./...

    - name: Test
      run: go test -v ./...
```

The first thing we need is to tell the `go` command we want to target WebAssembly, which can be done declaring the `GOOS` and `GOARCH` variables on the job:

```yaml
jobs:

  build:
    runs-on: ubuntu-latest
    env:
      GOOS: js
      GOARCH: wasm
```

The "Build" step should now work as expected, checking that our code compiles to WebAssembly.

However for the "Test" step to work, we need some more configuration.

Of course we need an execution environment for our compiled WebAssembly, in our case Node.js will be perfect, so let's set it up in addition of Go:

```yaml
    - name: Set up Node.js
      uses: actions/setup-node@v2.4.0
      with:
        node-version: 14
```

And finally we need to add `go_js_wasm_exec` to our `PATH` to enable `go test` running our tests using Node.js.

`go_js_wasm_exec` is located in the `misc/wasm` directory of the Go installation, we can add it to the `PATH` with a simple step:

```yaml
    - name: Setup PATH for wasm
      run: echo "${{env.GOROOT}}/misc/wasm" >> $GITHUB_PATH
```

## Complete setup

```yaml
name: Go

on:
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]

jobs:

  build:
    runs-on: ubuntu-latest
    env:
      GOOS: js
      GOARCH: wasm
    steps:
    - uses: actions/checkout@v2

    - name: Set up Go
      uses: actions/setup-go@v2
      with:
        go-version: 1.17

    - name: Setup PATH for wasm
      run: echo "${{env.GOROOT}}/misc/wasm" >> $GITHUB_PATH

    - name: Set up Node.js
      uses: actions/setup-node@v2.4.0
      with:
        node-version: 14

    - name: Build
      run: go build -v ./...

    - name: Test
      run: go test -v ./...
```

This setup is based on [the instructions in the Go WebAssembly wiki page](https://github.com/golang/go/wiki/WebAssembly#executing-webassembly-with-nodejs), it can be adapted to run tests in a browser.
Piping arbitrary Powershell variables into NodeJS
Tags: powershell, shell, justfoundout
Published: 2021-08-20 22:18:49



So yea I just learned how to pipe a powershell variable into a nodejs script.

```powershell
(base) @Carl ➜ my-pwsh-deps git(main> $str = './README.md'
(base) @Carl ➜ my-pwsh-deps git(main) node -p @"
>> const path = require('path')
>> let s = ``$str``
>> console.log(path.parse(path.resolve(s)))
>> "@
{
  root: 'C:\\',
  dir: 'C:\\Users\\Carl\\gitstuff\\my-pwsh-deps',
  base: 'README.md',
  ext: '.md',
  name: 'README'
}
```

It's kind of similar to when you see a slice of `perl` code inside a `bash` script.  Pretty cool.
Some soft skills that we should keep in mind and remember often ✨
Tags: programming, productivity, leadership, devjournal
Published: 2021-08-20 22:14:08

Some things I learned and some things I am still learning. Once my mentor told me that soft skills are very important, and before programmers, we are people, we are humans. So it's good to remember these tips often. 


## ✨ Ask dummy questions.
There are a million technologies. And you're not expected to know them all, so ask! [I don't understand what these words mean" From what source can I read about this? Remember there are no dummy questions, only fools who don't ask.


## ✨ Be kind
The IT world is full of hostile opinions and we all want the best results. That is not why you have to become an unpleasant and arrogant person. Radiate kindness. You're going to go far.


## ✨ Take advantage of what other people are doing
Look for existing solutions before starting a task. Understand the coding paradigms used. Look at your team's code. Present your solution in the best way.


## ✨ Fight for diversity
It is important the participation of women in IT an Tech. It's vital to add diversity and a new perspective in the area. Encourage the participation of diversity in your team. This makes the technology more reliable and not reflect only the world and the view from men.


## ✨ Do the right thing
Code is art. And you are the artist, of course! Every task is an opportunity to write beautiful and elegant code. Take the opportunity and become a professional. Take pride in your work, don't just make it work. Make it work the best way you can.


## ✨ Find your way, fight for yourself
Some tasks have a big impact on job advancement or promotions. Others not so much. You have to do your best at both. But your day should start with the high-impact task. Fight for yourself, make yourself grow, no one else will do it for you.


## ✨ Look for critics in your code.
Make code review. Review your code as much as possible, the more constructive feedback you get, the faster you will learn and grow.


## ✨ Put your ego aside
Your colleagues are unique and talented, with experiences and super smart.
Be empathetic, be open-minded, learn from your team, even when they are wrong.


## ✨ Take initiative
Look for opportunities to improve process and experience development of your team and project. Improve documentation, learn from your mentors and teach others. Be a mentor too! Become the person you wanted to have as a mentor when you started as a junior.


## ✨ Throw yourself into the fire
We will never be ready to work on large projects or new features, deploy in production, manage implementations... the best way to prepare for them is to do them! 
You will expand your comfort zone. And you'll grow a lot!  


## ✨ Intention, always intention.
It doesn't matter if you spent 4 hours to solve something and you did it wrong. Maybe it takes so much time! Delete and start again. And again. 
Make sure that behind every line of code there is purpose, intention and clarity.

What other advice would you give? :)
Open sourced react eccomerce web app with PayPal checkout
Tags: opensource, react, javascript, help
Published: 2021-08-20 22:12:58

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ser1j3a156ug0fb8cixb.jpg)

Github  - https://github.com/abodmicheal/React-projects/

live project - https://abod-zone.web.app
43 - A Decentralized Reference Architecture for Cloud-native Applications
Tags: microservices, api, monitoring, cloudarchitecture
Published: 2021-08-20 21:46:18

**This post was originally published on Fri, Aug 20, 2021 at [cloudwithchris.com](https://www.cloudwithchris.com/episode/decentralised-reference-architecture-cloud-native/).**

The number of microservices running in enterprises increases daily. As a result, service composition, governance, security, and observability are becoming a challenge to implement and incorporate. A "cell-based" architecture is an approach that can be applied to current or desired development and technologies to address these issues. This technology-neutral approach helps cloud-native dev teams become more efficient, act in a more self-organized manner, and speed overall release times.

In this talk, Asanka will introduce the "cell-based" reference architecture, which is decentralized, API-centric, cloud-native and microservices friendly. He will explain the role of APIs in the cell-based approach, as well as examine how real applications are built as cells. Asanka will explore the metrics and approaches that can be used to measure the effectiveness of the architecture and explore how organizations can implement the cell approach.

{% youtube SrJMqU_vHhA %}