Tuesday, June 11, 2013

Will US immigration bill kill Indian IT companies?

Contents

It’s all about jobs so it is

Gang of Four to Gang of Eight

Vocabulary used in this article

Point 1:- Increased visa Quota

Point 2:- Increase in VISA cost

Point 3:- Client side restriction

Point 4:- H1 B mandated salaries

Point 5:- Visa restriction in 3 phases

Impact on Indian IT overall


It’s all about jobs so it is… 

I really understand how sentimental this topic is for some US people who have a different feeling for outsourcing and immigration policies. Personally I respect the sentiment because it’s a very natural thing which any human would do. But my intention through this article is to not spark a debate if outsourcing is good or bad ?, did Americans loose jobs ? etc. My main intention here is to understand the technical points surrounding the new proposed US 2013 immigration bill and how it impacts Indian IT companies.

So please do refrain from making comments which would divert the cause of this article. Let peace and better understanding prevailJ.


Gang of Four to Gang of Eight












If you are one of those Indian developers whose interest revolves around programming, SQL, design patterns, it’s time to momentarily shift your attention from Gang of four (GOF) design patterns to Gang of eight (GOE) proposed immigration reform bill. Because this bill will affect Indian IT companies and directly to you to a great extent.

Now I am personally not sure if the bill will pass through. Until this date this bill is still debated in the senate. So incase for political reason this bill does not go through, this write up will go obsolete. 


It’s an 800 page long bill which makes it quiet complicated to understand. Especially if you are not residing in US then understanding the bill makes it more difficult. So the main purpose of this article is to make Indian developers understand what the bill says and what are the key points that will affect Indian IT companies. So below are 5 key points which I have extracted from the bill which concerns Indian IT.


Vocabulary used in this article

I am assuming that this article will generate more interest with in Indian developers than anywhere else. So I am going to use some vocabularies in this article which can be confusing at times for Indian audience. Some of these vocabularies would look very lame for people who are residing in US but I can bet many Indian developers are not aware of the same. Below is a short explanation of the same to avoid confusion.

Democrat and republicans: - These two are largest political parties in US like how we have BJP and Congress parties in India.

Gang of Eight:- They are bipartisan gang comprising of 8 people. Bipartsian means the gang comprises four people from democrat party and four people from Republican Party.  Please refer democrats and republican from the previous definition.
















US immigration bill 2013:- It’s a reform bill which is made in consensus by gang of eight to define a path for undocumented immigrants , improved visa system , fast tracking permanent residence in US  etc.

Indian MNC and US MNC: - In my whole article whenever I say “US MNC” I am referring to software companies which have been established and originated from US (ex. Microsoft, Apple etc). When I refer the word “Indian MNC” these software organizations are established and have origin from India (ex. Infosys, TCS etc).

Client side recruitment: - Software companies execute project in two ways in-house or at the client side. In house means they have their own premise and they develop project taking requirements from the client side. Client side means developers sit at client premises and execute projects.

As said previously the bill is an 800 page document which talks about various things like bringing undocumented (illegal) population in to a legal framework, green card, citizenship etc.  But for Indian IT industry the most important thing is impact on H1 and L1 visas. This is what Indian IT companies thrive on.  So my main focus of this article will revolve around how the bill impacts H1 and L1 statuses.

















Point 1:- Increased visa Quota

First let’s start with some good news. The H-1B visa quota would be increased from 65,000 to 110,000 and can be further increased to 180,000 depending on further demand. But this quota increase would benefit US MNC’s more rather than Indian MNC.  We will discuss about the same in the coming points.

Point 2:- Increase in VISA cost 

This is a definite impact on Indian IT companies. If you are not a US MNC and your IT work force is greater than 50 members:-
  • You need to pay $5000 more if you are filing more than 30% and less than 50% H1-B visa of your total IT work force.
  • You need to pay $10000 more if you are filing more than 50% H1-B visa of your total IT work force.

For US MNC’s the visa cost will be around $500 for every H1-B they recruit.

Point 3:- Client side restriction

This is a real killer for IT companies. If you are Indian MNC with employees in US comprising more than 15% H1-B of your total US work force, you cannot place employees directly on client side. Client side means your employees can not work in clients premises. Most of the Indian IT companies feed on this. Personally I feel 15% is a very less number. This clearly benefits US MNC as they do not have any restrictions.

Point 4:- H1 B mandated salaries

I personally like this point a lot. Indian MNC’s have been paying down rated salaries to Indian H1-B professionals in US. Due to this US MNC’s were not able to compete with them and second a local US developer had to compete with the down rated salaries. So now if this bill passes there will be strict H1-B mandated salaries. So this is a good news on a individual level, but for Indian MNC’s its taking their profit pie out and loosing edge over competitive rates with US MNC’s.

Point 5:- Visa restriction in 3 phases

In point 1 I talked about good news that there is increase in visa quota. But this increase in visa quota will not help out individual Indian MNC’s. It will help Indian IT overall but not individual MNC’s.

There is a 3 phase visa restriction which has been planned and it is as follows:-
  • From the year 2014 you can only apply for 75% H1-B’s of your total workforce. 
  • In 2015 only 65%.
  • In 2016 only 50%.

Impact on Indian IT overall

Looking at the points above the overall conclusion points are as follows:-

  • This bill definitely looks bad for Indian IT MNC’s but the bill is not bad for Indian IT Industry as such. Indian developers who are working in US will now get revised higher salary rates. 
  • Second the increase in visa quota means more people can now get jobs in US. Only the change will be you will not see people going from only selected Indian IT companies but will be spread across other Indian IT companies.
  • Clearly this will impact Indian IT MNC’s in the coming years due to increased visa fees, less allocated visa quota per MNC and client side placement policies. The bill favors more US MNC’s and they will definitely gain from the same.
  • Indian IT companies need to recruit more people locally and than sending onsite. So with this bill Indian companies will do lot of recruitment in Indian soil rather than US so that they do not get in to visa complications. 
  • Also probably the outcome of this bill will lead to better salaries in US MNC’s rather than Indian MNC’s. So in 2016 we should see Indian developers more attracted to US MNC’s in India rather than Indian IT companies.

I am not an expert in these kind topics. I am more of a technical person who does training on www.questpond.com . But because this topic interested me, so I thought of penning it down. So if you think if I have written anything wrong here or objectionable, let me know I will try to amend the same.










Sunday, May 12, 2013

Dependency injection (DI) VS Inversion of Control (IOC)

The main goal of Inversion of control and Dependency injection is to remove dependencies of a application. This makes the system more decoupled and maintainable.

First let’s try to understand IOC (Inversion of control).  If you go back to old computer programming days, program flow used to run in its own control.  For instance let’s consider a simple chat application flow as shown in the below flow diagram.
  1. End user sends chat message.
  2. Application waits for the message from the other end.
  3. If no message is found it goes to Step 2 or else moves to Step 4.
  4. Displays the message.
  5. User continues with his work ahead.

Now if you analyze the program flow closely, it’s sequential. The program is in control of himself. Inversion of control means the program delegates control to someone else who will drive the flow. For instance if we make the chat application event based then the flow of the program will go something as below:-
  1. End user sends chat message.
  2. User continues with his work ahead.
  3. Application listens to events. If a message arrives event is activated and message is received and displayed.



If you see the program flow it’s not sequential, its event based.  So now the control is inverted. So rather than the internal program controlling the flow, events drive the program flow. Event flow approach is more flexible as their no direct invocation which leads to more flexibility.

A word of caution here, do not conclude that IOC are implemented by only events.  You can delegate the control flow by callback delegates, observer pattern, events, DI (Dependency injection) and lot of other ways.

IOC (Inversion of control) is a general parent term while DI (Dependency injection) is a subset of IOC. IOC is a concept where the flow of application is inverted.   So for example rather than the caller calling the method.

SomeObject.Call();

Will get replaced with an event based approach as shown below.

SomeObject.WhenEvent += Call();

In the above code the caller is exposing an event and when that event occurs he is taking action.  It’s based on the Hollywood principle “Don’t call us we will call you”.  In Hollywood when artists used to give auditions the judges would say them “Don’t call us we will call you”.

The above approach makes code more flexible as the caller is not aware of the object methods and the object is not aware of caller program flow.





DI provides objects that an object needs.  So rather than the dependencies construct themselves they are injected by some external means.  For instance let’s say we have the following below class “Customer” who uses a “Logger” class to log errors. So rather than creating the “Logger” from within the class, you can inject the same via a constructor as shown in the below code snippet.



The biggest benefit achieved by the above approach is “Decoupling”. You can now invoke the customer object and pass any kind of “Logger” object as shown in the below code.

Customer obj = new Customer(new EmailLogger());
Customer obj1 = new Customer(new EventViewerLogger());


Monday, April 29, 2013

.NET 4.0 FAQ Part 1 -- The DLR





Simple 7 steps to run your first Azure Blob Program



Introduction

Step 1:- Ensure you have things at place

Step 2:- What will we do?

Step 3:- Create a web role

Step 4:- Set the blob connection string

Step 5:- Create the blob on webrole onstart

Step 6:- Code your ASP.NET UI


Step 7:- Run the project and enjoy


Introduction


In this section we will create our first program using Azure blobs. This article creates a simple web page where we upload image files which are stored in azure blobs. We have also created a simple search text box which will help us to search the image blobs with the image file name.
In case you are a complete newbie to azure you can download my two azure basic videos which explain what azure is all about Video1 Video2.

Please feel free to download my free 500 question and answer eBook which covers
.NET , ASP.NET , SQL Server , WCF , WPF , WWF@
http://www.questpond.com .





Step 1:- Ensure you have
things at place




In case you are a complete fresher to Azure,
please ensure you have all the pre-requisite at place. You can read the below
article to get the basic prerequisite

http://www.codeproject.com/KB/cs/Simple5stepsAzure_.aspx
.




Step 2:-
What will we do?




Azure Blobs help to store large items like
files, in other words its file storage system. In this article we will create a
simple program to upload image files in Azure blob system.




Step 3:-
Create a web role




The first step is to a create a web role
project. In case you are fresher in Azure, you can go through

http://www.codeproject.com/KB/cs/Simple5stepsAzure_.aspx
to understand
how to create a web role project.



So let’s create a simple project with name ‘BlobStorage’. Once you have created
the project it creates two projects one is the cloud service project and the
other is the web role project. Cloud service project has all the necessary
configuration needed for your cloud service project while the web role project
is your asp.net project.









Step 4:- Set the blob
connection string




Now the next step is to define a blob
connection string in the service configuration file. So expand the ‘BlobStorage’
project, right click on roles and select properties.








Once you select properties, go to settings tab and add the blob connection
string as shown in the below figure. In the below figure we have added blob
connection string name as ‘BlobConnectionString’.








Click on the right hand eclipse and select ‘Use
development storage’. All the changes done using the setting UI will be
reflected in the ‘ServiceConfiguration’ file as shown above.





Step 5:- Create the blob
on webrole onstart




Now it’s time to start coding. Open the web
role project and open ‘WebRole.cs’ file.








Now let’s write a code on the ‘onstart’ event
to create the blob container.



public override bool OnStart()


{








}



Use the ‘CloudStorageAccount’ static class to
set the configuration environment.



public override bool OnStart()


{


// Set the configuration file


DiagnosticMonitor.Start("DiagnosticsConnectionString");


CloudStorageAccount.SetConfigurationSettingPublisher((configName, configSetter) =>


{


configSetter(RoleEnvironment.GetConfigurationSettingValue(configName));


});


....


....


....


....


}



The next step is to get a reference of the
cloudstorageaccount object using the blob connection string which was provided
when you setup your web role project.



// get the blob connection string


CloudStorageAccount objStorage = CloudStorageAccount.FromConfigurationSetting("BlobConnectionString");



Once we have access to the storage account
object, use the blob end point to create the blob client.



// get the client reference


CloudBlobClient objClient = new CloudBlobClient(objStorage.BlobEndpoint, objStorage.Credentials);



Give a nice name to the container and create
the container object using the client object which you have just created using
the blob end point. Call the ‘CreateIfnotExist’ method of the container to
ensure that you create the blob container only if it does not exist to avoid any
errors.



// Get the reference to container


CloudBlobContainer objContainer = objClient.GetContainerReference("mycontainer");





// Create the container if it does not exist


objContainer.CreateIfNotExist();



Step
6:- Code your ASP.NET UI




The final step is to create the ASPX page which
will help us upload image files in the blob container which we just created in
the ‘WebRole.cs’ file. You can see in t he below figure we have create a browse
button which help us upload image files and a search text box which will help us
search blob files.

So create the below defined ASPX UI.








In the above ASPX CS UI first get the reference
to the below specified name spaces.



using Microsoft.WindowsAzure;


using Microsoft.WindowsAzure.StorageClient;



In the file upload button we need to insert the
below code snippet to upload the file. So get access to the container object
‘MyContainer’ and call the ‘GetBlobReference’ function to get access to the
cloud blob object.



// Get the storage account reference


CloudStorageAccount objStorage = CloudStorageAccount.FromConfigurationSetting("BlobConnectionString");


// get the Client reference using storage blobend point


CloudBlobClient objClient = new CloudBlobClient(objStorage.BlobEndpoint, objStorage.Credentials);


// Get Container reference


CloudBlobContainer objContainer = objClient.GetContainerReference("mycontainer");


// Get blob reference


CloudBlob obj =objContainer.GetBlobReference(FileUpload1.FileName.ToString());



Set the meta data of the cloud object and open
a blob stream object to write the file. Do not forget to close the blob steam
object once you are done.



// Set meta values


obj.Metadata["MetaName"] = "meta";


// Open a stream using the cloud object


BlobStream blobstream = obj.OpenWrite();


// Write the stream to the blob database


blobstream.Write(FileUpload1.FileBytes, 0, FileUpload1.FileBytes.Count());


blobstream.Close();



Once we upload the file, we will browse through
the blob list to get the list of blobs present in the container.



// Browse through blob list from the container


IEnumerable<IListBlobItem> objBlobList = objContainer.ListBlobs();


foreach (IListBlobItem objItem in objBlobList)


{


Response.Write(objItem.Uri + "<br>"); 


}



In the same UI we have provided a search object
to search a blob. To search a blob first get access to the container object and
call the ‘GetBlobReference’ function with the blob name to get reference to the
cloud object.



// Get the blob reference using the blob name provided in the search


CloudBlob obj = objContainer.GetBlobReference(txtSearch.Text);


BlobStream blobstream = obj.OpenRead();



Read the blob stream using the blob steam
object and finally attach this stream with the Image object to display the same
in the HTTP response.



// Create the image object and display the same on the browser response


System.Drawing.Image objimg=null;


objimg = System.Drawing.Image.FromStream(blobstream,true);


Response.Clear();


Response.ContentType = "image/gif";


objimg.Save(Response.OutputStream,System.Drawing.Imaging.ImageFormat.Jpeg);




Step 7:- Run the project and enjoy




Finally enjoy your first blob program. You can
see in the below figure we have uploaded some image files in the blob.








We can also search the blob using the search
blob text box and you should be able to get the below image display from the
blob database.













34 important ASP.NET Interview questions



34 important ASP.NET Interview questions


Below are 34 important ASP.NET interview questions which repeat again and
again in .NET Interviews .


  1. What is an application object?
  2. what is the difference between Cache object and application object?
  3. How can get access to cache object?
  4. What are dependencies in cache and types of dependencies?
  5. Can you show a simple code showing file dependency in cache?
  6. What is Cache Callback in Cache?
  7. What is scavenging?
  8. What are different types of caching using cache object of ASP.NET?
  9. How can you cache different version of same page using ASP.NET cache object?



  10. How will implement Page Fragment Caching?


  11. Can you compare ASP.NET sessions with classic ASP?


  12. Which are the various modes of storing ASP.NET session?


  13. Is Session_End event supported in all session modes? 106


  14. What are the steps to configure StateServer Mode?


  15. What are the steps to configure SQLServer mode?


  16. Where do you specify session state mode in ASP.NET?


  17. What are the other ways you can maintain state?


  18. What are benefits and Limitation of using Hidden fields?


  19. What is ViewState?


  20. Does the performance for viewstate vary according to User controls?


  21. What are benefits and Limitation of using Viewstate for state management?



  22. How can you use Hidden frames to cache client data ?


  23. What are benefits and limitations of using Hidden frames?


  24. What are benefits and limitations of using Cookies? 109


  25. What is Query String and What are benefits and limitations of using Query
    Strings?


  26. What is Absolute and Sliding expiration?


  27. What is cross page posting?


  28. How do we access viewstate value of this page in the next page ?


  29. Can we post and access view state in another application?


  30. What is SQL Cache Dependency in ASP.NET 2.0?


  31. How do we enable SQL Cache Dependency in ASP.NET 2.0?


  32. What is Post Cache substitution?


  33. Why do we need methods to be static for Post Cache substitution?


  34. Can you explain page life cycle ?





Saturday, April 27, 2013

ASP.NET Interview Questions: - Show Post Cache substitution?


This is one of the asked ASP.Net Interview Questions during the Interview by the Interviewer.

Post cache substitution is used when we want to cache the whole page but also need some dynamic region inside that cached page. Some examples like QuoteoftheDay, RandomPhotos, and AdRotator etc. are examples where we can implement Post Cache Substitution.

Post-cache substitution can be achieved by two means:


  • Call the new Response.WriteSubstitution method, passing it a reference to the desired substitution method callback.

  • Add a <> control to the page at the desired location, and set its methodName attribute to the name of the callback method.



Learn more on ASP.NET interview questions

Regards,

From more on author’s blog related to ASP.NET interview questions click and visit.

ASP.NET Interview Questions: - Show Post Cache substitution?

This is one of the asked ASP.Net Interview Questions during the Interview by the Interviewer.
Post cache substitution is used when we want to cache the whole page but also need some dynamic region inside that cached page. Some examples like QuoteoftheDay, RandomPhotos, and AdRotator etc. are examples where we can implement Post Cache Substitution.
Post-cache substitution can be achieved by two means:

Figure: - “Writesubstitution” in action
You can see we have a static function here “GetDateToString()”. We pass the response substitution callback to the “WriteSubstitution” method. So now, when ASP.NET page framework retrieves the cached page, it automatically triggers your callback method to get the dynamic content. It then inserts your content into the cached HTML of the page. Even if your page has not been cached yet (for example, it's being rendered for the first time), ASP.NET still calls your callback in the same way to get the dynamic content. So you create a method that generates some dynamic content, and by doing so you guarantee that your method is always called, and it’s content is never cached.
Ok the above example was by using “WriteSubstitution” now lets try to see how we can do by using “<>” control. You can get the “<>” control from the editor toolbox.
Figure: - Substitution Control
Figure: - Substitution in Action
Below is a sample code that shows how substitution control works. We have ASPX code at the right hand side and class code at the behind code at the left hand side. We need to provide the method name in the “methodname” attribute of the substitution control.
View following video on Web.config transformation in ASP .Net: -

Learn more on ASP.NET interview questions
Regards,
From more on author’s blog related to ASP.NET interview questions click and visit.