teleren/devto huggingface dataset:
WordPress Theme Development with the latest Bootstrap 5
Tags: wordpress, bootstrap, javascript
Published: 2021-04-23 06:19:28

# About the tutorial 

We have created the most comprehensive tutorial about WordPress Theme Development with Bootstrap and Material Design 

☑  Creating a responsive, mobile-first website
☑ Stunning, modern design
☑ Easy to follow
☑ SEO friendly
☑ Free hosting

You can access the full tutorial roadmap & resources [here](https://mdbootstrap.com/docs/standard/cli/tutorial/wordpress/) or explore the videos below.

---

## #01: Environment (PHP/MySQL/WordPress)

In the following video, you will learn how to install PHP and MySQL using XAMP. Afterward, we will create a new instance of WordPress.

{% youtube svVCsr1Xezs %}

____

## #02: Theme (Using CLI)

Once we have WordPress up and running locally we can create new theme. You can either create empty starter (without any CSS nor JS) or use predefined starters which comes with preinstalled MDB package.

In this section we will show you how to easily create WordPress theme with single command. (At the bottom of the page we will also show you two alternative ways to create an empty theme)


{% youtube vROnt5uIjzc %}

____

## #03: Deployment (coming soon)

Using MDB CLI you can easily create and deploy WordPress. With a single command, your website will be published on the Internet.

[![project1](https://mdbootstrap.com/wp-content/themes/mdbootstrap4/content-gh/en/_mdb5/standard/web/docs/cli/tutorial/wordpress/assets/03.jpg)](https://youtube.com/playlist?list=PLl1gkwYU90QlAGkN9Tt2YrHVqMdj20VkB)
____

## #04: Blog Homepage

In the following video you will learn how:

- Add custom styles to your theme
- Import new libraries to your theme
- Change configuration of your theme (add feature image support)
- Use WordPress Loop

{% youtube CzcF1oTD-DY %}

____

## #05: Blog Post Page

In the following video you will learn how:

- Create WordPress template hierarchy
- Build WordPress loop for single posts

{% youtube xfaVlKVLdV0 %}
_____

## #06: WooCommerce Product Page

In the following video you will learn how:

- Install WooCommerce
- Add support for WooCommerce in our theme
- Work and adjust WooCommerce hooks
- Work and adjust WooCommerce templates

{% youtube 3nJ70cr6NQ8 %}
________

## #07: WooCommerce ShopPage

In this tutorial we will learn how to create a WooCommerce shop page.

{% youtube adVSSotBYGw %}

-----

## Additional resources

Learn web development with our **learning roadmap**:
**[:mortar_board: Start Learning](https://mdbootstrap.com/docs/standard/getting-started/)**

Join our mailing list & receive **exclusive resources** for developers
**[:gift: Get gifts](https://mdbootstrap.com/newsletter/)**

Join our private FB group for **inspiration & community experience**
**[👨‍👩‍👧‍👦 Ask to join](https://www.facebook.com/groups/682245759188413)**

**Support creation of open-source packages** with a STAR on GitHub
[![GitHub Stars](https://img.shields.io/github/stars/mdbootstrap/mdb-ui-kit?label=Star%20now&style=social)](https://github.com/mdbootstrap/mdb-ui-kit/)
Increase Of IOT Devices
in coming decades
Tags: iotfuturemodernized
Published: 2021-04-23 06:18:11

IOT known as Internet of Things is future of the world where we get all things done in a touch or button . IOT is also considered the beacons of the fourth industrial revolution.

IoT devices are pieces of hardware, such as sensors, actuators, gadgets, appliances, or machines, that are programmed for certain applications and can transmit data over the internet or other networks. They can be embedded into other mobile devices, industrial equipment, environmental sensors, medical devices, and more.

Increasingly, IoT devices are using AI and machine learning to bring intelligence and autonomy to systems and processes, such as autonomous driving, industrial smart manufacturing, medical equipment, and home automation. Many of these devices are small, power- and cost-constrained microcontroller-based systems. Network bandwidth and consumer expectations around data privacy and user experience continue to demand more on-device processing, where data is processed on the IoT endpoint, rather than using cloud-based approaches.

Examples of some of IOT devices are
Connected appliances.
Smart home security systems.
Autonomous farming equipment.
Wearable health monitors.
Smart factory equipment.
Wireless inventory trackers.
Ultra-high speed wireless internet.
Biometric cybersecurity scanners.

Sure, the adoption of IoT technologies in smart cities is a matter of convenience. But at the same time, they are capable of so much more. Like building a smart economy and governance, improving infrastructure, enhancing safety, cutting energy usage and cost, and reducing environmental impact.

In my opinion the IOT services will change a lot in future and help us to make the world more modernized.
LINEAR REGRESSION
Published: 2021-04-23 06:06:56

# What is Linear Regression?

Linear Regression is a linear approach to modeling the relationship between a scalar response and one or more explanatory variables. The case of one explanatory variable is called simple linear regression; for  more than one, the process is called multiple linear regression


# What is Simple Linear Regression?

The simple linear regression is a linear regression model with a single explanatory variable. 

# Implementing Simple Linear Regression in Python

```import numpy as np
from sklearn.linear_model import LinearRegression
x = np.array([5, 15, 25, 35, 45, 55]).reshape((-1, 1))
y = np.array([5, 20, 14, 32, 22, 38])
model = LinearRegression()
model.fit(x, y)
model = LinearRegression().fit(x, y)
r_sq = model.score(x, y)
print('coefficient of determination:', r_sq)
print('intercept:', model.intercept_)
print('slope:', model.coef_)
new_model = LinearRegression().fit(x, y.reshape((-1, 1)))
print('intercept:', new_model.intercept_)
print('slope:', new_model.coef_)
y_pred = model.predict(x)
print('predicted response:', y_pred, sep='\n')
y_pred = model.intercept_ + model.coef_ * x
print('predicted response:', y_pred, sep='\n')
x_new = np.arange(5).reshape((-1, 1))
y_new = model.predict(x_new)
print(y_new) ```
 

# What is Multiple Linear Regression?

Multiple linear regression, also known simply as multiple regression, is a statistical technique that uses several explan# What is Multiple Linear Regression?
atory variables to predict the outcome of a response variable. The goal of multiple linear regression is to model the linear relationship between the explanatory variables and the response variable.


# Implementing Multiple Linear Regression in Python


import numpy as np
from sklearn.linear_model import LinearRegression

```x = [[0, 1], [5, 1], [15, 2], [25, 5], [35, 11], [45, 15], [55, 34], [60, 35]]
y = [4, 5, 20, 14, 32, 22, 38, 43]
x, y = np.array(x), np.array(y)
model = LinearRegression().fit(x, y)
r_sq = model.score(x, y)
print('coefficient of determination:', r_sq)
print('intercept:', model.intercept_)
print('slope:', model.coef_)
y_pred = model.predict(x)
print('predicted response:', y_pred, sep='\n')
y_pred = model.intercept_ + np.sum(model.coef_ * x, axis=1)
print('predicted response:', y_pred, sep='\n')
x_new = np.arange(10).reshape((-1, 2))
print(x_new)
y_new = model.predict(x_new)
print(y_new)```
49 Days of Ruby: Day 27 - Object-Oriented Ruby
Tags: ruby
Published: 2021-04-23 06:03:44

---
title: 49 Days of Ruby: Day 27 - Object-Oriented Ruby
published: true
description: Join us on a 49 day learning journey through Ruby!
series: 49 Days of Ruby
tags: #ruby
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/9m73qaetuse3nm3y3it8.png
---

**Welcome to day 27 of the 49 Days of Ruby! 🎉**

Today is all about taking a lot of what we have learned so far and bringing it together.

In the past lessons, we learned about some of the critical applications of Object-Oriented programming, like classes and instantiations. We have yet to speak specifically about what Object-Oriented programming (OOP) is. Let's take today to do that.

## What is Object-Oriented Programming?

Ruby is one of the best languages to learn OOP in because Ruby was built for OOP!

Remember all those classes of `Coffee` we built in so many of the previous lessons? Did we ever stop to think about why we were building a `Coffee` class to begin with?

Perhaps we are creating a coffee shop made out of code. In this programmatic coffee shop, we will have coffee, milk, tables, chairs, cash registers, and a whole lot more.

Each specific type of thing should only really know about itself. We want to **encapsulate** all the logic for coffee inside coffee so that a chair doesn't need to worry about the quality of the beans.

**Encapsulation** is a crucial concept in OOP. It is just as we stated above. We put things in classes so to separate out the distinct pieces of code from each other. Coffee goes in a coffee class, chairs go in a chair class, etc., etc.

Another important concept in OOP is **inheritance**. If you recall we had a lesson earlier on inheritance. It is the idea that all objects descend from earlier objects, and likewise, are the ancestors of further objects down the inheritance line.

**Inheritance** is important because we want to keep things organized, among other reasons. I have some code functionality in Class A that will be shared with Class B. Do I copy and paste all that code from A into B? No, rather let Class B inherit what is in Class A, keeping it all tidy and neat.

One more good concept to know about OOP is something called **polymorphism**. What is this word that sounds like it comes from a philosophy class?

It's the idea that it can take many shapes. Specifically, for us, it means that while I have a generic `Coffee` class, I can create another class called `Americano` that has its own unique traits while also inheriting the more broad traits from `Coffee`:

```ruby
class Coffee
  def brew
    puts "Making a coffee now..."
  end
end

class Americano < Coffee
  def brew
   puts "Making an Americano now..."
  end
end
```

I hope this gave some more context to all of our earlier discussions of the practice of Object-Oriented programming. See you tomorrow!


**Come back tomorrow for the next installment of 49 Days of Ruby! You can join the conversation on Twitter with the hashtag [#49daysofruby](https://twitter.com/hashtag/49daysofruby).**
Newbie here! Designing my own website
Published: 2021-04-23 06:03:13

---
title: Newbie here! Designing my own website
published: true
description: My first step into web development
tags: 
//cover_image: https://direct_url_to_image.jpg
---
In this covid pandemic, I wanted to learn something new in order to keep me moving so figured nothing wrong with my own website! I am currently working on it but have already learned so much, HTML, CSS and some JavaScript. Having previous knowledge and understanding of Python has definitely helped but I have to admit, there were days where I was just pulling my head off. That's the time when I used to go through some of the posts here to regain my motivation and keep working on it. I am super excited to share my work and get feedback on it, once it's done.

So thank you everyone here and on other platforms who help people like me!
crontab -;  ? 
Tags: crontab, cron, linux
Published: 2021-04-23 05:42:11

I just had a weird experience and wanted to share it here to ask if anyone had a similar experience.

In the linux server, I was working on my crontab. My original plan was to type crontab with the option -l but I typed in my terminal as below.

```
crontab -;
```

The command above delete all the cron jobs I had and didn't leave anything. I couldn't find any blog or posts about the above command doing something. What could be the behind logic  of this?!
Contact Us Form Design | Free Code
Tags: contacusform, contactuspage, contacform, contactpage
Published: 2021-04-23 05:11:23

Hello friends, today in this blog we are going to create Responsive Contact Us Form or Page in HTML and CSS. There are many forms design I  have created before as well as responsive contact us form. Today we will build something better than the previous.

Contact us form means the section on the webpages form where the user can send messages to the particular person or admin of that website. The mainly contact us page contains two or three input fields where users need to fill in their message name and email.

I have given a beautiful image of the contact us form on the webpage. This is the contact form design that we are going to build. As you can have a look at this contact form template, on the left side there are some details of the webpage owner like address, phone number, and his email and on the right side, we can see three in the input field where user need to fill their name, email, and message.

This contact form is fully responsive. If you can see a real demo of this contact page and all those codes I have used to create this CSS contact form, you can watch the full video tutorial of this form that I have given below.

###Video Tutorial of Responsive Contact Us Form in HTML And CSS###
https://youtu.be/eUMqJMkwOBY

As you have seen in the video tutorial of  Responsive Contact Us Form using HTML And CSS. I have used simple HTML CSS code to create this contact form design. Actually, I can add many animations and hover effects in this form but, in real life people like simple and beautiful designs than unnecessary animation effects. As you have seen this contact form or page is fully responsive.

I have used only HTML and CSS to build this responsive contact form, I think you can easily make this type of contact from after watching, if you don't, it's okay I have provided a free source code of this responsive contact us page below.

###Responsive Contact Us Form or Page [Free Source Code]###

You can download all source code from the given link. <a href="">Click Here To Download All Source Code</a>
Site tradeoffs: SEO vs Speed vs Ease of update
Tags: webdev, nextjs, gatsby, html
Published: 2021-04-23 05:10:01

I have been doing web development for five years now and I have never actually thought about the tradeoffs I make when deciding what frontend stack to use. So recently I came across this course that discussed some of the common tradeoffs we ignore when deciding what type of website to build. 

So for this article, I'll discuss the different types of websites and how SEO(Search Engine Optimization), Speed, and ease of update; are some tradeoffs we make when developing websites.
___

#### Types of websites

##### _Static websites_
- These are sites that use static Html pages with a little CSS and even JS.
- The pages are uploaded to a CDN/Web host.
- also known as multi-page applications

some of the drawbacks for this are:
* slow - a fresh request to the server is made for every page.
* Hard to update - a lot of rewriting the same code on every page.

:white_check_mark: SEO     :x: Speed     :x: Ease to update

___

**_Single Page Websites(SPAs)_**
- usually made with frameworks such as Vue, React, e.t.c
- Only a single server request is made for the initial Html page
- Everything else is handled by the SPA in the browser i.e routing, data, etc, making it even faster.

the tradeoff for this is:
* These webpages are not SEO friendly - initial page requests usually return a blank Html page

:x: SEO     :white_check_mark: Speed     :white_check_mark: Ease to update
___

**_Server Side Rendered(SSR)_**
- pages are rendered on the server after every request.
- this is how traditional PHP, node JS websites that use templating engines like `ejs`, work.
- the server sources data and uses templates to render Html then pages are sent back to the browser

the tradeoffs for this are:
* speed - a fresh request needs to be made for every page. server requests can take time getting data and rendering pages.

:white_check_mark: SEO     :x: Speed     :white_check_mark: Ease to update
___

**_Static Site Generator(SSG)_**
- also known as Modern site generators
- examples are Gatsby and NextJS
- static pages are completed at build-time (before deployment)
- Pages are made using React components.
- Static pages are then deployed to the web.
- After the initial request, the site behaves more like a single-page application meaning routing is handled in the browser at no extra requests.

The advantage of this method is better SEO, speed - really fast and easy to update.

:white_check_mark: SEO :white_check_mark: Speed   :white_check_mark: Ease to update

___
3. Longest Substring Without Repeating Characters

Published: 2021-04-23 05:08:15

Given a string s, find the length of the longest substring without repeating characters.

*Example 1:*
```
Input: s = "abcabcbb"
Output: 3
Explanation: The answer is "abc", with the length of 3.
```

*Example 2:*
```
Input: s = "bbbbb"
Output: 1
Explanation: The answer is "b", with the length of 1.
```
*Example 3:*
```
Input: s = "pwwkew"
Output: 3
Explanation: The answer is "wke", with the length of 3.
Notice that the answer must be a substring, "pwke" is a subsequence and not a substring.
```
*Example 4:*
```
Input: s = ""
Output: 0
```

## Solution

```js
/**
 * @param {string} s
 * @return {number}
 */
var lengthOfLongestSubstring = function(s) {
    let start = 0, end = 0;
    let maxStringLength = 0;
    let charSet = new Set();
    
    while (end < s.length) {
        if (!charSet.has(s[end])) {
            charSet.add(s[end]);
            maxStringLength = Math.max(charSet.size, maxStringLength);
            end++;
        } else {
            charSet.delete(s[start]);
            start++;
        }
    }
    
    return maxStringLength;
};
```
2. Add Two Numbers
Published: 2021-04-23 05:07:58

Problem #2: https://leetcode.com/problems/add-two-numbers/

You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order, and each of their nodes contains a single digit. Add the two numbers and return the sum as a linked list.

You may assume the two numbers do not contain any leading zero, except the number 0 itself.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/em7qxmedf74s7tmxfdw2.jpeg)
 

*Example 1:*
```
Input: l1 = [2,4,3], l2 = [5,6,4]
Output: [7,0,8]
Explanation: 342 + 465 = 807.
```

*Example 2:*
```
Input: l1 = [0], l2 = [0]
Output: [0]
```

*Example 3:*
```
Input: l1 = [9,9,9,9,9,9,9], l2 = [9,9,9,9]
Output: [8,9,9,9,0,0,0,1]
```

## Solution

```js
/**
 * @param {ListNode} l1
 * @param {ListNode} l2
 * @return {ListNode}
 */
var addTwoNumbers = function(l1, l2) {
    let node = null;
    const carry = arguments[2];
    
    if (l1 || l2) {
        if (!l1) {
            l1 = new ListNode();
        }
        if (!l2) {
            l2 = new ListNode();
        }
        let val = l1.val + l2.val;
        if (carry) {
            val += 1;
        }
        node = new ListNode(val %10, null);
        node.next = addTwoNumbers(l1.next, l2.next, val > 9 ? 1 : 0);
    } else if (carry) {
        node = new ListNode(1, null);
    }
    return node;
};
```
1. Two Sum
Tags: javascript, algorithms
Published: 2021-04-23 05:07:35

Problem #1: https://leetcode.com/problems/two-sum/

Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to the target. You may assume that each input would have exactly one solution, and you may not use the same element twice.


*Example 1:*
```
Input: nums = [2,7,11,15], target = 9
Output: [0,1]
Output: Because nums[0] + nums[1] == 9, we return [0, 1].
```

*Example 2:*
```
Input: nums = [3,2,4], target = 6
Output: [1,2]
```

*Example 3:*
```
Input: nums = [3,3], target = 6
Output: [0,1]
```


## Solution

```js
/**
 * @param {number[]} nums
 * @param {number} target
 * @return {number[]}
 */
var twoSum = function(nums, target) {
    var complementMap = new Map();
    
    for(var j=0; j<nums.length; j++) {
        var complement = target - nums[j];
        if (complementMap.has(complement)) {
            return [complementMap.get(complement), j]
        }
        complementMap.set(nums[j], j);
    }
}
```
Schedule Script Execution in a Node.js Docker Image with Cron
Tags: docker, javascript, node, cron
Published: 2021-04-23 04:37:36

Cron is a popular tool to schedule tasks, it comes pre-installed on almost any Linux image such as Debian or Ubuntu. Cron can execute any command at a predefined time like 4:30 AM or every 2 minutes. For this reason, it is the first choice of developers for scheduled script execution.

A docker image is nothing else than a stripped-down Linux operating system and comes with cron. Most answers on StackOverflow suggest installing extra packages or building a custom image, but neither approach is necessary. The vanilla Node.js Docker image has everything needed to schedule the execution of javascript files.

## Example with Code

I want to run a javascript file every 30 minutes inside my docker image. I want to use `docker-compose`[^1] to start and stop the docker container.

Here's my docker compose file:

```yaml
version: "3.1"

services:
  price-daemon:
    image: node:14-alpine
    working_dir: /home/node/app
    volumes:
      - ./:/home/node/app
    command: "/usr/sbin/crond -f -l 0 -c /home/node/app/crontab -L /var/log/cron.log"
```

I use the lightweight `node:14-alpine`[^2] image and mount my current working directory as volume.

The `command` starts the cron daemon and it will look for the file `/home/node/app/crontab/root`. Remove `-l 0` if you don't like a super verbose log. In my working directory I created the file `crontab/root` with this contents:

```bash
# min hour day month weekday command
* * * * * /bin/date --rfc-2822 >> /var/log/cron.log
*/30 * * * * node /home/node/app/scheduled.js >> /var/log/cron.log 2>&1
```

The second line is just a timestamp printed into the log file for debugging purposes. The third line executes the `scheduled.js` file and logs its output into `/var/log/cron.log`

And that's it. Pretty simple right?

[^1]: https://docs.docker.com/compose/
[^2]: https://hub.docker.com/_/node
【Redis Week】 - 7 Days Best Practice With Alibaba Cloud ApsaraDB - Day04
Published: 2021-04-23 03:57:25

### Day 4 - Best Practice Of Redis Operation & Maintenance
[Watch Now (30 mins)>](https://www.youtube.com/watch?v=cLnjVe2jVR8)

> This video is in Chinese, and it's free. The contents are suitable for all developers (especially java developers). For English speakers, we recommended to click the playlist in the end of the video or you can click the link below to start learning directly.
[Best Practice of Redis (EN)>](https://www.youtube.com/watch?v=_JqcsKyDljw&list=PL54EFTJJZrwgfve8XuYSKTnIfve08WmfN)


### Main Contents
1. What does the real Redis Community look like? how does every Core Team member work with each other?
2. How many versions and editions does ApsaraDB for Redis have? What and how can cloud O&M make a difference?
3. What is geo-disaster and global multi-active High Availability?
Including PITR and geo-replica.


### Light Gifts
Redis Free Trial for all Redis beginners and Redis experts.
[Get the Free Trial](https://www.alibabacloud.com/product/apsaradb-for-redis)
FastAPI project template (jWT, MariaDB)
Tags: fastapi, python, mysql, webdev
Published: 2021-04-23 03:36:10

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/loonqezpkdk27cy3elto.png)
Design sample refer to project fastapi
https://github.com/phalconvietnam/FastAPI-project-template