Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lambda Expression added #791

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
114 changes: 63 additions & 51 deletions tutorials/learn-html.org/en/CSS Variables.md
Original file line number Diff line number Diff line change
@@ -1,51 +1,63 @@
Tutorial
--------

This page is empty. You are welcome to contribute the content by sending me a pull request:

[[https://github.com/ronreiter/interactive-tutorials]]

Exercise
--------

This page does not have an exercise yet. You are welcome to contribute one by sending me a pull request:

[[https://github.com/ronreiter/interactive-tutorials]]


Tutorial Code
-------------

<!DOCTYPE html>
<html>
<head>
</head>
<body>
</body>
</html>

Expected Output
---------------

<!DOCTYPE html>
<html>
<head>
<title>Hello, World!</title>
</head>
<body>
<p>Hello, World!</p>
</body>
</html>

Solution
--------

<!DOCTYPE html>
<html>
<head>
<title>Hello, World!</title>
</head>
<body>
<p>Hello, World!</p>
</body>
</html>
# CSS Variables: Enhancing Styling Flexibility

Cascading Style Sheets (CSS) have come a long way in providing developers with powerful tools to style web pages. One of the most significant additions to CSS in recent years is the introduction of CSS variables, also known as custom properties. CSS variables allow developers to define reusable values that can be used throughout their stylesheets, providing greater flexibility and maintainability in styling web applications.

## What are CSS Variables?

CSS variables are named values that can be reused throughout a CSS stylesheet. They are defined using the `--` prefix followed by a name and assigned a value. For example:

```css
:root {
--primary-color: #007bff;
--secondary-color: #6c757d;
}
```

In this example, we define two CSS variables, `--primary-color` and `--secondary-color`, with corresponding color values. The `:root` pseudo-class is used to define variables at the root level of the document, making them available globally within the stylesheet.

## Using CSS Variables

Once defined, CSS variables can be used anywhere in your stylesheet by referencing their names. For example:

```css
body {
background-color: var(--primary-color);
color: var(--secondary-color);
}
```

In this example, we use the `var()` function to reference the `--primary-color` and `--secondary-color` variables, setting the background color of the `body` element to the primary color and the text color to the secondary color.

CSS variables can also be scoped to specific elements or selectors, allowing for more granular control over styling. For example:

```css
.card {
--card-background: #f8f9fa;
background-color: var(--card-background);
}
```

In this example, we define a CSS variable `--card-background` within the `.card` selector, which sets the background color for all elements with the `.card` class.

## Benefits of CSS Variables

CSS variables offer several advantages over traditional CSS styling methods:

1. **Reusable Values:** CSS variables allow developers to define values once and reuse them throughout their stylesheets, reducing repetition and improving maintainability.

2. **Dynamic Styling:** CSS variables can be updated dynamically using JavaScript, allowing developers to create dynamic and interactive user interfaces without modifying the underlying CSS.

3. **Scoped Styling:** CSS variables can be scoped to specific elements or selectors, providing greater control over styling and reducing the risk of unintended side effects.

4. **Consistent Design Systems:** CSS variables enable the creation of consistent design systems by centralizing style definitions and promoting reuse across multiple components and layouts.

## Browser Support

CSS variables are supported in all modern web browsers, including Chrome, Firefox, Safari, Edge, and Opera. However, support for older versions of Internet Explorer (IE) is limited or nonexistent. To ensure compatibility with older browsers, developers can use CSS preprocessors like Sass or Less, which offer similar functionality and compile down to standard CSS.

---
**References:**

- [MDN Web Docs: CSS Variables](https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_custom_properties)

---
104 changes: 70 additions & 34 deletions tutorials/learn-html.org/en/Grid Layout.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,51 +3,87 @@ Tutorial

The "Grid Layout" is a concept used for designing websites using HTML and CSS. The basic concept of a grid allows us to
build an HTML page by using rows as the basic blocks, and each row can be divided into up to 12 columns.

This tutorial is incomplete. You are welcome to contribute one by sending me a pull request:
You are welcome to contribute one by sending me a pull request:
[[https://github.com/ronreiter/interactive-tutorials]]

Exercise
--------

This page does not have an exercise yet. You are welcome to contribute one by sending me a pull request:

[[https://github.com/ronreiter/interactive-tutorials]]

You can practice exercises here. [[https://github.com/yusuf7861?tab=repositories]]

Tutorial Code
-------------
```bash
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Grid Layout tutorial</title>
<style>
* {
box-sizing: border-box;
padding: 0;
margin: 0;
}

body {
font-family: 'Open Sans',sans-serif;
font-size: 16px;
line-height: 1.5;
color: #333;
background: #f5f5f5;
}

<!DOCTYPE html>
<html>
<head>
</head>
<body>
</body>
</html>
.container{
max-width: 960px;
margin: 100px auto;
padding: 10px;
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 10px;



/* column-gap: 10px;
row-gap: 10px; */

/* grid-auto-rows: minmax(200px, auto); */
/* grid-template-rows: repeat(3, 1fr); */
}

.item {
background: steelblue;
color: #fff;
font-size: 20px;
padding: 20px;
border: 2px solid skyblue;
}
</style>
</head>
<body>

<div class="container">
<div class="item">Lorem ipsum dolor sit amet consectetur, adipisicing elit. Iste, pariatur quis cum unde porro sequi, odit itaque officia </div>
<div class="item">Item2</div>
<div class="item">Item3</div>
<div class="item">Lorem ipsum, dolor sit amet consectetur adipisicing elit. Omnis voluptatibus dolore qui natus nam voluptates, harum hic ipsa laudantium suscipit et itaque corrupti perferendis quaerat possimus, labore maxime odit ipsum!</div>
<div class="item">Item5</div>
<div class="item">Item6</div>
<div class="item">Item7</div>
<div class="item">Item8</div>
<div class="item">Item9</div>
</div>

</body>
</html>
```

Expected Output
---------------

<!DOCTYPE html>
<html>
<head>
<title>Hello, World!</title>
</head>
<body>
<p>Hello, World!</p>
</body>
</html>

Solution
--------
![Grid Layout](https://i.postimg.cc/3RY1KmdH/Grid.jpg)

<!DOCTYPE html>
<html>
<head>
<title>Hello, World!</title>
</head>
<body>
<p>Hello, World!</p>
</body>
</html>
149 changes: 149 additions & 0 deletions tutorials/learnjavaonline.org/en/JavaDoc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@

# What is Javadoc?
Javadoc is a tool which comes with JDK and it is used for generating Java code documentation in HTML format from Java source code, which requires documentation in a predefined format.

Following is a simple example where the lines inside /*….*/ are Java multi-line comments. Similarly, the line which preceeds // is Java single-line comment.
```java
/**
* The HelloWorld program implements an application that
* simply displays "Hello World!" to the standard output.
*
* @author Zara Ali
* @version 1.0
* @since 2014-03-31
*/
public class HelloWorld {
public static void main(String[] args) {
// Prints Hello, World! on standard output.
System.out.println("Hello World!");
}
}
```
## Output:
```sh
Hello World!
```

# The javadoc Tags:
The javadoc tool recognizes the following tags:
| Tag | Description | Syntax |
| ---- | ------- | -------- |
| @author | Adds the author of a class. | @author name-text |
| {@code} | Display text in code font without interpreting the text as HTML markup or nested javadoc tags. | {@code text} |
| {@docRoot} | Represents the relative path to the generated document's root directory from any generated page. | {@docRoot} |
| @deprected | Adds a comment indicating that this API should no longer be used. | @deprecated deprecatedtext |
| @exception | Adds a Throws subheading to the generated documentation, with the classname and description text. | @exception class-name description |
| {@inheritDoc} | Inherits a comment from the nearest inheritable class or implementable interface. | Inherits a comment from the immediate surperclass. |
| {@link} | Inserts an in-line link with the visible text label that points to the documentation for the specified package, class, or member name of a referenced class. | {@link package.class#member label} |
| {@linkplain} | Identical to {@link}, except the link's label is displayed in plain text than code font. | {@linkplain package.class#member label} |
| @param | Adds a parameter with the specified parameter-name followed by the specified description to the "Parameters" section. | @param parameter-name description |
| @return | Adds a "Returns" section with the description text. | @return description |
| @see | Adds a "See Also" heading with a link or text entry that points to reference.| @see reference |
| @serial | Used in the doc comment for a default serializable field. | @serial field-description include exclude |
| @serialData | Documents the data written by the writeObject( ) or writeExternal( ) methods. | @serialData data-description |
| @serialField | Documents an ObjectStreamField component. | @serialField field-name field-type field-description |
|@since|Adds a "Since" heading with the specified since-text to the generated documentation.| @since release |
|@throws| The @throws and @exception tags are synonyms.| @throws class-name description|
|{@value} | When {@value} is used in the doc comment of a static field, it displays the value of that constant. | {@value package.class#field} |
| @version | Adds a "Version" subheading with the specified version-text to the generated docs when the -version option is used. | @version version-text |

If you are using JDK 1.7 then javadoc does not generate a great stylesheet.css, so we suggest to download and use standard stylesheet from https://docs.oracle.com

```java
/**
* @version 21.0
* since 2024
* @author yjama
*/
package JavaDoc;

/**
*
* @author yjama
*
* Class for Library Book
*/
public class Book {
/**
* @value 10 default value
*/
static int val = 10;

/**
* Parametrized Constructor
* @param s Book Name
*/
public Book(String s) {
}

/**
* Issue a Book to a student
* @param roll roll number of a student
* @throws Exception if book is not available, throws Exception
*/

public void issue(int roll) throws Exception {
}
/**
* check if book is available or not
* @param str Book name
* @return if book is available returns true else false
*/
public boolean available(String str){
return true;
}

/**
* Get Book name
* @param id book id
* @return returns book name
*/
public String getName(int id){
return "";
}

/**
* Main Method starts here
* @param args
*/
public static void main(String[] args) {

}
}
```



## Output:
[https://ibb.co/NsZ2xmB]
[https://ibb.co/d7wZMJc]
[https://ibb.co/PmWjZVg]

## Generating Javadoc for a Java File

Follow these steps to generate Javadoc for your Java file:

1. **Open Terminal or Command Prompt:**
Open a terminal (on macOS or Linux) or Command Prompt (on Windows) on your computer.

2. **Navigate to the Directory Containing Your Java File:**
Use the `cd` command to navigate to the directory that contains your Java file. Replace `path/to/your/directory` with the actual path. For example:
```bash
cd path/to/your/directory
```

3. **Generate javadoc:**
Run the javadoc command followed by the name of your Java file or package. For example:
```bash
javadoc YourClaas.java
```
If your Java file is part of a package, specify the package name instead of the file name:
```bash
javadoc your/package/name
```

4. **View the generated javadoc:**
Once the Javadoc generation process is complete, you'll see a new directory named `docs` in your current directory. Open the `index.html` file located inside the docs directory in a web browser to view the generated Javadoc.

That's it! You've successfully generated Javadoc for your Java file.

Loading