Information as Deck of Cards

by Yang Yang on August 5, 2016

Found this site when searching for answer to some git issues. It turns out to be a very nice way to teach stuff, simple and efficient:

A guide like this should be as easy to write as it is easy to learn from.

The key here is to associate problem / question / issue with a straightforward solution / answer in a very simple manner. Talk is expensive. We should talk as less as possible.

Deprive of any words that your tutorial or guide can live without but leave only those that are vital to the actual solution / answer.

A full tutorial or guide should be comprised of a list or a network of standalone articles that are simple yet powerful in addressing 1 – 3 problems each. They are more like a deck of cards wired together linearly or hierarchically that the readers can search or navigate back and forth.

Each article / card should be no more than 2 minutes of reading. This helps establish learning milestones for the readers thus keep them motivated to continue because each learning session is easy to finish and apply.


Post image for Beyond Snowden: How Government Corrupts Business

Beyond Snowden: How Government Corrupts Business

by Sam Peters on July 9, 2016

It seems we have been living with the Snowden revelations forever. But in truth, he has only been a household name since mid-2013. There was so much news released that it quickly became information overload. There was too much information to fully process any one piece of it. The takeaways from the information dumps can be summed up in the following manner:

  • The government is spying on its own people
  • Everything you do on your cell phone is being monitored in some way
  • Private businesses are colluding with the government to erode your civil liberties

Everyone kind of suspected the government was spying on them. And they knew that cellphone data could be monitored. But they were surprised and offended that the companies with which they were doing business were actively selling them out.

The level to which the government has subverted private industry is still news. The more we learn about what the government is doing in the name of security, the less security we feel like we have. Here are two examples:

The Government Compromises Your Protection

Never mind China and Russia. One of the biggest malware threats U.S. citizens face is from the U.S. government. For years, we’ve known that various governmental agencies attend black hat conferences. We also know that they hire some of the best hackers. Now we know what they are doing with all of that black hat talent. They are making and releasing malware. While we know about some of the malware offensives against other governments, there is no reason to believe that some of that malware isn’t used against U.S. citizens.

For these reasons, the government wants your computer to be as insecure as possible. Spiking the security punch your computer is drinking is one of the ways they can lull you into believing that you are secure when you really are not.

When your system is breached, sometimes the only thing you can do is wipe all the data and make a clean start. Before you can do that, you need to be sure to have a secure backup of your data. That means you will have to have some type of data loss prevention plan for such an eventuality. A plan is necessary due to risk factors such as:

  • Rapidly evolving compliance regulations and mandates
  • Continued growth of workforce mobility
  • Employees using their own mobile devices and consumer apps for work
  • Rising frequency of advanced persistent threats (APTs) and data breach incidents

The Government Causes Businesses to Compromise Core Values

Blackberry is in the news again, and it is not good for Blackberry fans. Blackberry CEO, John Chen, speaks on the great encryption debate and where BlackBerry stands on it all. What he is saying is proving worrisome to many longtime Blackberry fans.

Blackberry still has a lot of government contracts. And Blackberry’s only stronghold is mobile security. The conflict of interest becomes apparent when one hears what every branch of the government in almost every country is saying. Right now, especially in the U.S., there is a war on strong encryption on consumer devices. The government is demanding backdoors, and wants access to consumer communications upon request.

For his part, Apple’s Tim Cook has drawn a hard line when it comes to cooperating with such requests. He has publicly stated that Apple cannot comply with such requests because they have engineered its solutions so that Apple holds no keys, and cannot comply with such requests. They are in the business of privacy.

On the other hand, Blackberry’s John Chen is promising cooperation. He is not promising a backdoor. But he is taking a pro-government stance which seems geared toward protecting existing ties with government entities. Blackberry is not necessarily doing anything wrong. But it is a strange day when a consumer company defies the government in the name of security, while the security company defies security in the name of the government.

We have seen some disturbing examples of how the government is becoming more emboldened when it comes to pressuring businesses to serve as an unofficial branch of the state. As a consumer, your best protection is to use products that have a proven track record of consumer protection and strong encryption, and keep a good set of backups just in case.


It’s been quite a while since my last post on Kavoir. Lots of things have changed since then except people’s desire to make even more money from the ever-exploding Internet market. It’s such a vibrant economy that new opportunities and game changers are emerging and shaping themselves everywhere everyday.

As a millionaire after 8 years of hard (but not so smart) work, my next goal is to be a billionaire.

To achieve such an ambitious goal, I have to walk out of my comfort zone. I have to transform myself to someone completely different that I’ve never dreamed of myself as.

The first thing I’m going to do is to share ANYTHING and EVERYTHING I do with my websites to my readers. I’ll keep nothing to myself. So you adventure and evolve with me in this unexplored path and witness my rise or fall.

I want to keep journals as frequently as I can recording my journey to this goal. As a starter, my first venture is to promote my dresses store to a monthly sales volume of $100,000 from $9,000 before end of 2017.

About $9,000 per month as of Apr. 2016

Tune in and bear with me.

{ Comments on this entry are closed }

How does Elon Musk study?

by Yang Yang on December 13, 2014

Elon Musk
Elon Musk: Tesla, SpaceX, and the Quest for a Fantastic Future

Someone asked this question on Quora. I wrote an answer.

How does Elon Musk study?

People tend to overstate their feelings about somebody. They are usually not as good as we say they are nor as bad as we say they are.

Elon is smart but he’s not so much so unless he has a world-class team backing him up. And that takes money, which comes from his risk-taking business endeavors rather than his ability to study effectively, albeit it definitely adds up.

But still. It’s not about how fast / effective you study but about knowing exactly what to study against a very specific problem or well defined goal.

Elon has a definitive goal that he wants to achieve. This is what distinguishes him from others. Most study for the sake of knowledge, while he studies to solve problems.

This is the reason why it seems he’s more effectively in studying because he solves more problems than we do with the same amount of study.

80% of knowledge and techniques are cool but useless. Elon only spends time for the other 20% that are actually helpful in achieving his goals.

He does the right study in the right amount just enough at the right time just when the problem arises. Anything more is a waste.

Another reason I think why Elon studies well is he smartly modularizes his ultimate goal in smaller milestones that are easier to achieve one by one. Through consistent positive feedback, he has been able to stay motivated all the way, which is another boost to his study efficiency.

{ Comments on this entry are closed }

How to train myself to sleep less?

by Yang Yang on November 19, 2014

Someone asked a question:

I have been trying to reduce how long I sleep so that I have more waking hours available. I have read this question, and this one but it does not really give an answer.

My question is whether I can train my body to sleep less. I currently have about 6.5 to 7 hours sleep per night. If I reduce that to 6 hours every night for the next two months, and then down to 5.5 hours then onward, will my body get adjusted to the new sleep pattern?

When I was 22 and just graduated from college I had the same idea as you do now. As a workaholic who’s passionate about his work (software development) and very determined about his goal, I would keep working until late night and get up very early. The average sleep I got was about 5 hours per day, EVERYDAY, for 5 years, even on weekends. There’s always so much that I could do to make my projects better thus making more money.

For the first few years it was all good and rewarding because I was young and I had the power and energy to keep it going, even on very stressful times. But eventually I started noticing changes with regards to my body:

  1. I started going to doctors more often than my peers.
  2. My vision started to deteriorate, albeit slightly.
  3. I started losing hair.
  4. I started to forget stuff which shouldn’t be an issue before.
  5. Last but the most important, when you sleep less for very long time, eventually you’ll actually sleep less because it takes longer for you to fall asleep and you easily wake up.

So for a short answer, yes you can train your body to sleep less, but do make sure it’s not very long as to years so you can easily recover. It may not be obvious but sleeping less than you body needs DOES undermine your health. However the amount of sleep everybody needs may vary because we are designed differently in genes.

For a long answer, no, sleeping less wouldn’t let you get more things done in the long term. Everything has a price. It’s actually against productivity rather than for it. When I look back how I went through these years in retrospect, I could have not pushed myself that hard but still accomplish the same results. Productivity is about getting the most out of time rather than getting the most time. Lots of people have got plenty of time in their life, even more than they need, still they blow it. In fact, when I was in college, some of the top performing students actually sleep more than the average.

So sleep as much as you want. Time enjoyed is NOT wasted. Sleep is beautiful. Don’t waste it for some stupid things that you need done!

The Road goes ever on and on
Out from the door where it began.
Now far ahead the Road has gone,
Let others follow it who can!
Let them a journey new begin,
But I at last with weary feet
Will turn towards the lighted inn,
My evening-rest and sleep to meet.

–The Return of the King, Book VI, Chapter 6

{ Comments on this entry are closed }

The Rise of Web Bots

by Yang Yang on November 1, 2014

Just gave a read to this article:

Very intriguing.

The Internet is developing just like how the other industries are. Traditional industries try to make products out of the raw materials provided by nature, while Internet is trying to reach targeted information / answers by organizing raw data everywhere. That’s exactly what Google and their bots are doing. People prefer data / information that’s more consumable (quick and easily understood) than raw ones. In this sense, companies who organize and present data / information better than the others would have the consumers’ favor; on the other hand, companies that provide only raw data will be hit more by bots (middle men in the supply chain) and less and less by humans (end consumers).

  • Raw data => structured data => raw information => targeted information
  • Iron ore => refined steel => vehicle framework => Tesla Model S

The more usable, the higher in the supply chain, the more end consumers they get.

This is probably a good starting point for business endeavors. While we can’t beat Google but there are many specific niches that we can probably do better than them. On the Internet, money is about organizing and refining data / information.

Go ahead and organize data so you get something new and easier to understand, and you will make money.

{ Comments on this entry are closed }

In addition to necessary indexes and proper SELECT queries (only select needed columns), for wide tables, 2 basic tips apply well:

  1. Define your column as small as possible.
  2. Avoid using dynamic columns such as VARCHAR or TEXT as much as possible when you have large number of columns per table. Try using fixed length columns such as CHAR. This is to trade off disk storage for performance.

For instance, for columns ‘name’, ‘gender’, ‘age’, ‘bio’ in ‘person’ table with as many as 100 or even more columns, to maximize performance, they are best to be defined as:

  1. name – CHAR(70)
  2. gender – TINYINT(1)
  3. age – TINYINT(2)
  4. bio – TEXT

The idea is to define columns as small as possible and in fixed length where reasonably possible. Dynamic columns should be to the end of the table structure so fixed length columns ALL come before them. MySQL would then have a better time predicting the position of a column to perform select or update, otherwise it would have to read through the entire row byte by byte to find it.

It goes without saying this would introduce tremendous disk storage wasted with large amount of rows, but as you want performance I guess that would be the cost.

Another tip is as you go along you would find columns that are much more frequently used (selected or updated) than the others, you should separate them into another table to form a one to one relationship to the other table that contains infrequent used columns and perform queries with less columns involved.

{ Comments on this entry are closed }

Now that Google Apps closed sign-up for free plans, lots of people are looking for alternatives to Gmail for their own domains. Actually they don’t need to.

You can simply add other domains to your existing Google Apps account as separate domains to set up emails such as The separate domain emails perform exactly like those of the primary domain, with all the good stuff of Gmail, except you can’t do these things with a separate domain.

To add a separate domain to your existing Google Apps account, just login in the admin console and click “Domains” (click “More controls” if not visible) => click “Add a domain or a domain alias” => select “Add another domain” => enter the domain name => “Continue and verify domain ownership”.

After the routines of verifying ownership and setting up MX records, you can go ahead and add users / emails to the separate domain.

In most cases, you don’t need to find a Google Apps alternative this way, unless you hit the maximum number of users per account.

{ Comments on this entry are closed }

PayPal IPN payment_status

by Yang Yang on September 11, 2013

We use the payment_status value in PayPal IPN to determine the outcome of a transaction. There are 6 possible values according to the transaction logs of one of my websites, out of a total of 1132 occurences:

  • Completed – 884
  • Reversed – 100
  • Refunded – 67
  • Canceled_Reversal – 66
  • Pending – 13
  • Denied – 2

For those who are new to PayPal IPN:

  • Completed = You got the money and you can ship the goods.
  • Reversed = The payment was reversed by the other party (NOT you) and you lost the money! e.g. A chargeback.
  • Refunded = The money was refunded to the buyer (probably by you).
  • Canceled_Reversal = The money was again returned to you after it was reversed previously.
  • Pending = You haven’t got the money yet but you probably will after fraud review was done by PayPal or after the eCheck clears.
  • Denied = PayPal denies a payment because god knows why and you don’t get the money.

{ Comments on this entry are closed }

{ Comments on this entry are closed }