Professional Documents
Culture Documents
A DFS allows efficient and well-managed data and storage sharing options on a network
compared to other options. Another option for users in network-based computing is a shared disk
file system. A shared disk file system puts the access control on the client’s systems so the data is
inaccessible when the client system goes offline. DFS is fault-tolerant and the data is accessible
even if some of the network nodes are offline. A DFS makes it possible to restrict access to the
file system depending on access lists or capabilities on both the servers and the clients,
depending on how the protocol is designed.
In addition to the functions of the file system of a single-processor system, the distributed file
system supports the following:
2. User mobility
User should be permitted to work on different nodes.
3. Availability
For better fault-tolerance, files should be available for use even in the event of temporary failure
of one or more nodes of the system. Thus the system should maintain multiple copies of the files,
the existence of which should be transparent to the user.
4. Diskless workstations
A distributed file system, with its transparent remote-file accessing capability, allows the use of
diskless workstations in a system.
Arrays:
An array is a special variable, which can hold more than one value at a time.
If you have a list of items (a list of car names, for example), storing the cars in single variables
could look like this:
var car1 = "Saab";
var car2 = "Volvo";
var car3 = "BMW";
An array can hold many values under a single name, and you can access the values by referring
to an index number.
Using an array literal is the easiest way to create a JavaScript Array.
Syntax:
var array_name = [item1, item2, ...];
ex: var cars = ["Saab", "Volvo", "BMW"];
JavaScript arrays come in different forms and this post will explain what the difference is
between each array type. This post will look at the following array types;
Homogeneous arrays
Heterogeneous arrays
Multidimensional arrays
Jagged arrays
Homogeneous Arrays
As the name may suggest a homogeneous array is an array that stores a single data type(string,
int or Boolean values).
var array = ["Matthew", "Simon", "Luke"];
var array = [27, 24, 30];
var array = [true, false, true];
Heterogeneous Arrays
A heterogeneous array is the opposite to a homogeneous array. Meaning it can store mixed data
types.
var array = ["Matthew", 27, true];
Multidimensional Arrays
Also known as an array of arrays, multidimensional arrays allow you to store arrays within
arrays, a kind of “array-ception”.
var array = [["Matthew", "27"], ["Simon", "24"], ["Luke", "30"]];
Jagged Arrays
Jagged arrays are similar to multidimensional array with the exception being that a jagged array
does not require a uniform set of data.
var array = [
["Matthew", "27", "Developer"],
["Simon", "24"],
["Luke"]
];
as you can see, each array within the overall array is not equal, the first array has three items
stored in it, while the second has two and the third has just one.
Strings:
A JavaScript string is zero or more characters written inside quotes.
Example
var x = "John Doe";
either single quotes or double quotes can be used to form a string. A single quote can also be part
of a string.
var answer = "It's alright";
String Methods and Properties
Primitive values, like "John Doe", cannot have properties or methods (because they are not
objects).
But with JavaScript, methods and properties are also available to primitive values, because
JavaScript treats primitive values as objects when executing methods and properties.
String Length
The length property returns the length of a string:
Example
var txt= "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
var sln = txt.length;
Finding a String in a String
The indexOf() method returns the index of (the position of) the first occurrence of a specified
text in a string:
Example
var str= "Please locate where 'locate' occurs!";
var pos = str.indexOf("locate");
The lastIndexOf() method returns the index of the last occurrence of a specified text in a string:
Example
var str = "Please locate where 'locate' occurs!";
var pos = str.lastIndexOf("locate");
Both indexOf(), and lastIndexOf() return -1 if the text is not found.
Searching for a String in a String
The search() method searches a string for a specified value and returns the position of the match:
Example
var str = "Please locate where 'locate' occurs!";
var pos = str.search("locate");
Extracting String Parts
There are 3 methods for extracting a part of a string:
slice(start, end)
substring(start, end)
substr(start, length)
str.charCodeAt(0); // returns 72
CSS:
Cascading Style Sheet(CSS) is used to set the style in web pages which contain HTML elements.
It sets the background color, font-size, font-family, color, … etc property of elements in a web
pages.
There are three types of CSS which are given below:
Inline CSS
Internal or Embedded CSS
External CSS
Inline CSS: Inline CSS contains the CSS property in the body section attached with element is
known as inline CSS. This kind of style is specified within an HTML tag using style attribute.
<!DOCTYPE html>
<html>
<head>
<title>Inline CSS</title>
</head>
<body>
<p style = "color:#009900;
font-size:50px;
font-style:italic;
text-align:center;">
GeeksForGeeks</p>
</body>
</html>
Internal or Embedded CSS: This can be used when a single HTML document must be styled
uniquely. The CSS rule set should be within the HTML file in the head section i.e the CSS is
embedded within the HTML file.
<!DOCTYPE html>
<html>
<head>
<title>Internal CSS</title>
<style>
.main {
text-align:center;
}
.GFG {
color:#009900;
font-size:50px;
font-weight:bold;
}
.geeks {
font-style:bold;
font-size:20px;
}
</style>
</head>
<body>
<div class = "main">
<div class ="GFG">GeeksForGeeks</div>
<div class ="geeks">A computer science portal for geeks</p>
</div>
</body>
</html>
External CSS: External CSS contains separate CSS file which contains only style property with
the help of tag attributes (For example class, id, heading, … etc). CSS property written in a
separate file with .css extension and should be linked to the HTML document using link tag. This
means that for each element, style can be set only once and that will be applied across web
pages.
The file given below contains CSS property. This file save with .css extension. For Ex: geeks.css
body {
background-color:powderblue;
}
.main {
text-align:center;
}
.GFG {
color:#009900;
font-size:50px;
font-weight:bold;
}
#geeks {
font-style:bold;
font-size:20px;
}
Below is the HTML file that is making use of the created external style sheet
link tag is used to link the external style sheet with the html webpage.
href attribute is used to specify the location of the external style sheet file.
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="geeks.css"/>
</head>
<body>
<div class = "main">
<div class ="GFG">GeeksForGeeks</div>
<div id ="geeks">A computer science portal for geeks</p>
</div>
</body>
</html>
Properties of CSS: Inline CSS has the highest priority, then comes Internal/Embedded followed
by External CSS which has the least priority. Multiple style sheets can be defined on one page. If
for an HTML tag, styles are defined in multiple style sheets then the below order will be
followed.
As Inline has the highest priority, any styles that are defined in the internal and external style
sheets are overridden by Inline styles.
Internal or Embedded stands second in the priority list and overrides the styles in the external
style sheet.
External style sheets have the least priority. If there are no styles defined either in inline or
internal style sheet then external style sheet rules are applied for the HTML tags.
Regular Expressions:
Regular expressions are another type of data in JavaScript, used to search and match strings to
identify if a string is a valid domain name or to replace all instances of a word within a string, for
example.
Regular expressions have their own syntax and often you’ll need to consult a regular expression
reference if you’re doing something complex. Just search the Internet for what you need!
The following is a very high-level overview of a complex area, going through some simple
examples to show how to do it in JavaScript.
Creating regular expressions
Like with objects and arrays, there is a regular expression literalsyntax designated by two
forward slashes. Everything between is the expression:
if (lowerCaseString.match(regex)) {
alert('Yes, all lowercase');
}
match produces a truthy value if the regular expression matches the string
(lowerCaseString) match is called on. The string matches, so execution drops into
the if statement to show an alert.
Regular expressions can also be used to replace text:
var text = "There is everything and nothing.";
Boot strapping:
A bootstrap is the program that initializes the operating system (OS) during startup. The term
bootstrap or bootstrapping originated in the early 1950s. It referred to a bootstrap load button that
was used to initiate a hardwired bootstrap program, or smaller program that executed a larger
program such as the OS. The term was said to be derived from the expression “pulling yourself
up by your own bootstraps,” starting small and loading programs one at a time while each
program is “laced” or connected to the next program to be executed in sequence.
Bootstrapping is the process of loading a set of instructions when a computer is first turned on or
booted. During the startup process, diagnostic tests are performed, such as the power-on self-test
(POST), that set or check configurations for devices and implement routine testing for the
connection of peripherals, hardware and external memory devices. The bootloader or bootstrap
program is then loaded to initialize the OS.
Typical programs that load the OS are:
GNU Grand Unified Bootloader (GRUB): A multiboot specification that allows the user to
choose one of several OSs
NT Loader (NTLDR): A bootloader for Microsoft’s Windows NT OS that usually runs from the
hard drive
Linux Loader (LILO): A bootloader for Linux that generally runs from a hard drive or floppy
disc
Network Interface Controller (NIC): Uses a bootloader that supports booting from a network
interface such as Etherboot or pre-boot execution environment (PXE)
Prior to bootstrapping a computer is said to start with a blank main memory. The bootstrap
allows the sequence of programs to load in order to initiate the OS. The OS is the main program
that manages all programs that run on a computer and performs tasks such as controlling
peripheral devices like a disc drive, managing directories and files, transmitting output signals to
a monitor and identifying input signals from a keyboard.
Bootstrap can also refer to preparing early programming environments incrementally to create
more complex and user-friendly programming environments. For example, at one time the
programming environment might have consisted of an assembler program and a simple text
editor. Over time, gradual improvements have led to today's sophisticated object-oriented
programming languages and graphical integrated development environments (IDEs).