Friday, September 2, 2016

Product Design, how to start-up

Start ups are risky and costly business, it’s always wise to validate early on, build only what you need, and not more. And iterate as fast as you can.

Yunha Kim

  • After all, it’s not like you can choose whether to be a female CEO vs male CEO. But you can choose your attitude toward it.
  • I tend to be very aggressive. When I want to get things done, I’ll get them done. I tend to be impatient. But it helps me get stuff done.
  • We get gratification from seeing or building stuff in our hand.
  • This one idea that I have needs to be exectued perfectly and you succeed, otherwise a failure.
  • It’s my idea, my dream, I need to make it happen. If you consider as like, these are some of the ideas that we’ll try, if they fail, that’s okay, we’ll move on. At the end of the day, the worst thing happened to us is that we failed and we don’t know exactly why we fail.
  • knowing exactly why I failed is one of the learning that will help us go to the next.
  • The worst thing is to fail slowly and painfully over years.
  • failure is not the opposite of success, it’s a stepping stone to success.
  • learning and failing quickly, and never making the same mistake twice.
  • We fail? But screw your courage to the sticking post, and we’ll not fail.

Idea types

  • Simplify
  • Me too
  • Virtualize
  • Remix
  • Mission Impossible
The best problems to address are those that you have personal experiences with. Your commitment to finding a solution will be that much stronger and it will be the one thing that keeps you going through the crazy hights and the crazy lows of building a company.

Aaron Harris, founder of YCombinator

We are looking for founders who
  1. seems really great and formidable, so they can execute
  2. idea with chance of being a large business

best ideas

ideas across different industries https://www.ycombinator.com/rfs/
The very best startup ideas tend to have three things in common:
they’re something the founders themselves want,
that they themselves can build, and that
few others realize are worth doing. Microsoft, Apple, Yahoo, Google, and Facebook all began this way.
Why do so many founders build things no one wants?
Because they don’t use it themselves, they imagine other people wanting it.
it sounds plausible enough to fool you into working on them.
Paul Buchhei
Live in the future, then build what’s missing
If you’re not at the leading edge of some rapidly changing field, you can get to one. For example, anyone reasonably smart can probably get to an edge of programming (e.g. building mobile apps) in a year. Since a successful startup will consume at least 3-5 years of your life, a year’s preparation would be a reasonable investment.
Knowing how to hack also means that when you have ideas, you’ll be able to implement them. That’s not absolutely necessary (Jeff Bezos couldn’t) but it’s an advantage. It’s a big advantage, when you’re considering an idea like putting a college facebook online, if instead of merely thinking “That’s an interesting idea,” you can think instead “That’s an interesting idea. I’ll try building an initial version tonight.” It’s even better when you’re both a programmer and the target user, because then the cycle of generating new versions and testing them on users can happen inside one head.

Ted Talks

Nir Eyal: vitamin vs painkiller

Thursday, September 1, 2016

Derek Sivers; try everything in 12 years

Derek Siver

Making a company is a great way to improve the world while improving yourself. When you make a company, you make a utopia. It’s where you design your perfect world.

Why you need to fail?

when you’re green, you grow.
when you’re ripe, you rot.
No pain, no gain. (works for muscles and also brain)
  1. learning
  • to learn effectively, make mistakes and pay attention to these mistakes.
  • Making mistakes teach better than advanced preparation.
  • Doing what you know is fun, but doesn’t improve you.
  • Doing perfect in a practice room is not practicing
  1. growth mindset vs fixed minset
  • talent is from work vs innate
  • Anyone can master anything* vs you are great, or you aren’t.
  • The fixed mindset hurts you.
  • Mindset can be easily changed. (praise their effort/work not their talent)
  • You shouldn’t compare your inside with other’s outside, because we see our mistakes ourselves, but we only see other’s final product
  1. experiment
if you’re not failing, you are not trying hard enough.

books

  • mindset
  • the art of learning
  • the talent code
  • latent is overrated

weird, or just different?

Whatever true thing you can say about India, the opposite is also true.

Say no more often so you can embrace what you really love

Start now. No funding needed.

Keep your goals to yourself

Telling someone your goals makes them less likely to happen.
because someone acknowledge you that makes your mind tricked into feeling that it’s already done. You feel satisfactory. You’re less motivated to do the actual hard work necessary.

Derek Sivers speech to Berklee Colege of Music

6 things I wished I knew first day in Berklee
  1. Focus. Disconnect. Do not be distracted.
    you are surrounded by distraction. You are surrounded by cool casual people, telling you to be relax.
    My successful classmates are fiercely focus, determined and undistractable.
    While you are here, president will change, the world will change. Media will try to convice you these are important. But they are not.
  2. Do not accept their speed limit.
    I learn stuff in several weeks instead of sitting for a whole semester
    I graduated in 2.5 years.
  3. Nobody teach you anything. you have to teach youself.
  4. Learn from you heros, not only theirs.
  5. Don’t get stuck in the past. innovation is more important than imitation
  6. When done, be valuable.
    never underestimate the importance of making money in making music.
    Money is nothing more than a neutral proof that you are adding value in people’s life.
    Be one of the few know how to help yourself, instead of expecting others to do it for you.

Derek Sivers at TEDxTaipei 2012

life is ..

choice.

  • learn to ignoure logic and trust emotion
  • emotional brain stores instincts, fears and gut feelings
  • trust gut-feeling on something is usualy correct than when they tyr ot over-think it and use thier 5-dollar caclulator brains
  • if you learn to understand this feeling and saying this is good enoug and I’m happy with this. You actually make better choices and you feel better about it.
  • more choices is not always better. we are actually happier when we let other people make some choices for us, like see a doctor, follow religous rules, being told what to do
  • important vs urgent

time

  • how to use wisely? Always remember it’s limited
  • mostly future focused, somewhat present focus, somewhat past focus
  • state of flow, loving their work

memory

  • make more memory: to not get stuck in the routine too much, to do what’s novel, to do the risky thing, move to a new country, learn a new language, do ridiculous things

happiness

  • approach it side ways
  • ask yourself too much, how can I be happy? you’re going to be miserable

no meaning

  • I project all the meanings into it.
  • no inherit meaning
  • remove whatever meaning that holds you back
  • humans are 75% of water, I think humans are also 99% unused potential.
  • The thing holding you back from where you are to where you want to be, is always in your head. It’s usual because you put meaning on something that isn’t there.
  • If you learned that life has no meaning, then you can do whatever you want.

uncommon sense

2 why are you doing

Deathbed regret:
pursued something that someone convinced you should want, instead of what works for you.
what do you want? No matter what you choose, go for it.
  • money
    refuse fame, others in spotlight, just watch numbers
  • prestige
  • fame
  • leave a legacy
    like Trump, put your name on everything, make less money
  • freedom
    refuse responsibility, delegate everything,
    DIY = Decide it Yourself, but not Do.
key point is know, focus, don’t diffuse your energy to everything
Compass. Optimise.
know your goal

3 Nobody knows the future

4 Evolution

Love != Romeo & Juliet
Revolution!= War & Blood
Revolution = simply serving people better= uncommon sense

5 If not a hit, switch

12 years trying everything
If people aren’t loving what you’re doing, Stop!
Don’t persist. Don’t push it.
Warren Buffett
WE don’t swing unless it’s a clear home run.
Success comes from persistently improving and inventing,
not persistently pushing what’s not working

6 version 0.1

version 0.1 is what you can do right now, today, no programming, get real feedback.
If you’re not launching too soon, you’re launching too late. No perpect time

7 idea* Execution

I don’t want to hear ideas. I want to see the execution.

8 why CD baby is so successful

People remember you more for the little ways you make them smile, than all the business-school stuff you do.
So unusual (remarkable) that everyone tells their friends.
Can be shockingly unique.

Adam Grant: the surprising habits of original thinkers

late to the party

  • “ I have my most creative ideas when I’m procrastinating “
  • they are quick to start but slow to finish.
  • Failiure rate: First mover 47% vs improver 8%
  • It’s much easier to improve on somebody else’s idea than it its ot create something new from scratch. To be original, you don’t have to be first

feel doubt and fear

  • browser. who takes the initative to doubt the default and look for a better option
  • when you feel doubt, don’t let it go.
  • they’re afraid of failing, but they’re even more afraid of failing to try.
  • In the long run, our biggest regrets are not our actions, but our inaction.
  • It’s too important not to try.

have lots of bad ideas

  • They are not judged by their bad ideas
  • the greatest originals are the ones who fail the most, because they’re the ones who try the most

Tuesday, August 30, 2016

Data Analysis with R

Take-home thought

I only learned R for about 12 hours and finished half of this Udactiy course. I get a quick feeling of what R really is.
For me, R is very similar to Matlab, but more focus and highly specialized on data visualization. The console is very powerful, you can install package in console, like a terminal.
R has many built-in functions specialized for statistics. So it is very handy to get values like median, mean, correlation, deviation.
RStudio is a very nice IDE. It allows Rmd, similar to ipython notebook.
However, the syntax of R is highly specialized for certain drawing. And there are some syntax changes for ggplot2. I could pick up these details quickly later if I have to.

basics

constructs

concepts difficult to define and measure:
  • Memory
  • Happiness
  • Guilt
  • Love

operational definition

anger: number of profanities uttered per min
happiness: ratio of minutes spent smiling to minutes not smiling

what’s EDA

Initial data analysis
check assumptions required for model fitting and hypothesis testing and handling missing values and making transformation of variables.
Exploratory data analysis
summarize their main characteristics, generate better hypothesis, determine which variables have the most predictive power, and select appropriate Statistical tools
Develop a mindset of curious and skeptical.
install Studio: https://www.rstudio.com/
Swirl (statistics with interactive R learning). Swirl is a software package for the R statistical programming language. Its purpose is to teach statistics and R commands interactively.
Type the following commands in the Console, pressing Enter or Return after each line:
install.packages("swirl")
library(swirl)
swirl()

package

textcat
ggplot2

learning sources

basic command

ctrl+ L: clear the console
students <- c(“John”,”Kate”) # assignment, vector, 1-based, chr instead of string
numbers <- c(1:10)
numberOfChar = nchar(students)
data(mtcars) # load built-in data mtcars
names(mtcars)
str(mtcars)
dim(mtcars)
getwd()
setwd(“/Users/yuchaojiang/Downloads/EDA_Course_Materials/lesson2”)
statesInfo <- read.csv(“stateData.csv”)
stateSubset <-subset(statesInfo, state.region==1)
stateSubset <- statesInfo[statesInfo$state.region==1,] # equavilent method
head(stateSubset,2)
dim(stateSubset)

ggplot2

install.packages(‘ggplot2’, dep = TRUE)
Sean Taylor
Good data science comes from good questions, not from fancy techniques, or having the right data. It comes from motivating your research with an idea that you care about, and that you think other people will care about.
Gene Wilder
“Success is a terrible thing and a wonderful thing… Just do what you love.”
John Turkey
An ==approximate answer to the right problem== is worth a good deal more than the exact answer to an approximate problem

data wrangling

tidyr
dplyr

pseudo_facebook

setwd("/Users/yuchaojiang/Downloads/EDA_Course_Materials/lesson3")

pf <- read.csv("pseudo_facebook.tsv", sep = '\t')
names(pf)
library(ggplot2)
qplot(x =dob_day, data = pf) +
  scale_x_continuous(breaks=1:31)

ggplot(data = pf, aes(x = dob_day)) + 
  geom_histogram(binwidth = 1) + 
  scale_x_continuous(breaks = 1:31) + 
  facet_wrap(~dob_month)

qplot(x=friend_count,data=pf, xlim=c(0,1000))

qplot(x = friend_count, data = pf, binwidth = 25) + 
  scale_x_continuous(limits = c(0, 1000), breaks = seq(0, 1000, 50))

ggplot(aes(x = friend_count), data = subset(pf, !is.na(gender))) + 
  geom_histogram() + 
  scale_x_continuous(limits = c(0, 1000), breaks = seq(0, 1000, 50)) + 
  facet_wrap(~gender)

table(pf$gender)
by(pf$friend_count,pf$gender,summary)

qplot(x=tenure/365, data = pf, binwidth = .25, 
      color = I("black"),fill = I('#F79420'))+
  scale_x_continuous(breaks=seq(1,7,1),limits=c(0,7))+
  xlab('Number of years using Facebook') + 
  ylab('Number of users in sample')

qplot(x=age, data = pf, binwidth = 1, 
      color = I("black"),fill = I('#F79420'))

summary(pf$age)

# lesson 4
qplot(age, friend_count,data=pf)

ggplot(aes(x=age, y=friend_count),data=pf)+
  geom_jitter(alpha=1/20)+
  xlim(13,90)

install.packages('dplyr')
library(dplyr)
age_groups <- group_by(pf,age)
pf.fc_by_age <-summarise(age_groups,
            friend_count_mean= mean (friend_count),
            friend_count_median= median(friend_count),
            n=n())
head(pf.fc_by_age)

ggplot(aes(x=age, y=friend_count),data=pf)+
  xlim(13,90)+
  geom_point(alpha=0.05,
             position= position_jitter(h=0),
             color= 'orange')+
  coord_trans(y='sqrt')+
  geom_line(stat='summary', fun.y=mean)+
  geom_line(stat='summary',fun.y=quantile,fun.args=list(probs= 0.1),linetype=2,color='blue')+
  geom_line(stat='summary',fun.y=quantile,fun.args=list(probs= 0.5),linetype=2,color='red')+
  geom_line(stat='summary',fun.y=quantile,fun.args=list(probs= 0.9),linetype=2,color='black')

cor.test(pf$age,pf$friend_count,method="pearson")

with(subset(pf,age<=70),cor.test(age,friend_count,method="pearson"))

with(subset(pf,age<=70),cor.test(age,friend_count,method="spearman"))

Monday, August 22, 2016

Introduction to Java programming

learning source

two types of error

compiler-time error: syntax error
run-time error: logic error

algorithms

  1. unambiguous
  2. executable
  3. terminating

methods

  1. accessor ( don’t change property)
  2. mutator

object

you ask object to do work. you don’t know how they do that
what, not how
comment //

documentation and api

stringObject.replace(char target, char replacement)
import java.awt.Graphics2D;
import java.awt.geom.Rectangle2D;

code mold

public class XX
{
  public static void main(String args[])
  {
    System.out.println();
  }
}

public interface

public void addFriend(Person friend)
public void unFriend(Person nonfriend)
public String getFriend()

Variables

Instance variables (non-static variables)
Class variables( Static variables)
Local variables

example

/**
   A simulated car that consumes gas as it drives.
*/
public class Car
{
    private double milesDriven;
    private double gasInTank;
    private double milesPerGallon;


    /**
       Constructs a car with a given fuel efficiency.
    */
    public Car(double mpg)
    {
        milesDriven = 0;
        gasInTank = 0;
        milesPerGallon = mpg;
    }


    /**
      add gas to the Tank of car
      @param amount the amount of gas added into the Tank
    */

    public void addGas(double amount)
    {
        gasInTank = gasInTank + amount;
    }

    /**
      Gets the current amount of gas in the tank of this car.
      @return the current gas level
    */
    public double getGasInTank()
    {
        return gasInTank;
    }

    /**
      Drives this car by a given distance.
      @param distance the distance to drive
    */
    public void drive(double distance)
    {
        this.milesDriven = this.milesDriven + distance;
        double gasConsumed = distance / this.milesPerGallon;
        this.gasInTank = this.gasInTank - gasConsumed;
    }  

    /**
      Gets the current mileage of this car.
      @return the total number of miles driven
    */
    public double getMilesDriven()
    {
        return milesDriven;
    }
}
public class Friend
  {
  private String name;
  private String friends;
  public void addFriend(Person friend)
  public void unFriend(Person nonfriend)
  public String getFriend()
  }

fundamental data type

overflow
doubles are fuzzy
cast: (int)(3.35)
grayscale: Y=0.2126R+0.7152G+0.0722*B
sunset effect: +25
final int MAX_RED=255;
System.out.printf(“%8.2f\n”, price); // 8 character, 2 decimal points, float type

import java.util.Scanner;

Scanner in= new Scanner(System.in);
int age= in. nextInt();

java.lang.Math

Math.pow(a, n);
Math.sqrt(100);
Math.max(a,b);

decision

if ()
  {}
else if()
  {}
else
  {}
public static int SECONDS_PER_MINUTE=60;
final int SECONDS_PER_MINUTE=60;

they are never exactly the same

String.equal(); // not ==
final double EPSILON=1e-12;
Math.abs(x-y)<EPSILON; // not ==

loop

for (int i=1;i<=6;i++){} // i is local variable
for (int value:values){} // values is an array

Debugger

  1. break point
  2. single step
  3. inspect variables

ArrayList vs Array

ArrayList values= new ArrayList();
method: get(), set(),add()
double[] values=new double[10];
double[] values={32,54,67.5,29,35};

create a package

Basically, there are two ways:
  1. use package statement in the first line in the source file,then
    javac -d . file_name.java
  2. use javac -d Destination_folder file_name.java
To use the classes in a package:
import Destination_folder.*
import java.util.
​ Scanner, ArrayList, Arrays, Random

Interface

public interface Drawable
{
  void draw();  // automatically pubic, no implementation
}
public class house implements Drawable