Wednesday, January 2, 2013

A simple convention when hosting multiple sites locally

 

Firstly, A very Happy New Year 2013.

I wanted to share a sort of a neat trick/convention which I use to make my life easier when I am hosting multiple sites locally.

Suppose you are working on multiple web applications on the same desktop/laptop. Apart from using the built in Visual Studio Web Development Server, you would typically host your application on your local IIS as well, lets say for easier automated testing on your system.

Suppose you are working on two web applications which are hosted on the domains, earlyadopter.in and imadeitcount.com. Now you want to host these locally on your IIS as well. The typical approach would be to add an application to your IIS so that you may access these sites running locally through your browser by the following urls:

http://localhost/earlyadopter/

http://localhost/imadeitcount/

There are cases I have encountered where this has made life difficult. For example, if you are paring your url, you would have to do it differently for your localhost and for your actual production site.

What I do nowadays in these cases is that I modify the hosts file such that the following domains point to 127.0.0.1

http://earlyadopter.local

http://imadeitcount.local

Now, I can have as many local web applications without worrying about localhost.

What do you think? I think there may be better solutions out there, so if you know, please do leave a comment. I am also not sure how this would apply to LAMP stack solutions, so again, please do leave a comment if you have any insights on that end.

Cheers

Wednesday, December 12, 2012

Note to Self: Commit code frequently on git

Its been a long time since I blogged here. I have written drafts of THE post which was supposed to end this long hiatus from blogging, but I guess the short note I am writing today is short enough to go from draft to publish.

Since the last post, much has happened. One such thing is that I have started using Git. Its awesome. It is the way a SCM should be. Well at least most of it. I came across an issue today where I ended up losing some code I had written. In fact, it took a while to realize that code was lost. Here is how it can happen if you are not careful.

Create a temporary directory. Then try the following commands:

$ git init
$ echo “Baba Black Sheep” > blacksheep.txt
$ git add blacksheep.txt
$ git commit –m “First Commit”
$ git checkout –b whitesheep
$ echo “No black sheep, only white sheep here” > blacksheep.txt
$ cat blacksheep.txt
$ git checkout master
$ cat blacksheep.txt

The changes done in branch whitesheep are carried over to the master branch. I found this behaviour unexpected. I was expecting that when I create a branch, whatever changes I do there, remain in that branch. But apparently that is not the case.

Thus, this small note to self that whenever done with a piece of code, even on another branch, always commit. In case you are wondering how I lost the code, I think I made changes to a branch, forgot to commit the code, changed to master, and then pulled from bitbucket and during the rebase the changes made on the other branch were overwritten. At least that is what I think happened.
Will play around with this a bit more, but if I expected that changes made on whitesheep should not have reflected on master, I guess there would be others who would expect the same. So just something to keep in mind.

To end, I hope to be blogging more often here.

Sunday, October 23, 2011

Which state of mind?

The one big difference I find in myself in the last couple of years is that I take the random normal conversations with some of my friends with a pinch of salt. Does that mean that now finally I have a thought process and mind of my own? Or does that mean I am uncomfortable with some of the points that I hear and thus tend to ignore them? What is my state of mind? 

Posted via email from Random thoughts about tech and entrepreneurship

Saturday, October 8, 2011

Unsubscribe

I don't remember how I ended up registering on the wayn.com website. But lately, as I have been on a drive to reduce email overload, I have been unsubscribing from various mailing lists and wayn.com is one among many. But it stands out.

No matter how many times I unsubscribe from their list, I still keep receiving the emails. Funny thing I noticed the last couple of times is whenever I try to unsubscribe, I notice that I am already unsubscribed in their settings. Yet I keep receiving emails from them. Perhaps its a bug. Or perhaps its plain simple desperation.

Posted via email from Random thoughts about tech and entrepreneurship

Monday, October 3, 2011

Losing touch

For the past couple of weeks, I have been writing a lot of SQL queries as we do a major data update of the db. The update has been fairly painful, requiring a couple of days of manual mapping of old and new data. But what I realized over the last couple of weeks is that I have forgotten SQL and badly. 

Before I dove into the world of startups, I worked at Tesco HSC and I spent a lot of time over there writing SQL queries. Over the years I had become pretty good at it and had learnt some neat tricks such as using a pivot function. The reports I had developed required some complex data processing which meant a lot of temporary tables and a lot of complex sql queries, all while maintaining acceptable execution time. 

But three years later, I seem to have forgotten SQL. I feel my current proficiency in SQL has gone down from intermediate to beginner. But then I think that three years ago, I sucked at CSS and Javascript. I have been spending more time on front end stuff over the last year than back end. Also, I guess the back end stuff that I have had to touch has been fairly simple. So I guess it's OK. 

But it certainly isn't nice to feel that you are losing touch! :( 

Posted via email from Random thoughts about tech and entrepreneurship

Friday, August 19, 2011

The importance of a good UI

The most popular job board for startups nowadays seems to be the one by hasgeek. There have been other startup job boards around for a while, but the hasgeek job-board seems to have positioned itself as the defacto job board for startups. In fact, I have seen job  posts by companies like Akamai, which is a testament to the popularity.

What were the reasons that in a short span of time it has become the leading job board for startups and geeks? One is of course, it is FREE. This is in contrast to pluggd.in job board which charges you $10 for 30 days. But I have a feeling that the stickiness factor of the hasgeek job board is its UI. Displaying job posts as sticky post-its is something which leaves an impression on the mind of any visitor.

The underlying features are nothing different. The fields are pretty standard and the data you enter at jobs.hasgeek.in is what you would enter at any other job board. Perhaps the ability to tweet the job and spread the word is critical as well, but my hunch is that the decisive factor is the UI. 

Posted via email from Random thoughts about tech and entrepreneurship

Wednesday, July 27, 2011

Patience - A key weapon when busting bugs in someone else's code

At some point of time in your career as a software engineer/programmer/developer, you would have come across a situation where you were required to fix bugs or add a feature to an existing code base. Over the past few of months, I have been regularly in such situations as I help develop the newer and slick version of babajob.

A thing which I have noticed over the past few months is my general frustration at how things were implemented previously by different people at different points of time. The real frustration happens when I have to try and resolve bugs which occur because of trying to integrate certain portions of the old pieces with the new one. For this I have to understand  -

  1. What feature was the previous developer trying to implement?
  2. How was he/she trying to implement it?
If you are able to figure out the second question, figuring out the first one becomes easier as well. But trying to understand how the features were implemented has been a frustrating experience. And once I did understand how it was implemented, it lead to more frustration because I have never come across such implementations before and I always wondered why couldn't this be simply done the way most ASP.NET developers would do it? After all, what is the point of using ASP.NET if your new/edit forms are in .htm pages with javascript which is not jquery or even the retired Microsoft Ajax library. And worst of all, the javascript is not there for ajax calls, but to actually submit the form to a different aspx page!

Of course, over the course of time I have come to realize that the intention in many cases was merely to avoid duplication of code between the web and mobile interfaces. But this could have been achieved in a better manner, a direction in which we are headed slowly but surely.

Coming back to the title of the post, it is very easy to get frustrated by what you perceive as short-comings in the previous implementation. But getting frustrated is unproductive. It makes you lose your focus and concentration from finishing the task at hand and instead shifts your focus to the deficiencies of the previous implementation. As a result, you end up spending more time debugging because you have lost the focus and are unable to spot bugs which you would have had if you were in a calm and focused state of mind.

The best thing in such cases is to just get up and take a 2 min break, drink a glass of water, take a deep breath and try and bring your focus back to what you wanted to achieve.  Be patient and don't get flustered easily.

Posted via email from Random thoughts about tech and entrepreneurship