<html lang='en'>
<head>
<title>Site Title</title>
<link href="stylesheet-url.css" rel="stylesheet">
</head>
<body>
<h2>This is a Second Level Heading</h2>
<p>This is a Paragraph. Write anything in paragraph.</p>
</body>
</html>
body {
background: #fff;
font-family: 'sans-serif', Roboto;
box-sizing: border-box;
}
h1, h2, h3, h4, h5, h6 {
font-family: 'Roboto', sans-serif;
color: #333;
text-transform: uppercase;
}
a {
text-decoration: none;
color: #2a73cc;
transform: scale(0.9);
}
a:hover {
transform: scale(1.2);
color: #153955;
}
@mixin row-setting {
height: 20px;
text-align: center;
a{
text-decoration: none;
}
}
@mixin cell-setting {
@include row-setting;
td {
display: inline-block;
border: 1px solid #ddd;
box-sizing: border-box;
}
}
table tr {
@include cell-setting;
}
<?php
$a = 30; /* global scope variable */
$b = 50; /* Another global variable */
$c;
function addition(){
global $a, $b, $c;
$c = $a + $b;
echo Sum of $a + $b : $c.”;
}
addition();
?>
class Student:
def __init__(self, f_name, l_name):
self.firstname = f_name
self.lastname = l_name
def printname(self):
print(self.firstname, self.lastname)
# Now Create an instance of object by using the above Student Class and print the name required
name = Student("John", "Doe")
x.printname()
import React, { useState } from 'react';
function MyInput() {
const [value, setValue] = useState('');
const handleChange = event => {
setValue(event.target.value);
};
return (
<input
type="text"
value={value}
onChange={handleChange}
/>
);
}
const xhr = new XMLHttpRequest();
xhr.onreadystatechange = () => {
if (xhr.readyState === 4 && xhr.status === 200) {
console.log(xhr.responseText);
}
};
xhr.open('GET', 'codelib.css');
xhr.send();
const loadingIcon = document.createElement('div');
loadingIcon.innerHTML = '<i class="fa fa-spinner fa-spin"></i>';
loadingIcon.style.cssText = 'position: fixed; top: 0; left: 0; right: 0; bottom: 0; display: flex; align-items: center; justify-content: center;';
document.body.insertBefore(loadingIcon, document.body.firstChild);
const removeLoadingIcon = () => {
document.body.removeChild(loadingIcon);
};
const checkLoaded = () => {
if (document.readyState === 'complete') {
removeLoadingIcon();
} else {
setTimeout(checkLoaded, 100);
}
};
setTimeout(checkLoaded, 3000);
import java.util.Scanner;
import java.util.Random;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
Random rand = new Random();
System.out.print("Enter the first number: ");
int num1 = scan.nextInt();
System.out.print("Enter the second number: ");
int num2 = scan.nextInt();
int min = Math.min(num1, num2);
int max = Math.max(num1, num2);
int randomNum = rand.nextInt(max - min + 1) + min;
System.out.println("Random number between " + min + " and " + max + ": " + randomNum);
}
}
<div id="accordion">
<div class="card">
<div class="card-header" id="headingOne">
<h5 class="mb-0">
<button class="btn btn-link" data-toggle="collapse" data-target="#collapseOne" aria-expanded="true" aria-controls="collapseOne">
Collapsible Group Item #1
</button>
</h5>
</div>
<div id="collapseOne" class="collapse show" aria-labelledby="headingOne" data-parent="#accordion">
<!-- Remove the card-body element -->
</div>
</div>
<div class="card">
<div class="card-header" id="headingTwo">
<h5 class="mb-0">
<button class="btn btn-link collapsed" data-toggle="collapse" data-target="#collapseTwo" aria-expanded="false" aria-controls="collapseTwo">
Collapsible Group Item #2
</button>
</h5>
</div>
<div id="collapseTwo" class="collapse" aria-labelledby="headingTwo" data-parent="#accordion">
<!-- Remove the card-body element -->
</div>
</div>
<div class="card">
<div class="card-header" id="headingThree">
<h5 class="mb-0">
<button class="btn btn-link collapsed" data-toggle="collapse" data-target="#collapseThree" aria-expanded="false" aria-controls="collapseThree">
Collapsible Group Item #3
</button>
</h5>
</div>
<div id="collapseThree" class="collapse" aria-labelledby="headingThree" data-parent="#accordion">
<!-- Remove the card-body element -->
</div>
</div>
</div>
/* A simple Kotlin example to find out the factorial of a number */
fun factorial(n: Int): Long {
return if (n == 0 || n == 1) {
1
} else {
n * factorial(n - 1)
}
}
fun main() {
val number = 5
val result = factorial(number)
println("Factorial of $number is: $result")
}