Thursday, 3 February 2022

Kubernetes Secrets?

Kubernetes Secrets is not actually a secret ;)

Sometimes, Kubernetes Cluster needs access to sensitive information. To make the secret available for the containerized application, #Kubernetes has a dedicated API resource object called Secret. This secret can be accessed via volume mount or environment variable.

These secret objects are usually stored in the distributed state database called etcd in Kubernetes. As it is encoded only with Base64, the access to etcd will expose the secrets stored in the etcd. We all know the fact that Base64 is not at all secure as anyone can decode it just like that.

So, How to enable restrictions over our secret file in Kubernetes?

Kubernetes External Secrets let us rely on third-party systems like HashiCorp Vault, AWS Secrets Manager, Azure Key Vault, etc to enable REAL SECRETS. #HashiCorp Vault is something of my interest here. So let's see more about HashiCorp Vault here.

                     Kubernetes — Hashicorp Vault

It has two important components like Authentication Methods and Secrets Engines. Kubernetes External Secrets can authenticate Kubernetes service accounts with the help of Vault. This is created and used independently of the vendors (May be #AWS, #Azure , #GCP..)

===== Interesting features of #HashiCorpVault =====

Centralized Storage Of All Secrets -> Imagine having 100+ Services, Vault is your savior.

RBAC (Role-Based Access Control) -> Enable Read/ Write permission for the users over secrets?

Audits -> Who created? How many times are secrets accessed? Etc

Encrypted Secrets -> No more plain texts or bad encryptions

Dynamic Secrets -> Create dynamic secrets based on the requirement and calculated Time To Live (TTL) so possibility of less breach.

Password Rotation -> You wanna rotate secrets every 30 days? Simple with Vault.

Encryption As Service -> Flexible APIs for encryption

High Availability ->Vault supports multi-server mode for HA

When I say, What an awesome product it is! Experts warn me that the Complex Configuration of Hashicorp #Vault is the real trap.

Maybe, Its time to get some real hands on. Will make a post some other day about my experience.

Does Hashicorp Vault Configuration is that complex? Are you someone who deals with this configuration conundrum in your everyday job? Happy to know some of your interesting critical configuration/troubleshooting challenges/experiences in the comments below.

Wednesday, 20 January 2021

Infrastructure as Code - Deployment of customizable and scalable webserver in Azure

 

Before the advent of DevOps automation, deployment of an application in the server is a complex process that requires server setup, network configuration, route table creation, software, and DB configuration. It requires a lot of manual effort and at the same time, prone to human errors. The manual process may result in scalability, availability, and consistency issues. The fast-paced improvements happening in the DevOp world present a solution to this problem with the help of potential automation. Infrastructure automation has become crucial nowadays, as it becomes common that the application deployment happens multiple times per day with different configuration requirements.

Generally, infrastructure management includes key terms like networks, virtual machines, and load balancers. Infrastructure-as-code (IaC) is the key DevOp practice used for defining, deploying, updating, and destroying the infrastructure. IaC ensures that the target environment is deployed with the same configuration irrespective of the environment’s starting state, thus solving the problem of environment drift in the release pipeline.

IaC has the environment description and version configurations in precisely documented code formats such as JSON and enables a declarative configuration model that can be relied on for quick configuration and consistent deployments avoiding any manual errors during the deployment. Thus, the team can get the benefit of creating a stable, rapidly reliable, and scalable infrastructure with ease.

As the system is configurable, the infrastructure maintenance like addition/removal of servers, software updates, software reconfigurations can be done with minimal changes to the configuration files alone.

The Infrastructure as code can be achieved with the help of several tools. Infrastructure provisioning and management can be done with the help of tools like Terraform, Red Hat Ansible, Chef, Puppet, Salt Stack, and AWS CloudFormation.Terraform helps in initial installation and configuration. To configure and deploy the application, the tools like Chef, puppet, and ansible can be used.

        Infrastructure as Code

To explore Infrastructure-as-code with a simple project, I have created a scalable and customizable webserver using Azure, terraform, and packer.

I have created a custom policy in Azure that restricts the usage of resources without tags. I have assigned the policy to my resource group. I have specified the resource group in my server template and created the image using the free and open-source server templating software called Packer. This tool helps in creating images for the virtual machines thus helps in launching completely provisioned and configured machines in seconds. This is cross-platform compatible and has the capability to create multiple images in parallel. In the packer template, I have used builders, packer version, provisioners, and variables. Builders are basically an array of objects that defines the creation of images. Provisioners is an array that is used to run the scripts or commands over the image. Variables are the key-value pairs that define the user variables in the server template.

After building the image with the required configuration using the packer, I have used the provisioning tool Terraform to create the infrastructure based on the provided configuration. Terraform uses the domain-specific language called HashiCorp Language (HCL) to interact with the cloud providers. The biggest advantage of terraform is, it is cross-functional thus supports multiple cloud providers. Terraform allows the developer to create, update and destroy the infrastructure with ease. I have used the same resource group that I have used when creating the packer image here. The created packer image is used in the terraform configuration.

Terraform configuration includes resource group, virtual network, network security group, network interface, public IP, and load balancer. I have used a configurable file called variable.ts where you can configure the number of VMs to deploy, tags to include, name of the resource group, location preferences, etc.

Terraform can be initialized with the command ``terraform init`. We can see the plan by using the command ``terraform plan -out solution. plan`` . After the confirmation, we can apply the changes and deploy using the command ``terraform apply``.

More details about the project can be found at https://github.com/arunprakashpj/Azure-Infrastructure-Operations-Project

Friday, 7 August 2020

Exploring Java 8 Features

 

Many companies rely on Java 7. But You know When Java 8 was released? It's almost 6 years back !! Yeah, Java 8 was released by March 18, 2014! Still not adopted by many! Let's explore one Java 8 Feature every day in our upcoming posts!

Java 8 Features

  • Functional Interfaces and Lambda Expressions
  • Java Stream API for Bulk Data Operations on Collections
  • forEach() method in Iterable interface
  • default and static methods in Interfaces
  • Java Time API
  • Collection API improvements
  • Concurrency API improvements
  • Java IO improvements
  • Miscellaneous Core API improvements

Tuesday, 9 June 2020

Self Sovereign Identity


Every day we are seeing a lot of identity breaches. Starting from Facebook data leak to Aadhar information leak in India, the identity of people come under scanners. We all deserver to own our identity, control the usage without involving third parties. In a physical world, we all have a unique set of information to prove we are the citizen of the particular country, we know driving, we are eligible to vote via documents like passport, driving license, Voter ID, etc. We own the identity proofs and we can keep them safe but when it comes to the digital world, we are dealing with a different scenario.






 Current Digital Identity has two major problems. First, we don’t own the identity. We identify ourselves with the username/passwords or by logging into different systems using the SSO Authentication from third party organizations like Google, Facebook, etc. Thus, our identity is not owned by us. We don’t control the fact, how our identity is used. The next big problem is oversharing of information. If you are going to vote, we are supposed to prove that we are 18+. But the voter ID reveals other unnecessary information like date of birth, address, etc. This problem is witnessed in both physical and digital identities.

 Self Sovereign Identity came as a one stop solution to solve these problems. It combines attributes from different credentials and presents them as a single proof. It relies on Zero Knowledge Proof. Thus, the proof is just going to reveal Yes/No answers.  If the question is, are you eligible to vote, the proof will give only Yes/No as the answer. The identity proof is presented in a way that, the verifier can verify the authenticity of the credentials like the credential issuer, its uniqueness, integrity and can ensure that its jot tampered or revoked without contacting the issuer.

For Example, if you want to vote, the issuer(government) will put the public key in the ledger store and issue the unique token to you. When you reach the voting booth, the verifier can verify if that’s you, just by checking the data in the ledger store. This ledger store is not a centralized authority. It is not run by any single organization. We call this ledger store as Sovereign Ledger which is tamper resistance and ordered chronologically.

The relationship between voter booth and you are made only once. This is unique. Again, consider a case, if you go to the bank, you will make another unique relationship by showing them the possession of the credentials. The connection setup and credential exchange happens off-ledger, privately, without involving the third parties. Finally, you will be provided with a digital token by the bank after authorization. After getting the credential and the relationship, no requirement to use a username/password. No login and nothing. Just by proving the possession of the credentials and the connection you setup, you are going to say, its me, and here is the digital proof.

By establishing a peer to peer connection, we are safe from any kind of Man in the Middle attacks. To Make it work, we need some open protocols and standards. Several Organizations around the world came forward to maintain the standard ledger abiding by certain principles and rules to ensure that, the identity control will be with people themselves. This factor separates the sovereign from bitcoins and Ethereum. Here, Hyperledger Community comes to the picture. Stay tunes for next write ups!

Tuesday, 2 June 2020

Exploring Hazlecast Jet Runner


Apache Beam is an open-source, unified model for defining both batch and streaming data-parallel processing pipelines. Using one of the open-source Beam SDKs, users can build a program that defines the pipelineThe Beam Pipeline Runners translate the data processing pipeline that user-defined with his Beam program into the API compatible with the distributed processing back-end of his choice.
A Beam Runner runs a Beam pipeline on a specific (often distributed) data processing system. Available runners are listed below:
·        DirectRunner: Runs locally on your machine
·        Apex Runner: Runs on Apache Apex.
·        FlinkRunner: Runs on Apache Flink.
·        SparkRunner: Runs on Apache Spark.
·        DataflowRunner: Runs on Google Cloud Dataflow
·        GearpumpRunner: Runs on Apache Gear pump (incubating).
·        SamzaRunner: Runs on Apache Samza.
·        NemoRunner: Runs on Apache Nemo.
·        JetRunner: Runs on Hazelcast Jet.

The vision of Beam is to support: End Users who want to write pipelines in the language of their choice, SDK Writers who wish to unleash the power of beam through various new languages and finally Runner Writers who has a distributed processing environment and looking forward to supporting the Beam pipelines.

The Hazelcast Jet Runner is one such runner that can be used to execute Beam pipelines using Hazelcast Jet. It allows the user to write a modern Java code that focuses purely on data transformation while it does all the heavy lifting of getting the data flowing and computation running across a cluster of nodes. It supports working with both bounded (batch) and unbounded (streaming) data.

As a part of my course work, I decided to specialize in the track of distributed systems. After completing Distributed Systems , I have enrolled for Advanced Distributed Systems course as well which gave me an interesting opportunity to develop a streaming query that analyses data from the Linear Road Benchmark and I deployed that query in a Flink cluster.

This was the initial spark that triggered my interest in Data Streaming, and I continued to explore Apache Flink, Apache Spark, Apache Samza, and their runner support to Apache Beam. While diving deep into Beam Pipeline Runners, the conference talks about Apache Flink runner for Beam and samza portable runner for Beam gave me an architectural insight about Beam portable runners. Recently I worked on these Distributed Computing Projects, and I gained some hands-on experience with basic data streaming modules. I have also developed a Blackboard to implement Strict, Loose, and eventual consistency models as a part of my distributed systems course work.

I was trying to explore more into the field of Distributed Systems. Finally, I found this interesting DAG-based distributed computing Java library, Jet Runner for building fault-tolerant and elastic data processing pipeline that can distribute DAG tasks across cores and nodes to run in parallel. One other interesting feature of JET is the use of application-level cooperative threads that enable efficient parallelism without any overhead of context switching in OS-level threads. Thus, high-end performance is guaranteed by Jet with no external planning requirement.

Identity Management

Identity Management is a very significant term. We use username/password to identify ourselves online and identity management is under the hands of organizations like Google, Facebook, etc that results in oversharing of information. A practical example is, Anyone over 18 is eligible to vote but the Voter ID not only reveals the age but overshares information like dob, address, etc Yeah! Oversharing of information! This is an interesting case to solve. As a one-stop solution, Self Sovereign Identity comes into the picture. The Decentralized Identifiers (DID) acts as the identifier for the verifiable digital identity. The holder of this DID will have complete control over his data rather than having it under some organizations. It helps us in overcoming the problem of information oversharing with its exciting properties like Decentralization, Self-Sovereignty & Interoperability. The cryptography enables us to use Zero-Knowledge proof to identify ourselves with ease with the help of ledger technologies like blockchain. Oh ! This is super exciting to explore !! This summer, Am one among the very few people selected by The Linux Foundation to work on the hyper ledger projects!

Sunday, 6 October 2019

Understanding Chmod 777

One of the very common error , students face day to day is

       "You do not have the permissions to upload file to the folder

And as most of you aware that, chmod 777 <directory_name>  is the command that gives you permission to Read/Write/Execute the the content of the folder , this article is about the number 777. Yes, what does it mean by the number 777 in the chmod ?

Each folder will have an 8-bit data for granting permissions. By default, 000 means, no permission is available. By granting Read permission, 4 bits are added to the data. By providing Write permission, 2 bits are added to the data. By providing execute permission, 1 bit is added to the data. So totally it's 7.

Now, immediately follow-up question is why 777?

First digit 7 grants permission to the owner
Second digit 7 grants permission to the group
Third digit 7 grants permission to others

Friday, 28 November 2014

How to Download the Chrome Extensions ?

Its very simple to download chrome extensions and save it for later use in various devices

Step 1 :

Go to the required extension page and copy the URL

Step 2 :

Click the following URL

http://chrome-extension-downloader.com/

and paste the extension link the provided box to download the required extension


Thursday, 20 November 2014

SQL Injection

SQL Injection is a web attack mechanism used by hackers to gain access to the unauthorized databases and other content. It can be commonly described as the application layer attack.

Reason Behind the attack

The main reason behind SQL injection is improper coding techniques employed in development. This sort of improper coding gives a way for hackers to inject the malicious SQL command that in turn fetches the required unauthorized content to the hackers.

What skills required for a hacker?

Mostly hackers perform few simple attacks by just having basic knowledge with web browsers, SQL, creative guesswork to find table and field names

Where it starts?

Most hackers start injecting the malicious SQL commands in  Login Pages or in Support and Product request forms easily

Why Login pages act as the best place to start hacking?

Basically, SQL injection starts from login pages. During the login process, the user types the credentials (i.e. username and password) which is matched against the content that exists in the database. Hackers use this communication gap. They bypass access by interrupting this communication. They inject their content into DB and use this as a channel to steal the data. By worst case, the content becomes readable and get exposed to the hackers.

What technologies are used by hackers?

Hackers mostly use dynamic scripting languages like ASP.Net, PHP and Javascript.
SQL injection affects relational databases like MySQL,Oracle,Microsoft Access,MS SQL Server ,etc..

SQL injections fall into categories like First Order Attack and  Second-Order Attack

First Order Attack:

In this method, the hacker attack some strings to the input field and gains the response immediately

Second-Order Attack:

In this method, the hacker enters the malicious code into the database table and later access it with a third party ie another activity

Tips to prevent SQL injection attacks

1.       Strong server-side validation is recommended
2.       The stored procedure may prevent some sort of attacks
3.       Patches can be used
4.       Never allow the special characters in the user inputs
5.       Minimize the usage of executable SQL commands in SQL server


Tuesday, 18 November 2014

Marmalade Developer Offer is Back

Marmalade is a cross platform IDE mainly used for making mobile applications. Its a cross platform IDE and thus it facilitates coders to code it once and deploy it for multiple mobile platforms.

What is more exciting about it ?

They came with a new offer that can fetch you the following things :

  • $100 PayPal gift voucher
  • A priority review for Windows Phone Store promotion
  • A developer account token for the Windows Phone Store
  • A license to Windows 8.1 Pro (worth up to $200)
  • A Windows Phone device (at Microsoft’s discretion and subject to availability)
  • A Marmalade Indie license (worth $500)

If you are a windows developer,its more simple for you. Just check your existing windows app in the store and compare it with following criteria.

  • Have received a 3 star rating or above and/ or your game has at least 5,000 installs (if premium/paid) or 50,000 installs (if free-to-play)
If your game does not meet the above criteria, it can still qualify. Submit it for evaluation and your entry will be evaluated on the following criteria:

  • Whether your game has innovative content and is clearly differentiated from other games in the same genre
  • Developer track record in shipping quality games on mobile or other platforms
  • Overall quality of the user experience and presentation

Are you a fresh developer, then get more details from the below link..

https://www.madewithmarmalade.com/offers/windows 

Tuesday, 14 October 2014

SEO Copywriting

SEO COPYWRITING:
Effective SEO Copywriting should give a clear view of the idea flashed  in your mind. It can improve the link building. ” Who what why” can act as the popular keywords. Using Numbers also will attract some users. For example,” Top 10 Programming Sites”
Effective quotes can gain some impact.

General Tips:
Interlink your articles and Have useful external links for better performance.

Also I have mentioned the other tips that I came across!

Present the content well: 
If the search engine comes across the similar words again and again, then it will consider your content as spam .So be aware of it and present the content well.

Keyword density 
Keyword density is a probability of keyword or a keyword phrase, in proportion with other words, appears on a Web page. Overall keyword density increases with the increase in the usage of keywords. The more times that other words appear, the lower the possibility of keywords, thus it leads to lighter keyword density
Font
The italic words are considered as the keywords by the search engine.So notify the search engine with the italic words .

META tags 
Google will get impressed if the TITLE and DESCRIPTION tags are similar or identical.

Numbered lists 
Try to use numbered content to get listed first . For example “10 easy tips to optimize the site “.This will maximize your output .

File names 

File names with keywords will be an added advantage.

Search Engine and Directory Submission
Directory submission is one of the very simple and must one to do to reach the target audience . For example, try  http://freewebsubmission.com/
Keyword stemming
keyword stemming is a a very useful tool in the world of SEO.The process of keyword stemming involves adding a prefix, suffix, or plurals to make the popular keyword into a new word.This is one of the main process that helps in increasing the website trafiic. 

Wednesday, 8 October 2014

Keyword Tool For SEO


When we googled the word "Key word Tool" we will get The Google Adword Keyword Tool link. By clicking that link, we will be directed to that page. There the keyword  related to our site should be entered and searching should be done. By using this, we can find the competition for that particular keyword. Also the competition, global monthly searches of related keyword will be displayed that gives a brief idea.

So this will be a right place to begin the keyword researchVARIOUS STEPS IN KEYWORD ANALYSIS

This step is most important and probably the easiest one and you can complete it in 3 simple steps without any additional software or paid programs offered on the market.

1] Making Analysis with people:

1. Use your network of friends and relatives to know, what phrases or words they use during their search and keep them in a list
2. Google them and your task will be more simplified as google throws you the details of similar searches.
3. Use Google Wonder Wheel- This tool shows you the all related searches by their popularity .You can find the related search circle that make sthe process much more simpler. Have the list you collected in hands and use this Google Wonder Wheel to find the path of success.

2] Find the Influence of Keywords

Next big thing is to find the influence of the keyword that you going to use. Atleast 1500 people must have used it in a month so that you can go with it. Just find the probability of the keyword in internet before you shortlist it.

3] Define your competition and find the relevant keywords

Sitemap Creation

By placing a formatted xml file with site map on your webserver, you enable Search Engine crawlers (like Google) to find out what pages are present and which have recently changed, and to crawl your site accordingly.

G Mapper Tool may be used to generate  sitemap .

Use the following link to generate a site map.

Tuesday, 7 October 2014

SEO : Keyword Analysis

Keywords, as the name signifies they are the key items that are going to promote your site in the list made by the search engines. We can define a keyword as a single word or a combination of two or three phrases.. keyword analysis is the term or name given for the research made to find , what exactly the customers are looking for or typing during their search and what exactly he have to use to catch their attention or search engines attention.

Keyword discovery tools

Search marketing efforts can be greatly improved by the usage of Keyword discovery tools but they are bit costly to use.

Analyzing keywords allows you to:

Optimize Spend: Distribute budget based on the worth of the word used ie spend more on the words that fetch more benefits and spend low on the words that fetch you no use.
Increase Conversions: Always keep conversion rate optimization and return on investment (ROI) on mind

Eye Trends: Keep an eye on the current marketing trends and keywords

Prioritize Your Time: Prioritize areas that you have to concentrate more to keep yourself alive in the market.

Find New Markets: Use keyword analysis to grow your business and keep looking fr the breaking trends

Why Keyword Analysis ?
1) Targeting right audience
2) Getting lots of relevant traffic
3) Focusing on targeting geographic location
4) URL and Title Tag

Google focuses straight on the domain name and title tag to rank your site. The first and most important part of your on-page SEO is the title tag (<title></title>). You can find the title tag at the  top left of your page, where name and description will be given. Many people who outsource a site in a WYSIWYG editor completely forget about the last of the meta tags that still gives some quality ranking love from search engines.

A website's title tags are very important for several reasons:

1) The title tag shows up in search results as the blue link, and a good one helps the site get more clicks and visitors from search results.
2) Title tags are a crucial SEO element that can help the website show up higher when people search for the words in it.
3) Title tags show up when web pages are shared on social media sites like Facebook. This is important because social media mentions are now a ranking factor in Google search results.

The Things not to be done while framing title tags:

The term Home Page does not shower you any type of ranking so better avoid them in the title tags
Domain name can add significance to the site search ,which can be displayed during the listing
Though the title tag plays a significant role, length of the keyword is also the important factor. Search engines display only the first 70 characters of a web page's title tag and rest of the tag words are discarded. Also a short tag cannot turn the attention of the people so it’s better to choose the
Too many keywords will never help you in achieving the top list. Search engine will consider it as spam if too many keywords are added.

Monday, 6 October 2014

SEO Recommendations

Anyone who blindly using Search Engine Optimization techniques will not fetch fruitful results as expected.Sometimes, the search engines may find it as a spamming, though you did it genuinely. A kind of strategy should be used to ripe desired results. A lot of strategies exist that can boost your site to get listed at the  top during the google search .

There are certain recommendations that I can share here, so that you can build your site with some good Search Engine Optimization Techniques!

1) The pages that are created intentionally to trick the search engines to produce an inaccurate or poor quality results is termed as spam by most of the search engines. SPAM Detector tools are available to verify the site by ourselves.

What is a SPAM Detector?


Some people take advantage of the concept of Search Engine Optimization by making spam sites containing low quality content .But still google will display those sites at the top! The only reason behind that is that, these spammers use the concept   of Search Engine Optimization to trick the search engine by some means.


Spam Detectors are the tools that help us in knowing the spam sites . Its very easy for anyone to identify the spamming site.

I have given the link of the spam detector I have used myself during my intern project
http://tool.motoricerca.info/spam-detector/

Few tactics that are considered search engine spam.

These techniques include:

1.  Keywords unrelated to site
2.  Redirects
3.  Keyword stuffing
4.  Mirror/duplicate content
5.  Tiny Text
6.  Doorway pages
7.  Link Farms
8.  Cloaking
9.  Keyword stacking
10.Gibberish
11.Hidden text
12.Domain Spam
13.Hidden links
14.Mini/micro-sites
15.Page Swapping (bait &switch)
16.Typo spam and cyber squatting

Spam sites will be strictly punishable once they are filtered by the search engines.

2) Digging for Keywords


Keyword Research is the very important thing to be done .Try to find the keywords that can hunt most of the users. Login into Google Analytics. Discover trending keywords using advanced segments. Also, the other things to be tracked are listed below:

New Visits
% Exit
Bounce Rate
Avg. Time of Page
Pages/Visits


3) Narrowing Down Your Keyword Selections



General list of keywords  can be easily generated by the Google Keyword Tool. But we can fix only few trending keywords ie. Narrowing down of keyword selection is necessary.

1. Eliminate the keywords with more competition.
2. Add geographical location as a keyword to attract the local users.
3. Choose at least one keyword for each core category in the site.
It is the very important phase in Search Engine Optimization .Choosing the right keyword will help your site to get listed at the top !Thus Search Engine Optimization helps in building  good traffic every day to your site .

4) LINK BUILDING:


It includes following issues,

1) Some editorial links need no specific actions and all they expect is the worthy content. So these links bring more advantage which have no connection with Search Engine Optimization.
2) We can submit our links via blog or mail to a list. We can submit our directories at various sites and that may gain us the attention of users or at least convince them to move towards us.
3) Getting reviews from users and listing them in our page will not produce us, very great results but still we can expect it to have little impact.

Sunday, 5 October 2014

C++ Interview Questions

1. Name the operators that cannot be overloaded.

sizeof, ., .*, .->, ::, ?

2. What is a dangling pointer?

A dangling pointer arises when you use the address of an object after its lifetime is over. This may occur in situations like returning addresses of the automatic variables from a function or using the address of the memory block after it is freed.

3. How do I call a C function from C++?

Just declare the C function ``extern "C"'' (in your C++ code) and call it (from your C or C++ code)

4. Is C a subset of C++?

In the strict mathematical sense, C isn't a subset of C++. There are programs that are valid C but not valid C++ and even a few ways of writing code that has a different meaning in C and C++. However, C++ supports every programming technique supported by C. Every C program can be written in essentially the same way in C++ with the same run-time and space efficiency. It is not uncommon to be able to convert tens of thousands of lines of ANSI C to C-style C++ in a few hours. Thus, C++ is as much a superset of ANSI C

5. What is inheritance?

Inheritance is property such that a parent (or super) class passes the characteristics of itself to children (or sub) classes that are derived from it. The sub-class has the option of modifying these characteristics in order to make a different but fundamentally related class from the super-class.


6. What are instance variables?

These represent an object's private memory. They are defined in an object's class.

7. What is a super-class?

Given a class, a super-class is the basis of the class under consideration. The given class is defined as a subset (in some respects) of the super-class. Objects of the given class potentially posses all the characteristics belonging to objects of the super-class.

8. What is an object in C++?

An object is a package that contains related data and instructions. The data relates to what the object represents, while the instructions define how this object relates to other objects and itself.

9. What is polymorphism?

Polymorphism refers to the ability of an object to respond in a logically identical fashion to messages of the same protocol, containing differing types of objects. Consider 1 + 5 and 1 + 5.1. In the former, the message "+ 5" is sent to an object of class integer (1). In the later, the message "+ 5.1" is sent to the same integer object. The form of the message (its protocol) is identical in both cases. What differs is the type of object on the right-hand side of these messages. The former is an integer object (5) while the later is a floating point object (5.1). The receiver (1) appears (to other objects) to respond in the same way to both messages. Internally, however, it knows that it must treat the two types of objects differently in order to obtain the same overall response.

10. What is operator overloading?

It is the process of, and ability to redefine the way an object responds to a C++ operator symbol. This would be done in the object's class definition.

11. Define Copy Constructor.

A copy constructor is invoked when you initialize a new object of a class using an existing object. This will happen when:
You pass a copy of an object as argument to a function (i.e. when passing by value).
When you return an object from a function
Or initialize an object during declaration using another object.
If we don’t specify a copy constructor, the compiler already has a default copy constructor.

12. What is the difference between overriding and overloading?

An overrided method redefines an existing method in a superclass to specify a new behavior. Overloading means that you have multiple methods with the same name but with a different parameter list.

13. What is inline function?

When you call the function, execution of the program jumps to those instructions, and when the function returns, execution jumps back to the next statement in the calling function. Performance degradation occurs in jumping into and out of functions. When a function is small, the program can be speeded-up using inline functions. The use of inline functions avoids have the program jump into and out of the same function over and over again.If a function is declared with the keyword 'inline', the compiler does not create a real function; it copies the code from the inline function directly into the calling function. No jump is made.

14. List down the advantages of class templates

One C++ Class Template can handle different types of parameters.
Compiler generates classes for only the used types. If the template is instantiated for int type, compiler generates only an int version for the c++ template class.
Templates reduce the effort on coding for different data types to a single set of code.
Testing and debugging efforts are reduced.

15. Write a short notes on recursion with example.

Recursion is defined as a function calling itself. It is in some ways similar to a loop because it repeats the same code, but it requires passing in the looping variable and being more careful. Many programming languages allow it because it can simplify some tasks, and it is often more elegant than a loop.
void recurse()
{
  recurse();
}
void main()
{
  recurse();
}


Is it possible to accept command line argument in C++?
Yes, In C++ it is possible to accept command line arguments. To do so, you must first understand the full definition of int main(). It actually accepts two arguments, one is number of command line arguments, the other is a listing of the command line arguments.
Ex.
   int main( int argc, char *argv[])

17. Explain typecasting.

Typecasting is making a variable of one type, such as an int, act like another type, a char, for one single operation. To typecast something, simply put the type of variable you want the actual variable to act as inside parentheses in front of the actual variable. (char)a will make 'a' function as a char.
18. What’s the difference between public, private and protected?
A member (either data member or member function) declared in a private section of a class can only be accessed by member functions and friends of that class
A member (either data member or member function) declared in a protected section of a class can only be accessed by member functions and friends of that class, and by member functions and friends of derived classes
A member (either data member or member function) declared in a public section of a class can be accessed by anyone

19. What are some advantages/ disadvantages of using friend functions?

Member functions and friend functions are equally privileged. The major difference is that a friend function is called like f(x), while a member function is called like x.f(). Thus the ability to choose between member functions (x.f()) and friend functions (f(x)) allows a designer to select the syntax that is deemed most readable, which lowers maintenance costs. The major disadvantage of friend functions is that they require an extra line of code when you want dynamic binding.

20. What’s the difference between the keywords struct and class in c++?

The members and base classes of a struct are public by default, while in class, they default to private.












Saturday, 4 October 2014

How I Start Writing About Search Engine Optimization !

Just today, when I was digging my Materials folder in my desktop, I found lots of stuffs that I dumped under the topic SEO .Yes, Its Search Engine Optimization. I was working as a intern during my last summer for a company and I was assigned the task to analyse various stuffs about Search Engine Optimization. 

Earlier I found it boring, But later I found the real worth behind this task of Search Engine Optimization (Popularly called as SEO) . So I made documentations with some sort of interest and started learning the SEO. 

Just after a minute of having the history flashed in my mind, I thought of sharing all the stuffs I prepared during my internship to all the readers here.

For some time, I will publish the materials that I prepared from various sources here and feel free to post your comments as I crossed a long way in the domain of SEO and I hope I can help you out at least to some extent if some sort of help required!

Optimizing the site to get listed at the top during the search you made through various search engines like Google, Yahoo, Bing, etc.  is an art and business of course (If I am not wrong) .How can a site opened few months back can impress millions of viewers everyday ? I can guess your answer. Yes many of you will say me the answer “By providing some quality content “. Yes, Of course you are right. But what if , millions of sites getting registered every day comes up with a quality content  . Here the issue emerges! The competition arises between the quality sites that holds equally quality content. There comes the Savior Search Engine Optimization .

Search Engine Optimization is the technique that helps Google in finding the right site to get listed at the top. Various sub topics exist inside Search Engine Optimization which should be mastered before you start optimizing the site.

Starting from keyword analysis to the use of Google analytics tool, lots of process involved in optimizing a site. I have made few articles that may help you in your mission of optimizing the site .

Happy Journey with SEO ! 



Friday, 3 October 2014

Search Engine Optimization : Part 1

You may own a fantastic site regarding shopping, mobile reviews, marketing, blogging, etc.. But why your site is not getting displayed at the top during google search? Have you ever wondered of it? Does it have some logic behind?

Yes Of Course!! Many reasons are behind it! Google will never display some content at the top without having some sort of logic! It’s not only about your content, popularity, length  or period of existence !!   

The main reason, why few sites are displayed on the top of the google search is Search Engine Optimization! If you want a brief intro check my previous article!

In this article, I have discussed about the tools used in search engine optimization. I remember, I made this article long back for my internship purpose and just thought of sharing with you all!
The first and foremost tool to be employed in optimization is Google Insights for Search . It’s very necessary to analyze the keywords involved in the Google ranking. By using the appropriate keyword, we can increase the site ranking .Also, it’s very important to analyze the speed of our site so that we can enhance the speed after spotting the missing term. For this purpose, we can employ Google web master tool that checks the website speed.

The websites are recognized by the users based on their visibility in the first page. So every site tries to list their names in the top of the opening page. The text that exists in the hyperlink can be exactly tracked and the number of keywords can be increased. The keywords expected by the search engine should be initially analyzed and used properly. It’s important to find the related sites and we can make a comparison to put our site on top of the list. Web Master Tool may be helpful in achieving this.

So start with web master tool and Google analytics tool. Then, try comparing the existing keywords of the site with the required keywords to be added. Also the speed of the site can be analyzed to enhance the performance.

The context representing our site should be of high worth and it should be able to impress the attention. Regular monitoring of broken links should be done. The troubles made by the Search engine spiders should be overcome. The web server should be well designed to report the modification to the Google. The googlebot crawlers should be under consideration.

Also the site should be tested under different search engines. It was recommended not to use the unauthorized sites to check the quality of the site and not to use the hidden words.

SEARCH ENGINE OPTIMIZATION:
FUNDAMENTALS

1.Keyword Analysis
2.Competitor Analysis
3.Metatag optimization
4.Alt Tags optimization
5.Anchor tag optimization
6.Content optimization
7.Canonical issue
8.Search Engine friendly URL
9.Heading Optimization
10.Keyword density
11.Sitemap creation
12.Usability and Accessibility
13.Google Analytics
14.Web Master Setup
15.Browser Compatibility
16.HTML Optimization

How Google Works ?

Basically, Google includes three main parts that includes a Google Bot, indexer and a query processor. Google bots, a search engine spider retrieves thousands  of pages simultaneously and provide the information to the indexer. It crawls over the web and search for the particular pages and it also considers the add URL form. The Google bots add the fetched pages into the queue of the indexer. But, these bots are in the need to overcome some spamming problems like duplicate contents, cloaking, hidden text, domain spam, hidden links, typo spams. Bots are programmed in a such a way to differentiate the automated codes.

The Google index database stores the datas collected by the bots. Alphabetically sorted index helps in easy retrieval. The task of the query processor is to evaluate the queries and matching the verified documents. After successful evaluation, the pages are ranked based on the position of pages in page rank data structure.

Tuesday, 30 September 2014

Collections in Java :Part 1


Collections is a very special class in java. It includes collection framework which is classified into List, Set and Queue.
Let’s discuss an overview first, then in detail!

Collections includes three things .
                    1) List
                    2) Set 
                     3)Queue
Someone may remember a term Map right now. It doesnot belongs to collections however,we discuss it later.

List include three things.They are
                  1)Array List
                  2)LinkedList
                  3)Vector
                       -Stack

Set Includes:
                   1)Hash Set
                          -Linked Hash Set
                   2) Sorting Set
                           -Navigation Set
                            -TreeSet

Queue Includes
                    1) Priority Queue
                    2) Blocking Queue
                           -Priority Blocking Queue
                          -Linked Blocking Queue

Main use of collections is :

It is used for data transfer ie it holds the transfer the object .

Requirements to transfer the object :

1)To transfer the objects,they should be serializable

Here in collections, all objects are already serializable .As well they are clonable .

What is mean by clonable ?

When the objects are transferred from one place to other,they are not disturbed at the other end. At the other end they are cloned and operations are done on the cloned objects .So any misdeeds will not affect the original objects.

List

List is used when the order of insertion is very significant and duplication is not at all a problem.

Why we are going for Array List from Array ?

First let me explain ,Why we are using Array. 

To store one value we use the syntax as ,
datatype variable_name=1;
ie a=1;
To store another value, we can go for 
b=1;
But what if we want to store some 5000 values .Is it a best practice ? No. It is a worst practice to use the separate variables to store the values. So we are going for array .

Then why ArrayList ? Yes consider a situation when you declared a variable and stored 5000 values in array ie a[5000].But just think,what if you want to add another value to that particular array.Here comes a problem and the solution exists with the Array List. Yes ArrayList is extendable or growable in nature so its an easy task to add any element after some time .
Ex: ArrayList al=new ArrayList()

Three important constructors used in Array List :

ArrayList al=new ArrayList();
ArrayList al = new ArrayList(int Capacity); 
ArrayList al=new ArrayList(Collecton C); 

If you dont know the count to be used ,then arraylist is the excellent choice since it is growable. But nothing in this world comes with free of cost right ? Yes of course . It applies here too. 

When you insert some element in the middle of the Array List,then it replicates another list by including the new element.This leads to the performance degradation. 

Do you know,what will be the capacity of the new list formed ? 
You can calculate it with the following formula.

New Capacity = (Current Capacity*3/2) + 1

So if you know the capacity in advance,better use the constructor ArrayList al=new ArrayList(int Capacity) to mention the capacity in advance.

The constructot ArrayList al=new ArrayList(Collection C) is used for conversion purpose .

Other interesting fact about ArrayList is that,they implements random access interface .

Only ArrayList and Vector implements Random Access .

What is mean by Random Access ?

Random access interface helps in retrieving the elements allover the list with the same speed.Ie If retrieving the first element takes 1 second then same time is required to retrieve the kth element also. So Time taken is very less .