teleren/devto huggingface dataset:
Natural Video Tutorials | Playlist
Tags: adabas, natural, mainframes, naturalone
Published: 2022-07-06 08:09:26

---
title: Natural Video Tutorials | Playlist
published: true
date: 2022-06-16 09:25:49 UTC
tags: Adabas, Natural, Mainframes, NaturalONE
canonical_url: https://tech.forums.softwareag.com/t/natural-video-tutorials-playlist/258346
---

[![image](https://aws1.discourse-cdn.com/techcommunity/original/3X/b/5/b57804b15c370dc577acc0c547ea43d0e615700d.jpeg)](https://aws1.discourse-cdn.com/techcommunity/original/3X/b/5/b57804b15c370dc577acc0c547ea43d0e615700d.jpeg "image")

## Natural Tutorials

<iframe src="https://www.youtube.com/embed/6hYl-W_4yko?feature=oembed&amp;wmode=opaque&amp;list=PL3HwmrSYjxiMMdwFS8MmmG8XL_HI7plpB" width="480" height="360" frameborder="0" allowfullscreen="" seamless="seamless" sandbox="allow-same-origin allow-scripts allow-forms allow-popups allow-popups-to-escape-sandbox allow-presentation"></iframe>

Visit the [original post](https://tech.forums.softwareag.com/t/natural-video-tutorials-playlist/258346/1) in the Software AG Tech Community to find all the videos from this playlist.
COBOL & Natural API Enablement Tutorials | Playlist
Tags: adabas, natural, mainframes
Published: 2022-07-04 08:26:44

---
title: COBOL & Natural API Enablement Tutorials | Playlist
published: true
date: 2022-06-16 09:25:47 UTC
tags: Adabas, Natural, Mainframes
canonical_url: https://tech.forums.softwareag.com/t/cobol-natural-api-enablement-tutorials-playlist/258345
---

[![image](https://aws1.discourse-cdn.com/techcommunity/original/3X/b/d/bddb6979d06ee2c67fa435b9b762e99ecdbcec0f.jpeg)](https://aws1.discourse-cdn.com/techcommunity/original/3X/b/d/bddb6979d06ee2c67fa435b9b762e99ecdbcec0f.jpeg "image")

## COBOL & Natural API Enablement Tutorials

<iframe src="https://www.youtube.com/embed/videoseries?list=PL3HwmrSYjxiPJoFpryzvWV1lQyiFsWB5I&amp;wmode=transparent&amp;rel=0&amp;autohide=1&amp;showinfo=1&amp;enablejsapi=1" width="480" height="360" frameborder="0" allowfullscreen="" seamless="seamless" sandbox="allow-same-origin allow-scripts allow-forms allow-popups allow-popups-to-escape-sandbox allow-presentation"></iframe>

Visit the [original post](https://tech.forums.softwareag.com/t/cobol-natural-api-enablement-tutorials-playlist/258345/1) in the Software AG Tech Community to find all the videos from this playlist.
I’ve fucked up in an interview
Tags: interview, job, javascript, beginners
Published: 2022-06-16 09:08:34

Meesho interview round 1, I’ve literally fucked up in an interview

**Under the Hood**
Last week, when I was interviewing in coinbase, I got an interview request from [meesho](https://meesho.com/). I have the time slot available so I thought of giving an interview in messho. But I fucked up in 2 questions, I mean I was asked only 2 questions and didn’t even able to complete it.

**Questions**
2 questions were asked -

- Create your own groupBy function just like lodash
- Create your custom Promise.all method

Yes, those were the 2 questions and I was accorded one hour to complete them. I don’t know what happened to my mind then back during the interview that first question took more than 20 minutes and then also I’ve been only able to complete 95% of it. And the second question again took more than the expected time and I’ve only been able to complete 90% of it.

**Interview Level**
Both the questions were quite simple, I mean, if you give thought right now you might be able to find them. But the first question took so much time, more than expected and I wasn’t prepared for it.

**Problem**
Suddenly after the first 10 minutes, my mind stopped working, I couldn’t think of a solution to the problem. Probably because I have already given an interview before this one just a few hours back and even after this interview I’ve to give one more interview in Coinbase. So things become quite complicated or cumbersome that my mind stopped working in the middle of the interview 😁😂.

The situation become so bad that I stopped in the middle of the interview and told the interviewer that I am not able to think and that whatever I know is not helpful and not helping me to solve the problem.

The interviewer was very kind he ask me what to do then next and luckily I take a deep breath and start solving the problem again. After 10–20 minutes I am starting to find the way and am able to complete the problem up to 90%.

**Takeaways**
Although this kind of situation should not occur I am glad that I’ve handled it a bit more peaceful and didn’t get too panicked. My decision to try to keep trying was good, although I’ve struggled a lot even after that at the end I was very close to solving the problem. In fact, I’ve solved the problem if more time was given😁.

Never mind, things like these will happen, all we can do is be calm before the interview and during the interview.

My suggestion is to take a deep breath during those tough, high pressure and nervous situations just like Ronaldo did before taking free-kicks.

**Conclusion**
I’ve already added the questions so you can practise them in future. Please don’t forget to follow and until next time, have a good day, people.

Our website [iHateReading](www.ihatereading.in) || [Youtube](https://www.youtube.com/channel/UC6I-Tz6QwYbJpoIK7l0NtXA) || [Twitter](https://twitter.com/treyvijay)
Find Largest Value in Each Tree Row
Tags: leetcode, dsa, theabbie
Published: 2022-06-16 09:00:46

Given the `root` of a binary tree, return _an array of the largest value in each row_ of the tree **(0-indexed)**.

**Example 1:**

![](https://assets.leetcode.com/uploads/2020/08/21/largest_e1.jpg)

**Input:** root = \[1,3,2,5,3,null,9\]
**Output:** \[1,3,9\]

**Example 2:**

**Input:** root = \[1,2,3\]
**Output:** \[1,3\]

**Constraints:**

*   The number of nodes in the tree will be in the range `[0, 104]`.
*   `-231 <= Node.val <= 231 - 1`

**SOLUTION:**

    # Definition for a binary tree node.
    # class TreeNode:
    #     def __init__(self, val=0, left=None, right=None):
    #         self.val = val
    #         self.left = left
    #         self.right = right
    class Solution:
        def largestValues(self, root: Optional[TreeNode]) -> List[int]:
            mvals = {}
            nodes = [(root, 0)]
            mlevel = -1
            while len(nodes) > 0:
                curr, l = nodes.pop()
                if curr:
                    mlevel = max(mlevel, l)
                    mvals[l] = max(mvals.get(l, float('-inf')), curr.val)
                    nodes.append((curr.left, l + 1))
                    nodes.append((curr.right, l + 1))
            return [mvals[l] for l in range(mlevel + 1)]
Bölüm 1) echarts.js & Next.js ile Nasıl Dashboard Oluşturabiliriz?
Published: 2022-06-16 08:47:22

Merhaba, bir süredir dashboard geliştirme üzerine uzmanlaşmak istiyordum. Bu dönemde oluşan proje boşluğumda, biraz yeni şeyler öğrenmek, biraz da kendi portfolyomu oluşturup daha niş/odaklı projeler alabilimek için echarts.js ile proje geliştireceğim. 

Bir yazı seti oluşturup bu süreci deneyimlemek isteyen kişilere yardımcı olmak istedim. 
**İlk soru neden [echarts.js](https://echarts.apache.org/examples/en/index.html)**

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

- Daha önce Next.js ile projeler geliştirdiğim için react.js ile uyumlu çalışan ve beni uzmanı olmadığım hatalarla başbaşa bırakmayacağını düşündüğüm bir kütüphane olduğu için. 

Bu şartları sağlayan [recharts.js](https://recharts.org/en-US/) ve amcharts.js da var, fakat recharts.js in hazır grafiklerini echarts.js kadar estetik bulmuyorum. 

[amcharts.js](https://www.amcharts.com/) ise bence çok estetik ama daha önce bir projemde kullandığım için farklı bir kütüphane denemek istedim. Ayrıca amcharts.js opensource değil, enterprise müşteriler için uygun olmayabilir. (Ücretsiz kullanmak istiyorsanız logosunu grafiğe ekliyor.)

- Başlangıç aşamasında yetecek kadar hazır örnekler içermekte,

Bunlar benim kendi sebeplerim, daha detaylı bir inceleme için bu kaynağa bakabilirsiniz. 

[Bölüm 2
](https://dev.to/ozlemts/bolum-2-nextjs-tailwindcss-ve-echartsjs-kurulumu-35m5)
JavaScript: Find sum of numbers present in elements of nested array
Published: 2022-06-16 08:42:43

Hello Dev folks, I'm Gaurav - a front-end focused software developer from India. Recently I came across a JavaScript problem that required me to find sum of all the numbers present in elements of a nested array.
Okay without any further ado, here is the problem:
`sum([1, 'x', '2x', ['3', ['x2', '5']]]);`

So, you see a nested array with 2 levels of nesting being feed to a sum function.

Immediately it comes to mind that if the array was flattened, the task would have been much easier. So, that's what we are gonna do now. **Flatten the array**. You can flatten any way you want it - 
1. Use flat method available on arrays.
2. Use reduce and concat.
3. Use a library such as lodash.
4. Use a recursive function 

While using flat method on arrays is simplest to implement, I decided go with 4 and write a recursive method to flatten the array. It is fast and works for any input and any level of nesting. I'm using newer ES6 syntax.

```
const flattenArr = (arr, result = []) => {
  for (let i = 0, length = arr.length; i < length; i++) {
    const value = arr[i];
    if (Array.isArray(value)) {
      flattenArr(value, result);
    } else {
      result.push(value);
    }
  }
  return result;
};
```
Now, we have a flat Array and the task is easier now.
We will use a variable `sum` to store the result and set its initial value zero.
We can loop through each element of our new Array and if it is a number, we can add and assign it immediately to our sum variable.
The things get exciting when the elements of our new flat array are not a number. You can see in the problem statement above that we have two types of strings, one starting with a number and other starting with a character - `'3'`, `'2x'` and `'x2'`. 

For strings, starting with a number, we can directly use `parseInt` method and it will return the number for first type of string and NaN for the second type of string. That is, after using `partseInt` on `'2x'` and `'3',` we will get 2 and 3 respectively. These values being number can be added to our sum variable. While `parseInt('x2')` will return `NaN`. 

You can use another inbuilt method `isNaN` to check if the returned value is NaN. If the value is `NaN`, then we need to think of other ways to get the number present in that string. Regex comes to our rescue here, we can use a regex to match and filter the number present in string. 

```
const findNumInStringRegex = /\d+/;
let findNumInString = num.match(findNumInStringRegex);
```
This `findNumInString` will either be `null` or a number as string i.e, `null or '5'`.
If it is `null` there is nothing we can do, but for the other case we can again use `parseInt` to get the number and add it to our sum variable.

This way, we can add all the numbers present in elements of the nested array given in the problem.
The solution is present in a [jsfiddle here](https://jsfiddle.net/gauravkrp/yup5j417/10/).
Fruit Into Baskets
Tags: leetcode, dsa, theabbie
Published: 2022-06-16 08:30:48

You are visiting a farm that has a single row of fruit trees arranged from left to right. The trees are represented by an integer array `fruits` where `fruits[i]` is the **type** of fruit the `ith` tree produces.

You want to collect as much fruit as possible. However, the owner has some strict rules that you must follow:

*   You only have **two** baskets, and each basket can only hold a **single type** of fruit. There is no limit on the amount of fruit each basket can hold.
*   Starting from any tree of your choice, you must pick **exactly one fruit** from **every** tree (including the start tree) while moving to the right. The picked fruits must fit in one of your baskets.
*   Once you reach a tree with fruit that cannot fit in your baskets, you must stop.

Given the integer array `fruits`, return _the **maximum** number of fruits you can pick_.

**Example 1:**

**Input:** fruits = \[1,2,1\]
**Output:** 3
**Explanation:** We can pick from all 3 trees.

**Example 2:**

**Input:** fruits = \[0,1,2,2\]
**Output:** 3
**Explanation:** We can pick from trees \[1,2,2\].
If we had started at the first tree, we would only pick from trees \[0,1\].

**Example 3:**

**Input:** fruits = \[1,2,3,2,2\]
**Output:** 4
**Explanation:** We can pick from trees \[2,3,2,2\].
If we had started at the first tree, we would only pick from trees \[1,2\].

**Constraints:**

*   `1 <= fruits.length <= 105`
*   `0 <= fruits[i] < fruits.length`

**SOLUTION:**

    class Solution:
        def totalFruit(self, fruits: List[int]) -> int:
            n = len(fruits)
            i = 0
            j = 0
            ctr = {}
            mlen = 0
            while i <= j and j < n:
                ctr[fruits[j]] = ctr.get(fruits[j], 0) + 1
                j += 1
                if len(ctr) <= 2:
                    mlen = max(mlen, j - i)
                else:
                    while len(ctr) > 2 and i < j:
                        ctr[fruits[i]] -= 1
                        if ctr[fruits[i]] == 0:
                            del ctr[fruits[i]]
                        i += 1
            return mlen
Data Structures 101: Introduction to Data Structures and Algorithms.
Tags: beginners, php
Published: 2022-06-16 08:25:57

**Problem**

Given an array of integers, find the sum of its elements.
For example, if the array **ar=[1,2,3],1+2+3=6**,so return 6.

**Function Description**

Complete the simpleArraySum function in the editor below. It must return the sum of the array elements as an integer.

simpleArraySum has the following parameter(s):
- ar: an array of integers

**Input Format**

The first line contains an integer, **n**, denoting the size of the array.
The second line contains **n** space-separated integers representing the array's elements.

**Constraints**
**0 < n, ar[i] < 1000**

**Output Format**

Print the sum of the array's elements as a single integer.

**Sample Input**

```
6
1 2 3 4 10 11
```
**Sample Output**

```
31
```
Explanation

We print the sum of the array's elements:
**1+2+3+4+10+11=31**

**Solution**

Here, three approaches are used to solve this problem.

**1. Foreach**
This approach does not require the the size of the array hence the most likely loop to be used for this problem.

```
function simpleArraySum($ar) {
    // Write your code here
    $sum = 0;
    foreach($ar as $value){
        $sum += $value;
    }
        return $sum;
}
```

**2. For Loop**
The size of the array and the sum of the array are initialized before using for loop. The indices of the arrays to be summed are incremented by one to move to the next item in the array.

```
function simpleArraySum($ar) {
    $size = count($ar);
    $sum = 0;

    for($i=0 ; $i < $size; $i++){
      $sum += $ar[$i];
    }
    
    return $sum;
}
```

**3. While Loop**

This is the same as for loop but the operation stops when the condition `$i < count($ar)` is no longer true.

```
function simpleArraySum($ar){
    $sum = 0;
    $i = 0;
    while($i < count($ar)){
        $sum += $ar[$i];
        $i++;
    }
    return $sum;

}
```
The output of all three approaches is

```
31
```
Interesting project
Tags: security, python, cybersecurity, networking
Published: 2022-06-16 08:20:16

Hi! please, can you suggest me some cool project to develop with python in the cybersecurity field?
Not the common keylogger, but something a little bit different to add to my projects!
In the matter of facts i'm searching something to create from scratch with python preferably related to networking.
Thanks for all the advice!
Number Of Rectangles That Can Form The Largest Square
Tags: leetcode, dsa, theabbie
Published: 2022-06-16 07:30:36

You are given an array `rectangles` where `rectangles[i] = [li, wi]` represents the `ith` rectangle of length `li` and width `wi`.

You can cut the `ith` rectangle to form a square with a side length of `k` if both `k <= li` and `k <= wi`. For example, if you have a rectangle `[4,6]`, you can cut it to get a square with a side length of at most `4`.

Let `maxLen` be the side length of the **largest** square you can obtain from any of the given rectangles.

Return _the **number** of rectangles that can make a square with a side length of_ `maxLen`.

**Example 1:**

**Input:** rectangles = \[\[5,8\],\[3,9\],\[5,12\],\[16,5\]\]
**Output:** 3
**Explanation:** The largest squares you can get from each rectangle are of lengths \[5,3,5,5\].
The largest possible square is of length 5, and you can get it out of 3 rectangles.

**Example 2:**

**Input:** rectangles = \[\[2,3\],\[3,7\],\[4,3\],\[3,7\]\]
**Output:** 3

**Constraints:**

*   `1 <= rectangles.length <= 1000`
*   `rectangles[i].length == 2`
*   `1 <= li, wi <= 109`
*   `li != wi`

**SOLUTION:**

    class Solution:
        def countGoodRectangles(self, rectangles: List[List[int]]) -> int:
            mx = 0
            ctr = 0
            for a, b in rectangles:
                curr = min(a, b)
                if curr == mx:
                    ctr += 1
                elif curr > mx:
                    ctr = 1
                    mx = curr
            return ctr
Valid Palindrome II
Tags: leetcode, dsa, theabbie
Published: 2022-06-16 08:00:56

Given a string `s`, return `true` _if the_ `s` _can be palindrome after deleting **at most one** character from it_.

**Example 1:**

**Input:** s = "aba"
**Output:** true

**Example 2:**

**Input:** s = "abca"
**Output:** true
**Explanation:** You could delete the character 'c'.

**Example 3:**

**Input:** s = "abc"
**Output:** false

**Constraints:**

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

**SOLUTION:**

    class Solution:
        def validPalindrome(self, s: str) -> bool:
            n = len(s)
            i = 0
            j = n - 1
            while s[i] == s[j] and i < j:
                i += 1
                j -= 1
            if s[i] != s[j]:
                option1 = s[:i] + s[i + 1:]
                option2 = s[:j] + s[j + 1:]
                if option1 == option1[::-1]:
                    return True
                if option2 == option2[::-1]:
                    return True
                return False
            return True
Today's Daily Dose of Programming Humor
Tags: jokes, dailydeveloperjokes
Published: 2022-06-16 08:00:02

---
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/5e1259d336eb5.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:
___Q___: What good can come of 2989 witches casting a hex?

___A___: None, it is always 0xBAD
 -->
NestJS + TypeORM Transaction
Tags: nestjs, typeorm, typescript, webdev
Published: 2022-06-16 07:49:56

Few weeks ago, I started a new personal project for daily-pattern, I encountered a problem about transaction. It was a severe problem for me. I can't remember a specific version of `Typeorm` is, but they deprecated a `getConnection()` method in new version I installed. So I choiced downgrade `Typeorm` version and use the way I used to.

But, my used way has a tiny(but severe) trouble,
let see a code below.
```ts
const queryRunner = getConnection().createQueryRunner();
await queryRunner.connect();
await queryRunner.startTransaction();

try {
  // ...
  await this.modelRepository.save(newOBj);
  await queryRunner.commitTransaction();
} catch(e) {
  // error control logic
}

```
Can you see a problem?
It was totally stupid.
I thought that `QueryRunner` observes the DB's CUD action and makes it a transaction when it occurs.

But, It was not.
So I change code like this.
```ts
const queryRunner = getConnection().createQueryRunner();
await queryRunner.connect();
await queryRunner.startTransaction();

try {
  // ...
  await querRunner.manager.save(newObj);
  await queryRunner.commitTransaction();
} catch(e) {
  // error control logic
}

```
It seems like, There is an object called `manager` in `QueryRunner`, and this object determines the table according to the model and makes it a transaction.

a new logic work properly, so I just want to note my mistake and improvement. For me, and for someone who having the same problem as me.

Thanks for reading.
Plz comment if you have more nice idea or solution.


-----------------------------------------------------------------
Ref --
Cover Img ref : https://miro.medium.com/max/1400/1*GafbQWGfs0xDuH_A0z08wg.png
Linux: systemD (overview + basic management)
Tags: linux, beginners, systemd
Published: 2022-06-16 07:31:21

## Overview

systemd is the system of initialization in many modern distributions based on the Linux kernel. It was developed by Red Hat Corporation in 2010. This system at one time replaced the init subsystem.

systemd is built around the concept of modules (units) . Each module has a name, a type, and manages certain services.

The main advantage of this system is the parallelism during boot process. It allows you to significantly speed up the launch of the entire operating system.

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

systemd can control per-process execution environment, resource limit, working directory, root directory, ID, user, group, and more. Basically systemd is the parent of all processes and it controls the whole system.

Although systemd allows you to load services faster and speed up the operation of the OS as a whole, it has a number of arguments against using this initialization system.

The fact that this init system is responsible for such a large number of different tasks and processes, and also has huge powers in the system, has led many developers and system administrators to speak out strongly against this daemon, refusing to use it in favor of classical solutions.

Linus Torvalds and Richard Stallman have also raised doubts against systemd.
<hr/>

## Basic management

For now in many Linux distributions, all services are currently managed by the init system - systemd.

systemd have special tool which allow you to control services - **systemctl**

Syntax of that tool:
> systemctl options command service

<br/>
Let consider the most commonly used commands:
<u>start</u> - start service
> systemctl start apache

<u>stop</u> - stop service
> systemctl stop apache

<u>status</u> - show service's status
> systemctl status apache

<u>enable</u> - add service to autoload
> systemctl enable apache

<u>disable</u> - delete service from autoload
> systemctl disable apache

<u>list-units</u> - show all services
> systemctl list-units --type service
> systemctl list-units --type service --state running

<u>kill</u> - send a termination signal to a process is used in conjunction with options --signal and --kill-who

<u>restart</u> - restart service

<u>try-restart</u> - restart service if service was started
My Coding Vlog — Day 1
Published: 2022-06-16 07:20:54


## My Coding Vlog — Day 1

Here I am going to share my experience as a coding vlog.

[https://youtu.be/BexDAEtjKNg](https://youtu.be/BexDAEtjKNg)

I have shared a youtube link which contains the code output.

That video or I can say that I have again started with the basics of python and the famous books Automate the Boring Stuff with Python: Practical Programming for Total Beginners
[**my_coding_vlog/day_01.ipynb at main · shoeb370/my_coding_vlog**](https://github.com/shoeb370/my_coding_vlog/blob/main/day_01.ipynb)