teleren/devto huggingface dataset:
🦸 My popular post on Stackoverflow
Tags: stackoverflow, java, servlets, configuration
Published: 2019-12-30 10:43:29

The only way to modify web.xml to support for multiple servlet in JSPs, there is a way as shown in the following post on Stackoverflow network:

```xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee                                 http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
    <servlet>
        <servlet-name>LoginForm</servlet-name>
        <servlet-class>com.project.system.LoginForm</servlet-class>
    </servlet>
    <servlet>
        <servlet-name>RegisterForm</servlet-name>
        <servlet-class>com.project.system.RegisterForm</servlet-class>
    </servlet>
    <servlet>
        <servlet-name>UserController</servlet-name>
        <servlet-class>com.project.controller.UserController</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>LoginForm</servlet-name>
        <url-pattern>/LoginForm</url-pattern>
    </servlet-mapping>

    <servlet-mapping>
        <servlet-name>RegisterForm</servlet-name>
        <url-pattern>/RegisterForm</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
        <servlet-name>UserController</servlet-name>
        <url-pattern>/UserController</url-pattern>
    </servlet-mapping>
    <session-config>
        <session-timeout>
            30
        </session-timeout>
    </session-config>
</web-app>

```

https://stackoverflow.com/questions/43559372/how-to-modify-web-xml-for-multiple-servlet
Lyra : Command Line Parser for C++
Tags: cpp
Published: 2019-12-30 11:31:15

Parsing conmmand line arguments is a tedious task and many programming languages have libraries for it. While researching such libraries for C++ 
I found [Lyra](https://github.com/bfgroup/Lyra) which works as a header-only library for C++11 and higher.

It supports the usual positional and optional arguments known from POSIX style command line tools and has the possibility to automatically generate a help text.

For a full set of examples see the [documentation](https://bfgroup.github.io/Lyra/#_license).  

## Example: Optional Arguments and Help Text

```cpp
#include <iostream>
#include <lyra/lyra.hpp>

int main(int argc, const char** argv)
{
	// Variables to put arguments into:
	int width = 0;
	int height = 0;
	bool show_help = false;

	const auto cli = lyra::help(show_help)
		| lyra::opt(width, "width")
		["-w"]["--width"]("How wide should it be?")
		| lyra::opt(height, "height")
		["-x"]["--height"]("How high should it be?");


	// Parse the program arguments:
	const auto result = cli.parse({ argc, argv });

	if (!result)
	{
		std::cerr << result.errorMessage() << std::endl;
		std::cerr << cli;
		exit(1);
	}
	
	if(show_help)
	{
		std::cout << cli << '\n';
		exit(0);
	}

	std::cout << "width * height: " << width * height << '\n';
}
```

Starting the programm without arguments yields the default values, using -h triggers the help text:

```bash
./a.out 
width * height: 0
./a.out -w 15 -x 10
width * height: 150
./a.out -h
Usage:
  a.out [-?|-h|--help] [-w|--width] [-x|--height]

Options, arguments:
  -?, -h, --help

  Display usage information.

  -w, --width <width>

  How wide should it be?

  -x, --height <height>

  How high should it be?

```

Entering wrong arguments also leads to the help text being printed

```bash
./a.out --blabla dddd
Unrecognized token: --blabla
Usage:
  a.out [-?|-h|--help] [-w|--width] [-x|--height]

Options, arguments:
  -?, -h, --help

  Display usage information.

  -w, --width <width>

  How wide should it be?

  -x, --height <height>

  How high should it be?

```

## Non-optional Arguments

Non-optional parameters can be specified by using `lyra::arg` instead of `lyra::opt`. Non-optional arguments are just specified by their position in the CLI.

```cpp
const auto cli = lyra::help(show_help)
		| lyra::arg(width, "width")("How wide?")
		| lyra::arg(height, "height")("How high should it be?");
```

```bash
./a.out
width * height: 0
./a.out 10 10
width * height: 100
```
Daily Challenge #154 - Stable Arrangement
Tags: challenge
Published: 2020-01-06 16:22:57

---
title: Daily Challenge #154 - Stable Arrangement
published: true
series: Daily Challenge
description: A unique challenge that plays with manipulating arrays. 
tags: challenge
---
###Setup
Write a function that will take an array of unique positive integers, and two additional integers as input. With this method, try to rearrange the array so that the sum of any `n` consecutive values does not exceed `q`. 

Test constraints: 
- 2 <= `n` <= 6
- 4 <= `arr` length < 12
- `n` < `arr` length
- Every value in `arr` will be less than `q`

###Example
<pre>
const arr = [3,5,7,1,6,8,2,4];
const n = 3; // span length
const q = 13; // weight threshold
solver(arr,n,q); // one possible solution: [4,7,1,5,6,2,3,8] 
</pre>

###Tests

<pre>
[[3,5,7,1,6,8,2,4], 3, 13]

[[7,12,6,10,3,8,5,4,13,2,9], 4, 28]

[[9,16,11,6,15,14,19,3,12,18,7], 3, 35]
</pre>

Good luck!
***
_This [challenge](https://www.codewars.com/kata/5d6eef37f257f8001c886d97) comes from docgunthrop on CodeWars. Thank you to [CodeWars](<https://codewars.com/>), who has licensed redistribution of this challenge under the [2-Clause BSD License](<https://opensource.org/licenses/BSD-2-Clause>)!_

_Want to propose a challenge idea for a future post?  Email **yo+challenge@dev.to** with your suggestions!_
Video Snippets [1]
Tags: css, html, beginners
Published: 2019-12-30 13:57:31

Float is better used as a way to wrap text around images. Using float just for text can lead to several challenges that are not experienced with grid and flex. For example, it can be hard to make two elements (with text) that use float be identical in size unless the amount of text used is the same in both elements. 

<b><small> Source: </small></b>  <small><i>  CSS Layouts - Flexbox vs Grid vs Float </i>(https://www.youtube.com/watch?v=hYJvxsgnGMA)</small>
The Best Kubernetes Tutorials
Tags: kubernetes, azure, aws, gcp
Published: 2019-12-30 14:13:32

We have been looking for the best Kubernetes tutorials out there and thought of sharing some of what we found interesting to get started with Kubernetes.

The Official Kubernetes.io Tutorials
It is more of a collection of the existing content on Kubernetes.io. It focuses more on introducing the general concepts and constructs of Kubernetes. But it doesn’t provide necessary lessons that build upon each other. Covered Topics:

- The Basics.
- Configuring Kubernetes.
- Stateless Applications.
- Stateful Applications.
- CI/CD Pipeline.
- Managing Kubernetes Clusters.
- Services.

DigitalOcean Tutorials
It is a collection of articles that are nicely written and well organized. They are sometimes focused on Running Kubernetes on top of DigitalOcean however. But you are still going to learn a lot of Kubernetes basics that are applicable to any other infrastructure. Some of the notable topics are:

- An Introduction to Kubernetes
- An introduction to Kubernetes DNS Services
- An introduction to Helm, the package manager for Kubernetes
- Modernizing Applications for Kubernetes
- Building Optimized Containers for Kubernetes
- Kubernetes Networking Under the Hood
- Architecting Applications for Kubernetes
- Building Blocks for Doing CI/CD with Kubernetes
- How to Back up and restore a Kubernetes Cluster on DigitalOcean using Heptio Ark.
- How to Setup a Nginix Ingress with Cert-Manager on DigitalOcean Kubernetes
- How to Inspect Kubernetes Networking
The 7 Most Popular DEV Posts from the Past Week
Tags: top7
Published: 2019-12-30 16:10:14

---
title: The 7 Most Popular DEV Posts from the Past Week
published: true
description: A round up of the most-read and most-loved contributions from the community this past week.
tags: icymi
cover_image: https://thepracticaldev.s3.amazonaws.com/i/sfwcvweirpf2qka2lg2b.png
---
Every Monday we round up the previous week's top posts based on traffic, engagement, and a hint of editorial curation. The typical week starts on Monday and ends on Sunday, but don't worry, we take into account posts that are published later in the week. ❤️

#1. Entry Point

Aleksandar introduces us to three common web attacks and the methods to prevent them. This is a great entry point of understanding existing web security standards. 

{% link https://dev.to/maleta/cors-xss-and-csrf-with-examples-in-10-minutes-35k3 %}

#2. Pretty Impressive 💯

Florin explains why they pursued the #100Days100Projects challenge and answers some commonly asked questions from the community. You'll learn about how Florin stayed motivated, how they came up with ideas, and more.

{% link https://dev.to/florinpop17/how-i-built-100-projects-in-100-days-5be7 %}

#3. Fun Fun Fun!

Fanny is learning about functional programming and in this post, they share some of the benefits they've learned. Fanny also shares a bunch of additional resources at the end of the post.

{% link https://dev.to/fannyvieira/the-beauty-of-functional-programming-32ck %}

#4. Blazin' Cool

Jeremy shares an overview of Blazor, a framework from Microsoft that lets you build interactive web UIs using C# instead of JavaScript.

{% link https://dev.to/pluralsight/how-blazor-is-going-to-change-web-development-14n4 %}

#5. Programming Patterns

Tomaz shares an alternative to 'if' statements which leads to a big community discussion around imperative vs declarative programming. 

{% link https://dev.to/tomazlemos/keeping-your-code-clean-by-sweeping-out-if-statements-4in8 %}

#6. Fingers Crossed

C# is trending towards supporting more functional programming techniques. In this post, Matt shares the proposed aspects they're most excited about for C# 9.

{% link https://dev.to/integerman/the-dream-of-c-9-0-5fc7 %}

#7. Weird but Good

Have you used `mix-blend-mode` before? Cyd shares five cool tips and tricks for the front end. 

{% link https://dev.to/cydstumpel/5-things-in-web-development-i-learned-this-year-8p5 %}

_That's it for our weekly wrap up! Keep an eye on dev.to this week for daily content and discussions...and if you miss anything, we'll be sure to recap it next Monday!_
Top Benefits of Schema Markup for Your Website
Published: 2019-12-30 20:33:45

Whether you have a blogging website or a business website, the new feature introduced by Google Schema markup will give you benefits in many ways. If you don't anything about the feature. get help from <a href="https://www.darklabmedia.com/search-engine-optimization-seo/">search engine optimization services in Texas</a>. A professional SEO company will help you set up the feature. 

<strong>What is Schema Markup?</strong>

It is a code that you put on your website to help search engines feature more information results to users without browsing the website. If you know the rich snippets, understanding schema markup will be easy for you. The feature is supported by many major search engines. 

<strong>Benefits of Schema Markup</strong>

It helps search engines to understand your site's content better. The major goal of SEO is to let search engines understand your site and services. That is why schema markup is created. So, the number one benefit of the feature is to help the search engine understands your content so that it can display your website to relevant searchers. 

It helps in improving brand presence. For businesses, the feature has come up as a bonus to boost their brand presence online. Using the feature, then Google will display the pertinent business information that customers want such as social accounts, phone number reviews, etc. It will help you display logo, hours of operation, website links and much more. 

The feature helps to increase CTR because of rich results. In this case, only those users land to your website who are interested in your services. When they spend time on your site, it will increase the CTR and decrease the bounce rate. Adding product schema can increase the CTR rate by up to 10% according to experts. 

You can able to outperform your competitors. Since the schema markup feature has included in a countable number of websites. If you add the feature before your competitors, it would give a boost to your ranking. Google and Bing will improve your ranking. Thus, you can increase your website visibility online. 

Adding the schema markup feature helps to improve the position of the site for Alexa, Google Assistant, and voice search. If your website is according to emerging SEO trends, you can get the benefits of improving your position for voice search. Many times, a site with the search schema feature displays top on search results. 

Contact your SEO company to add the schema markup feature on your website. Don't stay behind in the race.
Happy New Year!
Tags: community, gratitude
Published: 2019-12-31 05:37:31

---
title: Happy New Year! 
published: true
description: 
tags: #community #gratitude
cover_image: https://user-images.githubusercontent.com/17259420/71611201-5d15fe80-2b97-11ea-8912-22386ce5eb9b.jpg
---

Happy New Year 🎉 to everyone in this awesome Dev.to community, It's been a great alternative to other blog platforms. I also would like to thank everyone for reading and following me this year. When I started I had a goal of reaching 500 followers at the year's end; I've now reached 2800 followers! Thank you all for taking interest in my writing and being a wonderful community. I hope everyone has been relaxing and enjoying time with families and loved ones this past week.

See you all in 2020! 🥳
Install Flutter without Android Studio
Tags: flutter, dart, android, openjdk
Published: 2019-12-31 06:36:14

In this tutorial, we will install Flutter and configure it, without installing Android Studio or any device emulator.

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/uji3id4jawldskzfwhc0.png)

### Prerequisites ###
* Terminal.
* Git.
* Access to system environment.
* VS Code and Flutter extension.

### Steps ###

1. First let's create a folder called _src_ or something you want in our _**C**_ drive.

2. Now let's go to install the Flutter SDK. We proceed to enter to the _C:\src_ folder and run 
`git clone https://github.com/flutter/flutter.git`
the Flutter sdk starts to download.

3. When the Flutter sdk has been downloaded, type "env" in the Windows search (or press windows key), and click on "Environment Variables...", edit the Path of the User Variables and add a new one "_C:\src\flutter\bin_".
![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/vhku7j3xbmodhtx9408o.png)
![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/sncoke79hfg5l1xkiene.png)

4. Run the command `flutter`, if the command is found it will start downloading some dependencies, after that run `flutter doctor`.

5. Download OpenJDK8, I recommend using this one [http://download.java.net/openjdk/jdk8u40/ri/openjdk-8u40-src-b25-10_feb_2015.zip](http://download.java.net/openjdk/jdk8u40/ri/openjdk-8u40-src-b25-10_feb_2015.zip)
Just extract the files on a folder like "_C:\Program Files\Java\openjdk8_".

6. Add the _JAVA_HOME_ and the path to the System Variables, go to edit the Environment Variables and click on "New..." under the System Variables
![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/710dhrgbwet1d6gta87c.png)
After you add the new system variable you can set the path for java, edit the Path of the System Environment and add "_%JAVA_HOME%\bin"
![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/gl34bcqdzk9r77yw0jmm.png)

7. Download Android SDK, Head to [https://developer.android.com/studio#downloads](https://developer.android.com/studio#downloads) and download **Command line tools only** for Windows. After downloaded, just extract the folder (tools) in a new folder on "_C:\Android_".

8. Install Android dependencies. Move to "_C:\Android\tools\bin_" and run the `sdkmanager.bat --list` (with the Terminal), run the following commands:
`sdkmanager.bat “platform-tools”`
`sdkmanager.bat “build-tools;28.0.3”`
`sdkmanager.bat “platforms;android-28”`
`sdkmanager.bat "platform-tools"`

8. Add the _ANDROID_HOME_ to the System Variables, add a new entry called "ANDROID_HOME" and the value is the path of your installation
![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/oo697rvshx2psvpqx9r1.png)

9. Allow debugging mode on your phone, you can follow this tutorial [https://developer.android.com/studio/debug/dev-options](https://developer.android.com/studio/debug/dev-options), allow the connection from your PC prompted on your phone's screen.

10. Run `flutter doctor`.
My 2019 in Review
Tags: showdev, 2019, career
Published: 2019-12-31 12:45:47

As 2019 is about to end, here is the list of work and achievements that I have done in 2019.

- Joined [V](https://vlang.io/) and being an active contributor then soon became a member.
- Made [Monkey Language in V](https://github.com/Delta456/monkey_v) which still needs to be finished and is pending due to current limitations
- Took part in Hacktoberfest 2019 and did 22 PRs in October.
- Founding Members of [V Community](https://github.com/v-community).
- Started [V by Examples](https://github.com/v-community/v_by_example) which is about to be completed.
- Learning how a compiler and interpreter works with [Interpreter Book](https://interpreterbook.com/) and [Compiler Book](https://compilerbook.com/).
- Started Learning by making an interpreter and porting a Python Library.
- 2k Followers on Dev in just 3 months!
- My implementation of Monkey Language in V got listed [here](https://monkeylang.org/).
- New Pixel Art Posts in my [DeviantArt](https://www.deviantart.com/delta2318) Account
- My [Python article](https://dev.to/delta456/python-init-is-not-a-constructor-12on) was listed and featured in [Python LibHunt Weekly Newsletter](https://twitter.com/PythonLibHunt/status/1207778623979061248) and got 54k views in just 2 days!
- My [Modern C++ article](https://dev.to/delta456/modern-c-an-introduction-36kg) was listed and featured in [C++ LibHunt Weekly Newsletter](https://twitter.com/CppLibHunt/status/1209415174236471296).
- Started learning Modern C++ and making a series of tutorials for it.
- Added content and fixed grammar for [Modern C++ Book](https://github.com/changkun/modern-cpp-tutorial) and will contribute more to it.

## Dashboard
![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/r8qpism8byneoc04mc55.PNG)


## Hacktoberfest Profile and T-Shirt
![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/90i7inn0jxb39y2ewjvy.PNG)
![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/ezhb1p7nf856p41b0gh1.PNG)


## Github Activity
![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/rp63euaf8go1zcx3lj7f.PNG)


I hope that I will be able to do more in 2020 and learn a lot of new things and meet new people.


Happy New Year Eve!
The Web We Share
Tags: html, a11y, semanticweb, webdev
Published: 2019-12-31 23:17:52

---
title: The Web We Share
published: true
description: Considerations for building beautiful, accessible, interoperable HTML
tags: #html #a11y #semanticweb #webdev
---

## Introduction

It’s a tale from another dimension: HTML markup representing not just a graphical experience but also virtual objects and their state.

HTML allows for a single element to have multiple meanings for different use cases.

You could imagine your markup as a topology with multiple layers of semantics. Or, as 3 different dimensions: visual, accessible, and machine-readable.

(And with WebXR and other emerging technologies being grafted onto the web platform, there will soon be more dimensions to consider! Spooky!)

## Visual

An element’s `class` and `style` attributes are most relevant to the rendering engine that displays the visual interface. For a lot of web developers, this is just the air we breathe.

## Accessibility

An element's `role` and `aria‑*` attributes are most relevant to screen readers.

Never heard of a screen reader? Most blind people don't use a mouse. Instead, they use a keyboard to operate an application that speaks the content and metadata of the currently focused element. People who are deaf-blind might use a screen reader with a refreshable Braille display.

When using a screen reader, properly marked up elements can be acted upon in unique ways. For instance, marking up all headings using heading elements (h1-h6) will compile them and make them available as a list for easier page navigation.

## Interoperability

Metadata attributes such as `itemprop` are most relevant to digital assistants and search engines, for things like indexing and repurposing.

Audio-enabled digital assistants often parse web pages' structured data and document outlines to find information. The relevant data can be packaged into an experience that is native to that service's voice UI.

## Engineering Strategies

To account for the wide range of ways HTML code can be utilized, always adhere to the HTML, ARIA, and Schema.org specifications.

In my experience, building a library of reusable, spec-compliant web components is the best way to deliver beautiful, accessible, interoperable websites.
McLear: From typo to a fun alias 🍔🍟
Tags: showdev, shell, bash, zsh
Published: 2019-12-31 17:57:28

---
title: McLear: From typo to a fun alias 🍔🍟
published: true
description: A fun bash alias made from a typo
tags: showdev, shell, bash, zsh
---
I mistakenly typed `mclear` in place of `clear` in my zsh terminal, and came up with a fun alias! Enjoy!
```bash
alias mclear='FOOD=(🍔 🍟); for i in {1..10000}; do printf "${FOOD[($RANDOM % ${#FOOD[@]}) + 1]}"; done'
```
![The alias in action!](https://thepracticaldev.s3.amazonaws.com/i/z0txn8xzy6om3glx3vuv.gif)
My First Seed of Blog Post
Tags: webdev, javascript
Published: 2020-01-01 09:55:32

##Intro
![Alt Happy New Year 2020](https://thepracticaldev.s3.amazonaws.com/i/wh31dhtxha1px6nx2gym.jpg)
<figcaption>Photo by cottonbro from Pexels</figcaption>
Hello guys!
First I want to say *Happy New Year* to all of my friends.

##Bio
My name is Vijay Kumar. I'm a student from University of Computer Studies, Mandalay. Currently, I'm studying computer technology (computer engineering).

##Learning
Although I'm a hardware student, I'm learning full stack web development . After all this doesn't matter what you do or who you are. Actually I'm studying full stack web development to make some money during this joyful university life and get some experiences from web projects. 

##Blog
This is my first ever blog and may be reading this blog will be like a block of texts with full of necessities what a good blog should have.I'll try to overcome with those necessities with the help of feedback from all of my friends.I also wanna ask for guidance if anyone found something wrong in any of my blog posts.In my future blogs, I'm going to write full stack web development related topics and some computer science and engineering topics too.

##New Year Resolution
  ![Alt a note book with some text written on it](https://thepracticaldev.s3.amazonaws.com/i/7beyf64s6t8mvgmohuj4.jpg)
  <figcaption>Photo by ***[freestocks.org](https://www.pexels.com/@freestocks)*** from *Pexels*</figcaption>
As today is new year day, everyone is goint to make some resolutions. I made mine too. Writing blog post is also included in my resolution. I hope all of my friends have also made some resolution and I wish they gonna meet their goals in near future.

##Starting my blogging journey
I'm starting to blog on *** Dev Community *** form now and I hope I'll get full support from my senior developers and my friends.

Thank You Everyone and enjoy this new year's first day.
Please don't forget to comment.

{% user vijaykumarktg18 %}

Cover Photo by ***[Dom J](https://www.pexels.com/@dom-j-7304)*** from *Pexels*
Bootstrap Datetimepicker Disable Dates Dynamically
Published: 2020-01-10 13:26:46

---
title: Bootstrap Datetimepicker Disable Dates Dynamically
published: true
date: 2020-01-01 00:00:00 UTC
tags: 
canonical_url: 
---

Hi guysIn this tutoriali will give you simple example of Bootstrap datetimepicker disable dates dynamically you can disable dynamically dates bootstrap datetimepicker using disabledDates methodwe are disabled bootstrap datetimepicker in specific datesit will useing disabledDates options to