Embrace Failures as Success

How do you define your greatest success? Can we say that a person’s ultimate success is the attainment of her/his greatest dream. I believe you will agree by that definition. However, the hindrance to most of the dreams is the fear of failures.Your dream can be big or small; you may conquer it or not; but to conquer it, you should be ready to take your first step instead being scared of loosing it. A task never started will never be accomplished.There is a very popular saying, “A job started is a job half done”.Moreover, there is no point to be afraid of losing something we do not have. We must strongly believe that we deserve to live our dreams.

Also, its ok to fail during the pursuit for your dreams. Because it takes perseverance and persistence to make a great produce. If Thomas Alva Edison was afraid of failures, we would not have incandescent bulbs after his thousand failed attempts. Failures have a whole lot of things to teach us than successes can. So embrace your failures like you embrace your success, and retrospect them to show constant improvement.

There is a Japanese art called Kintsugi, which is about fixing the fissures in broken pottery by filling them with precious metals like gold. If failures breaks you down, fill in your fissures with your precious learnings and grow more elegant than before. Let us treat success and failure alike and learn equally from them to grow further.




Seeing beyond what you see is wisdom

We are given birth without our approval, yet we manage to exist by absorbing the essence from the environment, from the society. Most people agrees that the human beings are social animals, who absorb and reflect their social circles. Yet, a very few manages to be out standing and successful by the definitions of the world. The questions like, How does these limited few manage to shine; what shapes their success;  are buzzing our minds for several months. After aggressive look up for the answers to the questions, we could read that there is a pattern which makes them what they are. Thought of penning down the observations as a series believing it would kindle the thoughts of my readers.

The most important feature of any successful person is continuous learning. It is true that a person’s growth stalls once she/he stops to learn, and it is extremely important in today’s world to stay current in our respective domains for us to exist and to survive as the changes are so rapid than any other times in the human history. Experience makes the best teacher, I do not doubt it. Yet, we cannot afford to experiment and experience every success and downfall to learn and to grow; we can certainly save a lot of energy, time and resources by learning from the lives of the other people who have already gone through the same path as you and acquire the required wisdom to achieve success. We have the resources in abundance, in the form of biographies, autobiographies, interviews, case studies and a lot more stuff on the internet. At the same time we also have an equal number of spoilers, litters and distractions that dilute the above mentioned sources. Its very important for us to acquire the skill to distinguish between the former and the latter, go to introspection mode to identify between the facts and spoilers. Picking up the necessary facts will make you knowledgable, but do you think that is enough for you to be successful? In my opinion, if a person is knowledgable, she/he can be competent and can survive in his/her respective field. We have a whole bunch of survivors in that case. But our sealing to success is far more higher, and it is not just enough to be knowledgable to reach there.

You may ask if knowledge is just not enough, what does it take to be successful. It is the wisdom, which sees things beyond what you see from the books or from the other sources of information. Do not just apply the same set of rules or formula you have picked up from your introspection. Go to the retrospection mode and see how you can craft your knowledge into wisdom. Question yourself and apply your findings to form fresh ideas instead copying the conventional ones. Accumulate knowledge but most importantly acquire wisdom to be successful.


Performance optimization in ASP .NET applications

Answer by Sharmilli Priyadarsini:

If you are using SQL server or an equivalent database in the background to process your data, try the below steps:
1. Process most of the data in the database and transfer only the required result set to the application layer.
2. If you have used store procedures or functions, run a profiler in the the database administrator and understand which of your queries consume more time(Usually due to unwanted joins). Optimise the expensive queries.
3. Ensure you have removed unnecessary lines of code added during debugging to print values has been removed and you have followed the best practices.

Now, if you are using an ORM like Entity Framework, assuming you must have used LINQ to Entity to do the database querying, you can still do the database profiling to identify the expensive or time consuming code by running the database profiler and attaching it to the respective process.

If your front-end is taking consuming, run your Visual studio profiler from the Analyse menu, and see where are the code can be optimized. You can also use re-sharper to do code analysis.

Other key tips are,
1. Use server side pagination instead on the client side.
2. See if there are nested for loops or foreach loops used for data processing.
3. Push your data processing logic as much as possible to the database.
4. Make sure the memory management is taken care.

Hope it helps.

I’m developing a project on  ASP.NET  mvc . In a certain table it has 22246148 rows data and its taking 04:48 mins to retrieve the  recor…

Are there a general set of “best practices” or the like for implementing social networking elements in ASP.NET, MVC, and C#?, or maybe us…

Best Practices While Developing On-line Learning Platform using Microsoft Technology Stack

Answer by Sharmilli Priyadarsini:

I assume that you want to create a learning platform using .net and you are looking for components to simulate the feeling of social networking.

If that is the case, you should probably think about using the templates from CMS(content management systems) like Umbraco. Or if you are thinking about building your own the system, go by SDLC model.

1) Analysis – Make a thorough domain study to understand the preferences of your customer and see what is their actual expectation and how this system could benefit them.
2) Design – Split this section into two, High Level Design (HLD), Low Level Design(LLD). The high level design should cover the requirements on the business perspective and you should get the queries clarified through your customer on the number of users who are going to consume the software and your screen designs must be reviewed and confirmed by the customer before jumping into low level design document. In low level design, we need to look at the two aspects, backend design and front end design considering the customer expectations. This acts as a foundation for building the project architecture.
3. Development – Create your database and the required project layers considering HLD and LLD in your mind. Always go from the backend to the front end as the backend design could give you a clarity or wholistic picture on the software.Decide your technology stack based on your budget and customer requirements. Depending on the user base, you may have to decide the number of layers, If your application has enhancement plans to extend in different platforms, use Web services, etc.you can use SignalR for displaying the dynamic information like chats, real-time feeds etc. If you have database developers use direct database connectivity for optimum performance, if you do not have database experts, use an ORM like entity framework. Now, once the architecture is ready, start developing the modules one by one, perform unit testing to ensure the functionalies are working as expected and comply with the design documents.
Testing – After unit testing, your product should go through rigorous testing which includes functional testing, regression testing, performance testing etc. The defects identified from the testing should be fixed and it has to go through retest before rolling out to user acceptance testing. A few users gets to evaluate the product and provide feedbacks for product improvisation if any.
Delivery – once the product passes through all the above step, the product can be handed over to the customer.

Are there a general set of "best practices" or the like for implementing social networking elements in ASP.NET, MVC, and C#?, or maybe us…

Difference between @html.TextBox and @html.TextBoxFor

Difference between @html.TextBox and @html.TextBoxFor.

My answer on Quora:

In abstract terms, the difference between the html helpers @html.TextBox() and @html.TextBoxFor() are the former is weakly typed and is independent of model and the latter is strongly typed and it should be bound to one of the model property in strongly typed view.

Consider the below piece of code,

This will be rendered as shown in the below image.

When you use, TextBoxFor, while the HTML is generated, it will automatically map the value from the model property to it, in the above case “UserName” . So when you post the values of the current page, if your controller is having your model as the parameter, the value can be retrived directly by accessing the property.

When you look at the above screenshot, the model will not hold the weekly typed “simpleTextBox”.

Hope you find it useful.

Can any one explain me the difference between @html.TextBox() and @html.TextBoxFor() in ASP.net MVC?

Model Binding and Strongly Typed Views

Model Binding and Strongly Typed Views

Answer by Sharmilli Priyadarsini:

In order to demonstrate model binding, I am making use of the default scaffold for Account registration available when you create a new web application with Visual studio.

Let us see how to create a strongly typed view using the below model,

Now, from your solution explorer, expand the controller folder and open the AccountController.

You will find something like the below action method,

Right clicking near the ActionResult and selecting go to view will navigate you to the Register.cshtml view which is strongly typed with “RegisterViewModel”. In order to make a view strongly typed, you can either do it through api or marking the model on the top of page as shown below:

Doing, so will generate you a strongly typed view as Register.cshtml bound to RegisterViewModel inside the accounts folder in views.

This is how you can create a strongly typed view. Now let us get into the detail of how to design your view by making use of the above model.When you take a close look of the above screenshot, you will see set of html helpers i.e all that follows “@html.” are said to be html helpers. Why because, they will generate the equivalent html to generate your web pages.

Let us take the below example
@html.LabelFor(m=>m.UserName, new{@class=”my-label”})
@ in the above line of code is known as razor syntax. Everything that follows the razor syntax will be rendered at the web server and are C# code in the .cshtml page and vb code in .vbhtml respectively.
html. represents that a html helper so the equivalent output will be a html code generated by the web server. we have different types of helpers like html helper, ajax helper etc.

LabelFor will generate a html label with the name user name which is strongly typed. But usually the label’s will not post the values to controllers they are just plain text. But if we have other controls like textbox, checkbox we can retrive their values in the controller.

Hope this clears your doubt.

I am getting quite confusion in binding the model data in view page, can any one explain me? How exactly it is done?