How to find Azure Subscription ID in the new Azure Portal

Nice thing to know if u r starting learning Azure

PR Code

Just a quick step by step on how to get you Subscription ID from the New Azure Portal.

1) Browse to and Sign into your account.

Screen-Shot-2017-02-18-at-16.26.jpg2) Once you are in the portal you should see the sidepanel with a tab for’Subscriptions’. Click on this to get to the next section. If the tab is not visible, then click on the ‘More services’ tab to find it.

3)In the new open panel you will see all the subscriptions you have access to and in the ‘Subscription ID’ column is the what you are looking for.


View original post


Getting Started with JMeter

This is a guide for someone who is trying to run JMeter for the very first time. So let’s dive into doing the stuff straight away by following the below steps

  1. First thing we need to do is to download JRT (java runtime environment), if we don’t have it installed already
  2. After installing JRT we need to download the Apache JMeter. I downloaded the .zip file under the binaries. if you can’t find it on the page click here. Please check on the Apache JMeter website there may be a newer version available.
  3. After unzipping the folder go to the bin folder and double click on jmeter.bat file which is highlighted in pic belowcapture
  4. This will start a console application, wait for few seconds and you will see a GUI for the JMeter.JMeter.PNG
  5. Now first thing we need to do is to create a Thread Group under the Test plan. So right click on Test Plan and go to Add -> Thread (Users) -> Thread Group. On this screen we can configure how many times this thread will run and few other things.
  6. Now right click on Thread Group in the tree and go to Add -> Sampler -> HTTP Request. On this pane we can configure the options related to http request.
    1. In the basic tab enter the server name of IP this can be a URL to your API Call
    2. Select implementation, in my case I selected HttpClient4
    3. Enter protocol, in my case I entered https
    4. Select method type i.e GET or POST or as per your api call
    5. In the path use the api function which is being called i.e the text appended after the main server address
    6. In the Body Data enter your json format data if your api call expecting that, otherwise do the needful as per your API implementation
  7. If your api call need some info to be appended in the header than right click on HTTP Request and go to Add -> Config Element -> HTTP Header Manager. Enter the data in key value pair. you can add data like  key = Content-Type, value=applicaiton/json
  8. If you want to validate the response of the API call, you can add Response Assertion by right clicking of HTTP Request and go to Add -> Assertions -> Response Assertion. The sample test is to be check the http response codes in this screen.
  9. If you want to extract the value from http response and use it and another http request. you can add the JSON Extractor or Regular Expression Extractor by right clicking HTTP Request and go to Add -> Post Processors -> JSON Extractor. The key fields in this page would be variable name (where your value will be stored to use in another http request), JSON path expression and match numbers. The format for JSON path expression is shown below. If you want to find only one match than Match Numbers should have 1 against it.json extractor.PNG
  10. Now in the end if someone wants to load sample data from csv for http requests then we need to add CSV data set config. Right click on Test Group and click on Add -> Config Element -> CSV Data Set Config. Key fields in this screen are
    1. Filename (Enter a full file path)
    2. Variable Names which will be use in http requests
    3. Delimiter usedcsv.PNG
    4. to use these variable in http request we need to change our http requests to be like this one. See how we changed the http request as per the variable names declared above.
  11. In the end click on RUN to see the test results in View Results Tree

Code Optimization for Ajax JQuery Web Request

When we use ajax calls for consuming web methods we use the following method.

type: “POST”,
url: url,
data: JSON.stringify(params),
contentType: “application/json; charset=utf-8”,
dataType: “json”,
success: function (result) {
if (result == null || result == undefined || result.d.trim() == ”) return;
successFunc(JSON.parse(result.d), targetObj);
failure: function (error)
{ }


But to use this code on each page and for each web method call is a repetition of  code and we can avoid that if we define it at one place and then consume it from there every time we need to use it.

One way of doing it is to enclose the code in a function like this below.

function ajax_data_loader(url, params, successFunc, targetObj) {
type: “POST”,
url: url,
data: JSON.stringify(params),
contentType: “application/json; charset=utf-8”,
dataType: “json”,
success: function (result) {
if (result == null || result == undefined || result.d.trim() == ”) return;
successFunc(JSON.parse(result.d), targetObj);
failure: function (error)
{ }

So wherever we need to use it we only need to call the function with the appropriate parameters.




Multilingual app in Android

Android considers English as primary language by default and loads the string resources from res ⇒ values ⇒ strings.xml. When you want to add support for another language, you need to create a values folder by appending an Hyphen and the ISO language code. For example if you want to add support for Urdu, you should create a values folder named values-ur and keep a strings.xml file in it with all the strings translated into French language.

So for example if in your strings.xml you have a value like

<string name=”new_equipment”>Nouveau Équipement</string>

the corresponding entry in strings-ur.xml would be

<string name=”new_equipment”> نئی مشین</string>

After created respective strings.xml files for all your supported languages all you have to do is change the Language under the Settings ⇒ Language & Input and it will change the language of the app.

Era of Modern Marketing

By- Umer Khalid

Internet has changed the way people work, shop, research & interact. Most Companies these days wish to have their own websites & social media pages to reach maximum potential customers. A business card doesn’t considered presentable if you don’t have an email ID and website URL on it. To satisfy the reason to be on search engines is quite obvious as there are millions of websites out there showcasing their products/services and focusing to reach more and more users applying different queries. This is how the idea of creating “Google – one of the most commonly used search engine with market share over 60%” came into the mind of its creators Sergey Brin & Larry Page when they had to search from huge data for a project during their PHD program. With major share among the most renowned search engines like Google, Yahoo & MSN, there are more than 400 million searches are being done daily on world wide web. Keeping that huge figure in mind almost every other company tries to come up in search engine rankings for all the relevant queries related to their business. The more they show up in search results, the maximum are the chances that people will click on their listings and will eventually perform the desired action they want from them i.e. buying a product or fill their form to contact them back.
Search engines are supposed to be the entry point for most of the online businesses exist in today’s world. Statistics show that people from all walks of life use search engines quite frequently to find whatever they want which eventually enables all online businesses to compete for those “search queries” in order to reach those people. By building a strong existence on search engines, any web business can live the dream of “earn while you sleep” very effectively. Your website is up and running where people can come and browse 24/7.
Once the online companies realize the importance of search rankings and the amount of huge business they can get through search engines, they then try to have professional internet marketers work with them. Those people understand & analyze the business first and then create an appropriate plan to target the business on search engines in order to get best possible exposure for the website. On many occasions, companies target both natural search listings as well as paid marketing (PPC) especially on Google.

Software Engineer Interview Questions

Q.  What is an Interface? How does it differ from a Class?
A. An interface is a contract only. It only contains method description, no concrete method. It can’t be instantiated.

Q. Explain the basic functionality of garbage collector.
A. It manages the allocation and release of memory. It automatically releases the orphan objects from memory. It can’t be controlled. Sometime it can be executed by force.

Q. When re-throwing exceptions should you use throw ex; or throw;?
A. The good technique is to use throw ; to keep the stack trace intact.

Q. If a method is marked as protected internal who can access it?
A. This method can be accessed in derived classes and in the same assembly.

Q. What is a delegate?
A. The delegate is the pointer to function and is often used for callback events.

Q. What is the difference between a process and a thread?
A. A process is the program unit and there can be more than one processes in an application. The process in turn can have multiple threads which are allocated a processing time.

Q. What is Encapsulation?
A. Encapsulation is the term of OOP which has the same purpose as the literal meanings. Using encapsulation means keeping the object and its properties and behavior in single boundary.

Q. Describe a strategy for designing and building components that minimizes recompiling of client applications when the component is updated.
A. It can be handled by using distributed mechanism. In past it was done using DCOM and COM+ and recently it is achieved by WCF services.

Q. What are javascript events? What are they used for?
A. Javascripts events are triggers which are invoked by the user action in browser. They are used to facilitate the user by formulating the immediate response without consulting the server.

Q. What is a postback?
A. Postback is an event of sending a pre-loaded page back to server. Like writing the URL on browser loads the page for the first time and when user clicks to some button or do some operation and submits the form back to server, it is called postback.

Q. What is a cookie?
A. A cookie is client side mechanism to store state. The data is stored on client machine.

Q. If you had the opportunity to change your current software development processes what would you change and why?
A. It all depends on the circumstances. First of the all I would be looking into the problem areas (if there is any) and solve them first according to requirement.
If I would need to change the architecture, I would be moving towards scalable, reusable, optimized, maintainable type of approach.

Q. What do you find most frustrating about software development?
A. Talking about my previous experience, I feel frustrated when the things are done in chaotic manner like no process, no rule, not enough time as these all contribute to the poor quality product.

Q. What are the important items that should be defined in a Functional Design Specification (document to capture high level design to be signed off with a client)?
A. The functional design specification contains all the functional requirements of the system, so it should be focused on What approach rather than How. The requirement should be clear and precise. If required (according to the User), it should include Use Case diagrams and some cases the GUIs to clearly portray the requirement and get them vet.

Q. I want to store my compact disk collection in a database and I want to store the following information for each compact disk:-

  • Artist’s name
  • Album title
  • Date acquired
  • Genre or type of music
  • The name of each track
  • The duration of each track
  • If it is a single or a double CD
  • If I own the CD or I’ve “borrowed” it from a friend

Could you please create a normalised database design that will enable me to store this information? Please limit your answer to the tables and columns required including the data type of each column and if it is a primary or foreign key.

CaptureQ. Assuming the database has been created and the data has been populated. Write an SQL statement to find all the “Pink Floyd” albums I own.
A. Select Album.* from Album inner join Artist
On Album.ArtistID = Artist.ID
         Where ArtistName = ‘Pick Floyd’

Q. Write an SQL statement to count how many albums of each genre I have in my collection
A. Select Count(AlbumID) From Album Group by Genre

OOP Interview Questions

What is Encapsulation in OOPS?

  • Encapsulation is one of the fundamental principles of object-oriented programming.
  • Encapsulation is a process of hiding all the internal details of an object from the outside world
  • Encapsulation is the ability to hide its data and methods from outside the world and only expose data and methods that are required
  • Encapsulation is a protective barrier that prevents the code and data being randomly accessed by other code or by outside the class
  • Encapsulation gives us maintainability, flexibility and extensibility to our code.
  • Encapsulation makes implementation inaccessible to other parts of the program and protect from whatever actions might be taken outside the function or class.
  • Encapsulation provides a way to protect data from accidental corruption
  • Encapsulation hides information within an object
  • Encapsulation is the technique or process of making the fields in a class private and providing access to the fields using public methods
  • Encapsulation gives you the ability to validate the values before the object user change or obtain the value
  • Encapsulation allows us to create a “black box” and protects an objects internal state from corruption by its clients

What is Inheritance in OOPS?

  • Inheritance, together with encapsulation and polymorphism, is one of the three primary characteristics (concept) of object-oriented programming
  • Inheritance enables you to create new classes that reuse, extend, and modify the behavior that is defined in other classes
  • The Class whose methods and variables are defined is called super class or base class
  • The Class that inherits methods and variables are defined is called sub class or derived class
  • Sometimes base class known as generalized class and derived class known as specialized class
  • Keyword to declare inheritance is “:” (colon) in visual c#

Benefits of using Inheritance

  • Once a behavior (method) or property is defined in a super class(base class),that behavior or property is automatically inherited by all subclasses (derived class).
  • Code reusability increased through inheritance
  • Inheritance provide a clear model structure which is easy to understand without much complexity
  • Using inheritance, classes become grouped together in a hierarchical tree structure
  • Code are easy to manage and divided into parent and child classes

What is Polymorphism in OOPS?

  • Polymorphism is one of the primary characteristics (concept) of object-oriented programming
  • Poly means many and morph means form. Thus, polymorphism refers to being able to use many forms of a type without regard to the details
  • Polymorphism is the characteristic of being able to assign a different meaning specifically, to allow an entity such as a variable, a function, or an object to have more than one form
  • Polymorphism is the ability to process objects differently depending on their data types
  • Polymorphism is the ability to redefine methods for derived classes.

Types of Polymorphism

  • Compile time Polymorphism
    •  Compile time Polymorphism also known as method overloading
  • Run time Polymorphism
    • Run time Polymorphism also known as method overriding

What is Access Modifier in OOPS?

Access modifiers determine the extent to which a variable or method can be accessed from another class or object

The following five accessibility levels can be specified using the access modifiers
• Private
• Protected
• Internal
• Protected internal
• Public

What is Abstract Class?

An abstract class is a class that cannot be instantiated and is always used as a base class.

The following are the characteristics of an abstract class:

  • You cannot instantiate an abstract class directly. This implies that you cannot create an object of the abstract class; it must be inherited.
  • You can have abstract as well as non-abstract members in an abstract class.
  • You must declare at least one abstract method in the abstract class.
  • An abstract class is always public.
  • An abstract class is declared using the abstract keyword.

The basic purpose of an abstract class is to provide a common definition of the base class that multiple derived classes can share. Static, Value Types & interface doesn’t support abstract modifiers. Static members cannot be abstract. Classes with abstract member must also be abstract.


What is Instantiation?

When you make a new instance the process is called instantiation and is typically done using the new keyword. A pure virtual function or pure virtual method is a virtual function that is required to be implemented by a derived class, if that class is not abstract By default, C++ matches a function call with the correct function definition at compile time. This is called static binding. You can specify that the compiler match a function call with the correct function definition at run time; this is called dynamic binding. You declare a function with the keyword virtual if you want the compiler to use dynamic binding for that specific function.

Static classes and class members are used to create data and functions that can be accessed without creating an instance of the class. Static class members can be used to separate data and behavior that is independent of any object identity: the data and functions do not change regardless of what happens to the object. Static classes can be used when there is no data or behavior in the class that depends on object identity. When applied to a class, the sealed modifier prevents other classes from inheriting from it. In the following example, class B inherits from class A, but no class can inherit from class B.

class A {}
sealed class B : A {}

You can also use the sealed modifier on a method or property that overrides a virtual method or property in a base class. This enables you to allow classes to derive from your class and prevent them from overriding specific virtual methods or properties.

Delegate:Any method that matches the delegate’s signature, which consists of the return type and parameters, can be assigned to the delegate. This makes is possible to programmatically change method calls, and also plug new code into existing classes. As long as you know the delegate’s signature, you can assign your own delegated method.
Composition is “Has a” relation (objects contained in it destroys when the main object is destroyed)
Aggregation is also “Has a” relation but objects contained is it .. has their own identity

Usually, when using composition, the object instantiates the objects it has. Look at the Chair class above. You can see that Back , Seat , and Leg are instantiated in the Chair class. When using aggregation, the object does not instantiate the objects it has. Look at the code below. The DinnerChair class has a Person , but it does not instantiate Person .

Overriding is in Inheritance while Overloading is same function name with different signature (in the same scope or in derived class).
The signature of a method is the combination of the method’s name along with the number and types of the parameters (and their order).

Is-a relationship is called inheritance i.e. Pepperoni is a pizza
Has-a relationship defined already where One objects contains other objects.

This is object-oriented programming and UML terminology, not Java-specific. There are actually three cases you should be aware of:
1. A House is a Building (inheritance);
2. A House has a Room (composition);
3. A House has an occupant (aggregation).

The difference between (2) and (3) is subtle yet important to differentiate. Together they are forms of association. What’s the difference? Composition implies the child object cannot live out of the context of the parent (destroy the house and rooms disappear) whereas aggregation implies the child can exist on its own (destroy the house and the occupant goes elsewhere).

Can you specify the accessibility modifier for methods inside the interface?
All the methods inside an interface are always public, by default. You cannot specify any other access modifier for them.

Is it possible for a class to inherit the constructor of its base class?
No, a class cannot inherit the constructor of its base class.