Advertisement

Ads

Monday, January 21, 2019

How Java Servlet Works?

Features of Java Servlet

There are 5 Features of Servlet are as Follow:
Portable: Servlet uses Java Programming language, and as we know java is portable language, so servlet is also portable.
Efficient: Servlets invocation is highly skilled as compared to any CGI programs.
Robust: JVM manages Servlet. That’s why Servlet is robust.
Performance: Servlet creates a thread for each request, so the performance of servlet is better than CGI.
Secure: Because it uses java language, so servlet is safe.

How Servlet Works?

Whenever a request comes, it received by the servlet, and then they forward the request to the web container. A Web container is responsible for handling the request by creating the new thread. Container creates multiple threads to execute various requests.

How Java Servlet Works?


Let’s understand the working of Servlet –
1. The User sends a request by clicking a link for a servlet.
2. Then, the container finds the servlet and Create two instances.
  a.HttpServletRequest
  b.HttpServletResponse
3. After this, the container creates a thread for executing the request. So they call the servlet’s service() method and passes the instances as arguments.
4.Based on the HTTPRequest method sent by client, service( ) method decides which servlet method, doGet() or doPost() to call. 
5. Then, to respond to the client, servlet uses response instance to write the response.
6.After the service( ) method is completed, container call the destroy( ) method. And the request and response instance are prepared for garbage collection.

Servlet API

there are 2 packages of java servlet API are as follow:

1.javax.servlet

This package contains several classes and interfaces that describe and define bonds between a class and environment for an object.

Interface: -

ServletResponse
ServletRequest
RequestDispatcher
ServletConfig
Servlet

Class: -

GenericServlet
ServletRequestWrapper
ServletResponseWrapper
ServletInputStream
ServletOutputStream

Exception

ServletException
UnavailableException

2.javax.servlet.http

This package contains several classes and interfaces that describe and define bonds between a servlet class running under HTTP protocol and environment for an object.

Interface:- 

HttpServletRequest
HttpServletResponse
HttpSession
HttpSessionContext
HttpSessionListener

Class: -

Cookie
HttpServlet
HttpServletRequestWrapper
HttpServletResponseWrapper
HttpSessionEvent




Thursday, January 17, 2019

16 Best On-Page SEO Techniques for Improve Search Ranking

16 On Page SEO Activities for Improve Search Ranking

On Page SEO including proper headings, proper keyword placement, ensuring content quality, and paying attention to many other factors.
16 On-Page SEO Techniques That'll Boost Your Rankings

1) website structure:

A website’s technical structure plays a central role in determining its success or failure. SEO professionals can develop content and customer-centric websites that are also accessible and attractive to search engines.


2) Meta Title:

Meta title is very important role play in search engine optimization. The title length should be 50 to 65 characters. Meta title display SERP.

3) Post Permalink Structure:

Your URL is displayed is one of the most important factors of On-page SEO. It is important to correctly display your URL with use of target keyword and should also avoid using special characters, symbols, brackets, commas, etc. within the actual URL.

4) Heading Tags:

Heading tags are mainly used to highlight various headings, sub-headings, and important Loading Word-press, the title tag is set at H1. You are not supposed to use any more than H1 tags anywhere in the article.

5) Keyword Density:

Your keyword density should be around 1.5% percent with a mix of LSI keywords. You need to keep one thing in priority that your first and last paragraph should contain your main keyword.

6) Meta Tags:

Your each web page must need to have unique and relevant meta description because that is one of the most effective On-page SEO. Along with search engines' pick up on keywords, user’s click on the post is equally important. Your meta descriptions need to be more user-friendly and relevant to the post.

7) Images:

Attractive and relevant Images are effective part to drive traffic to your post from image searches. To make your blog post more focused and targeted, you can add keywords in the “image title” and the “alt text” too. As much as your image can stick more users around you, that is more liking to increase your overall rank.

8) Original Content:

Your content should be original and use your main keywords in your content. Not over-optimized the content and take care of keyword density, keyword proximity, keyword prominence.

9) Internal liking:

To make your reader spend more time on your blog, you can generate interlinking of blog posts and it can also lead other pages of your site to the high rank. Internal links that are relevant to the original post show search engines that you are providing extra information beyond what is being displayed in the content.

10) External Linking:

Along with internal linking, external linking is also a great idea for generating more traffic to your website. You are only supported to generate external link building when the external website is relevant to your post. Always choose the trusted website for external linking.

11) XML and Html sitemaps: 

The XML Site map is used to identify our web site pages are index or not. XML site map google understand but does not understand the user. User understandable site map is HTML site map.

12) Robots.txt: 

Robots main aim is to read our website data and stored in the search engine database. When search engine crawlers come to your site it will be looking for some special file. i.e, call roboat.txt file. This file tells to search engine spiders which pages of your site should be index and which pages of your site should be ignored.

13) Move to HTTPS:

Move to HTTPS due to security reason and Google also considers it as a ranking factor and give you the better rankings to competitive keywords early.

14) Mobile Friendly:

This time is mobile time so your website should be mobile friendly and open easily on mobile. So make sure website should be mobile friendly.

15) Fast Loading Speed:

Your website should be loading fast. Because the user likes a fast loading website. If your website loading fast then you can gain more visitors. If you want to check your speed then use tools like GTMetrix, Google Developer tools.

16) Google analytics and webmasters:


Google analytics main aim is a track record of website like how many visitors visit from the site by using which keyword, which landing page and also identify what type of users visits from the site linkage group, gender etc and also identify which country of user visit from the site like USA, Canada, India etc.

Google Webmasters is used to checking crawl errors, index status searches queries and also identify how many backlinks to your site, internal links to your sites and also identify search queries, clicks, impressions etc.

10 Best OFF Page SEO Techniques 2021

Latest OFF Page SEO Activities


Off-page SEO indicates all the things that you do directly to your website to help you rank higher, such as social networking, article submission, forum, blogging, community creation & blog marketing, etc.
Here are some most effective off-page activities which help you to increase your page ranking :
Off Page SEO Activities

1) Social Networking Sites:

Social networking sites are becoming more acceptable these days! Social networking sites allow you to extend your online network by connecting and interacting with your friends and other interested people, to share things with each other, and most importantly to promote your website/blog and help build your online reputation. There are some top social networking sites -be it Facebook, Twitter, Instagram, Pinterest, google+, etc.

2) Blogging:

A blog represents your work, services. Blogging also helps search engines to crawl your site more frequently, as they have to update your latest blog post entries, which ultimately helps you rank higher in search engine results pages (SERPs).

3) Blog Marketing:

Posting comments on other blogs within the same niche as yours, Where you can add a link in the comments section. These links will be crawled by search engines, benefitting point for them towards your site.

4) Forum Marketing:

Make a list of forums online, that are related to your sites niche and get involved with that community. Take participation in the community and reply to threads, answer peoples questions, offer advice, etc. This involvement can help you to build up your online reputation.

5) Social bookmarking:

Bookmark your site and blog to promote your website on social bookmarking sites. You can Submit your latest blog posts and pages to the most popular bookmarking sites, like StumbleUpon, Digg, Delicious, Reddit, etc.

6) Article Submission:

Here you need to make articles about your website and submit them to high PR Article Submission Sites like; Ezine, Go Articles, Now Public, etc. You can also give links to your site.

7) Business Reviews and Rating sites:

You can submit reviews about other businesses or ask your friends/clients to write a review of your business in major business review sites like Glassdoor, Mouthshoot, RateitAll, Shvoong, Kaboodle, Stylefeeder, etc.

8) Infographics Submission:

Infographics are the most appropriating way of presentation! Where you can make and submit your infographics on infographics submission websites and also give reference links to your web page or blog.

9) Image And Video Submission:

If you want to make your videos and images popular, head to popular video and image submission sites. Give a proper title, description, title tags, and reference links. Using this way of submission you can get quality backlinks because all video and image submission websites have high PR.

10) Question And Answer:

Question and Answers is one of the most effective ways to get more traffic to your website. Your answers to the relevant questions can help you to build up an online reputation of your website. You can also place a link to your website so that people can easily find your website.

Saturday, January 12, 2019

How to do SEO For E-Commerce Website?

A Beginners Guides to Optimization of an E-Commerce website

SEO: Search Engine Optimization

SEO Strategy

Search Engine Optimization, every websites backbone, is the tool that can make or break any website. Optimization of an e-commerce website is more critical and complicated than doing SEO for any other website. It is because your e-commerce site can have many more hundreds or even thousands of product listings that require you to follow best practices ensuring the performance of your website at an optimum level.

Strategy

Forgetting to the top of Google search results there should be little margin or room for errors while conducting SEO for your e-commerce website. It is because ideally, you must be looking to be within top three positions to tremendously increase the traffic for your website.
The number one ranked result receives the search of 31.24 clicks. The number two gets half of it around 14.04 clicks and so on coming down for rest three ranked searches. These statistics show the importance of time spend and resource utilization required for your eCommerce website to win the SEO battle on Google ranking.

Auditing

SEO Audit

You need proper research and study for the audit of your website to identify the SEO loopholes of your website. Pay keen attention to your product listing by unfolding the pages while analyzing your eCommerce site. This is the area where most of the mistakes occur and it’s the most vital feature of your website’s performance. Use the effective tools to ascertain the errors, duplicate content, missing tags and many more errors impacting the SEO performance of your site.

Keyword Research

Keyword Research
This is the most important aspect of the SEO puzzle and wins over it. Wrong keyword search can lead you to low-quality traffic and minimal sales of your product. By strategically working on right keywords implementation on your product pages can reap you in attracting immense reputed consumers with huge sales targets achieved altogether. Perform on creating long-tail keywords (searches containing three or more words) research depicting an eye catchy relevance of the products. This eventually generates high feasibility of attracting and converting a consumer to buy your product which in turn gives you a solid reputation and higher ranking.

Internal Linking

The next step is internal linking. You might not have heard of this before, but I’m sure you know what it is. This is when you link pages of your website to other pages on your website.
Internal linking in seo

Mobile Version of Website

Do you know how hot mobile shopping is becoming? Many people are not only browsing the web, but also making purchases through mobile devices, which means it’s really important to have a mobile-friendly version of your site.

Customer Reviews

According to Internet Retailer, you can increase your e-commerce conversion rate by 14-76% by adding product reviews to your online store. Jupiter Research also found that 77% of consumers read reviews before purchasing online.

To Obtain more Customer Review

In addition to increasing conversions, customer reviews also positively impact your SEO because more reviews = more content, and frequent reviews = fresh content, which Google loves to see.

To obtain more customer reviews, you can use a reward-based plugin like WooTheme’s Review for a Discount option.

You also can send an email out a few days after you know a customer has received a product asking if they need any assistance, and, if not, would they please leave a review. Simple tricks like this will really help your SEO!


Track of Other Websites

seo competitor analysis

Always keep your eyes and ears open in evaluating and compiling the list of keyword search your counterpart sites seems to use in their SEO strategy. And then insight about which keyword is providing the best quality output. Figure out by trying to reach out to the best one by researching yourself. Focus on the product page review of the other websites to give yourself a better idea of organizing your SEO navigation search.

Thursday, January 10, 2019

10 Difference between C++ and C# Programming Language

What is the Difference Between C++ and C#?

difference between C++ and C# | C++ vs C sharp




No.
C++
C#

1.
C++ is a low-level language.
C# is a High-level Language.

2.
It supports the multiple inheritances.
It does not support multiple inheritances.

3.
In C++, you require to manage memory manually.
C# automatically manages Memory.

4.
In C++, after compiling code changed into machine code.
In C#, after compiling code is changed into an intermediate language code.

5.
C++ used for developed console applications.
C# programming used for Windows, mobile, and console applications.

6.
for Each loop is not supported in C++.
for Each loop support in C#.

7.
C++ does not support garbage collection.
C# supports garbage collection.

8.
C++ Does not support bound checking of arrays.

C# Support bound checking of arrays.
9.
Using this language can create a standalone application.

Using this language cannot create a standalone application.
10.
In C++, you can use pointer anywhere in the programme.

In C#, Only in Unsafe mode, you can use a pointer.

Sunday, December 30, 2018

Control Statement in PHP with Example

PHP Control Statement

What is Control Statement in PHP?

A block of code which decide the execution way of programme according to the value of the given condition.
PHP Control Statement with Example

There are some control statements that PHP supports.

1. PHP if Statement

If a given condition is true, only then if statement will execute.
Syntax:
if(condition) {
block1 of code;
}

if Statement Example: 
<?php
if ($15 > $10)
echo “15 is greater than 10”;
?>

Output:
15 is greater than 10

2. PHP if…else Statement

In PHP, if a statement is executed only when a specified condition is true. It evaluated to its Boolean values. If the condition is FALSE, it’ll ignore it.
Syntax:
if(condition) {
block1 of code
}else {
block2 of code
}

if - else Statement Example: Find a largest number between two numbers using if else statement;
<?php
$first_value = 5;
$second_value = 10;
if($first_value > $second_value) {
echo “$first_value is greater than $second_value”;
} else {
echo  “$second_value is greater than $first_value”;
}
?>
Output:
10 is greater than 5

3. PHP if….elseif….else Statement 

With this statement, you can select one of several blocks of code to be executed.
Syntax:
if (condition)
first blockto be executed if condition is true;
elseif (condition)
Second block to be executed if condition is true;
else
final block to be executed if condition is false;
if -else if else statement Example:
<?php
$d = date("D");
if($d == "Thu"){
echo "Have a nice weekend!";
} elseif($d == "Sun"){
echo "Have a nice Sunday!";
} else{
echo "Have a nice day!";
}
?>

Output:
Have a nice day!

4. PHP Switch Statement

It is like IF statements. If you want to select one of several blocks of code to be executed, use the Switch statement.
Syntax:
switch ( )
{
case1
break;
case2
break;
default:
default code
break;
}
?>

PHP Switch case Statement Example:
<?php
         $d = date("D");

         switch ($d){
            case "Mon":
               echo "Today is Monday";
               break;

            case "Tue":
               echo "Today is Tuesday";
               break;

            case "Wed":
               echo "Today is Wednesday";
               break;

            case "Thu":
               echo "Today is Thursday";
               break;

            case "Fri":
               echo "Today is Friday";
               break;

            case "Sat":
               echo "Today is Saturday";
               break;

            case "Sun":
               echo "Today is Sunday";
               break;

            default:
               echo “which day is this ?";
         }
      ?>

Output:
Today is Wednesday

Friday, December 21, 2018

Introduction to Control System Design and its Classification

What is Control System?

A control system is a group of mechanical or electronic devices that regulate alternative devices or systems using control loops. Typically, control systems are computerized.
Control systems are a central a part of the business and automation. The kinds of control loops that regulate these processes represent industrial management systems (ICS) like superior management and knowledge acquisition (SCADA) and distributed management systems (DCS).

Introduction to Control System Tutorial

Uses of Control systems are won’t enhance production, potency, and safety in several areas, including:

  • Agriculture
  • Chemical plants
  • Pulp and paper mills
  • Quality management
  • Boiler controls and powerhouse
  • Nuclear power plants
  • Environmental management
  • Water treatment plants
Control System Tutorial

There are two types of control system:

1. Open loop control system:  Its operation is incredibly easy, once a signal directs the control component to response, an output is going to be made. Samples of the open loop control systems include laundry machines, light-weight switches, gas ovens, etc.

Open Loop Control System | Thetechunknown
A washing machine is an example of an open loop system. The input and output of an open loop system area unit unrelated. An example is that the operation of a washing machine doesn't rely on the cleanness of the garments, however instead on this time. Each the structure and therefore the control method of an open loop system area unit are natural. However, the results of the output depend on whether the signal is suitable or not.

2. Closed loop control system: Sometimes, we tend to could use the output of the system to regulate the input. This can be referred to as feedback. Feedback could be a unique feature of a closed-loop system. A closed-loop system compares the output with the expected result or commands standing; then it takes appropriate management actions to regulate the input. Therefore, a closed-loop system is usually equipped with a sensing element, that is used to observe the output and compared it with the expected output.

Close loop Control System

One advantage of using the closed-loop system is that it will modify its output mechanically by feeding the signal back to the input. Once the load changes, the error signals generated by the system can adjust the output. However, closed-loop system management systems square measure typically a lot of complicated and so dearer to form.

Classification of Control System: 

Some popular Classifications of Control System are as Follow:
1. The equation of research and style, as Linear & Non-linear system.
2. the sort of the signal, as Time variable, Time-variant, Continuous information, distinct information systems, etc.
3. the kind of system parts, as Electro-Mechanical, Hydraulic, etc.,
4. the most purpose, as a Position management system.

Linear and Non-Linear systems:  A control system is linear if the principle of superposition applies to it. In actual track most of the systems area unit non-linear as a result of the saturation, friction, dead zone, etc. Most of the physical systems area unit non-linear to a certain extent.
Time varied & Time-Invariant System: whereas operative an effect system. If the parameters area unit unaffected by the time, then the system is named Time variant system. Most physical systems have parameters dynamic with time. 

Discrete information systems: If the signal isn't unendingly varied with time however it's within the type of pulses. Then the system is named distinct information system.

Continuous information systems: If the obtained at a varied a part of the systems area unit varied unendingly with time, then the system is named continuous information management systems. 

Adaptive management System:  In some control system, specific parameters area unit either not constant or vary in an unknown manner. If the parameters variations are more significant or rapid, it may be desirable to design for the capability of continuously measuring them & changing the compensation, so that the system performance criteria can always be satisfied. This is called Adaptive control system.

Optimal  Control system: optimum management system is obtained by minimizing and increasing the performance index. This index depends upon the physical network.
Single variable system: In the straightforward order there'll be one input & one output such system is named Single variable management system.
Multi-Variable system: In multivariable management system there'll be over one input & correspondingly additional output.

Monday, December 17, 2018

An Ultimate Guides to Garbage Collection in Java

What is Garbage Collection in Java?


Java garbage collection is the method by that Java programs accomplishes automatic memory management. Java programs compile to bytecode which will be run on a Java Virtual Machine. Once Java programs run on the JVM, objects are created on the heap, which is a share of memory dedicated to the program. Ultimately, some objects cannot be required. The garbage collector finds these unused objects and deletes them to liberate memory.

Java garbage collection

When there are not any references to an object, it is assumed to be now not required, Also, the memory, obtained by the purpose can be rescued. There is no specific necessity to destroy an object as Java handles the de-allocation by itself.
The technique that accomplishes this is often called Garbage Collection. Programs that don’t de-allocate memory will eventually crash once there’s no memory left within the system to assign. These programs are said to have memory escapes.

Why we perform Garbage Collection in Java?

The purpose of garbage collection is to spot and discard objects that are not any longer required by a program, so their resources are saved and reused. A Java object is a focus to garbage collection once it becomes inaccessible to the program within which it’s used.

How Java Garbage Collection Works?

Many people assume garbage collection collects and discards dead objects. But, in Java garbage collection is doing the differing! Live objects are followed and everything else chosen garbage. As you will see, this basic misunderstanding will result in several performance issues.

Let's begin with the heap that is that the space of memory used for dynamic allocation. In most configurations, the package allocates the heap in before to be managed by the JVM whereas the program is running. 

This includes several important complications:
Object creation is quicker as a result of world synchronization with the package isn’t required for every single object. An allocation claims some area of a memory array and transfers the offset pointer forward. The next assignment starts at this offset and requests the next portion of the array.
When an object is not any longer used, the garbage collector retrieves the underlying memory and recycles it for future object allocation. This implies there is no specific deletion and no memory is given back to the operating system.

All objects are allotted on the heap area managed by the JVM. Every item that the uses by the developer is treated in this manner, organized with class objects, variables, and even the code itself. If an object is being documented, the JVM considers it active. Once an object is no longer documented and therefore is not approachable by the application code, the garbage collector removes it and retrieves the unused memory.

Garbage Collection Example in Java:

public class Example1{   
   public static void main(String args[]){  
        /* Here we are purposely assigning a nullvalue to a reference*/
Example1 obj=new Example1();  
obj=null; 
        /* Here we are purposely assigning reference a to another reference b*/
Example1a = new Example1();
Example1b = new Example1();
b = a;
System.gc();  /* representing garbage collection by calling this*/
   }  
   protected void finalize() throws Throwable
   {
        System.out.println("Garbage collection is performed by JVM");
   }
}
Output:
Garbage collection is performed by JVM
Garbage collection is performed by JVM

In this example, we are representing the garbage collection by calling System.gc(). During this example, we have overridden a finalize() method. This method is invoked directly before an object is destroyed by java garbage collection method. This is often the motive you would see within the output that this technique has been invoked double.