Wednesday, October 4, 2017

Three (3) Mindsets For Exponential Growth

65% of startups failed due to founder and team issues.
  • Fear / Stress
  • Burnout / Depression
  • Time Starvation / Overwhelm
  • Co-Founder Conflict
  • Team Communication / Trust

There wrong mindsets and cultures.
  • Unhealthy relationship with anxiety (Control Junk)
  • Identification with the company (I am My Company, I am Game-Changer)
  • Self beat up (Take over Responsible of Failure)

Moving wrong mindsets to right mindsets help startup grows.

3 healthy mindsets and cultures for exponential growth:
  • Selfless Service (How am I being asked to serve today?)
  • Bigger than Me (I am simply a vessel to be of service. Don't mix your personality with your company. You can hire any CEO to run a company. Company Success x Your Success and Company Failures x Your Failures. It is just a separate component to learn.) 
  • Growth Mindset (Don't think failure is the end of the world. It's all about learning, growing, embracing challenger)

Book - Workplace by design


Space is an organization's second most valuable asset. Yet little attention is paid to how it supports the new ways in which today's organizations operate---teamwork, flattened hierarchies, telecommuting, collaborating across functions. Workplace by Design shows CEOs and managers alike how to put aside and rethink conventional, awkward notions of space utilization based on hierarchy and status--notions that pit people against each other in turf wars, tear apart teams, and tie up company cash. Using illustrative examples from Digital Equipment Corporation, Steelcase, and others, the authors show how team environments, non-territorial offices and other strategies can support business objectives, energize employees, and produce a more competitive organization.

A book in my bucket.

Wednesday, September 27, 2017

Create Java Project running on JBoss using Eclipse

Pre-requisition:
How to start JBoss Server using Eclipse

Create Java Project running on JBoss using Eclipse:
  1. Start Eclipse, and click “File > New > Other…”.
  2. Click “File > New > Other…”.
  3. Select “Web > Dynamic Web Project”, and click “Next”.
  4. Enter “HelloWorld” as Project Name, and click “Finish”.
  5. Create “index.html” in WebContent folder.
  6. Edit index.html and fill up.<p>HelloWorld!!!</p>.
  7. Right click index.html, select “Run As > 1 Run on Server” to preview.
  8. You can preview using this URL, http://localhost:8080/HelloWorld/index.html.

How to start JBoss Server using Eclipse

Software:
How to start JBoss Server using Eclipse:  
  1. Extract to D:\Program Files\jboss-5.1.0.GA
  2. Start Eclipse. 3. Click on “File > New > Other …”.
  3. Select “Server > Server”, and click “Next”.
  4. Select “JBoss > JBoss v5.0”, and click “Next”.
  5. Fill up below information and click “Finish”.
  6. Open “Server” view. Right click and select “Start”.
  7. Console will show server starting.
  8. Browse http://localhost:8080/, and you see JBoss Server started.
Others:
How to start JBoss Server using command line.
http://hiplab.mc.vanderbilt.edu/projects/soempi/jboss_startstop.html

Tuesday, July 4, 2017

24 Principles Running a Small Startup


  1. Properly advertise yourself. i.e.: Telling people what you do on your front page.
  2. Do not make your website looks corporate. People like to work with people, playful people, definitely not corporate. Probably put your happy photo at your website.
  3. Get money up front especially running consultancy firm. i.e.: Someone asks for a project and you quote them $15 per hour with an estimated 300 hours = $34,500. If they pay upfront, the rate is cheaper which is $100 x 300 hours = $30,000. Saving $4,500! This kinds of discount attract people to pay upfront. Another tip on running consultancy is always transparent by sharing timesheet with you customer.
  4. Always try to make a friend. i.e.: Small talk like where you from? Do you have any kids?
  5. Create core value for your team. i.e.: Practice Transparency, Pursue Excellence, Foster Education, Create Fun.
  6.  Be trustworthy, honest and humble.
  7. All business is based on systems.
  8. Hire a part-time project manager by delegate scheduling, reporting, meeting notes, clients arrangement to him.
  9. Hang out outside of work with your employee. i.e.: dinner together, having fun activities like team building.
  10. Hire people who fit your core values in point 5.
  11. Empower people. Don't try to manage your friend, as long as customer expectation meet is okay.
  12. Surround yourself with people you can hide or contractor.
  13. Join a support group. i.e.: business networking group or CEO group.
  14. Create a tradition. i.e.: whisky Wednesday, every Friday go lunch together.  
  15. Don't be afraid to apologize to your customers.
  16. It is okay to lose money on a transaction, just let your customer know about it. i.e.: Sending a client email. I just want to let you know that this task we estimate 10 hours, but it took us 20 hours. We told you only 10 hours, so we are going to bill you 10 hours. Sometimes, the customer just asks to the bill. Probably you can offer to split the cost.
  17. Seriously follow up. i.e.: Sending a short email to ask how thing going and anything can you help.
  18. Communicate with your customer more than your competitor. i.e.: 5 minutes on the new feature from your developer built.
  19. You can, but doesn't mean you should do it. Constantly look for things you can delegate.  
  20. Don't be afraid to take on more than you can handle.
  21. When a customer comes to you with a different job, you don't say - This is not what we do, we can't help you! Probably you can refer to other company and get reference fee. 
  22. Give more compliments. No body work well with criticize. This is a way you motivate people.
  23. Take a calculated risk. If your business is not moving, you might do something creative.
  24. Giving equity to co-founder or employee. A good book to read is "Slicing Pie" where it teach you calculating a theoretical value of your company, what do to when a founder leaves a company, how to handle equity when you have fire someone.

Create Scala Project using SBT and Jar using sbt-assembly


  1. Download and install SBT - http://www.scala-sbt.org/download.html
  2. Create SBT Scala Project by running this command - sbt new sbt/scala-seed.g8
  3. When prompted for the project name, type HelloWorld. This will create a new project under a directory named HelloWorld.
  4. Run the sample application by access HelloWorld folder, type sbt, compile and run.
  5. Add sbt-assembly as a dependency in project/assembly.sbt
    addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.5")
  6. Type assembly.
  7. Now you'll have an awesome new assembly task which will compile your project, run your tests, and then pack your class files and all your dependencies into a single JAR file: target/scala_X.X.X/projectname-assembly-X.X.X.jar.
  8. Type java -jar target/scala_X.X.X/projectname-assembly-X.X.X.jar to run the program.
References:

Wednesday, April 12, 2017

18 Important Notes To Be a Tech Founder

Why Tech Startup failed badly? Below are the 18 important notes to be a Tech Founder.
  1. You must be willing to wear multiple hat.
  2. Do one on ones, build borne with your employee.
  3. You can make money if you have an audience to your website, either by sponsorship or charging.
  4. Learn to be a Salesman. Follow up!!! Most of the developer just don’t know how to sell and market. This is related to point 1 – be willing to wear multiple hats. If you just can’t sell, find a co-founder might be a solution.
  5. Just because you would use and pay for a product, it doesn’t anyone else will. Customer validation is very important.
  6. Most businesses are built at networking groups. Join those meeting group if you want to be effective, you make friends, collecting business card and helping people.
  7. You can always find freelance or contractor to build your software.
  8. Writing is 50% writing, 50% self-promotion. Basically, you can request a blogger to link your page to your article. i.e. I like your blog. Your blog helps me up so much and thank you for doing. By the way, I just put up a blog post on XXX and I would like to get your feedback and link up if there anyway you can help us promote it. That’s will be awesome.
  9. You don’t have to give someone equity unless they want it. As a born developer, when you find someone can work well together, you tend to offer a partnership. Actually, you could hire him an employee and give a great bonus when the company grow. Giving equity might not give you problem now, might be later.
  10. Pay professionals when its matter. i.e. hire a designer if you are not with it.
  11. Provide value to others and it will come back to you.
  12. Consulting is a good way to build a company.
  13. Hire slow, fire fast. Spend time in the hiring process. i.e. invite the candidate to work together in a week. If you see he is no good fix, try to get them out as soon as possible.
  14. Don’t over engineer. i.e. build your own billing system.
  15. Spam – It works. The mailing list is really valuable.
  16. Over-deliver to your customer by giving them extra feature that they need it.
  17. Advertise about each new feature.
  18. Don’t be afraid of giving away. i.e. free weekend access by code school.

Thursday, January 19, 2017

JavaScript: Module Pattern with Anonymous Closure

Most developers create module JavaScript only with Public properties.
var ARMORY = {
  weaponList : [ * List of weapon object * ],
  removeWeapon : function(...){},
  replaceWeapon : function(...){},
  makeArmorRequest : function(...){}
};
Above module has a bunch of public variables and methods which can still be accessed by any code that know the name of the space and its properties.

What if we wanted some stuff to be accessible only to the module? Some privacy? This can be easily accomplished by wrap the entire set of properties in an anonymous immediately invoked function expression (IIFE).
var ARMORY = (function(){

  // Private
  var weaponList = [ * List of weapon object * ];
  var removeWeapon = function(...){};
  var replaceWeapon = function(...){};

  // Public
  return{
    makeArmorRequest: function(...){}
  }

})();
With IIFE, you can only have a single instance and you can call the instance without New. E.g.:
ARMORY.makeArmorRequest();

JavaScript: Ternary Conditional

Some simple conditionals take a lot of code to choose on assignment.
let isAuthor = false;
let weapon;

if (isAuthor) {
  weapon = "Exalibur";
} else {
  weapon = "Longsword";
};
Let's use a syntax trick to make this more concise!

The ternary conditional provides a shortcut over lengthier conditional blocks. Ternary conditional syntax:
someCondition ? pickThisIfTrue : pickThisIfFalse ;
Let's turn our lengthy conditional example to ternary conditional.
let isAuthur = false;
let weapon = isAuthor ? "Exalibur" : "Longsword";

JavaScript: Loop Optimazation

Here are the common For loop scenario.
let data = {name:["Simon", "Alvin", "Sharmal"]};

for(let i=0; i<data.name.length; i++){
  console.log(data,name[i]);
};
This is not  the best way because, at the start of each potential loop cycle, the program will need to find and retrieve:
  1. the value of i
  2. the data object
  3. the name property
  4. the array pointed by the property
  5. the length property of the array
We can use "caches values" to curtail lengthy, repetitive access to the same data.
let data = {name:["Simon", "Alvin", "Sharmal"]};

for(let i=0, x= data.name.length; i<x; i++){
  console.log(data,name[i]);
};
Memory access during loop control now only needs to:
  1. retrieve the value of i
  2. retrieve the value of x

JavaScript: Short Performance Tips

1. Use a document fragment to insert additional all at once.
  • Each new addition to the DOM causes document "reflow", which can really hinder user experience.
  • Fragments are invisible containers that hold multiple DOM elements without a node.

Bad Performance
let list = document.getElementById("kotwList");
let kotw = ["Simon","Alvin","Melvin","Shelman"];
for(let i=0, x=kotw.length; i < x; i++){
  var element=document.createElement("li");
  element.appendChild(document.createTextNode(kotw[i]));
  list.appendChild(element);
}

Good Performance
let list = document.getElementById("kotwList");
let kotw = ["Simon","Alvin","Melvin","Shelman"];
let fragment = document.createDocumentFragment();

for(let i=0, x=kotw.length; i < x; i++){
  var element=document.createElement("li");
  element.appendChild(document.createTextNode(kotw[i]));
  fragment.appendChild(element);
}

list.appendChild(fragment); // Only one DOM touch.

2. Declare variable as few times as possible. 
  • Every var keyword adds a lookup for the JavaScript parses that can be avoided with common extension.

Bad Performance
var name;
var age;
var birthday;

Good Performance
var, name, age, birthday;

Wednesday, January 18, 2017

JavaScript: Measuring Performance

You can test the speed of your code using console.time([label]) and console.timeEnd([label]).

Example:
console.time("SpendTest");
for(let i=0; i<100; i++){
  console.log(i);
};
console.timeEnd("SpendTest");