teleren/devto huggingface dataset:
Cloud Native Transformation - Deploying Integration workloads to AKS | Case Study
Tags: webmethods, integrationserver, esb, cloudcontainer
Published: 2022-05-17 13:03:24

---
title: Cloud Native Transformation - Deploying Integration workloads to AKS | Case Study
published: true
date: 2022-05-10 07:38:22 UTC
tags: webMethods, IntegrationServer, ESB, CloudContainer
canonical_url: https://tech.forums.softwareag.com/t/cloud-native-transformation-deploying-integration-workloads-to-aks-case-study/257312
---

[https://www.youtube.com/embed/LyEQ0m5CC1g](https://www.youtube.com/embed/LyEQ0m5CC1g?autoplay=1&feature=oembed&wmode=opaque)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xx0bm9fln3mfthldjldt.png)
 

Check the recording of the event:
https://groups.softwareag.com/events/details/software-ag-webmethods-developers-india-presents-case-study-cloud-native-transformation-deploying-integration-workloads-to-aks/

To get notified of future events join the WebMethods Developer India group visit: https://groups.softwareag.com/webmethods-developers-india/

[Visit original post](https://tech.forums.softwareag.com/t/cloud-native-transformation-deploying-integration-workloads-to-aks-case-study/257312)
#009 HP USB-C Dock G5 doesn't detecting monitors HDMI or DisplayPort - Resolved
Published: 2022-05-10 07:33:09

> 

I use the USB-C Dock G5 for almost one year; I have connected the Dock with two monitors using display ports and HDMI; After I've installed the last windows 11 updates and restart the PC I faced a problem with my monitors... Windows 11 doesn't recognize external monitors, connected over the Dock, but recognize if I connect the monitor directly to my PC using an HDMI port!

**What doesn't work: **

- Update all drivers

- Restarting, unplugging, and restarting all that stuff

- Uninstalling and then reinstalling the latest windows updates

- Updating the latest HP BIOS

- Updating the latest HP Graphics update 

- Connect and try new cables

- Connect and try the new USB-C Dock G5



Frustration goes high, but an engineer never gives up :) 

Finally, I fixed the problem with the following steps...



**WHAT WORKS: S O L U T I O N ** 

1. Shut down your laptop

2. Disconnect the dock

3. Reset the laptop by holding the power button & F6 for 20 seconds

4. Start your computer up

5. Plug the G5 dock back in



RESOLVED!

 p.s. HP guys should be working harder on this case! 


#HP #dockingstation
Adding an animated state to our Remix form
Tags: react
Published: 2022-05-10 07:05:24

Now that we have our [form displaying error](https://daily-dev-tips.com/posts/handling-errors-in-remix-forms/), we still have one slight downside.

Let's say our form takes quite a while to load. Some users might be impatient and click the submit button multiple times or even change the inputs.

Let's emulate that by introducing a "sleep" in our action.

```js
export const action = async ({ request }) => {
  // Sleep...
  await new Promise((r) => setTimeout(r, 1000));

  // All the other stuff
};
```

Now our code will always wait 1000 milliseconds.

## Using the Remix useTransition hook

Besides the hooks, we already used, Remix gives us a `useTransition` hook.
We can hook into the fact that the form is busy with something with this hook.

In our case, we want to disable all the form fields and change the text on the button, so the user knows something is happening.

First, we load the hook inside our render.

```js
import { useTransition } from '@remix-run/react';

export default function NewPost() {
  const transition = useTransition();

  // Our render
}
```

Then for the render part we can wrap our form elements inside a fieldset so we can quickly disable all of them:

```js
<Form method='post'>
  <fieldset disabled={transition.state === 'submitting'}>
    // Our form fields
  </fieldset>
</Form>
```

You can see we hook into the transition state, and if that is submitting, we disable the form.

Next, we can change our button to reflect the action as well.

```js
<button
  type='submit'
  className='rounded bg-blue-500 py-2 px-4 text-white hover:bg blue-600 focus:bg-blue-400 disabled:bg-blue-300'
>
  {transition.state === 'submitting' ? 'Creating...' : 'Create post'}
</button>
```

This is the same concept of using the state to determine which text to show.

If we run our code, we should get the following result:

![remix-animated-state.gif](https://cdn.hashnode.com/res/hashnode/image/upload/v1651257706199/6jOPk1PmL.gif)

You can also find the completed code sample on this [GitHub branch](https://github.com/rebelchris/remix-starter/tree/animated-state).

### Thank you for reading, and let's connect!

Thank you for reading my blog. Feel free to subscribe to my email newsletter and connect on [Facebook](https://www.facebook.com/DailyDevTipsBlog) or [Twitter](https://twitter.com/DailyDevTips1)
Tow Sum
Tags: beginners, datastructur, algorithms, interview
Published: 2022-05-10 06:45:57

<h2><a href="https://leetcode.com/problems/two-sum/">1. Two Sum</a></h2><h3>Easy</h3><hr><div><p>Given an array of integers <code>nums</code>&nbsp;and an integer <code>target</code>, return <em>indices of the two numbers such that they add up to <code>target</code></em>.</p>

<p>You may assume that each input would have <strong><em>exactly</em> one solution</strong>, and you may not use the <em>same</em> element twice.</p>

<p>You can return the answer in any order.</p>

<p>&nbsp;</p>
<p><strong>Example 1:</strong></p>

<pre><strong>Input:</strong> nums = [2,7,11,15], target = 9
<strong>Output:</strong> [0,1]
<strong>Explanation:</strong> Because nums[0] + nums[1] == 9, we return [0, 1].
</pre>

<p><strong>Example 2:</strong></p>

<pre><strong>Input:</strong> nums = [3,2,4], target = 6
<strong>Output:</strong> [1,2]
</pre>

<p><strong>Example 3:</strong></p>

<pre><strong>Input:</strong> nums = [3,3], target = 6
<strong>Output:</strong> [0,1]
</pre>

<p>&nbsp;</p>
<p><strong>Constraints:</strong></p>

<ul>
	<li><code>2 &lt;= nums.length &lt;= 10<sup>4</sup></code></li>
	<li><code>-10<sup>9</sup> &lt;= nums[i] &lt;= 10<sup>9</sup></code></li>
	<li><code>-10<sup>9</sup> &lt;= target &lt;= 10<sup>9</sup></code></li>
	<li><strong>Only one valid answer exists.</strong></li>
</ul>

<p>&nbsp;</p>
<strong>Follow-up:&nbsp;</strong>Can you come up with an algorithm that is less than&nbsp;<code>O(n<sup>2</sup>)&nbsp;</code>time complexity?</div>

Python solution using HashMap

```
class Solution:
    def twoSum(self, nums: List[int], target: int) -> List[int]:
        new_hash_map = {}
        
        for i, n in enumerate(nums):
            difference = target - n
            if difference in new_hash_map:
                return(i, new_hash_map[difference])
            else:
                new_hash_map[n] = i
                
            
        
```
Time complexity O(N)


Java Solution

```
class Solution {
    public boolean containsDuplicate(int[] nums) {
        Set<Integer> numbers = new HashSet<Integer>();
        for (int num : nums) {
            if (numbers.contains(num)) return true;
            numbers.add(num);
        }
        
        return false;
    }
}
```
Time complexity O(N)
Introduction to Deep Reinforcement Learning
Tags: deeplearning, machinelearning, python, datascience
Published: 2022-05-10 06:39:21

How to build a general artificial intelligence from scratch using a deep reinforcement learning algorithm called Deep Q-learning

Hi! I wrote an article on how to build a general artificial intelligence from scratch using a deep reinforcement learning algorithm called Deep Q-learning:
https://medium.com/@lorenzotinfena/a-formal-introduction-to-deep-reinforcement-learning-db639d8c48b8
Array.shift() - for shifting the first item in an array
Tags: javascript
Published: 2022-05-10 06:09:12

Article number 12 of the [Array Method Series](https://dev.to/dillionmegida/series/17614). In this article, I will explain the `shift` Array method.

## What is the Shift Method?
The `shift` method of arrays shifts the first item out of an array.

This method returns the shifted item and also modifies the array--removing the item from the array.

## Syntax of the Shift Method

```js
array.shift()
```

## Without the Shift Method
Here's how to imitate the `shift` method:

```js
let array = [1, 2, 3, 4, 5]

const shiftedValue = array[0]
const [, ...rest] = array
array = rest

console.log(shiftedValue)
// 1

console.log(array)
// [2, 3, 4, 5]
```

This approach is similar to what the `shift` method does in the background. It returns the first item and removes it from the array, thereby making the array lesser in length by 1.

## With the Shift Method

Here's how you achieve the previous result with `shift`:

```js
const array = [1, 2, 3, 4, 5]

const shiftedValue = array.shift()

console.log(shiftedValue)
// 1

console.log(array)
// [2, 3, 4, 5]
```

On the contrary to how `shift` works, read on [pop - for removing the last item from an array](https://dev.to/dillionmegida/arraypop-for-popping-the-last-item-of-an-array-5025)
Array.pop() - for popping the last item of an array
Tags: javascript
Published: 2022-05-10 06:07:59

This article is the eleventh of the [Array Method Series](https://dev.to/dillionmegida/series/17614). In this article, I will explain what the `pop` Array method is.

## What is the Pop Method?
The `pop` method of arrays pops out the last item in an array. 

This method returns the popped-out item and also modifies the array--removing the item from the array.

## Syntax of the Pop Method

```js
array.pop()
```

## Without the Pop Method
Here's how to imitate the `pop` method:

```js
const array = [1, 2, 3, 4, 5]

const poppedValue = array[array.length - 1]
array.length = array.length - 1

console.log(poppedValue)
// 5

console.log(array)
// [1, 2, 3, 4]
```

This approach is similar to what the `pop` method does in the background. It returns the last element and removes it from the array, making the array lesser in length by 1.

## With the Pop Method

Here's how you achieve the previous result with `pop`:

```js
const array = [1, 2, 3, 4, 5]

const poppedValue = array.pop()

console.log(poppedValue)
// 5

console.log(array)
// [1, 2, 3, 4]
```

On the contrary to how `pop` works, read on [shift - for removing the first item from an array](https://dev.to/dillionmegida/arrayshift-for-shifting-the-first-item-in-an-array-3lka)
Apache APISIX Plugins Orchestration Overview
Tags: plugins, tutorial, programming, opensource
Published: 2022-05-10 05:42:40

Currently, [Apache APISIX](https://apisix.apache.org/) API Gateway provides more than 50 built-in plugins broken down into several categories to meet the common usage scenarios. It covers authentication, security, traffic control, serverless, observability, and many more. 

## Problem 1

Plugins are unable to meet all the needs of the enterprise because each company has some unique needs. So, we often need to do some custom development of existing plugins to meet our business requirements. This is an actual problem because plugin development still requires more skills like in the specific programming language. For plugin development, different open-source projects have different solutions. 

## Problem 2

Sometimes your service requires you to use many plugins together. The problem now is that the plug-ins do not share context and cannot cooperate in all other API gateways that have been open source so far.

## Plugins Orchestration

In the following video tutorial, you will learn with low-code Apache APISIX plugin orchestration capability, how the above-mentioned problems can be solved and can help businesses to reduce the development cost of the new API Gateway Plugin to almost zero. We can easily orchestrate all existing plugins in a “drag-and-drop” way on the UI dashboard. You can also combine different plugins by using conditional components to create new “plugins”.  

{% embed https://youtu.be/Fv6ioo7Ce7E %}

---

## Plugin Orchestration in action

As you watch the video tutorial, the scenario was demonstrated where we decide the subsequent API request processing logic based on the processing result of previous plugin. 

- Our API receives requests only from whitelisted IPs with the _[ip-restriction](https://apisix.apache.org/docs/apisix/plugins/ip-restriction)_ plugin control.
- If the IP is in the whitelist, _[limit-count](https://apisix.apache.org/docs/apisix/plugins/limit-count)_ takes over and limits the number of requests 2 within 60 seconds time window.
- If new request comes from different IP range, the plugin returns a 403 (requested resource is forbidden) HTTP status code.

After putting all building blocks to the drawing board (plugins, condition), we will have a diagram similar to below:

![Plugin orchestration digram](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xnilhjbvnpwf5dy3kyae.png)

To learn more⤵️

➔ Read [Overview of Apache APISIX API Gateway Plugins] (https://dev.to/apisix/overview-of-apache-apisix-api-gateway-plugins-2m8o)

➔ Read [API Observability with Apache APISIX Plugins] (https://dev.to/apisix/apis-observability-with-apache-apisix-plugins-1bnm)

➔ Read [Centralized Authentication with Apache APISIX Plugins] (https://dev.to/apisix/centralized-authentication-with-apache-apisix-plugins-30fo)

➔ Watch Video Tutorial [Getting Started with Apache APISIX](https://youtu.be/dUOjJkb61so)  

➔ Watch Video Tutorial [Getting Started with Apache APISIX Dashboard](https://youtu.be/-9-HZKK2ccI)
Self-invoking function as React children
Tags: devterminal, react, frontend, selfinvokingfunctions
Published: 2022-05-10 05:34:12

I always wanted to be able to use return statement on children rendering. Self-Invoking Function is the solution. This is an example of building page states inside of the Layout component. 💡🧑‍💻

```jsx
const SelfInvokingChildren = () => {
  const [loading, error, data] = useData()

  return (
    <Layout>
      {(function () {
        if (loading) return <Placeholder />

        if (error) return <Error />

        if (!data) return <NotFound />

        return <PageContent data={data} />
      })()}
    </Layout>
  )
}
```
What are CTFs ? A beginner guide to CyberSec CTFs
Tags: cybersecurity, career, tutorial, news
Published: 2022-05-10 04:11:19

[
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6bncalt1j7eo7bjt8m0p.jpeg)](https://cybersechelper.me/what-are-ctf-beginner-guide-to-cybersecurity-ctf/)

https://cybersechelper.me/what-are-ctf-beginner-guide-to-cybersecurity-ctf/
Algoritmos: Tipos de Dados
Tags: beginners, programming
Published: 2022-05-10 03:56:42

Olá dev tudo bem? eu sou Samuel Balena e faço parte do grupo de embaixadores da DIO Campus Experts, e hoje estou aqui para discutir mais um assunto que é muito importante para a nossa carreira como desenvolvedor. Então vamos lá!

**Tipos de Dados**

No contexto do mundo da programação, dados é tudo aquilo que pode ser fornecido para o computador, de forma que possam ser processados para resolver um problema ou gerar informações.

Primeiro vamos definir melhor esses termos, então vamos lá.

**Dados:** é como se fosse um fragmento de um informação, por exemplo um número qualquer pode ser um dado, da mesma forma que uma palavra também pode ser um dado. Mesmo que fora de contexto, ainda não deixam de ser dados.

**Informação:** por sua vez um informação são dados dentro de um contexto, já que por sua vez um dado sem contexto não faça muito sentido, por exemplo vamos usar uma sequêcia de números: 11 95396-8948. Esses dados podem ser considerados uma informação, que nesse caso seria um número de telefone.

**Intrução:** simplismente é o que utilizamos para desenvolvimento de sistemas. Podemos dizer que se constitui numa sequência de palavras que o computador possa entender para realizar o processamento de dados.

**Tipos de dados**

Assim como definimos dados acima, vamos citar os seus tipos que existem.

**Númericos inteiros:** esses dados consistem em números inteiros e nas operações matemáticas. Por exemplo, nas operações de subtração, adição, divisão e multiplicação.

**Númericos Reais:** diferente de números inteiros, os números reais por sua vez contém uma parte inteira e outra fracionária. Exemplos: 10.9, 57.69, 7.1 e etc....

**Dados literais:** neste tipo de dados, contém sequências de números, letras e símbolos especias(geralmente utilizamos com " aspas duplas dentro de uma variável).

Quando trabalhamos com dados(que no nosso caso é o tempo inteiro), devemos ter cuidado e consciência de como podemos utiliza-lós e trata-lós.
Introdução a Algoritmos 👨‍💻
Tags: beginners, programming
Published: 2022-05-10 03:54:05

Olá dev tudo bem? eu sou Samuel Balena e faço parte do grupo de embaixadores da DIO Campus Experts, e hoje estou aqui para discutir um assunto que é muito importante para a nossa carreira como desenvolvedor. Então vamos lá!

**Introdução a Algoritmos**

Algoritmos é um assunto básico que está presente em nossa carreira, uma vez que nós desenvolvedores trabalhamos com isso diariamente. Uma definição que podemos utilizar é que, algoritmos se trata de uma sequência de passos que utilizamos para resolver um determinado problema.

Uma receita de bolo por exemplo, pode ser considerado um algoritmo. Vamos ver o exemplo a seguir.

Problema: Fazer um bolo delicioso.

Ingredientes: Nós iremos utilizar farinha, leite, ovo, manteiga e chocolate.

Passos: Primeiro coloque o ovo e farinha e bata até a mistura ficar homogênea. Em seguida, adicione os demais ingredientes, bata por 3 min. Despeje o conteúdo numa assadeira. Aqueça o forno a 180 graus por 5 min. Coloque a assadeira no forno por 40 min.

Resultado: Um bolo delicioso de chocolate.


Outro aspecto que vale ressaltar, em algoritmos utilizamos a lógica para estruturar a maneira e a ideia que são apresentados para resolver determinado problema. Já que por sua vez algoritmos é uma sequência de passos, a lógica vai nos ajudar a estruturar os nossos passos em uma ordem que faça sentido, sendo que em nosso exemplo, não há como entregar o bolo sem ao menos te-lô feito, ou se faltar os ingredientes.
Magical Bulk Insertion in Rails 6
Tags: ruby, rails, development, sql
Published: 2022-05-10 03:53:17

## Introduction
In modern apps we mostly have a requirement which allows user to perform bulk actions. Like insertion of records is the one.

On the first take you would come up with this version

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

## Problematic Region
So what the hack? Above code is a classic situation of multiple sql insert calls, each for a movie creation. This yields slow performance, eventually bad code! 

## Workaround in Oldies
If you're running on Rails 5 and older versions, you might face the situtation where writing raw customized SQL or using gems like [activerecord-import](https://github.com/zdennis/activerecord-import) is the final option you left with.

## Magic of Rails 6
But once you're up and running here, there is a method for you, built out of the box namely **insert_all**

Pick your wand and lets get started!

*We are discussing a Car model here

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

Documentation here: https://apidock.com/rails/v6.0.0/ActiveRecord/Persistence/ClassMethods/insert_all

Do you find it useful? Let me know inside comments!
Follow me for more interesting snacks.
Key points of Consistent Hashing
Tags: devops, design, systems, architecture
Published: 2022-05-10 03:52:13

### Key points of Consistent Hashing

The key to understand Consistent Hashing is to understand the following:

1. **We not only hash the key IDs but also the server/node IDs**. Modulo hashing works well for a fixed number of servers. However in reality servers can go down and become unavailable; so a fixed number of servers cannot be assumed.

2. Server IDs are hashed to a fixed range. The key IDs are also hashed to the same fixed range. Can imagine this range to be like a circle.

3. The key IDs are then routed to the closest server in the clockwise direction (It can be anticlockwise as well, as long as the same direction is used for all the keys).

4. Finally, only a single hashing algorithm need not be used. We can use multiple hashing algorithms to make the servers spread out across the circle. Thus the load can be distributed in a better manner.

---

Ref:

1. [Visual simulation of consistent hashing](https://tech.endeepak.com/blog/2021/09/22/visual-simulation-of-consistent-hashing/)

2. [What is Consistent Hashing and Where is it used?](https://www.youtube.com/watch?v=zaRkONvyGr8)
day 3/100 days of code i forgot
Tags: javascript, webdev, beginners, 100daysofcode
Published: 2022-05-10 03:40:41

i was late i forgot to upload this yesterday so i'm doing it today
i procastinated a little bit so i only learned a bit about functions and not much more than that
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/16rd3lrlwbxbvsm623g0.jpg)
SQL-Quick tip #12 - Available disk space
Tags: tsql, sqlserver, sql, mssql
Published: 2022-05-10 02:49:25

## Sql Server tips and tricks

This is part of a series of quick tips and tricks I have accumulated over the year, that I think can be useful for others.
If you have similar short tips and tricks please leave a comment.

### Available disk space

Having your database server running out of disk space is a very bad thing. Its the kind of showstopper that can really mess up your day, week or maybe the entire month.
So you should have some kind of monitoring in place to warn you if your disk is running low on space. You can buy some expensive enterprise all-inclusive software the monitors everything, or you start small by implementing scheduled task that runs a query to fetch information about the available disk space and then send you an email with the numbers.
The first script below will show how much disk space is left on the drive where your database is located and the second script will show how much disk space is currently allocated to the database and how much free space is available in the filegroup.

```sql
SELECT DISTINCT dovs.volume_mount_point AS Drive, CONVERT(INT,dovs.available_bytes/1048576.0) AS [Free Space In MB]
  FROM sys.master_files mf
 CROSS APPLY sys.dm_os_volume_stats(mf.database_id, mf.FILE_ID) dovs
 ORDER BY [Free Space In MB] ASC

SELECT DS.name [Filegroup name],
       DF.name [Filename],
       SUBSTRING(DF.physical_name, 1, 1) [Drive],
       DF.physical_name [Physical name],
       size/128 [Total size in MB],
       size/128.0 - CAST(FILEPROPERTY(DF.name, 'SpaceUsed') AS int)/128.0 [Available space in MB],
       CAST(FILEPROPERTY(DF.name, 'SpaceUsed') AS int)/128.0 [Actual space used in MB],
       (CAST(FILEPROPERTY(DF.name, 'SpaceUsed') AS int)/128.0)/(size/128)*100. [% Space used]
  FROM sys.database_files DF
  LEFT OUTER JOIN sys.data_spaces DS ON DF.data_space_id = DS.data_space_id
 ORDER BY DF.Name ASC;
```

![Sql Server Management Studio screenshot](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/f39oe6p3j6mlzswh2otv.png)
Adobe Photoshop: Upscale Image without quality loss
Tags: optimization, scale, photoshop, codequality
Published: 2022-05-10 02:26:48

The software’s **Preserve Details** feature is incredibly beneficial if you’re not sure how to enlarge a picture without losing quality. It can help whether you’re working with a small image to begin with, or forgot to save a picture in high-quality.

1. Open the image you want to make bigger.
2. Navigate to **Preferences** and pick **Technology Previews**. Ensure **Enable Preserve Details 2.0 Upscale** is enabled and press OK.

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

Navigate back to your picture, and go to **Image > Image Size**​​​​​​.
In the popup, change the dimensions of the image to your desired size. Next to Resample, instead of Automatic, pick **Preserve Details 2.0**.

![](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9p6n712vr6dchosbt1wc.jpg)

You can move the image around in the preview, then see you’re satisfied with the results.

[Source](https://www.makeuseof.com/how-to-upscale-an-image-without-losing-quality/).