Sid's Blog

( life => life.Make It Better ))

How to Add a Set of Directories to Environment Variable $PATH on a Mac?

I often find myself installing a software or package for my projects while working on mac where I need to add a specific path to my $PATH variable. So, I thought to write this quick post. Below is the directions to achieve the above goals:

  • Open Terminal on Mac from Applications or Spotlight.
  • Now run the command below:

sudo nano /etc/paths

Unit Test and Test Driven Development in ASP.NET MVC Application

This article aims to summarize the concept of testing which can help you while writing tests using any framework out there. I will be writing more on this topic and will also attach any relevant demo applications on github. 

Types of Testing

There are many types of testing that you may want to apply to your application, namely:

  • Unit Test & Test Driven Development (TDD)
  • User Interface Testing
  • Integration Testing
  • Acceptance Testing 
  • Performance Testing
  • Accessibility Testing
  • Security Testing

Some Facts About All the Programmer or a Software Developer

No matter where you are in your software development career or what technologies you work with, there are couple to things we all have in common:

  • Education (Everyone needs to go for education but the nature of that education can differ.)
    • Knowledge (the things we know)
    • Skills (how we use the knowledge)
    • Judgement (Choosing the right approach)
  • The challenge is – There are always new platforms, new tools, new languages as our field is growing rapidly.

In case of any other profession, if you stop learning, things will still work. But in fields like software development and information technology, we need to make learning as our habit and a passion too as if you don’t do it, your skills will be less valuable in the IT market.

Career of a Software Developer and Some Strategies to Survive

If you are an software developer by profession or have hobby to develop in some languages, I guess you spend most of your time working on different technologies and updating your skills either by attending conferences, books and other sources. There are many things to learn and by the time we learn some of them, we again have lots of other new things in queue, that never ends! It is sometimes very difficult to how to work in such environment and keep learning and updating your skills. Everyone has this issue but very few talk about this! Geeks can talk a lot about comparing different technologies or the competition going on between Microsoft, Google or any other organisation. But wait, is this all a software developer can think of or should do? No, we are not taking care of many important factors that I am going to talk about here.

What if I Don’t Have SQL Express Installed?

 what if I don’t have SQL Express installed?

If you don’t have SQL Express installed and running, you may have got the following error when your code tried to read or write some data:

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Blah blah blah… No problem! You can quickly switch to use the new SQL Server Compact – a lightweight, in-process database – without having to download or install anything manually. Simply add SQL Server Compact to your project by issuing the following command in the Package Manager Console:

Install-Package EFCodeFirst.SqlServerCompact

Extract Key/values From FormCollection in ASP.NET MVC Action Method

To avoid you from having to chase for the same information: here’s how you extract key / value pairs from the FormCollection that comes as an argument in an ASP.NET MVC action method:

public ActionResult Create(FormCollection formCollection){ foreach (var key in formCollection.AllKeys) { var value = formCollection[key]; // etc. } foreach (var key in formCollection.Keys) { var value = formCollection[key.ToString()]; // etc. }}

Must Have Developer Tools! Some Tricks to Develop Quicker

Google Developer Tools, Some tricks to develop quicker

  1. View Source => By going through menu navigation or Ctrl-Shit-I on windows or Cmd-option(alt)-I on mac.
  2. Or for particular element, just right click on it and choose inspect element.
  3. For fast navigation, prefer keyboard arrow keys to collapse or expand DOM elements. You will find the width and height of that active element as you move in Developer Tool.
  4. To get the full view of the page, try Ctrl – (minus) to zoom out so as to see your whole page with developer tools open without scrolling. Sometimes useful to me.