teleren/devto huggingface dataset:
Spring Boot One To Many Mapping Demo With H2 database
Tags: springboot, java, database, programming
Published: 2021-10-15 07:44:11

There are three basic entity relationships:-

* One-to-One
* One-to-Many/Many-to-one
* Many-to-Many

 A Single post can have multiple comments by this way we can apply one-to-many Mapping 

## Installation

Clone the repo from here:- [Click here](https://github.com/atharvasiddhabhatti/Springboot-Playground/tree/main/springboot-demo-one-to-many-mapping)

Import Maven based project in any of your Favourite IDE.

```bash
./mvnw spring-boot:run
```
## Output
Open in Browser

Access H2 Database.

```
http://localhost:8080/h2-console
```

## Usage
### MainClass.java
run() method is run when the application is started. The data is added in the database.

```java
	Post post = new Post("Spring Boot Post Title","Spring Boot Post Description");
		Comment comment1 = new Comment("Thanks for uploading");
		Comment comment2 = new Comment("Comment2 test");
		Comment comment3 = new Comment("Comment3 test");
		
		post.getComments().add(comment1);
		post.getComments().add(comment2);
		post.getComments().add(comment3);
		
		postRepository.save(post);
```


### Post.java
Id column is used to map the post and comments together.

```java
@OneToMany(cascade = CascadeType.ALL)
	@JoinColumn(name = "post_Comment_id",referencedColumnName = "id")
	List<Comment> comments = new ArrayList<>();
```
## Output
Comments are mapped by the ID of the Post on which they are commented. As you can see in the below images.

![output1](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ecnprxgd4ur1d8u6undj.png)
![output2](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ni7qyo6hg72hi7fcmg69.png)
## Configuration
### application.properties

```c
spring.jpa.show-sql = true

# Enabling H2 Console
spring.datasource.url=jdbc:h2:mem:testdb
spring.jpa.defer-datasource-initialization=true
spring.h2.console.enabled=true

# Enable Web Access
spring.h2.console.settings.web-allow-others=true
```
Advantages of Python
Tags: python, programming, datascience, opensource
Published: 2021-10-15 07:38:43

In this tutorial, we will learn about the advantages of python, which is a programming language. Python is one of the most popular programming languages in the world, used in industry and academia for solving complex problems. It has simple syntax, semantics, and human-readable code that helps you write clean but powerful programs faster.

There are many advantages to using python; it's easy to learn, able to process data efficiently, extensible (you can add extensions on top of the core), embeds quickly through interpreters like Jython or IronPython, and in general very flexible in what you can do with it. There is also an active community for help that is available otherwise in case they don't know how to solve something specific either.Learn more about python from [https://pythonscholar.com/python-programming]
Styling - Console.log
Published: 2021-10-15 07:21:05

Hello 👋 Guys Hope you are **safe and happy**. so in this blog i will tell you that how you can style console.log using javascript and CSS 😊

Q. Why We Need To Style Console.log And When ?

Ans - You have seen many social media websites such as Facebook or Google Plus, where they have big red text appearing in the console saying "WARNING!" or similar to prevent you from entering malicious code. There are many reasons for styling console.log but the main purpose is to prevent users from entering malicious code in the website 😊

To style console.log follow my steps 😊

When you console something it looks normal and not very cool looking but to style it we need to put "%c" attached to the text 

Check this code and if you want to test it just open the dev tools and go to console and then paste the code so that you can see the output...

Code.

> console.log("Here comes the text you want to display to the users", "and then put your css styles here to decorate the text");

```js
console.log("%cStyled Text", "color: #fff; background: #000; padding: 12px; font-family: Poppins; font-size: 20px; font-weight: bold;");
```

Thankyou Guys for giving your time and reading this hope you are safe and Happy...
Also don't forget to subscribe 🌟⚡ to my youtube channel

- https://youtube.com/c/codingfire?sub_confirmation=1
Credit Card Generator in Python (All Code)
Published: 2021-10-15 07:20:11

If you just need a bunch of numbers use the <a href="https://www.cardgenerators.org">online credit card number generator</a>.

Python, Java, C#, PHP and Javascript programs to generate valid credit card numbers (MOD 10). Useful for testing payment systems. This generates VISA, Mastercard, Amex, and a whole bunch of others.

The Luhn algorithm, also known as the "modulus 10" algorithm, is a checksum formula used to validate a variety of identification numbers, such as credit card numbers, IMEI numbers, National Provider Identifier numbers in the United States, Canadian Social Insurance Numbers, and Israel ID Numbers.

Algorithm:

The formula verifies a number against its included check digit, which is usually appended to a partial account number to generate the full account number.

Generating check digit:

Lets assume you have a number as: 3 - 7 - 5 - 6 - 2 - 1 - 9 - 8 - 6 - 7 - X where X is the check digit.
Now starting from the rightmost digit i.e. check digit, double every second digit. New number will be: 3 - 14 - 5 - 12 - 2 - 2 - 9 - 16 - 6 - 14 - X
Now if double of a digit is more then 9, add the digits. So the number will become: 3 - 5 - 5 - 3 - 2 - 2 - 9 - 7 - 6 - 5 - X
Now add all digits. 47 + X
Multiply the non-check part by 9. So it will be 47 * 9 = 423
The unit digit in the multiplication result is the check digit. X = 3
The valid number would be 37562198673.
Validating the generated number:
You can use tools available online to validate that the number generated is valid as per Luhn's algorithm or not. You can validate the number by visiting this site.

from random import randint

cc_number = []
multiplied_by_two = []
remaining_numbers = []
new_number = ''

# Ask for a first 15 digits of a card
starting_15 = input('Enter first 15 digits: ')

z = 0
y = 0

while z < 25:
    for i in str(starting_15):
        cc_number.append(int(i))

    # extract all the numbers that have to be multiplied by 2
    for i in cc_number[0:16:2]:
        i *= 2
        if len(str(i)) == 2:        # check if the multiplied number is a two digit number
            for x in str(i):        # if it is, separate them, and add them together
                y += int(str(x))
            i = y
        multiplied_by_two.append(i)
        y = 0

    for i in cc_number[1:15:2]:     # extract remaining numbers
        remaining_numbers.append(i)

    # Luhn's algorithm
    last_digit = ((sum(multiplied_by_two) + sum(remaining_numbers)) * 9) % 10

    for i in cc_number:
        new_number += str(i)

    print(new_number + str(last_digit))
    cc_number = []
    multiplied_by_two = []
    remaining_numbers = []
    new_number = ''

    starting_15 = int(starting_15) + randint(-15, 25)
    z += 1
Yet Another Number Game
Tags: codenewbie, java, easy, programming
Published: 2021-10-15 07:16:08

##Statment
>
Alice and Bob play the following game. They choose a number N to play with. The rules are as follows :
1) Alice plays first, and the two players alternate.
2) In his/her turn, a player can subtract from N any proper divisor (not equal to N) of N. The number thus obtained is the new N.
3) The person who cannot make a move in his/her turn loses the game.
Assuming both play optimally, who wins the game ?

**Input :**

The first line contains the number of test cases T. Each of the next T lines contains an integer N.

**Output :**

Output T lines, one for each test case, containing "ALICE" if Alice wins the game, or "BOB" otherwise.

**Sample Input :**
```
2
1
2
```
**Sample Output :**
```
BOB
ALICE
```

**Constraints :**
1 <= T <= 10000
1 <= N <= 1000000000

Note : For the first test case, Alice cannot make any move and hence Bob wins the game. For the second test case, Alice subtracts 1 from N. Now, Bob cannot make a move and loses the game.

### Solution:-
To run the code[ click here.](https://gouravmk.hashnode.dev/yet-another-number-game)
```
import java.util.*;
public class MyClass {
    public static void main(String args[]) {
     Scanner sc = new Scanner(System.in);  
	
		int T = sc.nextInt();  
		int arr[] = new int[T];
		int count=0;
		for(int i = 0; i <T; i++) {
			arr[i]= sc.nextInt();
		}
		for(int i = 0; i <T; i++) {
			if(arr[i]==1) {
				System.out.println("BOB");
			}else if(arr[i]%2==1) {
				System.out.println("BOB");
			}else {
				System.out.println("ALICE");
			}
		}
		sc.close();
    }
}
```
webMethods Integration Server Command-line tool Tutorials
Tags: integration, tutorial, video
Published: 2021-10-28 11:35:14

---
title: webMethods Integration Server Command-line tool Tutorials
published: true
date: 2021-10-15 07:13:59 UTC
tags: #integration, #tutorial, #video
canonical_url: https://tech.forums.softwareag.com/t/webmethods-integration-server-command-line-tool-tutorials/245042
---

[![wmIntegration](https://aws1.discourse-cdn.com/techcommunity/optimized/3X/b/4/b422fb087c5cf28f78013eba5f900f729017f0b3_2_510x374.jpeg)](https://aws1.discourse-cdn.com/techcommunity/original/3X/b/4/b422fb087c5cf28f78013eba5f900f729017f0b3.jpeg "wmIntegration")

## Overview:

Administer webMethods Integration Server from your Linux or DOS shell. Use the command line to view and modify Integration Server configuration and perform dozens of administrative actions.

## Playlist:

[![webMethods Integration Server Command-line tool playlist](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rwgwm60xk4i3nnieogv2.png)](https://www.youtube.com/watch?v=_NEnVbsx8vY&list=PL3HwmrSYjxiMn6mUciPZ4Q8r65xYNnnX0&t=6s) 

[Read full topic](https://tech.forums.softwareag.com/t/webmethods-integration-server-command-line-tool-tutorials/245042)
Showcase Your Blog Articles with React
Tags: javascript, webdev, tutorial, programming
Published: 2021-10-15 07:06:22

[![](https://cdn-images-1.medium.com/max/2264/1*BMIsYQF1_XlZJtR6YnCNwQ.png)](https://javascript.plainenglish.io/showcase-your-medium-articles-with-react-20a2a4151091?source=rss-f6e6b5239e7f------2)

Let`s build a React application that shows the Medium articles of any Medium user

[Continue reading on JavaScript in Plain English »](https://javascript.plainenglish.io/showcase-your-medium-articles-with-react-20a2a4151091?source=rss-f6e6b5239e7f------2)
Fluent If-Else statements?
Tags: discuss, programming, java, functional
Published: 2021-10-15 06:49:54

Some showerthoughts for the day:

I think it would have been nice if languages support [fluent](https://martinfowler.com/bliki/FluentInterface.html) conditional statements.

So instead of
```java
if(condition) {
    someFunction();
} else if (anotherCondition) {
    anotherFunction()
} else {
    doSomething()
}
```

Maybe have something like
```java
if(condition, someFunction)
    .elseIf(anotherCondition, anotherFunction)
    .else(doSomething)
```

or go further and make it return a value
```java
var someVar = if(condition, someFunction)
                    .elseIf(anotherCondition, anotherFunction)
                    .else(defaultValue)
```

**Pros**:
- you get a more succinct and arguably more expressive statement
- if used properly, it may read like a prose

**Cons**:
- it's probably unnatural or unintuitive to some people; more cognitive load perhaps?

I'm not actually sure if this already exists elsewhere and I'm too lazy to find out if it does.
But what do you guys think? Is this useful or am I just overthinking it? :laughing:
How to run a flask project on Repl.it? (with a brower preview)
Tags: python, flask, webserver
Published: 2021-10-15 06:13:39

Repl.it (https://repl.it/) is a very useful development runtime environment. We can easily run nodejs, php, html, python, ..etc. on repl.it.

But how to run a flask project on repl.it? We can refer to quick start on flask document: 

https://flask.palletsprojects.com/en/2.0.x/quickstart/

```
from flask import Flask

app = Flask(__name__)

@app.route("/")
def hello_world():
    return "<p>Hello, World!</p>"
```

But when we push "Run" button on the header area on repl.it, the console start to build and run and exit with nothing, sure, we didn't use flask command to start the program.

Switch to Shell, run:

```
$ export FLASK_APP=main
$ flask run 
* Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
```

We can find that it starts to listen port 5000, but we can't read the result content.

So, how to read the content? Just put the line on the bottom of these code:

```
app.run(host='0.0.0.0')
```

Then push the "Run" button, the web server listen on 0.0.0.0:5000 and start a new window that the browser preview content comes out. It's really convenient to develop python flask project on repl.it.

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

The demo project is here:

https://replit.com/@timhuangt/demoflask

Let's play with flask on Repl.it.
Week 6: Refactoring and git rebase
Tags: opensource, webdev, javascript, beginners
Published: 2021-10-15 06:13:15

This week I will is about refactoring my code and you guys can check out my change at this commit [6f20f71](https://github.com/BeAmazedVariable/TS-SSG/commit/6f20f71a78dcff2318f039d7b84e10d436e230c9)

**Summary of what I did

I change my README.md,package.json, LICENSE to close 2 issues [#3](https://github.com/BeAmazedVariable/TS-SSG/issues/3) and [#4](https://github.com/BeAmazedVariable/TS-SSG/issues/4)

I did move the parsing comman line argument into src/argv.ts and parsing html into src/html-maker.ts and instead of a global variable ` let inputPath; ` I decide to wrap all of them in another function for best practice 

And thanks to the advises on Slack from my prof, I decide to change using camel case which is my favourite to kebab-case.js
**Git rebase

I think this week we leanr another best practice using git where we can avoid octopus node using `$ git rebase  <the branch that we rebase our branch>`. I remmeber when I first start Git, people keep talking about Git as a time machine and now I know why. Rebase will move your HEAD one commite above and when you merge it back to the main branch, you will have a nice and clean commit log.

`$ git commit --amend ` also super usefull. I did not remeber how many times I have to create dummy commit because I forgot to change one or 2 small things in my working tree and have to start another new commit. Amend the commit really come out and help my git log way cleaner
3 Lightweight JavaScript Carousel Libraries
Tags: javascript, webdev, productivity, uiweekly
Published: 2021-10-15 05:41:47

_Save for later._
<br/>

###[embla-carousel.com](https://www.embla-carousel.com/)
>A lightweight carousel library with fluid motion and great swipe precision.

![embla-c](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hc3ffxmskpn6qm1ll41u.png)


###<br/>[glidejs.com](https://glidejs.com/)
>A dependency-free JavaScript ES6 slider and carousel. It’s lightweight, flexible and fast. Designed to slide. No less, no more.

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


###<br/>[splidejs.com](https://splidejs.com/)
>A lightweight, flexible and accessible slider and carousel. No dependencies, no Lighthouse errors.

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

<br/>
Thank you for reading. Please leave a like if you enjoyed the post and follow for upcoming articles!

<br/>P.S. Want the next post to be something specific? Do let me know in the comments.

🤘🏻
<br/>
Connect with me : [Github](https://github.com/deyRupak)
Support me : [Buy me a coffee!](https://paypal.me/deyrdx?locale.x=en_GB)
Data analysis using SPSS
Tags: statistics, beginners, tutorial, datascience
Published: 2021-10-15 05:32:29

<a href="https://www.statisticalaid.com">Statistical Aid</a> is a site where you can learn various topics about statistics and data analysis. Smoe of them are:
<a href="https://www.statisticalaid.com/how-to-analyze-data-using-spss-for-beginners-part-1/">Data analysis using spss</a>
<a href="https://www.statisticalaid.com/how-to-input-data-in-spss-data-analysis-part-2/">Data input in spss</a>
<a href="https://www.statisticalaid.com/how-to-import-data-in-spss-from-excel-file-data-analysis-part-3/">Import data in spss</a>
<a href="https://www.statisticalaid.com/how-to-sort-data-in-spss-data-analysis-part-4/">Sort data using spss</a>
<a href="https://www.statisticalaid.com/how-to-merge-file-in-spss-data-analysis-part-5/">Merge data file in spss</a>
<a href="https://www.statisticalaid.com/how-to-combine-two-data-set-using-add-variable-in-spss-data-analysis-part-6/">Combine data set in spss</a>
<a href="https://www.statisticalaid.com/finding-missing-values-replacing-missing-values-coding-missing-values-in-spss-data-analysis-part-7/">Missing value in spss</a>
<a href="https://www.statisticalaid.com/variable-transformation-recoding-variables-in-spss-data-analysis-part-8/">Variable transformation in spss</a>
<a href="https://www.statisticalaid.com/univariate-analysis-using-spss-data-analysis-part-9/">Univariate analysis in spss</a>
<a href="https://www.statisticalaid.com/bivariate-analysis-using-spss-data-analysis-part-10/">Bivariate analysis in spss</a>
<a href="https://www.statisticalaid.com/normality-checking-of-a-data-set-using-spss-data-analysis-part-11/">Normality of data in spss</a>
Divtober Day 15: Float
Tags: codepen, divtober, css, showdev
Published: 2021-10-15 05:31:38

---
title: Divtober Day 15: Float
description: Cartoon of a boat floating by itself with the oars in disarray.
published: true
tags: codepen,divtober,css,showdev
series: divtober
---

The word of the day is float... so I did a boat floating peacefully by itself, with the oars in disarray:

{% codepen https://codepen.io/alvaromontoro/pen/zYdvmVZ %}

And with a video of how it was done:

{% youtube kb-MxR1BXHw %}

----

The drawing is based on a [previous drawing I had done](https://codepen.io/alvaromontoro/pen/OJXVXMO)... which is funny, because initially I was doing a different illustration for divtober, also based on a [drawing for a CSS game](https://codepen.io/alvaromontoro/details/XWdrQOg):

{% codepen https://codepen.io/alvaromontoro/pen/jOLbKoO %}
How to make a card using html and css only?
Tags: html, css, tutorial
Published: 2021-10-15 05:18:16

The card element is a useful component to visualize important content on a webpage. It can be used for post feed, products, or summarized content. It is also useful to highlight features of a product or company as well. A standard card design consists of a thumbnail, title, summary, and link to a detailed page. Therefore, in order to make a card element more attractive, we can also add animation and hover effects. That’s we are going to make it here, card design with hover effect using pure CSS.

To know how to make a card go to [my website](https://tilakjain.netlify.app/show.html?bal=GdA5HfE9r3rvHPrDcARn)
7 Visual Studio 2022 Features That Will Change Your Life
Tags: desktop, web, net, industrynews
Published: 2021-10-17 21:05:26

---
title: 7 Visual Studio 2022 Features That Will Change Your Life
published: true
date: 2021-10-15 05:00:00 UTC
tags: Desktop,Web,NET,IndustryNews
canonical_url: https://www.grapecity.com/blogs/7-visual-studio-2022-features
---

Visual Studio 2022 launches this November. Check out the top 7 features that will change the way you dev. See more from GrapeCity today.
Setup Reactjs + TypeScript with Tailwind CSS
Tags: tailwindcss, typescript, react
Published: 2021-10-15 04:53:25

In this post, I will show you how to set up Tailwind CSS with Reactjs(TypeScript).

What we will create is this.
https://hopeful-rosalind-29803f.netlify.app/

### 1. Create a reactjs project with create-react-app
```zsh
$ yarn create react-app react-tailwind-ts --template typescript
```

### 2. Install Tailwind CSS
```zsh
$ yarn add -D tailwindcss@npm:@tailwindcss/postcss7-compat postcss@^7 autoprefixer@^9
```

### 3. Install CRACO
```zsh
$ yarn add @craco/craco
```

### 4. Modify files
In this step, we will edit two files, `package.json` and `craco.config.js`(create).
`package.json`
```json
"scripts": {
    "start": "craco start",
    "build": "craco build",
    "test": "craco test",
    "eject": "react-scripts eject"
},
```

`craco.config.js`

```js
module.exports = {
  style: {
    postcss: {
      plugins: [require("tailwindcss"), require("autoprefixer")],
    },
  },
};
```

### 5. Generate `tailwind.config.js`
In this step, we will generate `tailwind.config.js` by the following command and edit `purge`.

```zsh
$ yarn tailwindcss-cli@latest init
```

`tailwind.config.js`

```js
module.exports = {
  purge: ["./src/**/*.{js,jsx,ts,tsx}", "./public/index.html"],
  darkMode: false, // or 'media' or 'class'
  theme: {
    extend: {},
  },
  variants: {
    extend: {},
  },
  plugins: [],
};
```

### 6. Add Tailwind
`index.css`

```css
@tailwind base;
@tailwind components;
@tailwind utilities;
```

`index.tsx`

```ts
import React from "react";
import ReactDOM from "react-dom";
import "./index.css";
import App from "./App";
import reportWebVitals from "./reportWebVitals";

ReactDOM.render(<App />, document.getElementById("root"));

reportWebVitals();
```

### 7. Create a component for `Gradient Text`

`components/GradientText.tsx`

```ts
type Props = {
  text: string;
};

export const GradientText = ({ text }: Props) => {
  return (
    <div className="p-10 min-h-screen flex items-center justify-center bg-cool-gray-700">
      <h1 className="text-9xl font-black text-white text-center">
        <span className="bg-gradient-to-r text-transparent bg-clip-text from-green-400 to-purple-500">
          {text}
        </span>
      </h1>
    </div>
  );
};
```

### 8. Run the app

```zsh
$ yarn start
```

If everything works well, you will see the following image.

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


### repo

{% github koji/react_with_TailwindCSS %}
(SHOWCASE) Amazon Clone in SvelteKit, Svelte, TailwindCSS.
Published: 2021-10-15 04:49:13

{% youtube NHDOjV2HD_Y %}

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

LIVE DEMO URL CLICK HERE

##URL for the build: https://amazon-svelte.vercel.app/
##Source Code:  https://rebrand.ly/amazon_svelte


#Requirements 

Node 16 or above Features 

1. The Project uses SvelteKit, Svelte, TailwindCSS, ShopAPI, etc to fetch the data 

2. Highly Editable without changing the code

 

Just open the file src/assets/details.js 

Edit it according to your needs like the API URL, images URL, logo of the site, etc


##Product Insiders

 1. The Project displays the products.

 2. The product can be added to the cart.

 3. Can't See cart without signing in.

 4. Displays Total Price.

##Directory Structures


├── jsconfig.json
├── package.json
├── package-lock.json
├── postcss.config.cjs
├── README.md
├── sda.js
├── src
│   ├── app.css
│   ├── app.html
│   ├── assets
│   │   ├── cartHelper.js
│   │   ├── details.js
│   │   ├── firebaseImport.js
│   │   ├── req.js
│   │   └── router.js
│   ├── firebase
│   │   ├── auth.js
│   │   └── config.js
│   ├── global.d.ts
│   ├── hooks.js
│   ├── lib
│   │   ├── Body
│   │   │   ├── CarousalItem.svelte
│   │   │   ├── CheckoutProduct.svelte
│   │   │   ├── Currency.svelte
│   │   │   ├── ProductFeed.svelte
│   │   │   ├── Product.svelte
│   │   │   └── Stars.svelte
│   │   └── Header
│   │       ├── bottomnav.svelte
│   │       ├── index.svelte
│   │       └── login.svelte
│   ├── routes
│   │   ├── checkout.svelte
│   │   ├── index.svelte
│   │   └── __layout.svelte
│   └── store
│       ├── basket.store.js
│       └── user.store.js
├── static
│   ├── favicon.svg
│   └── robots.txt
├── svelte.config.js
└── tailwind.config.cjs



![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3swptayd5yk03egcdait.jpg)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8uvv3kq8l2q7byb7uiyy.jpg)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ky09gaye8iftgnoea9r6.jpg)