teleren/devto huggingface dataset:
Kotlin mutable & immutable variable – Val vs Var
Tags: kotlin, var, val, immutable
Published: 2021-04-16 14:18:42

https://grokonez.com/kotlin/kotlin-mutable-immutable-variable-val-vs-var

Kotlin mutable & immutable variable – Val vs Var

In the tutorial, <a href="https://grokonez.com">JavaSampleApproach</a> explains the differences between <strong>Kotlin Val vs Var</strong>.

<!--more-->
<h2>1. Kotlin Val</h2>
<code>val</code> is used to declare a <strong>read-only</strong> variable. It likes <code>final</code> in Java.
So we can <strong>NOT</strong> re-assign a new value for <code>val</code> variable.

<img src="https://grokonez.com/wp-content/uploads/2017/12/kotlin-val-vs-var-val.png" alt="kotlin val vs var - val" width="506" height="366" class="alignnone size-full wp-image-9946" />
<h2>2. Kotlin Var</h2>
<code>var</code> is used to declare a <strong>mutable</strong> variable. So we can change value of <code>var</code> variables.

<pre><code class="language-java">
data class Customer(val id: Int, var name: String)

fun main(args : Array<String>) {
	/*
 	 * I. Basic Datatype
 	 */
	var a = 5
	println("a = $a") // a = 5
	// can not re-assign a new value
	a = 6
	println("a = $a") // a = 6
	
	var str = "abc"
	println("str = $str") // str = abc
	// can not re-assign a new value
	str = "xyz"
	println("str = $str") // str = xyz
	
	/*
     * II. Object data model
 	 */
	var cust = Customer(1, "Jack")
	println("cust = $cust") // cust = Customer(id=1, name=Jack)
	// can not re-assign a new value
	cust = Customer(2, "Mary")
	println("cust = $cust") // cust = Customer(id=2, name=Mary)
}</code></pre>
<h2>3. Kotlin Val & Var with Object's Properties</h2>

More at:

https://grokonez.com/kotlin/kotlin-mutable-immutable-variable-val-vs-var

Kotlin mutable & immutable variable – Val vs Var
Kotlin – Compare Objects with Comparable Example
Tags: kotlin, compare, comparable
Published: 2021-04-16 14:26:02

https://grokonez.com/kotlin/kotlin-compare-objects-comparable-example

Kotlin – Compare Objects with Comparable Example

This tutorial shows you way to compare Objects with <code>Comparable</code> by an example.

Related posts:
- <a href="https://grokonez.com/kotlin/kotlin-sort-list-objects-comparable">Kotlin – Sort List of Objects with Comparable</a>
- <a href="https://grokonez.com/kotlin/kotlin-sort-list-objects-kotlin-comparator-example">Kotlin – Sort List of Objects with Kotlin Comparator Example</a>
- <a href="https://grokonez.com/kotlin/kotlin-comparator-binary-search-object-list">Kotlin Comparator Binary Search for Object List</a>

<!--more-->
<h2>I. Technology</h2>
- Java 1.8
- Kotlin 1.1.2
<h2>II. Overview</h2>
<h3>1. Goal</h3>
First, we compare two objects <code>Date(year:Int,month:Int,day:Int)</code>.
Second, we continue to work on two <code>Product(name:String,date:Date)</code> objects.
<h3>2. Steps to do</h3>
- Implement <code>Comparable</code> interface for the class of objects you want to compare.
- Override <code>compareTo(other: T)</code> method and:
+ return <em><strong>zero</strong></em> if this object is <em><strong>equal</strong></em> <code>other</code>
+ a <strong><em>negative</em></strong> number if it's <strong><em>less</em></strong> than <code>other</code>
+ a <em><strong>positive</strong></em> number if it's <em><strong>greater</strong></em> than <code>other</code>
<h2>III. Practice</h2>
<h3>1. Create Classes</h3>
<pre><code class="language-java">
package com.javasampleapproach.objcomparision

import kotlin.Comparable

data class Date(val year: Int, val month: Int, val day: Int) : Comparable<Date> {

	override fun compareTo(other: Date) = when {
		year != other.year -> year - other.year
		month != other.month -> month - other.month
		else -> day - other.day
	}
	
}
</code></pre>
<code>Product</code> class includes <code>Date</code> field (implemented <code>Comparable</code> interface), so you can compare two <code>Date</code> objects inside using operator <code><,>,==</code>.

More at:

https://grokonez.com/kotlin/kotlin-compare-objects-comparable-example

Kotlin – Compare Objects with Comparable Example
Cyber Security Tutorial
Published: 2021-04-16 14:14:20

Today, from kept degree relationship to beast corporate goliaths, all trades are going on through networks, which makes Cyber Security crucial for these relationship to guarantee their electronic assets. With the Cyber Security joblessness rate being 0% (CSO Online) and having 4 million unfilled Cyber Security occupations by and large (Netsparker), the remuneration offered to Cyber Security specialists are taking off. This blog will cover the Cyber Security pay in India to help you with picking an errand profile for your calling prospering. 

Cyber Security has gotten one of the definitely pursued purposes for living any put on the world. As advancement makes, the need to safeguard fascinating information from aggressors/engineers is getting quintessential to get certified movement and improvement. 

Remember, you own an alliance, or you are a specialist there. Undeniably, you needn't relax around latently with your customers' own personal data, thriving information, connection's business decisions, or some advantaged intel to be familiar with an unapproved person who can perform criminal endeavors with it. That gives the essential need to ensure the whole of this data with Cyber Security. In the current data driven world, this is the circumstance with every intrigue be it a startup or a MNC. As requirements be, the expert openings in this field are growing rapidly without a leeway. 

A Cyber Security Analyst will work inside a relationship to test for needs. The master necessities to do entrance testing to find the decisions that lie in the's relationship through which an attacker can meddle and mistreat the plan. 

This blog proposed to uncover some data into the repaying pay packs offered to Cyber Security experts in India. With the predictable premium for Cybersecurity specialists in the IT business from new relationship to corporate beasts in the country, it is the right opportunity to change to this field if you are tense about it. To begin the outing, you can upskill yourself with Intellipaat's [Cyber Security Tutorial](https://intellipaat.com/blog/tutorial/ethical-hacking-cyber-security-tutorial/) and in the end land your dream work with your optimal remuneration pack.
Using shapes in the web project
Tags: bootstrap, javascript, webdev, html
Published: 2021-04-16 14:05:16

## Shapes as a UI trend

When we look at various landing pages or look at Dribbble for inspiration, we find many graphical visualizations in which shapes are the focal point or essential elements. Current trends in web design clearly show that what catches the eye of the user and makes a given website or application interesting for him in terms of UI are two-dimensional figures with streamlined shapes, most often irregular, rounded, with subtle gradients or pastel in the background the colors. This trend does not surprise me at all, because the delicate shapes on which we add text or illustrations give the impression of lightness, minimalism, and at the same time can be diverse and tailored to the subject of a given web project.

_________


## Fancy Border Radius Tool

As we at MDB carefully follow frontend technological innovations and trends in web design, we decided to create many tools that will make it easier for you to apply many interesting UI ideas directly to your project built on the MDB package. You may already know some of these tools and some you do not, but today I would like to introduce you to the ["Fancy Border Radius Tool"](https://mdbootstrap.com/docs/standard/tools/design/fancy-border-radius/). With this shape generator, you can quickly and easily create the shapes you want and match the vision of your project. To create any shape, you must move the four sliders, which will allow you to get a figure with a different border radius. Then copy the generated CSS and HTML code, paste it into the project, give the appropriate height, width, and background color.


_____________



## Sample projects

Of course, the shape itself is not enough. For a better effect, it is worth adding a properly selected font and content or illustrations. In the three following projects, I will show you the various possibilities of using the ["Fancy Border Radius Tool"](https://mdbootstrap.com/docs/standard/tools/design/fancy-border-radius/).


## Intro with gradient shape and content

[![project1](https://mdbcdn.b-cdn.net/img/Photos/new-templates/fbr/4.png)](https://mdbootstrap.com/snippets/standard/marta-szymanska/2893866?view=side)


__________


## Various shapes within the grid

[![project2](https://mdbcdn.b-cdn.net/img/Photos/new-templates/fbr/5.png)](https://mdbootstrap.com/snippets/standard/marta-szymanska/2893876?view=side)


__________

## Shapes with illustrations

[![project3](https://mdbcdn.b-cdn.net/img/Photos/new-templates/fbr/6.png)](https://mdbootstrap.com/snippets/standard/marta-szymanska/2894053?view=side)
Kotlin – Integrate H2 database with Spring JPA( by Spring Boot) in Embedded mode

Tags: kotlin, h2, springboot, springjpa
Published: 2021-04-16 13:57:09

https://grokonez.com/spring-framework/spring-boot/kotlin-spring-boot/kotlin-integrate-h2-database-spring-jpa-spring-boot-embedded-mode

Kotlin – Integrate H2 database with Spring JPA( by Spring Boot) in Embedded mode

H2 database is a pure Java, open source and very fast engine. We can use H2 for development, testing and performance benchmarking. So in the tutorial, <a href="https://grokonez.com">JavaSampleApproach</a> will show how to integrate H2 database with Kotlin SpringBoot and Spring JPA in Embedded mode.

<!--more-->
<h2>I. H2 database and SpringBoot integration</h2>
H2 database has small footprint (smaller than 1.5 MB) with low memory requirements. It supports for multiple schemas and standard SQL, JDBC API. We can use H2 with disk based or in-memory databases.

H2 can be built by following mode:
– Embedded mode (local connections)
– Server mode (remote connections)
– Mixed mode (local and remote connections)

In the tutorial, We focus on Embedded mode to integrate H2 database and SpringBoot Application.

<img src="https://grokonez.com/wp-content/uploads/2018/02/kotlin-h2-springboot-jpa-architecture-H2-Embedded.png" alt="kotlin h2 springboot jpa - architecture - H2-Embedded" width="300" height="326" class="alignnone size-full wp-image-10636" />

How to configure it with SpringBoot?
-> Spring Boot has a built in H2 database, so We just add below dependency:

<pre><code class="language-html">&lt;dependency&gt;
    &lt;groupId&gt;com.h2database&lt;/groupId&gt;
    &lt;artifactId&gt;h2&lt;/artifactId&gt;
&lt;/dependency&gt;</code></pre>

H2 supports a convenient web based data console to interact with database while the development:

<img src="https://grokonez.com/wp-content/uploads/2018/02/kotlin-h2-springboot-jpa-architecture-H2-Database-console.png" alt="kotlin h2 springboot jpa - architecture - H2-Database-console" width="477" height="411" class="alignnone size-full wp-image-10637" />
<h2>II. Practice</h2>
In the tutorial, We create a Spring JPA Web application which uses Spring JPA to interact with H2 database in Embedded mode.

Step to do:
– Create Kotlin SpringBoot project
– Configure H2 database
– Implement Kotlin Spring JPA Web Application
– Run & check results

https://grokonez.com/spring-framework/spring-boot/kotlin-spring-boot/kotlin-integrate-h2-database-spring-jpa-spring-boot-embedded-mode

Kotlin – Integrate H2 database with Spring JPA( by Spring Boot) in Embedded mode
Kotlin sum() and sumBy() method for List, Map of Objects example
Tags: kotlin, sum, sumby
Published: 2021-04-16 13:46:48

https://grokonez.com/kotlin/kotlin-sum-sumby-method-list-map-objects-example

Kotlin sum() and sumBy() method for List, Map of Objects example

This Kotlin tutorial shows you example that uses <code>sum()</code> and <code>sumBy()</code> method for <code>List</code>, <code>Map</code> of Objects.

<!--more-->
<h2>I. Technology</h2>
- Java 1.8
- Kotlin 1.1.2
<h2>II. Overview</h2>
The goal is to calculate total <strong>quantity</strong> of all <code>Product(name, quantity)</code> objects in List/Map using:
- <code>sum()</code> method:
Firstly, <code>map()</code> will create a <strong>List</strong> of <strong>quantity</strong> first, then we invoke:
<pre><code class="language-java">
List<quantity>.sum()
</code></pre>
- <code>sumBy()</code> method:
It can apply on <strong>List</strong> of <strong>Product</strong>, but we must provide selector for indicating <code>quantity</code>:
<pre><code class="language-java">
List<Product>.sumBy(selector: product -> quantity)
</code></pre>
<h2>III. Practice</h2>
<h3>0. Product Class</h3>
<pre><code class="language-java">
package com.javasampleapproach.fold

data class Product(val name: String, val quantity: Int) {
}</code></pre>

https://grokonez.com/kotlin/kotlin-sum-sumby-method-list-map-objects-example

Kotlin sum() and sumBy() method for List, Map of Objects example
Java 9 Flow API – Reactive Streams
Tags: java9, reactive, streams
Published: 2021-04-16 13:38:39

https://grokonez.com/java/java-9/java-9-flow-api-reactive-streams

Java 9 Flow API – Reactive Streams

Java 9 introduces <strong>Reactive Streams</strong> under <code>java.util.concurrent.Flow</code> that supports an interoperable publish-subscribe framework. In the tutorial, we're gonna look at a general view of <strong>Reactive Streams</strong> and how it comes to <a href="https://grokonez.com/java-9-tutorial">Java 9</a> with some new <strong>Flow</strong> API Components.

Related Articles:
- <a href="https://grokonez.com/java/java-9-flow-api-example-publisher-and-subscriber">Java 9 Flow API example – Publisher and Subscriber</a>
- <a href="https://grokonez.com/java/java-9-flow-api-example-processor">Java 9 Flow API example – Processor</a>
- <a href="https://grokonez.com/java/java-9-flow-submissionpublisher-concrete-publisher">Java 9 FLow SubmissionPublisher – A Concrete Publisher</a>

<!--more-->
<div id="tuttoc" class="jsa-toc"></div>

<div id="tutcontents">
<h2>I. Reactive Streams</h2>
<h3>1. Overview</h3>
Reactive Streams aims to improve concurrency workflows for developers by solving the pain of back-pressure (when fast data source doesn't overwhelm the stream destination).

<img src="https://grokonez.com/wp-content/uploads/2017/04/reactive-stream-backpressure.png" alt="reactive-stream-backpressure" width="699" height="194" class="alignnone size-full wp-image-4537" />

In the image above, we can see that if <strong>Destination</strong> can not deal with incoming data from <strong>Source</strong>, all future data could be blocked until the existing ones are processed.

If the <strong>Source</strong> checks when <strong>Destination</strong> is not overflowed to send data, the problem could be solved. But in this case, it is still synchronous communication and we don't take advantage of an asynchronous system which enables the parallel use of computing resources, on collaborating network hosts or multi-core processor.

<strong>Reactive Streams</strong> processes an asynchronous stream data across an asynchronous boundary (passing elements on to another thread or thread-pool), and receiving side (Destination) is not forced to buffer arbitrary amounts of data, then buffer overflow will not occur.

In summary, <strong>Reactive Streams</strong>:
- process a potentially unbounded number of elements
- in sequence,
- asynchronously passing elements between components,
- with mandatory non-blocking back-pressure.

These things are possible by flow control and the <strong>publish-subscribe pattern</strong> which allows the <strong>subscriber</strong> to be able to understand limitation and show <strong>publisher</strong> its capacity.


More at:

https://grokonez.com/java/java-9/java-9-flow-api-reactive-streams

Java 9 Flow API – Reactive Streams
My First PR got merged!!
Tags: opensource, github, beginners, contribution
Published: 2021-04-16 13:25:28

I always want to work and contribute👩‍💻️ to large codebases but feared the complexity of code and also lack of knowledge dragged me backward from contributing to Open Source. But one day, I got an opportunity to attend a session with **GitHub star⭐️ of the Year** which my community has organized. After attending the session, I got the great inspiration to start with my Open Source journey by contributing to the community🚀️ and forgot about my level of knowledge/experience.

And then the magic✨️ happens, got my first issue and after working for 2 days my first pull request got merged. The issue was not difficult but I feel proud to be a contributor to the community.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/q72yzis7e5nfv9f5uzh5.png)

*Major Learning* - 
* My myth of Open Source contribution breaks off that only experts can contribute to a project. I agree with the fact that contribution does require good knowledge but one doesn't need to know all the things to get started with Open Source. 
* A good mentor can amplify your growth.
About Me
Published: 2021-04-16 13:12:56

Hey, I am Rajan Kumar. Currently I am Pursuing Matser Of Computer Application From Maulana Azad National Institute of Technology, Bhopal. Started my MCA course From 4 January, 2021. Here i get through NIMCET-2020 Entrance Exam with AIR 403 and Category Rank 150. This Exam is conducted on 22 October, 2020 in online mode for All India. It is National Level Exam that can be conducted by any participating NITs.
                   Due to current Covid-19 Pandemic, all the Academic process completed in online mode including classes, Assignments, and Examinations.
Importance of Big Data
Tags: bigdata
Published: 2021-04-16 13:03:59

The upheaval of data is moderately new. Before the recent years, the majority of the data was put away on paper, film, or some other simple media; just one-fourth of all the world’s put away data was advanced. But now the scenario has been changed. TB’s of data has been creating on every day. So to deal with the huge of data we use the concepts of Big Data for smarter Business decisions. So the employment opportunities have been drastically increasing in Big Data Domain.

I have received a lot many emails regarding Big Data. In this blog, I would like to tell the Basic Introduction & Importance of Big Data. I’m working as a Big Data Engineer and I would recommend taking this [Big Data Training](https://intellipaat.com/big-data-hadoop-training/) which helps me to land a job in Big Data


##What is Big Data?
Big Data deals with a huge amount of data, doesn’t matter whether the data has been structured data/unstructured data. There are a lot of companies that deal with big data for their business decisions and insights.
**Big Data deal with 3V’s**
Velocity
Volume and
Variety
Use of Big Data
Challenges that we face with Big Data
Storing data
Searching data
Sharing data
Transferring data


**How to Deal with Big Data?**
The problem has been solved by the usage of a Database server called MapReduce.The algorithm divides tasks into smaller parts and those are assigned to several computers, and these computers collect the results to form the final result dataset.

**Sectors uses Big Data every day**
1)Education
2)Medical
3)Banking
4)E-commerce
5)Social Media etc

Based on the usage the demand has been drastically increasing and can make career in Big Data
Kotlin – average() function with Kotlin Array & List examples
Tags: kotlin, array, list
Published: 2021-04-16 13:01:16

https://grokonez.com/kotlin/kotlin-average-function-kotlin-array-list-examples

Kotlin – average() function with Kotlin Array & List examples

In the tutorial, <a href="https://grokonez.com">JavaSampleApproach</a> will show you how to use Kotlin <code>average()</code> function with Kotlin Array & List collections by examples.

<!--more-->
<h2>I. Kotlin List with average() function</h2>
With Kotlin List, We use following method signatures of <code>average()</code>:

<pre><code class="language-java">
fun Iterable<Byte>.average(): Double (source)
fun Iterable<Short>.average(): Double (source)
fun Iterable<Int>.average(): Double (source)
fun Iterable<Long>.average(): Double (source)
fun Iterable<Float>.average(): Double (source)
fun Iterable<Double>.average(): Double (source)
</code></pre>

-> Returns an average value of elements in the collection.

Practice:

More at:

https://grokonez.com/kotlin/kotlin-average-function-kotlin-array-list-examples
Declaring JavaScript Variables.
Tags: javascript, beginners, tutorial
Published: 2021-04-16 12:53:56

Let's start of here. There are eight different data types in JavaScript which are undefined, null, symbol, string, object, and bigint.

 Variables allow computers to manipulate and store data. Similar to math (x and y variables), computer variables differ in a way where they can store many different values at any time.

### Let's dive right in and tell JavaScript to declare such variable by placing the keyword var in front of it.
    * EX:
        var dog;
    *  Here we created a variable called dog. We always end statements with semicolons. Variable names can be written up of numbers, letters, and _ or even $ (we'll explain that another time), but it cannot contain spaces or start with a number.