JavaScript is a versatile programming language primarily used to create dynamic and interactive features on websites. JavaScript is a scripting language that allows you to implement complex features on web pages. Browsers have Interpreters. It will converts JAVASCRIPT code to machine code. Browsers have its own interpreters like
Chrome β V8-engine
Edge β Chakra
JavaScript- Identifiers :
var message; β> Variable (Identifier) message = βJavascriptβ;
func sayHello() { console.log(βHelloβ) }
//sayHello Is the identifier for this function.
//variables , objects,functions,arrays ,classes names are identifiers in js.
SCOPE : In JavaScript, scope refers to the context in which variables and functions are accessible. It determines the visibility and lifetime of these variables and functions within your code. There are three main types of scope in JavaScript.
Global Scope:.
Variables declared outside any function or block have global scope.
These variables are accessible from anywhere in the code
example :
let globalVar = "I'm global";
function test() {
console.log(globalVar); // Accessible here
}
test();
console.log(globalVar); // Accessible here too
Function Scope
Variables declared within a function are local to that function.
They cannot be accessed from outside the function.
example :
function test() {
let localVar = "I'm local";
console.log(localVar); // Accessible here
}
test();
console.log(localVar); // Error: localVar is not defined
Block Scope:
Introduced with ES6, variables declared with let or const within a block (e.g., inside {}) are only accessible within that block
example :
{
let blockVar = "I'm block-scoped";
console.log(blockVar); // Accessible here
}
console.log(blockVar); // Error: blockVar is not defined
Keywords | Reserved Words
Keywords are reserved words in JavaScript that cannot use to indicate variable labels or function names.
Variables
variables ==> stored values ==> it will stored to ram / It will create separate memory.so we need memory address for access the values.
Stores Anything : JavaScript will store any value in the variable.
Declaring Variable :
* Var
* let
* const
we can declare variable using above keywords:
Initialize Variable :
Using assignment operator to assign the value to the variables.
var text = "hello";
JavaScript is a versatile programming language primarily used to create dynamic and interactive features on websites. JavaScript is a scripting language that allows you to implement complex features on web pages. Browsers have Interpreters. It will converts JAVASCRIPT code to machine code. Browsers have its own interpreters like
Chrome β V8-engine
Edge β Chakra
JavaScript- Identifiers :
var message; β> Variable (Identifier) message = βJavascriptβ;
func sayHello() { console.log(βHelloβ) }
//sayHello Is the identifier for this function.
//variables , objects,functions,arrays ,classes names are identifiers in js.
SCOPE : In JavaScript, scope refers to the context in which variables and functions are accessible. It determines the visibility and lifetime of these variables and functions within your code. There are three main types of scope in JavaScript.
Global Scope:.
Variables declared outside any function or block have global scope.
These variables are accessible from anywhere in the code
example :
let globalVar = "I'm global";
function test() {
console.log(globalVar); // Accessible here
}
test();
console.log(globalVar); // Accessible here too
Function Scope
Variables declared within a function are local to that function.
They cannot be accessed from outside the function.
example :
function test() {
let localVar = "I'm local";
console.log(localVar); // Accessible here
}
test();
console.log(localVar); // Error: localVar is not defined
Block Scope:
Introduced with ES6, variables declared with let or const within a block (e.g., inside {}) are only accessible within that block
example :
{
let blockVar = "I'm block-scoped";
console.log(blockVar); // Accessible here
}
console.log(blockVar); // Error: blockVar is not defined
Keywords | Reserved Words
Keywords are reserved words in JavaScript that cannot use to indicate variable labels or function names.
Variables
variables ==> stored values ==> it will stored to ram / It will create separate memory.so we need memory address for access the values.
Stores Anything : JavaScript will store any value in the variable.
Declaring Variable :
* Var
* let
* const
we can declare variable using above keywords:
Initialize Variable :
Using assignment operator to assign the value to the variables.
var text = "hello";
React- Router is used for render the components depends on URL without reloading the browser page. It navigates a page to another page without page reloads. we can use router in react project, first we install the react-router-dom package from react.
Then, access the router using
import {BrowserRouter,Router,Routes} from 'react-router-dom';
after that we use link to diplay the browser using Link instead <a href=''>in react.
so,
import {BrowserRouter,Router,Routes,Link} from βreact-router-domβ;
example for using Link and routes:
Using Links:
'/' is the root page it display default home page
<Link to='/'>Home</Link>
<Link to='/about'>About</Link>
<Link to='/contact'>Contact</Link>
React- Router is used for render the components depends on URL without reloading the browser page. It navigates a page to another page without page reloads. we can use router in react project, first we install the react-router-dom package from react.
Then, access the router using
import {BrowserRouter,Router,Routes} from 'react-router-dom';
after that we use link to diplay the browser using Link instead <a href=''>in react.
so,
import {BrowserRouter,Router,Routes,Link} from βreact-router-domβ;
example for using Link and routes:
Using Links:
'/' is the root page it display default home page
<Link to='/'>Home</Link>
<Link to='/about'>About</Link>
<Link to='/contact'>Contact</Link>
# Install the public key for the repository (if not done previously): curl -fsS https://www.pgadmin.org/static/packages_pgadmin_org.pub | sudo gpg --dearmor -o /usr/share/keyrings/packages-pgadmin-org.gpg
# Install the public key for the repository (if not done previously): curl -fsS https://www.pgadmin.org/static/packages_pgadmin_org.pub | sudo gpg --dearmor -o /usr/share/keyrings/packages-pgadmin-org.gpg
Iβm experiencing an issue with Eclipse where it closes automatically when I use βSystem.out.printlnβ.
Environment : Eclipse Version: eclipse 2024-03 is the latest version of Eclipse today I reinstalled it. I downloaded Eclipse from the official Eclipse Foundation website at Eclipse Downloads | The Eclipse Foundation 1.
JDK version : java 22.0.1 2024-04-16 Java SE Runtime Environment (build 22.0.1+8-16) Java HotSpot 64-Bit Server VM (build 22.0.1+8-16, mixed mode, sharing)
Operating System: Ubuntu Ubuntu 22.04.4 LTS
Problem Description: Whenever I run a simple Java program that uses System.out.println. Eclipse hung and closed automatically without getting any error messages.
How i fix this issue
I fix this issue
Hi everyone,
I recently encountered a problem with Eclipse. when I upgraded Ubuntu 20 to Ubuntu 22 then some applications did not work properly . After some troubleshooting, I discovered that switching from Wayland to X11 resolved the issue. Hereβs how you can do it:
How to Switch from Wayland to X11 on Ubuntu
If youβre experiencing issues with Wayland and want to switch back to X11, follow these steps:
Turn off Wayland and switch back to X11.
Log out of Ubuntu.
Start to log in again and click the icon that has appeared at the bottom right of the screen β that gives you the option to disable Wayland.
Switch back to Xorg.
Switching to X11 fixed the issues I was having, so I hope this helps anyone experiencing similar problems. Let me know if you have any questions or need further assistance!
Iβm experiencing an issue with Eclipse where it closes automatically when I use βSystem.out.printlnβ.
Environment : Eclipse Version: eclipse 2024-03 is the latest version of Eclipse today I reinstalled it. I downloaded Eclipse from the official Eclipse Foundation website at Eclipse Downloads | The Eclipse Foundation 1.
JDK version : java 22.0.1 2024-04-16 Java SE Runtime Environment (build 22.0.1+8-16) Java HotSpot 64-Bit Server VM (build 22.0.1+8-16, mixed mode, sharing)
Operating System: Ubuntu Ubuntu 22.04.4 LTS
Problem Description: Whenever I run a simple Java program that uses System.out.println. Eclipse hung and closed automatically without getting any error messages.
How i fix this issue
I fix this issue
Hi everyone,
I recently encountered a problem with Eclipse. when I upgraded Ubuntu 20 to Ubuntu 22 then some applications did not work properly . After some troubleshooting, I discovered that switching from Wayland to X11 resolved the issue. Hereβs how you can do it:
How to Switch from Wayland to X11 on Ubuntu
If youβre experiencing issues with Wayland and want to switch back to X11, follow these steps:
Turn off Wayland and switch back to X11.
Log out of Ubuntu.
Start to log in again and click the icon that has appeared at the bottom right of the screen β that gives you the option to disable Wayland.
Switch back to Xorg.
Switching to X11 fixed the issues I was having, so I hope this helps anyone experiencing similar problems. Let me know if you have any questions or need further assistance!
A simple text scanner that can parse primitive types and strings using regular expressions. A Scanner breaks its input into tokens using a delimiter pattern, which by default matches whitespace. The resulting tokens may then be converted into values of different types using the various next methods.
Scanner sc = new Scanner(System.in); System.out.println("Enter the value:"); int value =sc.nextInt(); System.out.println(value);
A simple text scanner that can parse primitive types and strings using regular expressions. A Scanner breaks its input into tokens using a delimiter pattern, which by default matches whitespace. The resulting tokens may then be converted into values of different types using the various next methods.
Scanner sc = new Scanner(System.in); System.out.println("Enter the value:"); int value =sc.nextInt(); System.out.println(value);
Java is a simple programming language. Because syntax is derived from C & C++ language. Java has removed some complex topics like Pointers, Operator Overloading, and Multiple Inheritance explicit memory allocation. Java has an Automatic Garbage Collection.
2. Java is Robust :
Java is Robust which means Strong | Reliable
It uses strong memory management.
Java provides automatic garbage collection which runs on the JVM to get rid of objects that are not being used by a Java application anymore.
There is exception handling and the type checking mechanism in Java
It is developed in such a way that it puts a lot of effort into checking errors as early as possible, which is why the Java compiler can detect even those errors that are not easy to detect by another programming language.
3. Java is Platform Independent :
Operating System β Os is interface between Human Being and Machine. Platform is nothing but Processor + Os .
Java has two level translation β Compilation and Interpretation.
Java Development Kit β JDK
Compiler is the part of jdk. Error checking mechanism is also present in jdk.
First jdk will check the error. If in case error is present in the code compilation is not allowed. So translator need error free file for translation process.
.Java file is converted into .classfile using JDK. It will check whole file into single run. Classfile is otherwise called Bytecode.
This byte code or .Classfile is Platform Independent code. Because .classfile is common for all the Platform(Os).
Java virtual machine β JVM . Jit compiler is part of JVM
JVM is part of JRE β Java Runtime Environment.
.Class file is converted into binary code using interpreter. It will check line by line. Binary code is otherwise known as Machine code.
This compilation is Platform Dependent conversion.
Jit compiler : Just in time compiler. Converting Byte code into Binary code.
Java is a simple programming language. Because syntax is derived from C & C++ language. Java has removed some complex topics like Pointers, Operator Overloading, and Multiple Inheritance explicit memory allocation. Java has an Automatic Garbage Collection.
2. Java is Robust :
Java is Robust which means Strong | Reliable
It uses strong memory management.
Java provides automatic garbage collection which runs on the JVM to get rid of objects that are not being used by a Java application anymore.
There is exception handling and the type checking mechanism in Java
It is developed in such a way that it puts a lot of effort into checking errors as early as possible, which is why the Java compiler can detect even those errors that are not easy to detect by another programming language.
3. Java is Platform Independent :
Operating System β Os is interface between Human Being and Machine. Platform is nothing but Processor + Os .
Java has two level translation β Compilation and Interpretation.
Java Development Kit β JDK
Compiler is the part of jdk. Error checking mechanism is also present in jdk.
First jdk will check the error. If in case error is present in the code compilation is not allowed. So translator need error free file for translation process.
.Java file is converted into .classfile using JDK. It will check whole file into single run. Classfile is otherwise called Bytecode.
This byte code or .Classfile is Platform Independent code. Because .classfile is common for all the Platform(Os).
Java virtual machine β JVM . Jit compiler is part of JVM
JVM is part of JRE β Java Runtime Environment.
.Class file is converted into binary code using interpreter. It will check line by line. Binary code is otherwise known as Machine code.
This compilation is Platform Dependent conversion.
Jit compiler : Just in time compiler. Converting Byte code into Binary code.
git rm --cached filename if incase want to remove the added file use git remove git rm --cached -f filename -f --> forcefully remove the file.
git push
push the commited file from the local to cloud repo using git push. it will push the file to remote repository.
git pull
when u need to change or edit or modify the remote file first you will pull the file to local repository from remote using git pull.
git branch Branch means where will you store the files in git remote.git branch is to specify the branch name it will push the file to current remote branch.
git checkout -b "branchname" to create a new branch.
git checkout branchname check the created branch or new branch
git branch -M branchname to modify or change the branch name
git branch -a to listout all branches.
git status check all the status of previously used command like know the added file is staged or unstaged
git rm --cached filename if incase want to remove the added file use git remove git rm --cached -f filename -f --> forcefully remove the file.
git push
push the commited file from the local to cloud repo using git push. it will push the file to remote repository.
git pull
when u need to change or edit or modify the remote file first you will pull the file to local repository from remote using git pull.
git branch Branch means where will you store the files in git remote.git branch is to specify the branch name it will push the file to current remote branch.
git checkout -b "branchname" to create a new branch.
git checkout branchname check the created branch or new branch
git branch -M branchname to modify or change the branch name
git branch -a to listout all branches.
git status check all the status of previously used command like know the added file is staged or unstaged
Java is invented in 1991 by James Gosling of Sun Microsystems (later acquired by Oracle)
WORA β> write once run anywhere
Rules and syntax are derived from C and C++ Languages.
Java is a technology consisting of both a programming language and a software platform
To create an application using java , we need to download the JDK (java development kit) . which is available for all platforms (OS).
JDK
JDK is one of three core technology packages.
JDK provides the tools necessary to write java programs that can be executed and run by the JVM and JRE.
Every jdk contains java compiler
.java --> compiler | converter | Translator --> Bytecode write the program in java, then a compiler turns a program into java bytecode.which converts .javafile to .classfile
compiler β> translate the entire source code in a single run and its performance is higher.
interpreter β> translate the entire source code line by line and its performance is lower.
Bytecode
Instruction set for java virtual machine (Jvm) , which means bytecode is not human readable. its is platform (os) independent.
JVM
Jvm parses and runs (interprets) the Java bytecode
It breaks the bytecode and interprets line by line. and it produce byte code to binary code
This byte code is platform dependent (Os)
Just in time [ JIT ] Compiler -Interprets the Java bytecode.
JRE
Java Runtime Environment
java only runs in jre.
Its a secured runtime environment. it contains jvm and jvm contains Jit.
Java is invented in 1991 by James Gosling of Sun Microsystems (later acquired by Oracle)
WORA β> write once run anywhere
Rules and syntax are derived from C and C++ Languages.
Java is a technology consisting of both a programming language and a software platform
To create an application using java , we need to download the JDK (java development kit) . which is available for all platforms (OS).
JDK
JDK is one of three core technology packages.
JDK provides the tools necessary to write java programs that can be executed and run by the JVM and JRE.
Every jdk contains java compiler
.java --> compiler | converter | Translator --> Bytecode write the program in java, then a compiler turns a program into java bytecode.which converts .javafile to .classfile
compiler β> translate the entire source code in a single run and its performance is higher.
interpreter β> translate the entire source code line by line and its performance is lower.
Bytecode
Instruction set for java virtual machine (Jvm) , which means bytecode is not human readable. its is platform (os) independent.
JVM
Jvm parses and runs (interprets) the Java bytecode
It breaks the bytecode and interprets line by line. and it produce byte code to binary code
This byte code is platform dependent (Os)
Just in time [ JIT ] Compiler -Interprets the Java bytecode.
JRE
Java Runtime Environment
java only runs in jre.
Its a secured runtime environment. it contains jvm and jvm contains Jit.
pidof ---> find the process ID of running program vi test --> new process ps -ef | grep vi pidof vi pwdx 8279 to know the present working directory of vi using pid.
nice value
NI β> (-20 to 19) highest priority to lowest priority range.
1 to 19 β> non root users will aslo set the ni values
-20 to -1 β> root user only set the value
to modify the program priority.
ps -l --> process list to change the priority of the running program nice -n 11 ps -l
renice
changing the priority of the running program.
user-management
useradd
create a new user or update default new user information.
tail /etc/passwd β> userslist
adduser β> adduser, addgroup β add a user or group to the system
sudo passwd sample to set a password for sample user. sudo passwd -Sa to check all the users having password or not. set a password for the sample user
after setting the passwd for sample user
sudo passwd -d sample d --> delete NP --> no passwd
user-delete
sudo userdel sample sudo userdel -r sample --> to delete with home
Group
to create group with user
to create a group
addgroup :
deletegroup :
sudo groupdel groupname sudo delgroup groupname
sudo usermod -aG sudo username permission to using i commands for new user to give sudo or root previlage for new user.
pidof ---> find the process ID of running program vi test --> new process ps -ef | grep vi pidof vi pwdx 8279 to know the present working directory of vi using pid.
nice value
NI β> (-20 to 19) highest priority to lowest priority range.
1 to 19 β> non root users will aslo set the ni values
-20 to -1 β> root user only set the value
to modify the program priority.
ps -l --> process list to change the priority of the running program nice -n 11 ps -l
renice
changing the priority of the running program.
user-management
useradd
create a new user or update default new user information.
tail /etc/passwd β> userslist
adduser β> adduser, addgroup β add a user or group to the system
sudo passwd sample to set a password for sample user. sudo passwd -Sa to check all the users having password or not. set a password for the sample user
after setting the passwd for sample user
sudo passwd -d sample d --> delete NP --> no passwd
user-delete
sudo userdel sample sudo userdel -r sample --> to delete with home
Group
to create group with user
to create a group
addgroup :
deletegroup :
sudo groupdel groupname sudo delgroup groupname
sudo usermod -aG sudo username permission to using i commands for new user to give sudo or root previlage for new user.