teleren/devto huggingface dataset:
How to test Your API inside VSCODE
Tags: webdev, beginners, vscode, productivity
Published: 2021-05-07 11:19:59

Hey All 👋 . 

Recently I got to know about a VS Code extension called **Thunder Client⚡⚡** which can be used to test our API inside VS Code.
How Cool 😎 is that to test our API in the editor that we use all the time.

**Thunder Client** is a GUI-based Rest Api HTTPS client and has a very clean UI and easy-to-use interface.

One of the key highlights of this extension is **Scriptless Testing**

As we need to write a lot of boilerplate code in Postman and other clients to do basic testing using scripting like status code equal 200. In Thunder client, there is a GUI-based test where we can select a couple of dropdowns to do most standard tests very easily without any scripting knowledge.
As you can see in the image below

![](https://miro.medium.com/max/1000/1*Ke_upcoljKriEz1q6hmIHg.png)


## 🖥 How to install

- First of all open your VS Code and Click on extensions on the sidebar and install thunder client.

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


- now you will see a icon on side bar
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ri47g140gygip7v840pg.png)

##Lets test Thunder client a little bit 

- for testing you can create your own API or you can use
 
> https://gorest.co.in/
 
and get your authentication token and you are good to go.

below you can see Thunder Client in action in Below GIF

- GET request  

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

- POST request in which we create a GUI based Test

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


 Now you can play around thunder client a little more.


Let me know your thoughts about it 😃and if you like it share it with others.

![end](https://media2.giphy.com/media/26AHC0kdj8IeLkmBy/200.webp?cid=ecf05e47a1atqwznh4fq0oe3xqf3hy4ifhr25jovp2c21ld7&rid=200.webp&ct=g)
HTML : Paragraphs
Tags: codenewbie
Published: 2021-05-07 11:15:36

Paragraphs are the most basic HTML element. This topic explains and demonstrates the usage of the paragraph element in HTML.

The HTML `<p>` element defines a paragraph:
```html
<p>This is a paragraph.</p>
<p>This is another paragraph.</p>
```
# Display
You cannot be sure how HTML will be displayed. Large or small screens, and resized windows will create different results.

With HTML, you cannot change the output by adding extra spaces or extra lines in your HTML code. The browser will remove any extra spaces and extra lines when the page is displayed:
```html
 <p>This               is another paragraph,       extra spaces will be                    removed by           browsers</p>
```


<a href="https://www.buymeacoffee.com/rkycom" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Buy Me A Coffee" style="height: 60px !important;width: 217px !important;" ></a>

With all that being said, I highly recommend you keep learning!

Thank you for reading this article. Please feel free to connect with me on [LinkedIn](https://www.linkedin.com/in/www-rajeshkumaryadav-com/) and [Twitter](https://twitter.com/rky_com).
React core concept!
Published: 2021-05-07 11:13:16

**1. What is react?**
Ans: React is a Javascript library, it's not a framework. it's lightweight easy to use and makes the website UI cooler! React do one thing at a time and finished it well.

**2. Difference between library & framework**
 Ans: The difference between library & framework is the library would be changed by the user as he wants but the framework has a specific rule which must maintain a user. The big problem with the framework is if the user implements one thing then the full system load automatically.

**3. Why react so popular?**
Ans: React is a lightweight library. It makes programmer work easy to create UI. It builds up a relation between developers and browsers so developers can modify UI easily. React introduced the developer with the smart idea of virtual DOM(Document Object Model).

**4.The benefit of using React?**
Ans: Before react, developers worked with DOM API and it working is hard. Anyone who has knowledge of Javascript can easily use ReactJS. For Android and IOS Mobile Applications React Native so beneficial and ReactJS users can easily maintain React Native. Most of the features of ReactJS were released after the test at facebook.com so the bug possibility has zero.

**5. How to React update instantly?**
Ans: React update the specific functionality which needs update and doing this work React doesn't run full functionality it remove the update complexity and browser performance fast.

**6. What is JSX?**
Ans: JSX an extension to javascript it helps to write HTML code in Javascript code so the user could not be open another HTML file to write HTML code. Browser isn't able to read JSX files directly for that browser translate these JSX codes and this call 
"transpiler". We can use Babel or Typescript as a transpiler.

**7. React component and apply CSS**
Ans: React is a component-based library. This helps website renders first because which component needs it to render only that. To make a component its name must declare in capital letter. Although the small letter component name worked the capital letter is good practice. We can use CSS inside React component but its method is using inside double curly braces.

**8. React functions and classes**
Ans: The beginning stage of React is used as a class-based components library. Many complexity and limitations replaced it with a function method also called React Hooks. Compare between classes and functions, function Is simple and user friendly its benefit is complex component break into smaller parts.

**9. Why React use component?**
Ans: Component makes code readable and simple, it helps to break a big or complex code into smaller parts. User can reuse a component where they need. Declaring global variable it's easy to use from any component.

**10. React Hooks discussion**
=> React Hooks is more powerful and you can do it as your need. All hooks function must need a state that declares with useState. This hooks side effects can be manageable by using useEffect. React hooks function only usable in a function component it couldn't be a usable in-class component.
Generating Android APK file with React Native
Tags: reactnative, react, ios, android
Published: 2021-05-07 10:59:54

Let's be honest, even if you really like React Native, you were frustrated with it at least once. Especially if you have just started working with it.

So I hope this post will help at least some of you :D.

This are 7 steps how to generate your Android APK file so you can test your app on a real phone and share it with your friends or testers. 

**Currently tested and working with latest version today 0.64**

1. Generate private signing key using keytool. How to do that you can find it [here](https://reactnative.dev/docs/signed-apk-android#generating-an-upload-key). If you are using OpenJDK, then your keytool is probably in C:\Program Files\OpenJDK\openjdk-xxxxx-xxx\bin.

2. Make sure to copy signing key to /android/app/ folder of your react native app.

3. Edit gradle.properties file in your android folder by adding following (make sure to replace ***** with a password that you want to use, my-upload-key and my-key-alias with the names you want):
    ```
     MYAPP_UPLOAD_STORE_FILE=my-upload-key.keystore<br>
     MYAPP_UPLOAD_KEY_ALIAS=my-key-alias<br>
     MYAPP_UPLOAD_STORE_PASSWORD=*****<br>
     MYAPP_UPLOAD_KEY_PASSWORD=*****<br>
    ```

4. Add signing config in Gradle config file. Edit the build.gradle file in your android/app/ folder:
    ```js
 ...
 android {
     ...
     defaultConfig { ... }
     signingConfigs {
         release {
             if (project.hasProperty('MYAPP_UPLOAD_STORE_FILE')) {
                 storeFile file(MYAPP_UPLOAD_STORE_FILE)
                 storePassword MYAPP_UPLOAD_STORE_PASSWORD
                 keyAlias MYAPP_UPLOAD_KEY_ALIAS
                 keyPassword MYAPP_UPLOAD_KEY_PASSWORD
             }
         }
     }
     buildTypes {
         release {
             ...
             signingConfig signingConfigs.release
         }
     }
 }
 ...
    ```

5. Check if the file my-release-key.keystore ("my-release-key" is the key you entered earlier) is located in path /android/app/ (if it is not there, make sure to copy it there from the folder where your key was created).

6. Create assets folder in /android/app/src/main/

7. Open your terminal and position yourself to root folder. Run command: 
    ```
   react-native bundle --platform android --dev false --entry-file 
   index.js --bundle-output 
   android/app/src/main/assets/index.android.bundle --assets-dest 
   android/app/src/main/res
    ```

8. Open one more terminal and position yourself into android folder. Run command: 
`gradlew clean` 
or 
`./gradlew clean`

9. After previous command is finished run: 
`gradlew assembleRelease -x bundleReleaseJsAndAssets` 
or 
`./gradlew assembleRelease -x bundleReleaseJsAndAssets`

10. If everything goes well, you can find your signed apk file in `android/app/build/outputs/apk/`
or 
`android/app/build/outputs/apk/release/`
Kotlin Map collection – map() methods
Tags: kotlin, map, collection
Published: 2021-05-07 10:55:42

https://grokonez.com/kotlin/kotlin-map-collection-map-methods

Kotlin Map collection – map() methods

In the tutorial, <a href="https://grokonez.com">JavaSampleApproach</a> will show you how to use <code>map()</code> methods to transform Kotlin Map collection to Kotlin List collection or a new Map collection.

<!--more-->
<h2>I. Kotlin Map collection with map() methods</h2>
Kotlin Map collection supports a set of map() methods to transform the given map to a new map or a new list:

<pre><code class="language-java">1. fun &lt;K, V, R&gt; Map&lt;out K, V&gt;.map(transform: (Map.Entry&lt;K, V&gt;) -&gt; R): List&lt;R&gt;
2. fun &lt;K, V, R : Any&gt; Map&lt;out K, V&gt;.mapNotNull(transform: (Map.Entry&lt;K, V&gt;) -&gt; R?): List&lt;R&gt;
3. fun &lt;K, V, R, C : MutableCollection&lt;in R&gt;&gt; Map&lt;out K, V&gt;.mapTo(destination: C, transform: (Map.Entry&lt;K, V&gt;) -&gt; R): C
4. fun &lt;K, V, R : Any, C : MutableCollection&lt;in R&gt;&gt; Map&lt;out K, V&gt;.mapNotNullTo(destination: C, transform: (Map.Entry&lt;K, V&gt;) -&gt; R?): C
5. fun &lt;K, V, R&gt; Map&lt;out K, V&gt;.mapKeys(transform: (Map.Entry&lt;K, V&gt;) -&gt; R): Map&lt;R, V&gt;
6. fun &lt;K, V, R&gt; Map&lt;out K, V&gt;.mapKeys(transform: (Map.Entry&lt;K, V&gt;) -&gt; R): Map&lt;R, V&gt;
7. fun &lt;K, V, R&gt; Map&lt;out K, V&gt;.mapValues(transform: (Map.Entry&lt;K, V&gt;) -&gt; R): Map&lt;K, R&gt;
8. fun &lt;K, V, R, M : MutableMap&lt;in K, in R&gt;&gt; Map&lt;out K, V&gt;.mapValuesTo(destination: M, transform: (Map.Entry&lt;K, V&gt;) -&gt; R): M	</code></pre>

Now practicing ->
<h3>0. Initial data for practicing</h3>
<pre><code class="language-java">
data class Address(
	val street: String,
	val postcode: String
)
 
data class Customer(
	val firstName: String,
	val lastName: String,
	val age: Int
)

data class Person(
	val fullname: String,
	val age: Int,
	val address: Address
)

val customerMap = mapOf(Pair(Customer("Jack", "Davis", 25), Address("NANTERRE CT", "77471")),
						Pair(Customer("Mary", "Taylor", 37), Address("W NORMA ST", "77009")),
						Pair(Customer("Peter", "Thomas",17), Address("S NUGENT AVE", "77571")),
						Pair(Customer("Amos", "Nelson",23), Address("E NAVAHO TRL", "77449")),
						Pair(Customer("Craig", "White",45), Address("AVE N", "77587")),
						Pair(Customer("Laura", "Lewis", 32), Address("NANTERRE CT", "77471")),
						Pair(Customer("Steven", "Harris", 39), Address("S NUGENT AVE", "77571")),
						Pair(Customer("Paul", "Moore", 18), Address("E NAVAHO TRL", "77449")),
						Pair(Customer("Mary", "Cook", 61), Address("S NUGENT AVE", "77571")),
						Pair(null, null))

</code></pre>
<h3>1. Transform a given Kotlin Map to List</h3>
<h4>1.1 map()</h4>
Method signature:

More at:

https://grokonez.com/kotlin/kotlin-map-collection-map-methods

Kotlin Map collection – map() methods
What the heck is JSX in React.
Published: 2021-05-07 10:55:23

JSX stands for JavaScript XML. JSX allows you to write HTML inside React. JSX is a syntax extension to JavaScript. In this article, I will try to explain how to use JXS without bashing your keyboard into your monitor. It is fairly simple when you get the hang of it.

As I say, using JSX you can write HTML directly into React with added functionality. Eventually, during the build process [babel](https://babeljs.io/) will transpile your code in plain JavaScript.

JSX code:
```javascript
<Navbar color="gray" />
```

Compiles into:
```javascript
React.createElement(
  Navbar,
  {color: 'gray'}
)
```

You can use any HTML tag that you want. If you don't have any child element you can use that tag as a self-closing tag.

JSX code: 

```javascript
<div className="imageContainer" />
```

compiles into: 

```javascript 
React.createElement(
  'div',
  {className: 'imageContainer'}
```

Something that you should note here is that you can't use the "class" keyword because it is a reserved word for JavaScript so you have to use "className" instead. and also you can't use a dash (-) in your class names so you need to use camelCase for your naming. 

User-created components must start with a capital letter. <myHeader> is a big no no in react. It should be like this,  <MyHeader>.

You can pass a JSX component as a child element. You can also pass simple HTML, JavaScript expression, and Functions as children.

```javascript 
<CartContainer>
<CartHeader/>

<h1>{name}</h1>
<p>Thank you</p>

</CartContainer>
```

Booleans, Null and Undefined are ignored when rendering. Don't get me wrong, these are valid children, but they don't get rendered. If you want to render them in your UI you have to convert them into a string.

```javascript
const answer = true;
<div>
  The answer is {String(true)}.
</div>
```

Earlier in this article, we saw that the JSX compiles into calls to React.createElement so the React must be in scope. (What is Scope?? The "Scope" is beyond the scope of this article. We will talk about it in another article.) So what it actually means to be in scope?? Simply it means that you have to import React in each of your [components](https://reactjs.org/docs/react-component.html).

```
import React from 'react';
```

You can send data from one component to another in JSX using something called [Props](https://reactjs.org/docs/components-and-props.html). You can pass any JavaScript expression and string by typing the name of data following by equal sign and curly braces.

```javascript 
<ShoppingCart key={001}, name={"LV Wallet"}/>
```

if statements and for loops are not expressions in JavaScript so you can't send them as a Props but you can use them in the surrounding code.

```javascript 

function NumberDescriber(props) {
  let description;
  if (props.age > 18 ) {    
description = <strong>Underaged</strong>;  
} else { 
  description = <i>18+</i>; 
 }  

return (
<div>{props.number} is an {description} number</div>
);
}

```
Play Satta Matka at Dpboss
Tags: dpboss, sattamatka, games
Published: 2021-05-07 10:51:58

Following are few amazing tips through which one can become the master of this game and become the next satta matka king:

Doing Proper research and techniques

If you aren’t new to this industry, you must be well aware of all the fundamentals of it. Many of the professional matka bettors use techniques like researching satta charts, jodi charts, and panel charts. After doing thorough research on channels like these we can go for other things ahead. Researching is important because one needs a proper technique to reach a certain level of success. An individual can do this thing either by social media or taking personal help from other strong individuals. Research and techniques are too important for us. Research is mostly done on the charts. That’s where we get most of the suggestions. 

Take extra care while you earn money

It is important to earn money. Every player has to make sure that they earn money. Money earning is easier when people are provided proper guidance. Guidance while playing this game is very important as these things change the way people think. While a player or a professional selects a market, app, or website to play; they need to be double sure of a lot of things before doing anything. Taking care of people while they do stuff is really important. Some of the app owners don’t play or do anything on any app or website. Due to this a player often feels unsafe. To be the satta king, a player needs to be on the safest websites and play with the best in it. People can play satta matka game and become satta king at [dpboss](https://www.dpbossonline.com/kalyanmatka) online site.

Recipe for satta king

There’s no proper way to be the best satta king in the world of [satta matka](https://www.dpbossonline.com/). Even if you are way too good in kalyan satta or kalyan starline, you need a proper way to reach heights. Things can become easier if you follow all the above-mentioned stuff and work hard to reach your goals.
JAVA DATABASE CONNECTIVITY (JDBC)

Tags: javascript, database
Published: 2021-05-07 10:44:54


JDBC is Java application programming interface that permits the Java software engineers to get to information base administration framework from Java code. It was created by JavaSoft, an auxiliary of Sun Microsystems. It empowers the java projects to execute SQL proclamations.

JDBC is an application programming interface that characterizes how a java developer can get to the information base in plain organization from Java code utilizing a bunch of standard interfaces and classes written in the Java programming language. JDBC gives techniques to questioning and refreshing the information in Relational Database Management framework, for example, SQL, Oracle and so forth

The Java application programming interface gives a system to progressively stacking the right Java bundles and drivers and enrolling them with the JDBC Driver Manager that is utilized as an association production line for making JDBC associations which supports making and executing proclamations, for example, SQL INSERT, UPDATE and DELETE. Driver Manager is the foundation of the JDBC engineering.

By and large all Relational Database Management Systems uphold SQL and we as a whole realize that Java is stage free, so JDBC makes it conceivable to compose a solitary information base application that can run on various stages and cooperate with various Database Management Systems.

Java Database Connectivity is like Open Database Connectivity (ODBC) which is utilized for getting to and overseeing information base, yet the thing that matters is that JDBC is planned explicitly for Java programs, while ODBC isn’t relied on any language.

In this way JDBC encourages the software engineers to compose java applications that deal with these three programming exercises:

It causes us to interface with an information source, similar to an information base.

It encourages us in sending questions and refreshing proclamations to the information base and

Recovering and handling the outcomes got from the information base regarding offering an explanation to your question.

Item COMPONENTS OF JDBC

The JDBC API
2.The JDBC Driver Manager

3.The JDBC Test Suite

4.The JDBC-ODBC Bridge
String handling in java
Published: 2021-05-07 10:41:26

String is an object that represents sequence of characters. In Java, String is represented by String class which is located into java.lang package

It is probably the most commonly used class in java library. In java, every string that we create is actually an object of type String. One important thing to notice about string object is that string objects are immutable that means once a string object is created it cannot be changed.

>string-handling-feature 
In Java, Char Sequence Interface is used for representing a sequence of characters. Char Sequence interface is implemented by String, String Buffer and String Builder classes. This three classes can be used for creating strings in java.

>char-string-handling-feature
What is an Immutable object?
An object whose state cannot be changed after it is created is known as an Immutable object. String, Integer, Byte, Short, Float, Double and all other wrapper classes objects are immutable.

>Creating a String object
String can be created in number of ways, here are a few ways of creating string object.

1) Using a String literal
>String literal is a simple string enclosed in double quotes " ". A string literal is treated as a String object.
2) Using new Keyword
>We can create a new string object by using new operator that allocates memory for the object.

>public class Demo{    
    public static void main(String[] args) {  
    	String s1 = new String("Hello Java");
    	System.out.println(s1);
    }  
}  

Each time we create a String literal, the JVM checks the string pool first. If the string literal already exists in the pool, a reference to the pool instance is returned. If string does not exist in the pool, a new string object is created, and is placed in the pool. String objects are stored in a special memory area known as string constant pool inside the heap memory.

String object and How they are stored
>When we create a new string object using string literal, that string literal is added to the string pool, if it is not present there already.
Concatenating String
>There are 2 methods to concatenate two or more string.

Using concat() method
>Using + operator
1) Using concat() method
>Concat() method is used to add two or more string into a single string object. It is string class method and returns a string object.
2) Using + operator
>Java uses "+" operator to concatenate two string objects into single one. It can also concatenate numeric value with string object.
Kotlin convert Map to SortedMap
Tags: kotlin, sortedmap, map
Published: 2021-05-07 10:40:44

https://grokonez.com/kotlin/kotlin-convert-map-sortedmap

Kotlin convert Map to SortedMap

In the tutorial, <a href="https://grokonez.com">JavaSampleApproach</a> will show you how to convert Kotlin Map to SortedMap.

<!--more-->
<h2>I. Convert Kotlin Map to SortedMap</h2>
<h3>1. using toSortedMap()</h3>
Method signature:

<pre><code class="language-java">public fun &lt;K : Comparable&lt;K&gt;, V&gt; Map&lt;out K, V&gt;.toSortedMap(): SortedMap&lt;K, V&gt; = TreeMap(this)</code></pre>

-> Converts a <strong>Map</strong> to a <strong>SortedMap</strong> so iteration order will be in key order.

Practice:

<pre><code class="language-java">
val simpleMap = mapOf(Pair(4, "four"), Pair(8, "eight"), Pair(5, "five"), Pair(7, "seven"), Pair(10, "ten"), Pair(1, "one"))
println(simpleMap)
/*
	{4=four, 8=eight, 5=five, 7=seven, 10=ten, 1=one}
*/

val sortedMap = simpleMap.toSortedMap();
println(sortedMap)
/*
	{1=one, 4=four, 5=five, 7=seven, 8=eight, 10=ten}
*/</code></pre>
<h3>2. using toSortedMap() with Comparator</h3>
Method signature:

<pre><code class="language-java">public fun &lt;K, V&gt; Map&lt;out K, V&gt;.toSortedMap(comparator: Comparator&lt;in K&gt;): SortedMap&lt;K, V&gt;</code></pre>

-> Converts a Map to a SortedMap with <strong>comparator</strong> so that iteration order will be in the order defined by the <strong>comparator</strong>.

Practice:

More at:

https://grokonez.com/kotlin/kotlin-convert-map-sortedmap

Kotlin convert Map to SortedMap