Cloud computing is that where you rent computational and storage services according to your needs. Here are some of the benefits that cloud computing offers.

You don’t have to buy any hardware and software (of course its licensing).

You don’t have to hire some highly technical IT resources to manage all the hardware and software for you. In fact you don’t have to even get the services of some consulting company.

If your business grows means users increase you don’t have to buy additional hardware.

If there are some security updates or patches you don’t have to apply your self, it will be the responsibility of your cloud computing vendor.

If somehow your business goes into lost you can down scale your computing environment.

If you have a site which has some load during weekends, on new season or on holidays then you don’t have to buy and configure additional hardware and software licenses instead you up scale your computing environment and then again downscale when peak time goes. Some cloud computing vendors as Microsoft provides the ability to auto scale your cloud computing environment.

You don’t have to buy hardware/software for staging environment, create the same environment using cloud computing as your application will actually have in production, in this you will not reduce the cost but if later on you are satisfied with the testing you can remove that staging environment at all.

This model of computing is very flexible you pay only for the services you use. All type of business (small and big companies) should use cloud computing.

Cloud Computing

Posted: May 22, 2014 in Cloud Computing

Cloud computing is model in which you will rent computational power and storage according to your needs and without knowing internal details. You don’t have to buy hardware or additional hardware when your business grow. You don’t have to maintain the environment and security of your infrastructure.

Cloud computing provides you the Speed, Scalability and reduction in Cost. Actually you pay what you use.

Currently different vendors are providing cloud computing in three different flavors:

  1. Infrastructure as a Service (IaaS).
  2. Software as a Service (SaaS).
  3. Platform as a Service (PaaS).

We will briefly look into each flavor one by one:

Infrastructure as a Service (IaaS)

In this flavor vendor provides the infrastructure and customer himself is responsible to manage it, we can take example of Cloud Servers where you rent a machine but you yourself install and manage all the programs and security related stuff. You must have some IT skills to manage it.

Software as a Service (SaaS)

It is a model in which vendor gives you the service you just have to make configurations (very basic level) that are required like you get a mail service from a vendor. You don’t have to setup and maintain your server (either physically or virtually) you just need to add your users and rest will be done by the vendor.

Platform as a Service (PaaS)

It combines the good things from IaaS and SaaS, you just have to pay focus on your business logic and develop solution and leave the rest to the PaaS provider. You don’t need to know where your binaries or data is. You just have to deploy your solution, whenever you need more computational power, simple add it. When you don’t need extra computational power then scale it down. In this model infrastructure is provided to you but you don’t have to be an expert to run and maintain it. Instead you consume easy to use services exposed by the PaaS vendor.

ASP.NET SignalR

Posted: December 12, 2013 in .NET Framework, ASP.NET, JavaScript

ASP.NET SignalR is library which used to build real time web applications. Normally client can send requests or in other words can call methods on the server but server can’t call methods on the client.

As HTTP protocol is stateless by nature so when server sends response back to the client it forgets about the client.

SignalR provides the capability to the server that it can call methods on the connected clients, suppose there is data on the server which frequently updates and client needs to show these updates immediately. What client will do is it will periodically send request to the server to get the updates. Similarly if there is a chat application it, chat client need to send requests to the server to get the new messages for this user. But it was never possible that server itself sends data to the connected clients but it is now possible with SignalR library.

SignalR uses websockets technology if available or fallback to some other transport if websockets are not supported by client or server.

You can directly build application using websockets technology but there some advantages using the ASP.NET SignalR library over the websockets direct programming.

  1. You don’t have to maintain separate code for the applications to use websockets if available and fallback code if websockets are not available.
  2. Using SignalR required less efforts to create an applications as it already does a lot of things for you.
  3. You don’t have to keep updating your application for newer versions of the websockets implementation.

So whenever you need to create real time full duplex application use ASP.NET SignalR.

Get Database size in SQL Server

Posted: December 19, 2012 in SQL Server

Run the following command in SQL Server Management Studio to see the Database file size in SQL Server along with other info.

DBCC SHOWFILESTATS;

UsedExtents column contains information about the size of database file, to get the accurate size in MB use the following formula

UsedExtent*64/1000

How to get DLLs from GAC

Posted: December 10, 2012 in .NET Framework, ASP.NET
Tags:

There is any easy method to get the Dlls from GAC (Global Assembly Cache). This is some time required if you want to copy a dll to your bin folder and want to redistribute it with your application (off course you must have to consider the redistribute terms from Microsoft or any other vendor who owns that assembly).

Open the run window, enter this command “c:\windows\assembly\gac_msil” without quotes and hit Enter key.

It is some time very tidious to align the radio buttons and corresponding labels with each other.

Here is the trick to do that. Say you have a wrapper div in which you have radio buttons and labels and id of the wrapper div is radioButtonsWrapper then add the following into your style sheet


.radioButtonsWrapper label
{
float:left;
margin-top:2px;
}

.radioButtonsWrapper input[type='radio']
{
float:left;
}

and for checkboxes


.radioButtonsWrapper label
{
float:left;
margin-top:2px;
}

.radioButtonsWrapper input[type='checkbox']
{
float:left;
}

What is Silverlight?

Posted: August 5, 2012 in Silverlight

Silverlight is Microsoft’s solution to build RIA(Rich Internet Applications). It bridges the gaps between desktop and web applications. It provides the ease of deployment and updates with responsiveness close to the desktop applications.

It is has a runtime which is subset of CLR (Common Language Runtime). Silverlight is a plugin for browsers which run Silverlight applications in sandboxed environments.

Adobe Flash is the biggest competitor of the Silverlight. Latest statistics (before the release of Silverlight5) show that flash is installed on almost 60-70% of the computers in the world. Whereas Adobe Flash is installed on 95% of the computers. However when we compare the time duration in which Silverlight has gain popularity is far ahead of Adobe Flash.

Silverlight was initially developed for media applications like video,audio and vector graphics. But from version 3 it heavily turned its focus towards business applications.

It has rich support to build RIA applications, nice set of built in controls as well as huge collection of third party controls.

Silverlight is compatible with all major browsers (Internet Explorer 6+, Firefox 3+, Chrome 4+, Safari 3+) in two major operating systems, Microsoft Windows and Apple Mac. An open source plugin is also available for LINUX operating system by Moonlight project team. However there are some complexities in it, moonlight release is always after some delay after the release of the new version of Silverlight from Microsoft, also the sale of Novell to AttachMate put uncertainty on the future of moonlight project.

Windows Phone 7 operating system runs Silverlight based applications, even though these applications has similar code base but are built specifically for Windows Phone7 operating system. It means you can’t run a Silverlight application from a webpage even it has the same code that is used to build Windows Phone 7 application.

But this opens many exciting possibilities for sharing a large portion of code between Desktop and Windows Phone 7 versions of the applications.

Silverlight Runtime is almost 6.6 MB download, it contains subset of the .NET Framework and full implementation of the Common Language Runtime. It means you can right code in any .NET language.

Application code is compiled into assemblies which along with the XAML files and other resources are are packaged into a .XAP file. This file is then downloaded on the client machine and executed within the plug-in.

Silverlight applications can’t make use of assemblies that target the full .NET Framework.

Silverlight applications generally run inside browser but from version 3 applications can run out of browser like standard Windows and Mac applications. Meaning that you can place a short cut on the Desktop or on the start menu to launch the application. Application automatically updates itself when a new version is available on the server.

Initially Silverlight applications run in the sandobxed environment but from version 3 it can be installed out of browser but application could not do any thing with the user’s computer unwanted to make the applications more and more safe. In version 4 Silverlight applications can be installed out of browser with elevated trust permission and application was able to interact with COM.In version 5 Silverlight applications can make low level (P/I) calls to the platform even running inside the browser with elevated trust permissions so native windows code can be called from Silverlight applications.

Some time it is very difficult to find the insecure content on a page e.g we have page and it is on SSL but browser prompts the user that it contains some insecure content as well.

But how can we find that where is the insecure content on this page.

An easy way is to open this page in Google Chrome and see its console. It will show all the insecure content (or references to insecure content) on this page.

Use the following command to insert the content (text, image or whatever you want) at the cursor position in tinyMCE  rich text editor

Example 1: Insert Text

tinyMCE.execInstanceCommand('txtSummary',"mceInsertContent",false,"This is the text to be inserted");

Example 2: Insert Image

tinyMCE.execInstanceCommand('txtSummary', "mceInsertContent", false, "<img width='200' height='100' src='http://www.abc.com/images/example.gif' />");

Where txtSummary is the id of the text area in which you want to insert the content. If cursor is inside that text area then content will be inserted at the cursor position but if this text area does not have focus then content will be inserted in the start of that text area.


If you run any T-SQL statement in query editor then Result/Message windows appears and takes almost half of the window.

It bothered me a lot, specially when you have big stored procedure working on in query editor.

I could not find a short cut key or menu item to hide this unless I used the mouse to resize it and push it to bottom to make some space.

Then I find a short cut to toggle this window and short cut is Ctrl+R.