“How much you can take and move forward” defines you.

Posted in Uncategorized | Leave a comment

I don’t know who this “I am” is

This is a very contemporary song, but if you listen carefully you may appreciate the deep message. The song goes like this:

– I am not hindu, or muslim or of any other religion
– I am not space/air/fire/water/earth
– So on an so forth

Bhagawan Ramana Mahirshi used to say to inquire into who is “I am” and hold onto that one thought and grace would fall one day. The message of the song is similar to that but in an interesting way. If you ever try to do the inquiry you would quickly come to a conclusion that it is the hardest thing to do in this whole world. In scriptures this layer (or veil) is called “Asmita” (or Aham Asmi) which literally mean I exist or pure “I am”. We somehow intuitively know that we exist right? Sages say, that is the root from which the whole samsara (our imaginary world) grows. You know the worst part, there nothing we can do. i.e. to know that we are NOT. Kind of stupid endeavor if you think about it. If i want to do or know something my presence has to be there first right? That’s the 1st order condition. So how can I know that I am NOT?

This is where every concept or theory or anything that the MIND can hold breaks down. All the great sages of the past says to hold steady (in the “I am”) and one day THAT (call grace or god or anything you like but remember all concepts are false?) will come and take over what IS. I say pretty tall order for mortal beings, but a Buddha, a Mahavir, a Ramana Mahirishi come and show us that it is possible.

I would say we enjoy this beautiful song and see if we can get a glimpse of this pure “I am”.

Posted in Uncategorized | Leave a comment

Feynman lectures – Hosted by none other than “Bill the Gates”

I came across these lectures and was pleasantly surprised that Bill Gates bought the rights for these and is hosting them free for public. I think he is definitely using his money wisely here.

I am listening to them one at a time. They are quite long (close to 1 hour each). They are such a pleasure to watch. Just to keep myself alert while watching I am going to try to understand and post here the links between physical laws as described by Feynman and what some of Easter Mystics has to say. My knowledge in both are miniscule. This way, I am hoping to learn both a little bit better. There is a wonderful book Tao of Physics which goes very deep into this matter. I am trying to see if I could agree and understand Mr Fritjof Capra a little better.

Posted in Uncategorized | Leave a comment

Apply Newtonian principle to overcome procrastination

An object in motion will stay in motion and an object at rest will stay at rest unless acted upon by an external force – Newton’s laws of motion


Trent of The Simple Dollar published a to-the-point article “The Thought of Starting This Project Overwhelms Me”. It is very well said that we should concentrate on

  • Important but not urgent thing and
  • Discard the urgent but not important things

I think this is a nice scale to judge an activity.

Trent did not go into the technicalities (how) of doing this. A few things that has helped me start the ball rolling when I feel overwhelmed are:

  • Stop thinking about the activities (stop breaking down into small chunks etc.)
  • Stop planning (where to start, what to do, why to do etc.)
  • Just start doing anything that first comes to mind

That always starts the ball rolling and things kind of fall into place. Recently in my job I had to write a big technical design document and there were so many things I had to put together that I felt the same way as Trent. Here is how I went about it. I Thought (planned, brood, worried) about it for a day. The more I did those the more overwhelmed I felt. Finally, I just put my foot down and just opened a template document and start typing whatever came to mind. At first it looked and felt weird. But after a few minutes the relevant ideas start showing up and in about 4 hours I could put down everything.

I think Newtonian principle is in work here. Once thinking/planning/worrying sets in, it has a tendency to generate more of the same. And once the actual doing sets in it attracts more doing. But the change does not happen automatically. You need to apply some force. So just apply the force (how much tiny it may seem) and see how the things just take care of themselves.

Posted in Uncategorized | Leave a comment

That is where and from them all we come from

You see the sun, the moon, the stars, the mountains, the flowers, etc. that is where and from them all we come from. How true it is. Poetically that’s just beautiful, but scientifically inclined folks cannot deny the facts too. we all are made of proton, neutrons (well you can argue muon, pions). All the things of the world and beyond are made up of the same particles (as far as we know right).

But Alas! I somehow know with the utmost conviction that I am not this laptop nor the printing paper nor the telephone nor the monitor nor the keyboard etc. So I go ahead and destroy anything I like and feel no remorse. How did I come to this conclusion with such conviction and Bob Randall was able to come to a such a whole encompassing conviction. Hope I am not the only one holding such twisted convictions. We all can use a little bit compassion towards things.
Help me God. Thanks Bob!

Posted in Uncategorized | Leave a comment

A few more songs that are close to me

Such a beautiful advertisement. Is it not fitting that instead of expecting others to fix our problems we should try ourselves? Most times children are best teachers because they are still so not touched by all the human politics.

Now my lord. He is the one who links the end to the beginning. So it’s only fitting that he is here.

Posted in Uncategorized | Leave a comment

Nostalgic songs collection

Here are a few songs which are very personal and always always brings out the nostalgic feelings in me. They were with me in my growing years and have left a deep mark.

Well this is very fitting, How do you figure out what life is all out?

A few more gems!

What can i say about Mukesh?

Nothing can match the classics

A few song that brings out the my post graduations (1993-1995) day in me.

Here is a tragic, I had a very close friend. In college years, he was infatuated with a girl in front his house. So we used to tease him with the following song. Sadly, he died in a motorcycle accident at a tender age of 22. Very sad, such a nice and cultured boy. A real loss. How can you explain such things?

Posted in Uncategorized | Leave a comment

Eugene Fama’s Books

Eugene Fama is one of the pioneer’s of efficient market hypothesis. He is the guy behind Fama-French model and countless other theories behind Modern Portfolio Theory. There is none other more respected individual in finance then him. He has written 2 books which are long out of print. He has made copies of those books and made available.

Take a look:


If you are really interested in the math behind Modern Finance (or if you are feeling less challenged in your current environment), you can give these books a try. They are real gem (Caution, they are used for Phd. Courses in University of Chicago Finance department).

Posted in Uncategorized | Leave a comment

Securing a windows folder

I was trying to enable the Encrypted file system (windows EFS) in my box.

Here is a great post describing in detail how to do it:


And I faced a lot of problem. I tried to setup the EFS using group policy editor which shows that it is enables. But I used to get the following error message all the time (“This machine is disabled for file encryption”)

I did not know what the problem was, till I got this post.


What basically was happening was that my machine was joined to a primary domain controller and my individual machine settings were not taking effect because the domain controller used to replace it every time.

No way to know this unless you use the effective resultant policy using the command rsop.msc

To view the group policy editor use the command: gpedit.msc

To view the effective resultant policy use the command: rsop.msca


Posted in Uncategorized | Leave a comment

How to do WCF UserName token authentication with dynamic proxy for test driven development (TDD)

Problem definition:

Previously I have linked to a website which describes in detail how to enable your WCF applications for username tokens authentication. That article went thru the setup of username token authentication using configuration files and client proxies. That is alright if you want to generate client proxies and use in your client application.

For testability reasons (which I will describe) we need to be able to use dynamic proxies for WCF services. I had to search a few places to gather all the required information to do this. Here I will describe how it can be done from a test driven development (TDD) methodology standpoint.


In the example I have used a classical MVC pattern with service implementation for retrieving the model. At a high level the complete data flow is represented as:


I am just going to explain about the Web-server layer where the MVC pattern and WCF dynamic proxy resides. Maybe later I can go explain the other tiers and some of their nice features.

I created a View like the following:

public interface ISearchUserView
string SystemTextBox {get; set;}
string HostTextBox { get; set; }
string BankTextBox { get; set; }
string PathTextBox { get; set; }
ArrayList DataFormatDropDownList { get; set; }
ArrayList TradingMethodDropDownList { get; set; }
GenericCollection<UserData> UserGridView { set; }

 The implementation of the view is not important for this article, so I will leave that as well for now.

Then I created a controller which holds the view.

public class SearchUserController
private IDataService _service = null;
private Views.ISearchUserView _view = null;
public Views.ISearchUserView View
get { return _view; }
set { _view = value; }


Now the relevant parts are the following code:

public SearchUserController(Views.ISearchUserView view)
View = view;

WSHttpBinding binding = new WSHttpBinding(“WSHttpBinding_IDataService”);
EndpointAddress address = new EndpointAddress (new Uri(http://localhost:8731/Web.Service/DataService/&#8221;),
new DnsEndpointIdentity(“MyServerCert”));

ChannelFactory<IDataService> service = 
new ChannelFactory<IDataService>(binding, address);
// Add the user name token to the request, these should come from the config file

// where we should encrypt them

service.Credentials.UserName.UserName = “test”;
service.Credentials.UserName.Password = “test”;
// Custom SSL validation of the server certificate,

// this we don’t need in production.

// in dev the cert is really not valid so to bypass the certificate validation

// we need custom validation here.

service.Credentials.ServiceCertificate.Authentication.CertificateValidationMode = X509CertificateValidationMode.Custom;
service.Credentials.ServiceCertificate.Authentication.CustomCertificateValidator = new MyX509Validator();
_service = service.CreateChannel();
// Dependency injection
public SearchUserController(IDataService service, Views.ISearchUserView view)
_service = service;
_view = view;

 Let me go thru each line of the code.

public SearchUserController(Views.ISearchUserView view)

This is a constructor that I am overriding which accepts a view, nothing special.

WSHttpBinding binding = new

Now we need to define the binding properties in the client side to connect to the server. The server is an implementation of the following ServiceContract.

public interface IDataService
GenericCollection<UserData> GetUsers(string bankName);

 The binding is defined in the web.config file of the web-project as:

<!– WCF binding configurations –>
                <binding name=WSHttpBinding_IDataServicecloseTimeout=00:01:00
                    <readerQuotas maxDepth=32maxStringContentLength=8192maxArrayLength=16384
maxBytesPerRead=4096maxNameTableCharCount=16384 />
                    <reliableSession ordered=trueinactivityTimeout=00:10:00
enabled=false />
                    <security mode=Message>
                        <transport clientCredentialType=BasicproxyCredentialType=Nonerealm=“” />
                        <message clientCredentialType=UserNamenegotiateServiceCredential=truealgorithmSuite=DefaultestablishSecurityContext=true />

 Most of the configuration entries are not important at this point. Only thing that is worth pointing out is the security settings.

                    <security mode=Message>

                        <transport clientCredentialType=BasicproxyCredentialType=Nonerealm=“” />

                        <message clientCredentialType=UserName”  negotiateServiceCredential=truealgorithmSuite=DefaultestablishSecurityContext=true />


 Basically we are stating that we will use message level security with credential type UserName. To use this setting we need to have SSL connection between client and server. That is a necessary requirement because we will be sending the username and password across the wire in clear text.

EndpointAddress address = new
EndpointAddress(new Uri(http://localhost:8731/Web.Service/DataService/&#8221;),

 The above code is just setting the server host address, nothing special here.

ChannelFactory<IDataService> service = new ChannelFactory<IDataService>(binding, address);

 Here I am creating the ChannelFactory for the particular service implementation.

service.Credentials.UserName.UserName = “test”;

service.Credentials.UserName.Password = “test”;

 The above 2 statements is where we need to set the user name and password for the UserName token authentication. Generally these values should be stored in a configuration file or something, but for demonstration purpose I hard-coded them.

service.Credentials.ServiceCertificate.Authentication.CertificateValidationMode = X509CertificateValidationMode.Custom;

service.Credentials.ServiceCertificate.Authentication.CustomCertificateValidator = new MyX509Validator();

 _service = service.CreateChannel();

Now the above 2 lines are not terribly important. In a production environment the server will have a valid X509 certificate from a certificate authority such as GeoTrust® but for development environment I did not have a certificate so I created a dummy certificate using the following command

makecert.exe -sr LocalMachine -ss My -a sha1 -n CN=MyServerCert -sky exchange –pe

That means it’s not a valid certificate. So if you want to bypass the actual server certificate validation (for SSL communication) then you can use the above logic to short circuit the validation.

The code for MyX509Validator is pretty straightforward for demonstration purpose:

public class MyX509Validator : X509CertificateValidator
public override void Validate(X509Certificate2 certificate)
// validate argument
if (certificate == null)
throw new ArgumentNullException(“certificate”);

// check if the name of the certifcate matches
if (certificate.SubjectName.Name != “CN=MyServerCert”)
throw new SecurityTokenValidationException(“Certificated was not issued by thrusted issuer”);

 That is all you need to create a dynamic proxy with full SSL/UserName token validation. You may ask, why do I need this? I can achieve the same result using configuration files as well? Well as I mentioned this is important for TDD. Here is the testability code:

Dependency Injection:

// Dependency injection

public SearchUserController(IDataService service, Views.ISearchUserView view)


_service = service;

_view = view;


The visual Studio Test code is as follows:


public void TestPortalUserDataControllerIscallingTheServiceAndSettngValueIntoTheView()
MockObjects.MockISearchUserView view = new MockObjects.MockISearchUserView();
MockObjects.MockIDataService service = new MockObjects.MockIDataService();
SearchUserController controller = new
SearchUserController(service, view);

Assert.AreEqual(“Test Bank”, view._data[0].Bank);

 Pretty straight forward. We need to create 2 mock objects 1 for the view and another for the WCF service. Inject them to the Controller and voila. Here are the mock objects (I did not bother to use any mock framework here, but you can use one).

public class MockISearchUserView : ISearchUserView
public string BankTextBox
return “Test”;
throw new NotImplementedException();


public class MockIDataService : IDataService
#region IPortalDataService Members

public GenericCollection<UserData> GetUsers(string bankName)
GenericCollection<UserData> users = new GenericCollection<UserData>();
UserData user = new
user.Bank = “Test Bank”;
return users;

 Maybe in a future post I can go into detail about the testing things.


Here I wanted to demonstrate how you can use the WCF authentication mechanism without generating client proxies. You can use the dynamic proxy functionality provided in WCF to achieve the same results. This is important for the testability reasons as I demonstrated. TDD is a way of coding, if you like it there is no greater thing that happened to software development that this. If you don’t like it, you will hate it for all the complexity that it brings in. I am in the former camp.

Posted in Uncategorized | 3 Comments