Thursday, April 25, 2013

Design Patterns

Let us start looking at the Design Patterns:

http://en.wikipedia.org/wiki/Solid_(object-oriented_design)
http://en.wikipedia.org/wiki/GRASP_(object-oriented_design)
http://www.codeproject.com/KB/architecture/#Design+Patterns
http://www.oodesign.com
http://javapapers.com
http://apievangelist.com
http://apigee.com
http://www.objectaid.net/
http://www.learnerstv.com/
http://howtodoinjava.com/
[Liskov's Substitution Principle]

http://en.wikipedia.org/wiki/SOLID_(object-oriented_design)
http://en.wikipedia.org/wiki/Don't_repeat_yourself

Adapter Pattern: Class Adapter vs Object Adapter:

  • Class Adapter uses inheritance and can only wrap a class. It cannot wrap an interface since by definition it must derive from some base class.
  • Object Adapter uses composition and can wrap classes or interfaces, or both. It can do this since it contains, as a private, encapsulated member, the class or interface object instance it wraps.
    The difference is subtle. Usually the later approach (favoring composition over inheritance) is the preferable as explained in the link which I'll quote here:
    Object-Oriented Programing (OOP) has too well known candidates for the reuse of functionality: Inheritance (whitebox reuse) and Composition (blackbox reuse). If you try to reuse code by inheriing from a class you will make the subclass dependent on the parent class. This makes a system in many cases unnecessarily complex, less testable and makes the exchange of functionality at run time unnecessarily hard. As a [Clean Code Developer] you should follow the Liskov Substitution Principle (LSP) when you need to decide if inheritance is appropriate.
    Composition means that one class uses another. You will further promote decoupling by defining the interfaces clearly. That will also give you the advantage that implementations can be easily replaced. So before you start applying the Liskov Substitution pronciple, think about the Favour Composition over Inheritance concept and ask yourselve why you shouldn't prefer composition right away.
    "Because inheritance exposes a subclass to details of its parent's implementation, it's often said that 'inheritance breaks encapsulation'". (Gang of Four 1995:19)



Thursday, February 7, 2013

RESTful API

Is it RESTful? read this...
http://roy.gbiv.com/untangled/2008/rest-apis-must-be-hypertext-driven

Saturday, December 22, 2012

Networking


http://blog.creativeitp.com/posts-and-articles/networking/hubs-switches-routers-and-bridges/

http://www.cellsoft.de/


Network packet capturing:

http://eecs.wsu.edu/~sshaikot/docs/lbpcap/libpcap-tutorial.pdf

Utility for network debugging:
1. tcpdump: to see if there are any packets coming across to the port at which the application is listening.
2. strace & gstack: to track what system call the application process is currently waiting on.
3. lsof: to track what(and how many) file descriptors are open for the application process.



top running processes: "top"
top running processes: "prstat"
                                           "prstat -n 1 -a"
number of cores: "kstat cpu_info|grep core_id|sort -u|wc -l"
prtconf | grep Memory


cat /etc/release

Tuesday, November 27, 2012

success lies in "success"

Success is very much relative term and difficult to define it. Hence, success do not exists by itself in isolate fashion but it lies in the word SUCCESS itself.


http://www.caseylorraine.com/2012/06/4-ways-create-life-conscious-language/

Leader...
https://www.linkedin.com/today/post/article/20130128162711-15077789-11-simple-concepts-to-become-a-better-leader?_mSplash=1&sessionid=q5h0saTWKsiKwJOVDPuD

Monday, October 15, 2012

Money matters!

IT Refund status:

How to become RICH-
"I will tell you how to become rich. 
Close the doors. 
Be fearful when others are greedy. 
Be greedy when others are fearful."

Ten Commandments for Trading
 Be realistic. Make trading price dependent, no opinion dependent
 Trading is a full-time profession, not a part time job. It cannot be half-hearted
 Know the rules and verify them for they may not to what you assume
 Never aspire to be the market’s master. It’s best to be its slave.
 Leverage your skills, not your capital
 Have a broad idea of direction. Remember, trend is your friend
 Don’t be afraid to make a mistake. Only ensure you make one that you can afford so that you may love to make another
 Play Seen’, not Blind’ for the market offers many opportunity even after the cards are open
 Know what and how much to risk. Assess risk
 Take a loss. The first loss is the best loss. Pyramid your profit
 Good judgment comes from experience. Experience comes from bad judgment. Trading can only be learnt, it can’t be taught

Ten Commandments for Investment
 Be an optimist: the necessary quality for investing success
 Expect a realistic return. Balance fear and greed
 Invest on broad parameters and the larger picture. Make it an act of wisdom, not intelligence
 Caveat emptor. Never forget this four letter word: R-l-S-K
 Be disciplined. Have a game plan
 Be flexible for investing is always in the realm of possibilities
 Contrarian investing: not a rule, not ruled out
 It’s important what you buy, it’s more important at what price you buy
 Have conviction, be patient. Your patience may be tested but your conviction will be rewarded
 Make exit an independent decision, not driven by profit or loss