The world's coolest Laptop

Computing technology

The perfect UI for a logon screen

Communications has made our world tiny

Cant live without one

Tuesday, December 13, 2011

Artificial Neural networks in marketing

What is an Artificial neural network?

Human brain is made of large number of nerve cells or neurons. These are interconnected in a beautiful fashion to form what is called the Neural network. This neural network is responsible for what we are, what we do in our daily life, the reason we learn, remember, process etc. This is what makes human intelligent.

What if we could simulate the human brain’s neural network? Imagine a computer program that somehow is built in the same manner as the brain is. It could do wonders. Alright I have to agree I am being insane here. It’s not practically possible to simply simulate what our brain does using a computer program. But yes let’s say if we can build a program that is very very very inferior to our brain still it can do a lot of wonders. The main reason is because it can learn and perform everything on its own. This particular software code that tries to simulate the neural network of human brain is what is called Artificial neural networks (Neural networks created artificially) in short ANN.

Why ANN?

Let’s look at the traditional approach to programming. Say we have an event occurring, if a condition ‘A’ is satisfied do something if a condition ‘B’ is satisfied do some other thing. If there are multiple events we write multiple codes for that. Now an undeniable fact is that the programmer should know all the cases and the paths that are going to be taken and should provide a case specific action. What if the programmer forgets a case? Or what if the cases are too much to handle? What if the cases are not known or cannot be thought of? The programmer has to again write the code after the issue is reported and build it again. And this process keeps happening like we get version 1 of software, version 2, 3 and so on.

Now what would it be when you have a system that can learn automatically. If there were to be a program that is intelligent to learn, adapt and perform operations. This is possible using ANN. ANN offers an unique approach to look into a problem. ANN does not require explicit coding of a given problem which gives a significant advantage over the traditional approach. ANN is very flexible, it can be trained, and it can Measure and interpret expectations

Alright!! enough with the technical talk. What has this stupid thing got to do with Marketing?

In simple terms, ANN for Marketing can be viewed as software tool that helps the Marketers to take decisions. Before the actual marketing process, there is something called the market research. First, I will deal with specific examples here for easier understanding. Let’s say for market research you have a survey. Say you have 10 people being interviewed. Fine a human can personally sit down, interpret the answers and to an extent give a quantified output. Let’s say we have 10000 people are being interviewed. Now its not possible for human’s to do it. Even if you employ a large number of human’s to do it the disadvantage is that the way everyone percepts the answer will be different. Secondly, it leads to wastage of human resources. The most obvious choice is to look for a software tool. Let’s use the traditional approach to build a software tool. Obviously this software has to identify patterns of words or text that are to relevant and convert them into something that can be measured or in other words quantified. Now what if the pattern is not known to the programmer? An answer can be in a variety of forms. I can give an answer like – “This is bad”. Another person can say the same thing in a different form – “This sucks”. Now both nearly mean the same thing -that the customer is not satisfied about something. Using a case based approach this becomes really tedious. But with ANN it’s much easier.

ANN can be recognize patterns, pick up key information that are not easily identifiable, develop relationships among them. Nothing is explicitly coded. There are also ANN’s that can automatically interact with the environment for learning without any explicit training.

While doing market research, it is very difficult to develop the relationship among the parameters, recognize patterns. ANN does this automatically. One can even find those missing parameters, check their importance and much more.

One more interesting capability of ANN is its predictability. What happens next is a big question mark? Given the intelligence of ANN, it is known to have a very good predictability. Say how a price of commodity would be at a later stage, is a key factor for building the marketing strategy. ANN’s predictability in many cases have proven to be close to accurate.

For more resources, please post a comment with your mail id.

Saturday, July 30, 2011

Build action property - WP7:The property could not be read/written because the language service returned an unknown error



The property could not be read/written because the language service returned an unknown error

One of the most frustrating errors I have faced till now while developing app for Windows phone 7(WP7). I didn’t get any proper solution when I googled. So I wanted to share what solution I found for this error.

The story goes like this. I finished my windows phone 7 app – Finance Manager beta(listed in my blog). When i submitted to the App hub it said,

The [NeutralResourceLanguage] attribute is missing on the entry Linkassembly.

Well i was puzzled by this and as every person does I googled. And I got the solution to this problem easily. It was because fortunately many of the people had faced the same problem. I found 2 ways to solve this problem either manually through or using wizards. As a programmer I went for the manual option. The manual solution is to go to assemblyinfo.cs file. This file can be accessed in the solution explorer under the properties section. Then add the following commands.

using System.Resources; //on the top

[assembly: NeutralResourcesLanguage("en")] //In the section where all the attributes are given.

Else you can right click on the properties tab and under the build tab below default namespace. Click on the assembly information. In that under the Neutral language drop down select the language you want.

Normally this should solve the problem.

But unfortunately, my problem did not get solved, I gave the new XAP after adding this tag also, App Hub returned the same error. So I went to the second option of using the wizard. But when I clicked Assembly information all the fields were empty. I was wondering what the problem was. So I decided to manually feed in the values in to the fields. But when I clicked ok, Visual studio threw an error

The property could not be read/written because the language service returned an unknown error

I googled this, but unfortunately no solutions. I had no other choice but to solve the problem myself. So as I looked in to various things in my project settings, properties etc, I did find what the problem was.

There is a property of all the items in the project called Build Action. If this property is set wrong then the functionality of the app will be totally different even if one has done the coding perfectly. When I saw what the Build action property of Assemblyinfo.cs ,it was set to content. It should have been compile. I changed it to compile. Immediately all the fields in Assembly information of the properties of the project were loaded properly(As I described earlier, all the fields were empty but now they were loaded with values ).

Make sure your Build action property for all items is set properly. For example if u set the property of the DLL’s used for Localization should be set to content. If you set it to resource, though DLL have been created properly you will not get the output. So as such, Build action property if not set to the proper value can be really bugging.

Tuesday, July 12, 2011

Frames in Windows phone 7 - The concept of vanishing grids



One of the major challenges while designing a mobile application is that size of the mobile screen is very small compared to the regular screen size of the laptops or desktops. So it becomes really tedious in terms of the design even though most of the smart phones today have the scroll feature. Particularly when we want to design a page with many options, the page gets really crammed up with buttons. So what do we do? Recollect the concept of frames in a website. By frames what is I mean is that frames allow the designer to present multiple documents in a single interface.

While I was designing my windows phone 7 app, my main aim was user friendliness. It is very tedious for the user to navigate to different pages every by clicking numerous buttons. It doesn’t present a single interface for all the functions. For an end user it is not comfortable as it involves too much of navigation, interface keeps changing, No centralization etc. So when I decided to do something about this, as everyone does I googled my query with different tags. I ended up seeing something about Pivot and panorama controls which was also there in the offline training kit. Well I did find it interesting but at the same time, I thought of doing some experimentation. So here i provide my approach to the problem without using any of the pivot or panorama controls.

I started recollecting what grids were (Equivalently the canvas and stack panels). I recollected there is a property called height of a grid. What if I can make that height zero and resize it whenever I want to. So if I have multiple grids and make one appear at a time and at the same time make others not appear (make their height 0), it would solve the problem. Indeed, this approach did work. You can also use the same approach with width of the grid.

The first step is to categorize the options you have. The second step is to decide how you want the interface to be. Next step is the design an interface. I designed the page as follows. On the top section of the page, I had buttons denoting the categories and bottom of the page I had an area to display the associated items for that category like textbox, buttons etc.

When I click category one, the set of associated items should appear in the display area. Now how exactly do you achieve this is the next question. To do this first create different grids for different categories with each grid encapsulating the items belonging to that particular category. Let’s say for the sake example that the names of the grids are grid1,grid2,grid3 and so on for category1, category2, category3 etc. respectively. Now these grids are placed in the display area inside the main content panel. Under each grid encapsulate those items belonging to that category. Say for example, if category1 has 6 buttons and one textbox, then those items are to be placed under grid1. Now in the XAML code note the height or width of that grid and then make the height or width of the grid1 zero. Now repeat this procedure for all the grids so that you have a customized grid for each category. Please note that during design you won’t be able to see what you have done with previous grids(you can see only the present grid you are working with) as you have made the heights of those grids 0. You can view them by making the height of the present grid (the one you are working with) as zero and assign the height of the grid to that value, you have made note of earlier.

Coming to the coding part of it I am going to demonstrate using C# though this concept can be applied to VB also. In main constructor (Where the function initialize component is invoked) below the InitializeComponent() function give the following code.

grid1.Height = 0;

grid2.Height = 0;

grid2.Height = 0;

grid2.Height = 0;

grid2.Height = 0;

grid2.Height = 0;

You can also create an event handler when the page loads and give the above code there. This code is to make sure that all the grids are at zero height or in other words no category is displayed when the user enters the page. This is not mandatory and can vary depending on how you want the user to see the interface when he enters the page, the logic etc.

The next step is the event handlers when the category buttons are clicked. While placing the components, note the size of the grids which is according to your design. Let’s say for example sake that 255 is a height suitable for the design(the one you noted earlier). Create the event handler for click event of Category1 button by double clicking the category1 button in the design view. The following code goes into that:

grid1.Height = 255;

grid2.Height = 0;

grid2.Height = 0;

grid2.Height = 0;

grid2.Height = 0;

grid2.Height = 0;

Similarly for category 2 buttons, in the click event handler the following code goes:

grid1.Height = 0;

grid2.Height = 255;

grid2.Height = 0;

grid2.Height = 0;

grid2.Height = 0;

grid2.Height = 0;

This process is repeated for all the categories.

You can alternatively make the width of the grid also zero. The purpose is to make the other grids vanish and make only one grid appear at a time.

And there it is your own frames page in WP7 with vanishing grids.

Well the advantage with this technique is that it’s very simple to use, many of them are just copy pasting the things that have already been done, easy management, a single UI with multiple options etc. The disadvantage is that while designing if you lose track of what you have been doing it is very difficult to come back to what you have been designing because if you have large categories it is very much difficult as the XAML code becomes big. Apart from this I personally didn’t face any disadvantage.