Sunday 6 July 2014

Startup Lessons from a Spark Talk

Few days back, I attended a Spark event where there was a session on technology and there was a presenter who had experience of starting a project from a start to success. Here are some important points from the talk.


  • Don't work in the dark. If you have an idea go and talk to people what they think about it rather than making assumptions and finding out at a very later stage that you have developed something that nobody wants to use.
  • Do not build unless talking to people. You can get a quick feedback without starting to develop the product by talking to people.
  • You have to have a market for your product. Do not target everybody ( at least when you start ). The reasons why you need to to have a well defined market is that it will help you with your marketing campaigns and usability decisions.
  • Instead of coming up with an idea, choose a market. Try to pick a big market with bigger players ( business making more than 1 million dollar a year ). Smaller players are struggling to make money and fighting for their survival so chances are they will be very cautious to buy something unless it is something they really need and relying solely on these players adds lot of risk for the viability of your business.
  • Pick a market that is going up and is likely to be that way in future ( e.g Property ). One way to find which industry is hot is by looking at job boards website and filtering jobs by industry type. The more the number of open jobs in an industry, the hotter it is likely to be.
  • Talk to your the market about their pain points. You want to focus on the most painful points. You don't want to sell proteins or vitamins, but rather pain killers. Focus on the problems because of which people in your market hate their jobs. ( Example : People in property management hate property inspections )
  • Focus on a problem that would stay. ( continue to exist e.g People trying to get rich quickly )
  • Talk to people in the market about their problems but not what to they think can solve it. People will give you weird answers when asked about what can be a solution to their problem.
  • The presenter did not have money and technical knowledge to build the product but knew the pain point and had a solution in the mind. He outsourced the product development for version 1.0 and then later was able to hire people locally
  • Subscription based model works. Do not target consumers as odds of getting successful in a consumer market are fairly low compared to B2B solutions.
  • Once successful and growing, you need local development team.
  • If there is a solution and people do not use it, it does not count.
  • Talk to people more and more.
  • Sales is the best skill to learn. Fear of rejection or fear of hearing NO can demotivate you from selling. Overcome it.

Sunday 19 May 2013

Copy or Rename multiple files to another extension in Linux

Recently I came across a problem of renaming multiple files to a different extension in linux. Basically what I had was a folder with template files and I wanted to create php files from them while keeping the original ones intact. Here is my folder structure.

/Config
 - Database1.template
 - Database2.template
 - Database3.template

And this is what I wanted to achieve


/Config
 - Database1.template
 - Database2.template
 - Database3.template
 - Database1.php
 - Database2.php
 - Database3.php

It turned out that you can do it using just one simple command ( instead of writing a shell script ). A command called "rename" is what I was looking for.

$ rename 's/\.template/.php/' *.template

The above command tells linux to look at all the template files in the current folder, search for template text and replace it with php. Hope this helps you as well.

Cheers.




Sunday 5 May 2013

All Your Brain Suck - Awesome talk by Paul Fenwick


I attended codemania 2013 few days back. Really loved the talk given by Paul Fenwick so sharing it over here.

P.S The video is from OSCAN 2011 but the content is same as of codemania 2013.

Cheers

Friday 3 May 2013

Thinking OOP in php ( Part 1 )

This is part 1 of thinking OOP ( some people even say OOPs ) in php series. The aim of this series is to pick up some real world problem ( kinda ) and then to solve it using Object Oriented Concepts and Design Patterns and Principles. Let's get started then.

Problem
Let's assume that you are working as a programmer in a company and a new requirement has just come up. Your page will be passed a parameter called color and based on that color you have to display a button ( obviously of that color ).

Solutoin 1
Let's review our code for some potential problems.

  1. The logic of how our button is displayed is naked. ( We will have to modify this script file if we decide that our color should begin with capital letter )
  2. The logic of what to do based on the value of parameter is tightly coupled with the client ( For example, if in some other script file we want to reuse the button display logic we will end up copying these lines or do an include or whatever )
Let's address problem number 1 first. We can hide the implementation of button by creating a class. Lets create classes called BlueButton and GreenButton.
Solutoin 2
Our Solution 2 looks slightly better than solution 1. We have solved the problem of implementation of button being naked by encapsulating it in to a class. However, we still have logic of which class to instantiate and knowledge of all the classes ( BlueButton, GreenButton and all the future ButtonClasses ) coupled in the client. To solve this issue, we are going to use Factory Design Pattern.

Builder In our case, ConcreteProduct is Button class. We do not have an AbstractProduct class but we will create one.
Solutoin 3 And that's basically it. We have successfully applied design pattern and OOP concept ( encapsulation ) to the given problem. Next time I will cover a new problem and one more design pattern. Cheers

Tuesday 23 April 2013

How to find hostname from ip address in Windows?

Recently, I came across a problem of finding a hostname from ip address. Basically I needed to find who made an api call within our network (LAN). The solution turned out to be rather too simple. Here is what you need to do.


  1. From Start Menu, navigate to Command Prompt. ( Keyboard shortcut is Ctrl + R, then type cmd and press Enter )
  2. Type nbtstat -A <ip_address> and press Enter.
  3. You will see a table with name,type and status. Just look in the name column and Bingo.
Now here is the interesting bit. If your target machine is not using Windows then you would see nothing. In my case it was only one machine not using Windows so I was able to identify it quite easily.

Give it a try and let me know what you think.