Thursday, August 23, 2018

How to check whether operating system is 64 bit or 32bit?

What is 32 and 64 bit operating system?

The terms 32-bit and 64-bit refer to the way a computer's processor that is CPU, handles information. The 64-bit version of Windows handles large amounts of random access memory (RAM) more effectively than a 32-bit system. This refers to capability of processor that how much memory it can hold from RAM and it will help ro imrpove speed of processing.
To find out if your computer is running a 32-bit or 64-bit version of Windows in Windows 7 or Windows Vista, do the following:

How can I tell if my computer is running a 32-bit or a 64-bit version of Windows?



Open System by clicking the Start button The Start button, right-clicking Computer, and then clicking Properties.
Under System, you can view the system type.

Which version of Windows should I install: the 32-bit version or the 64-bit version?


To install a 64-bit version of Windows, you need a CPU that's capable of running a 64-bit version of Windows. The benefits of using a 64-bit operating system are most apparent when you have a large amount of random access memory (RAM) installed on your computer, typically 4 GB of RAM or more. In such cases, because a 64-bit operating system can handle large amounts of memory more efficiently than a 32-bit operating system, a 64-bit system can be more responsive when running several programs at the same time and switching between them frequently.

How to check whether CPU is 32 or 64 bit?



Go to search bar of windows and type system information.
Click on System information as shown in diagramme.
[caption id="attachment_416" align="alignnone" width="519"]Systeminformationsearch



System InformationSysteminformationHow to check whether CPU is 32 or 64 bit




System Type64bitsystemview RAM,Processor,System type details


On the right side of System Information, look for the System Type option under the Item column. The associated value, in the Value column, will tell you which type of CPU the computer has in it. If the System Type value includes "x86" in it, the CPU is 32-bit. If the System Type value includes "x64" in it, the CPU is 64-bit.

Reference:https://support.microsoft.com/en-in/help/15056/windows-7-32-64-bit-faq

How to install Java or JDK

Check your windows is 64bit or 32 bit?









Download .exe from below link based on your operating system is 32bit or 64 bit?


https://www.oracle.com/technetwork/java/javase/downloads/index.html
https://www.oracle.com/technetwork/java/javase/downloads/jdk10-downloads-4416644.html






Run Exe and follow steps


Once its installed you can run below command on command prompt and check whether its installed or not?




java -version
C:\Users\admin>java -version
java version "1.8.0_181"
Java(TM) SE Runtime Environment (build 1.8.0_181-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.181-b13, mixed mode)

C:\Users\admin>


  This means your java is installed successfully

Tuesday, August 21, 2018

Add and remove elements form array in javascript

Note:I have coded using typescript but javascript functions remains same

Declaration of Array:




numberoftasks: string[];


Adding elemnts in Array using push function



addtask() {
console.log('Adding Task: ' + this.form.value.task);
this.numberoftasks.push(this.form.value.task);
console.log(this.numberoftasks);
}


Output:["user1", "admin", "kavitha"]


Splice function with deletecount and start index 


deletetask(index) {
console.log('Deleting' + index);
this.numberoftasks.splice(index,1);
this.form.controls['task'].reset();
}

I am passing index as 0  in deletetask function and below is output.






Splice function Without deletecount


deletetask(index) {
console.log('Deleting' + index);
this.numberoftasks.splice(index);
this.form.controls['task'].reset();
}



If you wont pass any delete count then it will consider index as start index of elements needs to be deleted and it will delete all elements coming after this index.

e.g. if  index is 0  deletetask(0)

then it will delete entire array.


e.g. if  index is 1  deletetask(1)

then it will delete Elmets coming after index 1.

so out put will be like
["user1"]




Caused by: java.lang.NoSuchMethodError: javax.servlet.ServletContext.getVirtualServerName()Ljava/lang/String;

Check all your Maven (or equivalent) dependencies and make sure that you - or most likely another dependency - are not pulling in a pre-3.1 version of the javax.servlet / servlet-api that may be taking precedence over what's in your Tomcat 8. If you've manually deployed, make sure you haven't manually copied any servlet-api JARs into Tomcat itself.


Below image you can see that old servlet API jar got added due to transitive dependency.







Solution:
Exclude servlet jar form dependency


Before:
<dependency>
<groupId>org.apache.velocity</groupId>
<artifactId>velocity-tools</artifactId>
<version>2.0</version>

</dependency>


After

<dependency>
<groupId>org.apache.velocity</groupId>
<artifactId>velocity-tools</artifactId>
<version>2.0</version>
<exclusions>
<exclusion>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
</exclusion>
</exclusions>

</dependency>

A child container failed during start java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost]]

Check all your Maven (or equivalent) dependencies and make sure that you - or most likely another dependency - are not pulling in a pre-3.1 version of the javax.servlet / servlet-api that may be taking precedence over what's in your Tomcat 8. If you've manually deployed, make sure you haven't manually copied any servlet-api JARs into Tomcat itself.


Below image you can see that old servlet API jar got added due to transitive dependency.







Solution:
Exclude servlet jar form dependency


Before:
<dependency>
<groupId>org.apache.velocity</groupId>
<artifactId>velocity-tools</artifactId>
<version>2.0</version>

</dependency>


After

<dependency>
<groupId>org.apache.velocity</groupId>
<artifactId>velocity-tools</artifactId>
<version>2.0</version>
<exclusions>
<exclusion>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
</exclusion>
</exclusions>

</dependency>

Friday, August 17, 2018

Advantages of spring session

1)Supports horizontally and vertically scaled application
2)Easy to externalise session storage and management like redid ,memedcache,jdbc,hazelcast
3)Supports multiple session for same user.
4)Supports multiple session in same browser for different users.no need to logout and login by another user to start their session.
5)Easy to implement
6)Well Documented.

What is hazzlecast?

Hazzlecast is in memory data grid.
It's kind of clusters cache.which works with multiple running node and caters every request.
In this every node is working as master and serving requests.
All nodes are working as team so better performance is delivered.
Hazzlecast runs on jvm so it's easy to integrate with java.

Due to in memory data grid and clustered cache it will improve performance.This is mostly getting used for low latency high throughout softwares.

How to check whether operating system is 64 bit or 32bit?

What is 32 and 64 bit operating system? The terms 32-bit and 64-bit refer to the way a computer's processor that is CPU, handles info...