Tuesday, November 16, 2010

How to delete a content type in SharePoint 2010

This sounds quite simple for lot of people. In order to delete a content type what you need to do is

Go to SiteActions --> SiteSettings --> Galleries --> Site content types  
click on the content type you want to delete, then click on delete this site content type
under settings
.
But this can only be done if the content type is not associated with any list, libraries, etc.
  • Say you have a list associated with the content type you want to delete.
In that case you need to go to the relevant list and remove the content type from the list.  

  • Say you need to delete the list as well, and you delete the list without removing the content type from the list.

Here's the strange part.

Even though you delete the list,  when you try to delete the content type it gives the error that the content type is still in use.  What happens actually is that the list which was deleted is resides in the recycle bin and content type is still associated with the deleted list. 

In order to solve that problem,
  • First  you need to delete the lists from the site recycle bin.
  • Then go to the "site collection recycle bin" link at the top description.
  • Make sure you delete the content from  "Deleted from end user Recycle Bin" also.

Its done....

Friday, June 11, 2010

PHP -Cannot modify header information - headers already sent by...

I know there are lot of articles regarding this issue but I thought that I would share my experience with you all since I spend considerable amount trying to fix that issue.

In PHP this error occurs mainly due to two reasons
  • If there exist white spaces  before any of the starting php tags prior to the place where you use  header(Location : ".....") function.  Here is an example.
note that the line I have marked in red shows the empty line before the start of
  •  Next, if we try to use header function inside html tags it will also not worked. Here is an example


 Here if you need to use the header function, you need to use it before line no 164.

Sunday, March 7, 2010

Singleton Pattern

I thought this would be a good design pattern to start with.

Little info :

Name                     : Singleton
Type                      : "Creational"
Description            : This design patterns let only a single object to be created for a particular class. All the                                 communication to that class is done via that single object.

Real World Usage

GSM Modem Connected via USB Port
This is a scenario which I came across during my internship program. There I was given a  task to develop a module which can be used to do the mobile communication of an online trading portal. The system needs to receive SMSs from users at anytime and need to send SMS to users according to the requests made by users. But if you use two objects to send and receive SMS, simply the system will fail, due to the fact that, you have only one port with a modem. Once you open that port for either sending or receiving, you can't open it again for the other operation. Therefore in such cases it is good practice to adhere to Singleton. Since singleton allows only one instance to be available from a particular class, you can use that instance for both send and receive operations.

Sample code is given below.

class SMS
{
     private static SMS smsObj;
     protected SMS()
    {
      // Do the initialization of modem port.
    }

    public static SMS GetObject()
    {
        if (smsObj == null)
       {
            smsObj = new SMS();
       }
       return smsObj ;
    }
}

class InPut
{
     public InPut()
     {
      SMS sms = SMS.GetObject();
     // receive sms.
     }
}

class OutPut
{
     public OutPut()
     {
      SMS sms = SMS.GetObject();
     // send sms.
     }
}

Server Farms

As we all know in the modern world, internet has become the primarily source of information. Each day you might browse information using search engines like google, yahoo, Baidu, MSN,..etc and retrieve millions of results in very quick time.

"Great!! I got what I need in just a split second. Now lets go ahead with my work."

But have you ever thought how you get those results so quickly? Think about your brand new Quad-Core and the amount of time it takes to process a simple search query in your hard driver. It can be from split second to may be few minutes. But when it comes to a search engine it gives you millions and millions of records in milliseconds. How they are achieving this?

The answer is server farms.
A Server farm is a large collection of computers connect together in order to meet the server needs, which are otherwise impossible to achieve. It is commonly used for cluster computing where high computational power is required. The workload is distributed among the individual components hence providing expedited computing processes. With this kind of arrangement, the computational power of the computers have gone beyond our imagination. A server farm can process a calculation which a single server will not be able to finish during its entire life time.

Still server farms are not reliable a mainframes due to multiple points of failures. However large server farms have come up with mechanisms like data redundancy, automatic switch into a redundant or standby computer and rapid reconfiguration of the server cluster.

When it comes performance of server farms, electricity and cooling factor plays the major role. In a server farm about 33% of power is consumed by a typical cooling system. and since the systems need to up and running 24X7 the electricity consumption is also very high.Therefore rather than focusing on the cost of high speed processors and the computers, most server farm owners concern about the cost of cooling systems and electricity bills that they have to pay. Due to these factors, large companies are finding ways to reduce the cost of cooling. One such method is to go for places where we have a cool climate throughout the year. At the moment Iceland which has a cool climate everyday and cheap geothermal electricity supply is building its first server farm.

Web 3.0 - The semantic web

What is web 3.0 or semantic web?
How is it different from web 2.0 (the current web) ?

These were two questions that was roaming in my head for a quite a while. Then I did some research and found out what actually it is. Before starting that, let me give you a brief introduction about how the web evolved.

Web 1.0 (read only web , passive users)


Web 1.0 is the starting point of the world wide web (WWW) in around 1991. Web 1.0 refers to the ordinary web sites like static html sites, shopping carts and so on. Basically Web 1.0 only allows users to retrieve information via web sites. It was kind of one way data transmission, because web site owners at that time concerned lot about the privacy issues.

Web 2.0 (interactivity, user contribution to content, active users)


But in around 2004 the new generation of world wide web emerged as Web 2.0. It introduce the interactivity to the web with flash components, AJAX, XML and RSS integration. This integration receives the interaction of the internet users and the use of blogs, wikis, and social networking technologies  increased rapidly and still growing at some rate. Although Web 2.0 was a breakthrough in world wide web, some experts says that there were no significant change in the technology, but a different way of collecting and providing information to the users.

Web 3.0 (meaning/context base, not keywords any more)


Web 3.0 is totally different concept than its predecessors. Unlike earlier versions, where the information was based on keyword matching, Web 3.0 focuses on semantic searching. In other words contextual search. In a semantic web, resources are built according to RDF (Resource Description Framework). In RDF, we attach metadata and specify relations between resources. (can use multiple syntaxes, including XML).
By this way all the resources in the world wide web are connected in a meaningful way, not just data wise. Therefore when you process a search query you get results which are highly relevant to what you look for.

Why Web 3.0 is important?

After doing a search in the present web, how many times did you scratch your head because of (apart from few worthy results) millions of results returned which are irrelevant for your search? Probably almost all the time. Say you search the web with "Alien Vs Predator". Then 9 out of 10 time you will refer to the movie. But when you search you will get plenty of results which has "Aliens", another set of results with "Predators" and also another bunch of results for "vs" and "Versus" which are no use for you.

Let me give you another simple example. Just think that a user browse the web with the word "Kennedy". In Web 2.0 or earlier versions, what it does is, it serve the user with all the data which contain the word "Kennedy". It can be the "Former President of USA" or it can be the "Kennedy Space Center". Lets say that the user only want to know about the space center. Then the results which gives information about the former president of USA has no importance.
This is where Web 3.0 comes handy. In Web 3.0 rather than matching the keyword "Kennedy" it does a contextual searching. This contextual search depend on few key relationships.

  1. Why you need to search this
  2. From where you search (location)
  3. From which device you search (PC, Laptop, Mobile)
  4. Connection between you and the information
Using the above relationships and many others, Web 3.0 gives you the best possible results. Simply saying,
"Web 3.0 is all about filtering the content that is of interest to you"

Though it is quite fascinating to speak about semantic web, the implementation is quite difficult. The present web data is not semantic. They are optimized for keyword based search queries. Some top ranked search engines claims that they have incorporated semantic to their search. Here what you need to understand is that the search is semantic but the resources are not. Which means that the semantic search uses data which are optimized for keyword based searches, resulting low accuracy and low related (Of course these are more related than a conventional search). Instead of that what we need is, semantic search uses semantic data in the web, like RDF. which indeed will give high related results for the user. In order to achieve that, current data and resources in the web needs to converted in to formats like RDF, which might take a long long time. (We can't accurately say web is this much big. The indexable web is more than 11.5 billion pages and there are huge number of pages which are not indexed.). But what we can do is, make sure that the new data and resources are in formats where semantic search can use them effectively. In that way we can make tomorrow's web a meaningful one which provides what you need.

Cloud Computing

Cloud computing is a technology which is growing rapidly in the IT industry. It involves in delivering hosted services over the internet often in a consumption-based model. These services can be divided in to three major categories, Infrastructure-as-a-Service (IaaS), Platform-as-a-Service (PaaS) and Software-as-a-Service (SaaS).

Cloud computing gives you the ability to access resources independent of the hardware you use or your physical location. With cloud computing, rather than store information on your PC or mobile device you can accessed them via the internet. Also with cloud computing you don't need to download or install dedicated software on your PC, instead you can use service provider's software which indeed help freeing up on-board memory and reducing energy costs.



Some people often misunderstand cloud computing with SOA (Service Oriented Architecture) but these two are different. SOA only provides software services to the clients, while in Cloud computing you actually get the chance to access to the hardware resources as well. So in a sense we can say that cloud computing is an extended version of SOA.

A cloud computing service can be either public or private. In public cloud anyone can buy the services. But in a private cloud, limited number of people will get the services which are provided by a proprietary network or a data center. If a particular service provider uses a public cloud resources to create their own private cloud, then it is called as a virtual private cloud.
Today the largest public cloud service provider in the world is the Amazon Web Services. As you can see though the word cloud computing is somewhat new, but its applications and usages are put into practice some time ago.

Whether it is private, public or virtual private, the goal of cloud computing is to provide easy and scalable access to computing resources and IT services.

Common design patterns

If some one ask, what is the difference between a conventional programmer and a skilled programmer? your answer would be quite straight forward. Obviously the quality of the code which the skilled programmer wrote is far better than a typical programmer. When it comes to quality codes, the word "Design Pattern" often arises. What is a design pattern? Well, in software design, now and then again we came across same kind of problems. As time goes people thought of coming up with some sort of solutions to those reoccurring problems. Today, we coined these solutions as "Design Patterns".
Since there are millions of web pages which describes what are design patterns I think this is enough for the intro.In this series of posts, instead of the theory and other highly technical stuff, what I will focus on is how we adopt these design patterns to real world scenarios. At the end of the day that is all matters whether you are a Software Developer, Engineer or Tech Lead. Am I correct? I think so :)