Rework: book review

img_6316
I was not fan of reading book earlier. I was like to sit against computer and would like to build stuffs using the programming knowledge that i posses. But i have read on internet about rework book. I knew that most of people who are doing business like this book. I have purchased this book ftom Amazon kindle store and downloaded kindle app for iPhone. I have started reading this book. I red few chapters and find it interesting to me. Than i had started reading this book when ever i had time.

Rework has expressed tottally different way of starting or doing business. Infact it empoers your thinking level in personal life also. The book is talking about Various topics

Planning

Planning in practical way instead of spending too much time in only planing.

Meetings

Too much meeting will distract you from work. Early morning habitual meeting will boar you. Instead meet when you have some results. Frequent mertings would eat all people’s time.

Competition

Book has nicely explain business competion and how to stand uniquely in this competition.

Promotion

It also covers how to promote your work. Promotion in a practical way instead of spending special time just only for promotion.

Hiring

This book said when you are starting your own business instead of hiring initially just start work with your own. Keep doing it for few time. If you alone is not enough to complete work than you should think about hiring.

There are other good topics which this book covers which i have not listed in this short book review.

I tottaly recommend to read this book if you are doing business or plan to start new one.

Advertisements

HTML element and their states

Designing html using css is nice and organized way to work. After working since last 5 years with web technologies i have learnt a lot many things for web development. The tools available today and the techniques used to develop applications. Among all i find HTML is interesting technology and very easy. In fact non-progarmmer can also learn it quickly and use it.

In this post i am talking about different state of HTML element. So when ever you design HTML page you have visibilty of it. Most of the HTML element have below states.

  • Normal State: Default state,

All of the element have this state and it is normal state in which we are desiging.

  • Hover State:  when mouse moves  over the element

All element have this state also.

css class :    :hove

  • Focus State: When keyboard cursor blinks in text box

Used for input elements when they receive keyboard focus.

css class :    :focus

  • Active State:

Used for hyperlink and button when they clicked

css class :    :active

Example:

Let see practial example of above 4 state. To understand above 4 state correctly we can take example of input type text.

1. Focus class example:

You can see that when you click on textbox and as soon as it receivs keyboard focus it’s border gets changed because we have added this behaviour in css using :focus css class.

2. hover class example

You can see when you mouse hover over the link , link change it’s background and underline is removed from link. This behaviour is achieved using :hover cssclass. You can use hover for any html element.

Note: this article is in progress.

Traits: Give power to your class

While building application using OOP class, interface play an important role. These two construct are very basic building block of software design. Unlike interface php has new concept called trait.

Trait is nothing new but set of class methods which has implementation details also. But interface have only function declaration not implementation. This makes PHP trait unique from interface.

Let’s take a practial example to understand this awesome feature provided by PHP 5.4 .

See below code which gives small higlight on how to use trait.

You can see that we have used one DriverTrait and used it in multiple class to leaverage same operaitons.

NOTE: This feature is only provided on PHP5.4 and above.

 

Building Own Framework in PHP Part-1

Up-til now i am very much fan of famous PHP framework Laravel. The latest version of it 5.1 has very nice features to build web application using modern tool. It provides full-stack approach to build web application. After using Laravel from very long time i am very much familiar with it’s component.

But from last couple of weeks i was thinking to build own small framework which is completely written by my self and fulfil requirements to build web application in day to day life. In Laravel i feel that entry point is Routes and it is very good place to control application routes and flow. So i started thinking to build own router. I have searched on google and found few results. Among all result i like slim framework Route class and got inspiration from there and try to build own small router for specific actions only.

My Small own router.

We can also pass arguments in dynamic action method in call_user_func_array function. You can see i have passed empty array to keep this simple. But if required we can pass argument and can expect that argument in controller method.

Like

$action = "getOrderDetail";
call_user_func_array(array($orderController, $action), array(34));

that we have to write getOrderDetail method as follow

    public function getOrderDetail($order_id)
	{
		echo "Now you will receive order detail for order id :".$order_id;
	}

From the above code i can now have some confidence to build this router component generic using .htaccess file which provides nicer way to url rewrite feature in Apache web server.

Also dynamic languages like PHP, Ruby, Python prvoides such a nice facility so that dynamism is achieved using their core feature.

Write your own css, wakeup the hidden designer 

After developing web basef software since last five and half years i have worked with different front end tools especially for css to design web pages. Among all i like twitter bootstrap and jQuery ui. These both kits are free and widely used. Also they cover most of the components which requires in day to day use for building different softwares ui. 

Why your own css instead of freeware or third party?

Even though after using thede kits from last couple of years today i personaly realised that for any web based ui i have to write my own css. Because 

  • if i chose twitter bootstrap or jquery ui most of the time my effort goes to fit or restyle their elements as per the project needs. 
  • However incase of bootstrap they are using too much space between elements. 
  • If i am using twitter bootstrap and later if i have to add jQuery ui, i have to look bootstrap version of jquery ui elements or have to put some effort to style jquery ui elements nearer to bootstrap.

How to plan your own css

Writing your own css for any project is not that much complex than you think. 

  • The idea is to identify commonly used elements from the sketches or wireframes that you have.
  • Style each element independantly as a components. 
  • And finally build different pages using all your custom styled element. 
  • While designing pages with your custom styled elements if you require to do some changes than do it in such way that they might not affect in other pages.

I have personally experienced this technique while developing  a saralhisab.com a mobile based pocket diary app.

Conclusion

In conclusion if you are a good designer than ask your self to design first instead of picking ready made item. I hope you will be definately have better than you could built with ready made.

Quickly upload site using file compression technique

Recently i am building saralhisab.com a fun way to track daily expenses on mobile device. Currently only way to use this service is using browser but android app is also on the way. I have built this application in php framework named “Laravel”. When i was done with this app i had purchased small hosting plan and did host it. As laravel have numbers of sub directories and vendor packages i find some dificulty while uploading saralhisab app files by files and folders by folders using filezila which is conviniet for small numbers of files and folders.

  

But where there are numbers of files and folders then uploading it is time consuming and some times failed for few files. When i am facing this problem couple of times the most merciful God gave me an idea that if i compress all the files and folders in single compressed files and upload it with filezilla it will take less time and gives result which will either filly succeed or failed for uploading task. So i created zip file of my saralhisab app and uploaded zip file only.

  
Once zip file is uploaded i have open terminal and did ssh to the hosting server.  

 

Opened directory where i had uploaded zip file. Extracted it and move files and directories in proper places.  So i find this is easiest way to upload site.