teleren/devto huggingface dataset:
Checkout field customizer for WooCommerce
Published: 2022-09-13 06:45:18

I'm looking for a checkout field customizer for WooCommerce. Found [CoDesigner](https://codexpert.io/codesigner) and [CartFlows](https://wordpress.org/plugins/cartflows/). Has anyone tried these plugins?


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5kwn74l69d63c6854dmp.jpg)
Контейнер с наибольшим количеством воды
Tags: kotlin, algorithms, leetcode, medium
Published: 2022-09-13 06:28:24

Давайте разберем задачу контейнера с наибольшим количеством воды. Ее можно найти по ссылке [Container With Most Water](https://leetcode.com/problems/container-with-most-water/)

## Постановка задачи
Дан целочисленный массив значений высоты `height` размера `n`, т.е. нарисовано n вертикальных линий.

Необходимо найти две линии, которые вместе с осью X образуют контейнер, который содержит наибольшее количество воды.

Верните в качестве результата максимальное количество воды, которое может храниться в контейнере.

## Примеры входных данных

### Пример 1
**Входные данные:**
height = [1, 8, 6, 2, 5, 4, 8, 3, 7]
**Результат:**
49

### Пример 2
**Входные данные:**
height = [1, 1]
**Результат:**
1

## Решение
Для решения этой задачи надо использовать жадный алгоритм с двумя указателями. На каждом шаге необходимо вычислять максимально возможный результат. Для этого мы начнем итерироваться с двух концов контейнера. Продвигаться будем левым или правым указателем в одну итерацию. Выбор указателя будет зависить от того, является ли он не большим.

## Решение по шагам

**1)** Сначала надо инициализировать переменную `max`, которую вернем в качестве результата.

```kotlin
var max: Int = 0
```

**2)** Затем необходимо инициализировать левый и правый указатель.

```kotlin
var left: Int = 0
var right: Int = height.size - 1
```

**3)** Для итерации по списку вершин реализуем цикл `while`. Условием окончания цикла является равенство вершин `left` и `right`, либо то что вершина `right` оказалась левее вершины `left`. На каждом этапе считаем текущий объем воды.

```kotlin
while (left < right) {
    val curr = Math.min(height[left], height[right]) * (right - left)
    ...
}
```

**4)** Далее сравниваем текущий объем воды с максимальным и наибольшее значение присваиваем переменной результата.

```kotlin
...
max = Math.max(curr, max)
...
```

**5)** Затем сравниваем левое и правое значение высоты вершин. Если правая вершина больше, то необходимо перевинуть левую вершину к центру. Иначе - двигаем правую вершину к центру.

```kotlin
...
if (height[left] < height[right]) {
    left++
} else {
    right--
}
...
```

**6)** В конце возвращаем переменную `max` в качестве результата.

```kotlin
...
return max
```

## Оценка сложности
- По времени - O(n). По списку выполняется один проход.
- По памяти - O(1). Количество используемой памяти не зависит от размера входного массива.

## Полное решение
```kotlin
fun maxArea(height: IntArray): Int {
    var max: Int = 0
    var left: Int = 0
    var right: Int = height.size - 1
    while (left < right) {
        val curr = Math.min(height[left], height[right]) * (right - left)
        max = Math.max(curr, max)
        if (height[left] < height[right]) {
            left++
        } else {
            right--
        }
    }
    return max
}
```
The Problem With Coding Influencers
Tags: career, beginners, programming, codenewbie
Published: 2022-09-13 06:27:27

Let's for a moment say, that you're a complete beginner( maybe you are). And you type in **YouTube**, "_learn how to code_"( or anything similar), and then... you're bombarded with clickbait videos( btw I also made a YouTube video about this, watch it [here](https://youtu.be/y_qbvmlUUe0), if you like videos more)


![Learn How To Code Clickbait](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7t4nmiotf70b66mlrzpz.png)

You're only going to see videos of how you can learn to code fast, in 100 days, some even say in 30 days. And some say 10 minutes.

Then( remember you're a beginner) you follow these videos, you might sign up for their course( if they have one) and you'll probably get sold a dream and a damn lie.

Then **X**( whatever the video said) amount of time goes by. And you don't know anything. 

You're probably going to think that you're not good enough. The whole thing is very demoralizing.

And the worst part about this is that these videos get millions of views( which makes them even more credible). I mean just look at the image above.

---

Next bs on the list is the whole, "_Best Coding Language!_".
Again you're a beginner, you don't know anything. And then you watch these videos, think( for example) Python is the best language, and when you decide you want to do game development and you need to use C#( or C++) you'll be demoralized.


![Best Coding Language Clickbait](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5607cxis0fplgik2yiyb.png)

Once again these videos get tons of views. I'm not even blaming them at this point. I mean, coding has to be the hardest niche to grow on, of course, you'd want to make **clickbait-y content**.

---

The next bs( and I'll get to the point after this) on the list is, "_How to get a job at google?_".

![How To Get A Job At Google Clickbait](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ieivyyyq8mqmwlc06nn9.png)

The irony of these videos. Again they sell you a dream( probably a course as well) and in return, you get demoralized.

---

Here's the truth about this whole thing. People want something fast and easy. Time, dedication & discipline are unattractive. I'm pretty sure that the algorithm, seeing realistic titles getting few views, doesn't even push out realistic content anymore. It's fuc*ed up.

My main problem with this is that I can imagine people trying these( getting a job at google thing) and after 3 months thinking that they're not smart enough for coding. And as a result, they quit.

Coding takes a long time. **Enjoy the process, have fun make friends.**

**Notice**, I didn't debunk these myths, if you're a beginner and don't understand what I'm talking about, I'm more than happy to tell you everything in detail. Just make a comment or message me.

Have a great day :)
Google action fetching data from an RSS feed
Tags: googlecloud, javascript, beginners
Published: 2022-09-13 06:15:21


In the previous article, we looked at [fetching data from an API for our Google action](https://daily-dev-tips.com/posts/google-action-fetching-data-from-an-api/).

However, in my case, I don't have an API at my disposal. I have an RSS feed, so let's see how we can use that to fetch the latest article, which we can return.

If you'd like to follow along, you can use [this article](https://daily-dev-tips.com/posts/google-actions-via-cloud-function/) as your starting point.

## Fetching RSS data and prompt in Google action

Since our action is based on a cloud function, we can add some dynamic data fetching.

Open up your webhook `package.json`, and let's first add the package we need to parse XML.

```js
{
  "dependencies": {
	  // The other deps
    "xml-js": "^1.6.11"
  }
}
```

Now you can head over to the `index.js` file and start importing the packages we need.
This includes the node-fetch API.

```js
const fetch = require('node-fetch');
const convert = require('xml-js');
```

Then we'll need to convert our handle function to an async function.

```js
// Previous
app.handle('greeting', (conv) => {});

// New
app.handle('greeting', async (conv) => {});
```

And then, we can start by fetching our RSS feed. This can be parsed as plain text.

```js
const response = await fetch('https://daily-dev-tips.com/sitemap.xml');
const text = await response.text();
```

From here, we can use the xml-js package to convert it into a readable stream of JSON.

```js
const jsonData = JSON.parse(convert.xml2json(text, { compact: true }));
```

> Note: I'm using compact mode, which removes a lot of unneeded lines

Then we can add a new card with the first item's data.

```js
conv.add(
  new Card({
    title: jsonData.feed.entry[0].title._cdata,
    text: jsonData.feed.entry[0].content._cdata,
    image: new Image({
      url: 'https://daily-dev-tips.com/images/logo.png',
      alt: 'Daily Dev Tips logo',
    }),
  })
);
```

Save and deploy your function; wait for the deployment to finish and test it out.

![Google actions get data from RSS](https://cdn.hashnode.com/res/hashnode/image/upload/v1662186242360/rp1JLUAd8.png)

### 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)
How to use two NPM packages for single HTML tag???
Published: 2022-09-13 06:10:48

Assume we're having a div tag, which looks like this :

```
<div>Welcome to Youtube : https://www.youtube.com/ #youtube </div>
```

I want to use two npm packages for this tag.
One is [react-linkify](https://www.npmjs.com/package/react-linkify) which is used to make links in a div clickable.
Other one is [react-highlight-hashtags](https://www.npmjs.com/package/react-highlight-hashtags) which is used to highlight hastags.

Now I want to use these two packages on above div. When I tried to make nested tags like this :

```
<Linkify>
    <Hashtags> 
         <div>Welcome to Youtube : https://www.youtube.com/ #youtube </div>
    </Hashtags>
</Linkify>
```
I'm getting some errors. How to achieve this ???

Thanks in advance.
I created an App in Python Using Kivy.
Tags: python, programming, tutorial, beginners
Published: 2022-09-13 06:01:19

After Scrolling through many Online developer forums and watching many tutorials I finally found out how to make a "Hello World" basic App in Python using Kivy.

This is how I made it:
[https://youtu.be/v1rEVZXpVZA](https://youtu.be/v1rEVZXpVZA)

Do share your feedback about the App in the discussion section.

Thank You
Stay Tuned
Tricky CSS questions
Tags: css, webdev, beginners, tutorial
Published: 2022-09-13 05:56:48

Hello Guys today i want to ask some basic but tricky questions in CSS which i found interesting.

Let's get started...

> Ques. 1 - Why float elements make their parent container height 0px?

> Ques. 2 - Why inline-block elements have default space between them even there is no margin?

> Ques. 3 - How clearfix works in CSS ?

> Ques. 4 - How to center element in absolute or relative positioning without using margins or paddings or text align?

> Ques. 5 - Can we use margins in html email templates?

> Ques. 6 - Can we manually provide width and height to span element and if no how can we do it?

> Ques. 7 - how can we change the scrollbar styling in CSS?

> Ques. 8 - Suppose you have 12 paragraphs , how can you target and give every fourth element a text color of violet?(this one not so tricky)

> Ques. 9 - Suppose we have a triangle shape in a div how can we provide the shadow to the triangle ? (Box shadow will provide the shadow to the div element which will be sqaure but not to the triangle)

> Ques. 10 - Suppose we have 5 elements and we provided an animation to all those 5 elements but we want to have a delay of 0.3s between every element, first will run after 0.3s, second will run after 0.6s and so on. How can we give that delay without using separate classes to those elements and using a single class to all elements?

THANK YOU FOR CHECKING THIS POST

You can contact me on -
Instagram - https://www.instagram.com/supremacism__shubh/
LinkedIn - https://www.linkedin.com/in/shubham-tiwari-b7544b193/
Email - shubhmtiwri00@gmail.com

^^You can help me by some donation at the link below Thank you👇👇 ^^
☕ --> https://www.buymeacoffee.com/waaduheck <--

Also check these posts as well
https://dev.to/shubhamtiwari909/js-push-and-pop-with-arrays-33a2/edit

https://dev.to/shubhamtiwari909/tostring-in-js-27b

https://dev.to/shubhamtiwari909/join-in-javascript-4050

https://dev.to/shubhamtiwari909/going-deep-in-array-sort-js-2n90
MLOps: Machine Learning Lifecycle
Tags: datascience, machinelearning, devops
Published: 2022-09-13 05:55:07

Building machine learning products or ML-assisted product features involve two distinct disciplines:

* **Model Development:** Data Scientists — highly skilled in statistics, linear algebra, and calculus — train, evaluate, and select the best-performing statistical or neural network model.

* **Model Deployment:** Developers — highly skilled in software design and engineering — build a robust software system, deploy it on the cloud, and scale it to serve a huge number of concurrent model inference requests.

Of course, that is a gross over-simplification. It takes several other vital expertise in building useful and successful ML-assisted products:

* **Data Engineering:** Build data pipelines to collect data from disparate sources, curate and transform it, and turn it into homogenous, clean data that can be safely used for training models.

* **Product Design:** Understand business needs, identify impactful objectives and relevant business matrices; define product features or user stories for those objectives, recognize the underlying problems that ML is better suitable to solve; design user experience to not only utilize ML model prediction seamlessly with rest of the product features but also collect user (re)action as implicit evaluation of the model results, and use it to improve the models.

* **Security Analysis:** Ensure that the software system, data, and model are secure, and no Personally Identifiable Information (PII) is revealed by combining model results and other publicly available information or data.

* **AI Ethics:** Ensure adherence to all applicable laws, and add measures to protect against any kind of bias (e.g. limit the scope of the model, add human oversight, etc.)

As more models are being deployed in production, the importance of MLOps has naturally grown. There is an increasing focus on the seamless design and functioning of ML models within the overall product. Model Development can’t be done in a silo given the consequences it may have on the product and business.

We need an ML lifecycle that is attuned to the realities of ML-assisted products and MLOps. It should facilitate visibility for all stakeholders, without causing too many changes in the existing workflows of data scientists and engineers.

In the rest of the article, I first give an overview of the typical Model Development and Software Development workflows, and then how to bring the two together for adapting to the needs of building ML-assisted products in the MLOps era.

[Continue reading »](https://www.ml4devs.com/articles/mlops-machine-learning-life-cycle/)
393. LEETCODE solution in CPP
Tags: cpp, programming
Published: 2022-09-13 05:41:57

```
class Solution {
 public:
  bool validUtf8(vector<int>& data) {
    int leftToCheck = 0;

    for (const int d : data)
      if (leftToCheck == 0) {
        if ((d >> 3) == 0b11110)
          leftToCheck = 3;
        else if ((d >> 4) == 0b1110)
          leftToCheck = 2;
        else if ((d >> 5) == 0b110)
          leftToCheck = 1;
        else if ((d >> 7) == 0b0)
          leftToCheck = 0;
        else
          return false;
      } else {
        if ((d >> 6) != 0b10)
          return false;
        --leftToCheck;
      }

    return leftToCheck == 0;
  }
};

```
#leetcode
#challenge
Make an impact on your clients with AR Business Cards.
Tags: augmentedreality, android, businesscards, nocode
Published: 2022-09-13 05:38:04

Utilize the PlugXR Augmented Reality Platform to create a new look for your business cards. Your conversion rates will increase if you make it more appealing to your prospects.

😊Create your first advanced AR experience with PlugXR's powerful features. 

[https://bit.ly/3lpVMB4 ](https://bit.ly/3lpVMB4)

## **For detail information**
:[https://bit.ly/3B9ycAL](https://bit.ly/3B9ycAL)
Damn Vulnerabilities List Lab
Published: 2022-09-13 05:37:50


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4hzv1w9sbgrprmln21ry.png)
Damn Vulnerabilities List Lab
#AWSGoat : A Damn Vulnerable AWS Infrastructure
https://lnkd.in/dq2cYPG2

#AzureGoat : A Damn Vulnerable Azure Infrastructure
https://lnkd.in/dKMMrESA

#Webpentest: A Damn Vulnerable Web Application
https://lnkd.in/dNJxX-Fe

#API: A Damn Vulnerable Web Sockets
https://lnkd.in/dMbJgP5h

#Mobile: Damn Vulnerable Hybrid Mobile App
https://lnkd.in/dSMZMuzZ

#cybersecurity #redteam #blueteam #bugbounty
Method chaining in Javascript
Tags: javascript, beginners, codenewbie, tutorial
Published: 2022-09-13 05:30:47

NOTE: In method chaining we return **this**

1. **Method Chaining example using ES6 class**
![Method Chaining example using ES6 class](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lseqq404oymaov7haj3p.png)

```
//method chaining using class object
class Calculator {
    constructor() {
        this.value = 0;
    }
    add(x) {
        this.value += x;
        return this;
    }
    sub(x) {
        this.value -= x;
        return this;
    }
    mul(x) {
        this.value *= x;
        return this;
    }
}

const obj = new Calculator();
obj.add(10).add(10).mul(2).value;
```

2. **Method chaining example using javascript object shorthand**
![Method chaining example using javascript object shorthand](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y6yavba5dexme8ao6bri.png)

```
//method chaining using object shorthand
let operations = {
    arrayValue: [],
    insert: function (x) {
        this.arrayValue.push(x);
        return this;
    },
    remove: function () {
        this.arrayValue.pop();
        return this;
    },
    filterMatching: function (x) {
        this.arrayValue = this.arrayValue.filter((e) => e === x);
        return this;
    },
};

operations.insert(1).insert(2).insert(3).remove().filterMatching(1).arrayValue;

```
Rotate Right - LinkedList
Tags: javascript, leetcode
Published: 2022-09-13 05:21:51

```js
var rotateRight = function(head, k) {
    
    if(head === null || head.next === null){
        return head;
    }
    for(let i=0; i<k; i++){
        let current = head;
        let previous = head;
        while (current?.next){
            previous = current;
            current = current.next;
        }
        let lastElement = previous.next;
        previous.next = null;
        lastElement.next = head;  
        head=lastElement
    }
    return head;
};
```

```js
   
  let current = head;
    let slow = head;
    let fast = head;
    let size = 0;
    
    if(!head || !head.next) return head;
    
    while(current) {
        current = current.next;
        size++;
    }
    
    let shiftBy = k % size;
    if (shiftBy === 0) return head;
    
    
    while(shiftBy--) {
        fast = fast.next;
    }
    
    while(fast.next) {
        fast = fast.next;
        slow = slow.next;
    }
    
    
    fast.next = head;
    head = slow.next;
    slow.next = null;
    
    return head;

```
Laravel 8 Inner Join Query Example
Tags: laravel, laravel8, join, mysql
Published: 2022-09-13 05:16:26

In this article, we will learn about laravel 8 inner join query example. Also, see how to join two tables in laravel 8. In laravel you can use group by query same as PHP. 

So, we will also see a query of laravel inner join with the group by. The query builder may also be used to add join clauses to your queries. To perform a basic "inner join", you may use the join method on a query builder instance.

For laravel inner join query example we need the first argument passed to the join method is the name of the table you need to join to, while the remaining arguments specify the column constraints for the join. 

You may even join multiple tables in a single query and inner join query use in laravel 6, laravel 7, laravel 8.

So, let's see an example of inner join in laravel 8.
AWS Spot instances
Tags: aws, cloud, career
Published: 2022-09-13 04:55:55

☁️ ☁️ Amazon EC2 Spot Instances
Run fault-tolerant workloads for up to 90% off

Amazon #ec2 Spot Instances let you take advantage of unused EC2 capacity in the AWS cloud. Spot Instances are available at up to a 90% discount compared to On-Demand prices. You can use Spot Instances for various stateless, fault-tolerant, or flexible applications such as big data, containerized workloads, CI/CD, web servers, high-performance computing (HPC), and test & development workloads. Because Spot Instances are tightly integrated with AWS services such as Auto Scaling, EMR, ECS, #cloudformation , Data Pipeline and AWS Batch, you can choose how to launch and maintain your applications running on Spot Instances.

💡 How it works


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1a9kwnek2lsfb7b0zlfg.PNG)

💡 Why:
✅ Low, predictable prices
✅ Massive scale
✅ Easy to use
✅ Easy to automate


💡 Where:
✅ Big Data & Analytics
✅ Containerized workloads
✅ CI/CD Testing
✅ Web Services
✅ Image and media rendering
✅ High performance computing

💡 Best Practices:
✅ Prepare individual instances for interruptions
✅ Be flexible in terms of instance types and availability zones
✅ Use EC2 Auto Scaling groups or Spot Fleet to manage your total capacity
✅ Use integrated AWS services to manage your Spot instances

Check Spot instances pricing [here](https://aws.amazon.com/ec2/spot/pricing/)
Best LMS Ghost Themes in 2022
Tags: ghost, themes, ux, podcast
Published: 2022-09-13 04:54:54



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

Learn is a [premium Ghost theme](https://themeix.com/product/category/ghost-themes/) for Ghost CMS. It is optimized for learning content management system, as well as suited for education, training, and corporate websites.  It has many convenient features, such as easy user management, ticket reservation system, attendance tracking, etc.

## Learn LMS Ghost Theme Features 

- Free and Paid Course / Lesson Options
- Modern Ui & Unique Design
- Well-Ordered Stacks
- Numerous Footer variants
- Multiple blog page variant
- Fully Responsive LMS Template 
- Fully Responsive LMS Template  Possible
- Google Web Fonts (FREE)
- Responsive Navigation Menu
- Responsive Navigation Menu
- W3C Validated Code
- W3C Validated Code

[Download Learn](https://themeix.com/product/learn-premium-lms-theme-for-ghost-cms/ref/32/)