teleren/devto huggingface dataset:
Navbar CSS Tutorial: Create a Navigation Bar with Flexbox.
Tags: javascript, webdev, beginners, css
Published: 2022-11-20 12:59:02

Hey guys again welcome back to the new tutorial for beginners. Where we will make an navbar using flexbox and this navbar is totally responsive so don't miss this tutorial becasue you have learn to lot by makung this navbar .
Likewise 


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

This Blog will show you Navbar CSS Tutorial: Create a Navigation Bar with Flexbox.

**Important Link**
  🔗 Article Link: [Link](https://ziontutorial.com/navbar-css-tutorial-create-a-navigation-bar-with-flexbox/)

- How to make navbar using flexbox.

- How to align logo to the right side .

- How to make smooth transition hover effect in it 

Before jump to the tutorial just download the assets for the navbar . 

Source Code Link : [Download](https://ziontutorial.com/navbar-css-tutorial-create-a-navigation-bar-with-flexbox/)
Disabling ONLY_FULL_GROUP_BY on MySQL docker Laravel Sail
Published: 2022-11-20 12:58:55

**When you get this error:**
`Error Code: 1055. Expression #11 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'YOUR_COLUMN_NAME_HERE' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by`

Just put on your `docker-compose.yml` the follow command on `mysql container`:

```
        command:
            --sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION
```

It will look like this:
```
    mysql:
        image: 'mysql/mysql-server:8.0'
        ports:
            - '${FORWARD_DB_PORT:-3306}:3306'
        environment:
            MYSQL_ROOT_PASSWORD: '${DB_PASSWORD}'
            MYSQL_ROOT_HOST: "%"
            MYSQL_DATABASE: '${DB_DATABASE}'
            MYSQL_USER: '${DB_USERNAME}'
            MYSQL_PASSWORD: '${DB_PASSWORD}'
            MYSQL_ALLOW_EMPTY_PASSWORD: 1
        command:
            --sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION
        volumes:
            - 'sail-mysql:/var/lib/mysql'
            - './vendor/laravel/sail/database/mysql/create-testing-database.sh:/docker-entrypoint-initdb.d/10-create-testing-database.sh'
        networks:
            - sail
        healthcheck:
            test: ["CMD", "mysqladmin", "ping", "-p${DB_PASSWORD}"]
            retries: 3
            timeout: 5s
```

Restart and test again :D
How to Create a Landing Page in WordPress | Elementor | For Beginners
Tags: wordpress, beginners, tutorial, html
Published: 2022-11-20 12:35:09



## 🎇💡Output


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

How to Create a Landing Page in WordPress | Elementor | For Beginners
This Blog will show youHow to Create a Landing Page in WordPress
Tutorial Link : [Link](https://www.youtube.com/watch?v=SPXb05v7qkk&ab_channel=ziontutorial)
🔗 Essential links
[More Beginners Project Here](https://ziontutorial.com/how-to-create-a-landing-page-in-wordpress-elementor/)
I'm your father - marcin.dev
Tags: webcomics, programming, jokes
Published: 2022-11-20 12:05:55

I am your father!


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

https://marcin.dev/comics-i-am-your-father

https://marcin.dev/comics
Spring boot REST- API - configurations (Part 1)
Tags: java, spring, api, tutorial
Published: 2022-11-20 11:58:58

Hello. I've just started a new work-study formation and I learn Java and Spring. 
I will use Spring 2.4.7 with Java 11 and Eclipse for this tutorial and I work on MacBook with macOS Monterey version 12.

## 1). Creating a new workspace:

I open my Eclipse editor and I create a new workspace: 

![creation of new workspace](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yf3l8clp5xitm85ks3fh.png)

After tapping on switch workspace I browse where I want to create my new workspace:

![browse a new espace](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0dpl3vndnam0q08tnp6c.png)

and I create a new folder where I will create a new workspace: 

![new space](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tddu7mmjp5tn7bofd3uu.png)


![new workspace browsed](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ki3h6fy84thnypnwkbhr.png)

Now I restart Eclipse:

![new workspace created](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/od3sqrqhtxr42pmos810.png)

## 2)Eclipse configuration for this workspace:
I open preferences on Eclipse (if you have Windows the preferences ai in the window tab) 

![preferences 1](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kkvc954sskj9p53a6w52.png)


![preferences 2](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sjkzqvqnvjsml3am9cl1.png)

I will use Java 11 this time so I configure my JRE:

![JRE](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9mcfizzrwmxe7cfpgai3.png)

To continue I apply this change and I adapt its environment:

![JRE](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b9vy5p1awpvjodtr06cx.png)

In input I write foramtter  - this is a plugin that helps to format a code, after I chose Code style formatter and  Java Conventions and I edit it:

![preferences formatter](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ojarspjqqarv9bb647ui.png)

I change the ligne wrapping from 120 to 60:

![ligne wrapping](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9gmvg1uhnmy69yi0vqzs.png)

and I change a Java Conventions [built-in] to Java Conventions custom

![Java Conventions custom](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sng9yiqtcjcs4iqthw1n.png)

and I press OK.

Next, I write save in input: to format save actions: and I check this and I press Configure...: 

![save options](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gti0wd4us12vs7r8u1od.png)

And I change the use of parentheses in expressions:

![parentheses](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9se5rxfl37bc6xvpi6fk.png)
and I press OK.

After that I change the configuration of Javadoc and uncheck it:
![javadoc](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1rado415hy1ampz4yg85.png)

And the last change is the spelling which can pollute the work if is always active so I uncheck it also:


![spelling uncheck](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/eu5461sy4eo0hdljklqv.png)

I apply all these changes and now I can start a new spring project. 

See you in the next part.
Storybook - writing stories
Tags: storybook, webdev, beginners, testing
Published: 2022-11-20 11:57:46

Let's take a closer look at writing our own stories with Storybook.

Before we dive into the details of creating these stories, let's describe what a story is.

A story defines the rendered state of a UI component. It's a function that returns the result of your component based on a set of arguments.

Stories live next to your original components. For instance, if you have a `button.tsx` file, your account would be in the same folder but called `button.stories.js`.

Do note stories can be written in any set of languages. You are not bound to plain javascript or typescript. These are the supported formats.

- `js`
- `ts`
- `jsx`
- `tsx`
- `mdx`

## Format of a story file

Now that we have a broad understanding of stories let's look at the analogy of the story file.

First, we have a default export that defines how the story will be listed in the sidebar.

Let's take this example story:

```js
// Button.stories.js|jsx

import React from 'react';

import { Button } from './Button';

export default {
  title: 'Button',
  component: Button,
};
```

This alone won't do much, as we haven't defined an actual story for this component. (Remember, it's a rendered state).

So let's add a primary button state story.

```js
export const Primary = () => (
  <Button primary label='Button'>
    Button
  </Button>
);
```

As you can see, we can define named exports that return the component with a set of props.
In this case, we return a primary button with a fixed label.

If you open the Storybook, you should see this component under the button.

![Component added](https://cdn.hashnode.com/res/hashnode/image/upload/v1668145143388/UjNYVurRN.png)

So, we can now add a secondary story, which will render our button component in its secondary state.

```js
export const Secondary = () => <Button label='Button'>Button</Button>;
```

Which will render the button like this:

![Secondary button render](https://cdn.hashnode.com/res/hashnode/image/upload/v1668145349375/e5V85j7TI.png)

## Additional options for a story

A story can do a bit more than render one specific state.

We won't go into all the details in this article as we will explore them further throughout the following ones, but let's take a high-level look at them.

- `args`: Define the components options so we can easily reuse them to clean our code
- `play function`: Test specific user flows automatically
- `parameters`: Test external impact on your component. For instance, a theme switcher is one example.
- `decorators`: Provide a way to wrap your component
- `combined`: We can even combine multiple components into one story
- `loaders`: an experimental feature where we can load external data

These are the options for a story. Very high-level, we'll dive into them in more detail in the following articles, so be sure to subscribe to the newsletter.

### 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)
Day41 of #100DaysOfCode
Tags: 100daysofcode, beginners, prismic
Published: 2022-11-20 11:39:25

This is harder than I thought 😂.

Been reading, watching, trying the CMS myself.

I think I have a better understanding of Prismic now. But it will take more time than I thought.

But with that said, if I can make Prismic work, the website would be quite scalable (Not like Notion 😂).

And if the website works, I should be able to call myself a (junior) full stack dev?? 😂
310+ new features and changes, Iphone ios 15 Features, Ios 15,
Published: 2022-11-20 11:34:10

we are going in-depth with the software to cover more than 310 new features and changes.
And if you guys want to know the first settings you need to change and how to get the best battery life possible on iOS 15.

we have a lot to cover.

So let's just go ahead and get straight into this update. So you can see here, the size of this update will come in around three gigabytes that will depend on your device and the version you're coming from.

But that is coming from iOS 14.8. And the official bill number for IUs 15 is 19 a 3, 4, 6. So it is different than the RC build that beta testers got last week. And the modem firmware has also been changed to 2.09 at 0.10.

So if you were having connectivity issues on iOS 14, those could be resolved with these updates. All right, So now what's new here in iOS 15.

And the first thing is actually inside of settings. So you can see over here, we have iOS 14 on the left, iOS 15 on the right. It's going to be that way throughout this video. And you will see that there is no padding on the edges of the settings pane.

So you can see that each panel, each little section right here does not go all the way across the screen. Like it used to it's a little bit more compact. There's the padding on both sides. And I think this gives it a more modern and clean look.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7f6iawzfl08r0saa8efr.jpg)

[](https://internetonl9.blogspot.com/2021/10/310-new-features-and-changes-iphone-ios.html?m=1)
Think You're Cut Out for Doing Online Earning? Take This Quiz
Published: 2022-11-20 11:27:50

If you have been unemployed for quite a while but feel that you have a potentially lucrative online income on the way, then you are not wrong, at least if you look at the numbers. A study conducted by eMarketer estimates that in 2017, Americans will spend $37.1 billion on online activities. This number is expected to jump to more than $152.6 billion by 2021, which is an increase of at least 170% from 2014.

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

Looking at that amount, you may wonder whether you would be cut out for it if you didn't already have experience. But the truth is that you may have more experience than you think, and you may not even know it yet. Don't be intimidated by that, though—you can take the online-earning quiz below that will reveal your eligibility for online marketing promotions and help you decide whether or not you want to move forward. And you don't even have to turn a profit to take advantage of it.


[https://internetonl9.blogspot.com/2021/10/think-youre-cut-out-for-doing-online.html?m=1]
Deals for devs for Black Friday 2022 (up to 100%)
Published: 2022-11-20 11:22:23

![Black Friday - Bootstrap logo, Laravel logo, Angular logo, C logo, Kotlin logo](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/djtjtnhszf6trr6kfrur.png)

The end of November can be a truly exausting time.

Every billboard screams at you about the latest disocunt that is not only "exclusive" & "insane" but very often it's also... far-fetched.

Most industries have their own tricks for getting you to buy something. 

The only symbol more prevalent than the percantage sign (%) is perhaps an asterisk (*). The discounts are huge, until you look closer, just to find an asterisk telling you that the "amazing 90%" applies only to your seventh product...

## But are _software deals_ different?

Well... not all of them - but most of them are indeed better than promotions for physical products.

Companies selling software have a very significant advantage.
Selling more copies of software doesn't relate to higher production costs.

They only need to create their product once, and then they can sell it an infinite number of times without repeating the cost of production.

Of course, there are also costs of updates & maintenance, but still - they usually do not translate to higher costs of selling a "unit" of something.

**That's why discounts for software are usually the best.**

And that's why software companies celebrates huge promotions twice - during Black Friday, and a couple day laters during Cyber Monday.

## And what about _promotions for programmers_?

Those are even better than software for laypeople.

Programmers tend to be good at math, so when they see "30% OFF" they won't pay more than 70% of the initial price.

**I created [a GitHub repository](https://github.com/mdbootstrap/Black-Friday-2022), aggregating only the best discounts for software developers - no asterisks!**

Feel free to add offer you found on your own via PR!

See highlighted offers:

---

#### 💸 [Bootstrap 5 + Material Design 2.0](https://mdbootstrap.com/sale/friday/) – up to 86% OFF

 - 86% OFF Bundle
 - 65% OFF other packages
 - 20,000+ premium components
 - 800+ design blocks
 - 400+ templates
 - 100+ plugins 
 - UI Kits for Bootstrap 5, jQuery, Angular, React & Vue
 
 [![Black Friday deals for developers](https://mdbootstrap.com/img/Marketing/campaigns/blackfriday2022/black-friday.png)](https://mdbootstrap.com/sale/friday/)

---

#### 💸 [BootstrapDash](https://www.bootstrapdash.com/offers) – Bootstrap Themes and Templates – Up to 85% OFF!

  - 85% off on the “Mega Bundle”
  - Get 54 premium website templates (dashboards, UI kits, login pages, etc) built with Bootstrap, Angular, Vue, and React, up to 85% off!
  - 25% off on any template.
  - Flat 25% off on all templates.
  - Coupon Code: BLACKFRIDAY
 

[![BootstrapDash](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ntlx8lv127gtnw30pbwv.jpg)](https://www.bootstrapdash.com/offers)
For loop with else in python
Tags: snippet, python, loop
Published: 2022-11-20 11:06:11

---
title: For loop with else in python
published: true
description: 
tags: #snippet #python #loop
# cover_image: https://direct_url_to_image.jpg
# Use a ratio of 100:42 for best results.
# published_at: 2022-11-20 11:05 +0000
---

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ojh8vxoafk5z90ihh7wd.png)
Common Threats to Container Security
Published: 2022-11-20 11:01:05

**General Container Threats**

Application-level DDOS and XSS against public-facing containers.
Compromised containers trying to ‘phone home to download malware.
Compromised containers try to scan other internal systems to find other weaknesses or search for sensitive data.
Container breakout and unauthorised access across containers, hosts, or data centers.
Container resource hogging, eating up CPU/Mem/Disk/IO to impact or even crash other containers.
Live to patch applications that bring in malicious processes from a hijacked DNS or another service.
Network flooding from poorly designed applications impacts other containers.


**Container Attacks – Examples**

SQL injection attacks gaining ownership of a database container to start stealing data.
The shell-shock bash bug allows remote attackers to execute arbitrary code inside a container.
The heart-bleed bug caused the container’s memory to be leaked and analyzed.
The Glibc stack-based buffer overflow is caused by a man-in-the-middle attack.
New zero-day attack on a container causing a persistent threat
How to Setup a superb License Free LAMP WEB SERVER on special VPS
Tags: webdev, beginners, cloudskills, server
Published: 2022-11-20 10:57:37

**i will explain this subject as short as i can to you in a few step. If i get positive feedback i will explain each step as more as i can for everybody who wants to have free web server. And also i can explain some technical tips which you may face during installation..**

1. First of all  hire VPS with root rights. If anybody ask me about cheap and stable VPS's i will replay as special with email.
2. Install Debian 11 bullseye or Ubuntu or any Linux Server OS.
3. Install putty- puttygen in your computer. And create special SSH Keygen With puttygen.
4. Update & Upgrade your server with SSH connection( putty).Install nano or vim editor which you want, in my opinioun i prefer nano.
4. Embed your root ssh keygen which you have create on your computer to Debian server's root user files with nano or vim editor.  Then in ssh configuration file  "turn off"  "login with password". Also i recomend to you to change SSH port for security reasons. Reboot and connect to server.
5. Now your server is ready for Web control interfaces. For web  server software we wont use Cpanel or Plesk etc. We will just use Webmin + Virtualmin (Open Source Web control is best than all). I felt obliged to write this article because I have been using Virtualmin for years without any problems and for free.
6. Before webmin end virtualmin  install apache2 and mysql-mariadb and php8.1. Then go to Virtaulmin installation instructions and install virtualmin (virtualmin also installs webmin to).
7. Connect to webmin interface on browser and input user and password ( You must create root password for webmin , you can find how to create it when you google it) . Also for security reasons activate 2FA Auth (google authenticator) in webmin. Download Google Auth to your phone to create codes.
8. When you connect to webmin interface, go to Virtualmin interface and setup instruction will be appear. Setup and recheck Virtaulmin and later Create Web Server for your domain. 
9. When creating web server via virtualmin check SSL section to create free ssl certificate by Let's Encrypt (Also many thanks to Lets Encrypt team.)
10. install joomla CMS to your web folder (public_html). And go to browser enter your domain and you will see setup joomla instructions. After all your web site is ready. Then you can customize your web site as you can do.
Finally many thanks to developers who work for for Joomla , [Virtualmin](https://www.virtualmin.com/), [Debian](https://www.debian.org/), [Webmin](https://www.webmin.com/), [Let's Encrypt](https://letsencrypt.org/) and more Open Source's organizations. I think people must support such Open Source's organizations
My motto is that "World can be better with knowledge".
** I i wish to prepare Youtube serial for more details from start to end **
How can I set the value of a select input in React?
Tags: react, beginners, programming
Published: 2022-11-20 10:00:00

### Adding selected to an option

A very common way of setting a `<select>` input's value is by adding a `selected` attribute to one of its `<option>` elements. For example:

```jsx
const Select = ({ values, callback, selected }) => {
  return (
    <select
      disabled={disabled}
      readOnly={readonly}
      onChange={({ target: { value } }) => callback(value)}
    >
      {values.map(([value, text]) => (
        <option selected={selected === value} value={value}>
          {text}
        </option>
      ))}
    </select>
  );
}
```

### Setting value for the select

While this approach closely resembles HTML and feels intuitive, there is an easier way to do the same thing. [React](https://reactjs.org/docs/forms.html#the-select-tag) provides us with a shared API between `<input type="text">`, `<textarea>` and `<select>` where we can use `value` or `defaultValue` (depending if the input is controlled or not) to set the field's value.

Using this API, we minimize the effort of checking for the selected value, as well as making the code easier to read and update as necessary. Here's an example:

```jsx
const Select = ({ values, callback, selected }) => {
  return (
    <select
      disabled={disabled}
      readOnly={readonly}
      defaultValue={selected}
      onChange={({ target: { value } }) => callback(value)}
    >
      {values.map(([value, text]) => (
        <option value={value}>
          {text}
        </option>
      ))}
    </select>
  );
}
```

Note that the above implementation uses `defaultValue`, therefore it implies that the component is uncontrolled. You can convert this `Select` component into a controlled component by using `value` instead of `defaultValue`.

---

_Do you like short, high-quality code snippets and articles? So do we! Visit [30 seconds of code](https://www.30secondsofcode.org/) for more articles like this one or follow us on [Twitter](https://twitter.com/30secondsofcode) for daily JavaScript, React and Python snippets!_ 👨‍💻
Python 3 ways to compute multiplication of list & how to to reduce in general
Tags: python, programming
Published: 2022-11-20 09:49:23

How to compute the multiplication of a list in python? 
```python
a = [1,2,3,4,5]
```

## for loop
The most intuitive and easy solution. 
```python
res = 1
for i in a:
    res *= i
```
## math.prod or np.prod
`math` or `numpy` module has an embedded function for multiplication of list.
```python
import math
res = math.prod(a)
```
or 
```python
import numpy as np
res = np.prod(a)
```

## functools.reduce
This is personally my favourite, it is an elegant one-liner with easy extensions to compute other tasks related to "reduce a list to a single number".
```python
import functools
res = functools.reduce(lambda x, y: x * y, a)
```
say if you want to piece together a list of strings
```python
functools.reduce(lambda x,y: x+y, ["hi,", " world"])
```
say if you want to add a list of nums:
```python
functools.reduce(lambda x,y: x+y, [1, 2, 3, 4])
```