S.O.L.I.D Principles
Filed Under (Development, Programming) by fakhrul on 28-05-2009
What is S.O.L.I.D?
It is a collection of best practice, object oriented design principles which can be applied to your code.
S – SRP (Single Responsibility Principle)
There should never be more than one reason for a class to change.
O – OCP (Open Close Principle)
Software entities (Classes, Modules, Functions, etc.) should be open for extension but closed for modification.
L – LSP (Liskov Substitution Principle)
Functions that use… references to base classes must be able to use objects of derived classes without knowing it.
I – ISP (Interface Segregation Principle)
Clients should not be forced to depend upon interfaces that they do not use.
D – DIP (Dependency Inversion Principle)
High level modules should not depend upon low level modules. Both should depend upon abstraction.
2 ways to copy an image from Microsoft Word
Filed Under (Blog) by fakhrul on 23-05-2009
1. Copy and paste to the paint editor’s software.
pros: fast to execute.
cons: image quality will drop.
2. Save the document as html and then get the image in the html folder.
pros: slow to execute.
cons: image quality will remain.
Fixed Mindset vs. Growth Mindset
Filed Under (Blog) by fakhrul on 23-05-2009
Fixed Mindset –Intelligence is static
Leads to a desire to look smart and therefore a tendency to
- Avoid challenges
- Give up easily
- See effort as fruitless or worse
- Ignore useful negative feedback
- Feel threatened by the success of others
As a result, they may plateau early and achieve less than their full potential.
All this confirms a deterministic view of the world.
Growth Mindset – Intelligence can be developed
Leads to a desire to learn and therefore a tendency to
- Embrace challenges
- Persist in the face of setbacks
- See effort as the path to mastery
- Learn from criticism
- Find lessons and inspiration in the success of others
As a result, they reach ever-higher levels of achievement.
All this gives them a greater sense of free will.
Resource:
1. http://michaelgr.com/2007/04/15/fixed-mindset-vs-growth-mindset-which-one-are-you/
2. http://missbakersbiologyclass.com/blog/2008/03/06/the-curse-of-the-smart-student
How to protect your software?
Filed Under (Blog, Development, Programming) by fakhrul on 21-05-2009
During dinner last night, my colleagues and me had discussing about the software protection and licensing. We want to create a license for our application so that we can charge our customer per license. The question is, how can we do that?
There are several options that had been highlight last night.
1. Using a dongle. It is a hardware that can be plug into the usb port. Anybody want to use the software must plug in the dongle.
2. For a web base application, we can limit how many user can login in one time. Track the active user session. If over limit, block the access.
3. Encrypted the password for those who can use the systems.
After googling, I had found out some other interesting point on how to protect the software.
Basically, there are 2 common ways to protect the software (for executable file)
1. Using 3rd party software.
2. Build your own protection in your code.
Using 3rd party software.
There are a lot of 3rd party software that we can use to protect our software. The utilities may include the licensing and obfuscator. Below is some of the tools
1. Intellilock - A lot of developers in the internet had recommended this tools.
2. Solo Server
3. Microsoft Licensing – One of developer said that “It is crazy expensive for small business”
4. Microsoft Shareware Starter kit
5. Aspack
Build your own protection in your code.
Below are some of common ways on how to do a protection in your own code.
1. Hardware protection
Using hardware mechanism such as Dongle. Dongle can be use as a key to start the software. Your software will be sell together with the dongle. So the licensing is base on how many dongle. To run the software, the verification thru dongle need to be done first.
pros: The software can use anywhere if you have a dongle.
cons: Hardware cost + development time.
2. Online registration/verification code. Verify through online once.
pros: Cheap
cons: Need an internet connection.
3. Encrypted key that holds portion of program algorithm. (can’t just skip over the check)
Common way to do the encryption key is using a public-private key.
- - To generate the key, we can base on Processor Id or Hard disk Id or MAC address.
- - You can also put the expire date, and other extended data in your key. Encrypt it with MD5 or others algorithm so that customer cannot simply read and change the expiry date.
pros: Cheap
cons: Extra development time
4. Controlling your expiry date base on when it build.
If you are hosting your homepage on a server that you control, you could have the downloadable trial-version of your software automatically compile to a new binary every night. This compile will replace a hardcoded datetime-value in your program for when the software expires.
pros: Easy
cons: User can cheat by changing the date on you computer but most people won’t do that.
First time using Live Writer, and it is great
Filed Under (Blog) by fakhrul on 15-05-2009
It is a free tool from Microsoft that help me to write a blog without opening the internet browser. Normally, when I want to create a new post, I will open the internet browser, login, create new post and then start writing… Later do some content indent, then save it. Check the grammar and spelling.. add some picture.. etc.. That’s lot of thing to do. And it is not suitable to do all the thing in the internet browser.
Later, I had figured out the Live Writer. And it make my life easier. I can write a post in the Live Writer. Then send it to my wordpress blog.
There are a lot of feature and you should give a try. It is very lightweight application.
For more information, visit here windowslivewriter
A funny workaholic clip
Filed Under (Blog, Fun) by fakhrul on 01-05-2009
I think, every worker want to be like this guy.. haha













