July 10, 2016
Leetcode 56: Merge Intervals
study the code:
http://xiaoyaoworm.com/blog/2016/06/27/%E6%96%B0leetcode56-merge-intervals/
https://gist.github.com/jianminchen/a75a3ff78dbb863774b3b97da0d150f8
Write down C# code - 20 minutes workout later.
Sept. 24, 2016
The idea is the following:
1. Sort the list of intervals by start value;
2. Do iteration in the following
base = first.interval
foreach(interval in list)
{
if base.end < interval.start
{
result.add(base);
base = current;
base
___________
current
_____________
}
else
{
(1) base
------------------------
current
---------------------
(2) base
____________________
current
_________
_____________________
new base
}
}
Have some drawing to analyze the problem.
blog reading:
http://www.canadianbusiness.com/leadership/office-space/microsoft-canada-vancouver/
http://www.canadianbusiness.com/leadership/office-space/jordan-banks-facebook-canada/image/2/
Editorial Notes:
1. Julia, could you write down your experience about this problem solving?
Answer: Julia spent 8+ hours to work on the HackerRank world code sprint #7 problem solving.
The idea is to find most simple task you can complete:
Two intervals are not overlapped, so left one should be added to result collections, and move to next one. In order to find the first one, sort the intervals using start time.
From January 2015, she started to practice leetcode questions; she trains herself to stay focus, develops "muscle" memory when she practices those questions one by one. 2015年初, Julia开始参与做Leetcode, 开通自己第一个博客. 刷Leet code的题目, 她看了很多的代码, 每个人那学一点, 也开通Github, 发表自己的代码, 尝试写自己的一些体会. She learns from her favorite sports – tennis, 10,000 serves practice builds up good memory for a great serve. Just keep going. Hard work beats talent when talent fails to work hard.
Sunday, July 10, 2016
Saturday, July 9, 2016
Business intelligent study
July 9, 2016
Julia spent over years to work on Microsoft Excel, powerpivot table and vertipaq engine to do data analysis. Now, she likes to do some study on Tableau:
She could not recall the engine name - vertipaq, so she googled and then found this article -
1. http://searchsqlserver.techtarget.com/feature/Importing-SQL-Server-data-into-PowerPivot-for-Excel
Tableau - Spend a few hours to read and then learn something about Tableau products:
Read blogs:
2. http://www.36dsj.com/archives/42081
Take some notes here from the blog:
Business intelligence (BI)
a list of features: "A B C D E S"
1. A = Automation
To collect, analyze data, it takes time to work on
2. B = Big Data
Hadoop based
Tableau supports Hadoop, Spark.
3. C = Complex Analysis - Include Machine Learning, predictive modeling
4. D = Data Integration/ Connection
5. E = Easy-to-use.
6. W = Workflow Embedded
3.
http://www.36dsj.com/archives/46378
4. Learn how to read a graph using Tableau:
Sankey Diagram:
Others call DecisionTree/ Flow Diagram/ Alluvial Diagram
http://www.36dsj.com/archives/22337
http://www.36dsj.com/archives/16647
5. Podcast - Tableau - Vancouver
http://www.vancouvertechpodcast.ca/episodes/41291-episode-33-tableau-software
Last 20 minutes, Jesse Calderon talked about everything about Tableau - how team works together, how new project is organized etc.
6. A lot of great insights - how to think about venture capital/ product/ problem solving?
https://www.youtube.com/watch?v=d8o20TP7270
7. Tableau - Visual Analysis
https://www.youtube.com/watch?v=hoAbjerDak4
Podcast: Microsoft Canada project manager talk:
http://www.vancouvertechpodcast.ca/episodes/40343-episode-31-microsoft#0:27:53
Julia spent over years to work on Microsoft Excel, powerpivot table and vertipaq engine to do data analysis. Now, she likes to do some study on Tableau:
She could not recall the engine name - vertipaq, so she googled and then found this article -
1. http://searchsqlserver.techtarget.com/feature/Importing-SQL-Server-data-into-PowerPivot-for-Excel
Tableau - Spend a few hours to read and then learn something about Tableau products:
Read blogs:
2. http://www.36dsj.com/archives/42081
Take some notes here from the blog:
Business intelligence (BI)
a list of features: "A B C D E S"
1. A = Automation
To collect, analyze data, it takes time to work on
2. B = Big Data
Hadoop based
Tableau supports Hadoop, Spark.
3. C = Complex Analysis - Include Machine Learning, predictive modeling
4. D = Data Integration/ Connection
5. E = Easy-to-use.
6. W = Workflow Embedded
3.
http://www.36dsj.com/archives/46378
4. Learn how to read a graph using Tableau:
Sankey Diagram:
Others call DecisionTree/ Flow Diagram/ Alluvial Diagram
http://www.36dsj.com/archives/22337
http://www.36dsj.com/archives/16647
5. Podcast - Tableau - Vancouver
http://www.vancouvertechpodcast.ca/episodes/41291-episode-33-tableau-software
Last 20 minutes, Jesse Calderon talked about everything about Tableau - how team works together, how new project is organized etc.
6. A lot of great insights - how to think about venture capital/ product/ problem solving?
https://www.youtube.com/watch?v=d8o20TP7270
7. Tableau - Visual Analysis
https://www.youtube.com/watch?v=hoAbjerDak4
Podcast: Microsoft Canada project manager talk:
http://www.vancouvertechpodcast.ca/episodes/40343-episode-31-microsoft#0:27:53
A small research about frugality
July 9, 2016
Frugality - Try to save time, save money, and save the resources.
How to build the habit to think in frugality?
How to measure the progress of good thinking in frugality?
What to do to prevent impulse shopping or other things?
How to save time, focus on important things first?
...
A list can be long, first of all, memorize the verse:
Proverbs 28:6 Better to be a poor person who has integrity than to be rich and double-dealing.
Lessons she learned:
1. Spent a lot of time to debug/maintain the code in last 6 years, if she learns to focus on writing bug-free code in the first writing, that is a lot of savings on time. It is not frugal to write code, without a few of rewriting followed, some refinements, following some code standards, following certain design principles closely;
That time goes to study of algorithm, problem solving, code standards, etc.
2. Spend a lot of time reading/ studying, without practice (write code/ write blogs/ help others at work), or review later on, the knowledge is easy to come/ easy to go. Not focusing on the most important thing - data structure, algorithm, math, problem solving, try to overcome the limitation of cognitive ability etc.
3. Should work on time management / planning / decision making. Good planning saves a lot of time later.
Frugality - Try to save time, save money, and save the resources.
How to build the habit to think in frugality?
How to measure the progress of good thinking in frugality?
What to do to prevent impulse shopping or other things?
How to save time, focus on important things first?
...
A list can be long, first of all, memorize the verse:
Proverbs 28:6 Better to be a poor person who has integrity than to be rich and double-dealing.
Lessons she learned:
1. Spent a lot of time to debug/maintain the code in last 6 years, if she learns to focus on writing bug-free code in the first writing, that is a lot of savings on time. It is not frugal to write code, without a few of rewriting followed, some refinements, following some code standards, following certain design principles closely;
That time goes to study of algorithm, problem solving, code standards, etc.
2. Spend a lot of time reading/ studying, without practice (write code/ write blogs/ help others at work), or review later on, the knowledge is easy to come/ easy to go. Not focusing on the most important thing - data structure, algorithm, math, problem solving, try to overcome the limitation of cognitive ability etc.
3. Should work on time management / planning / decision making. Good planning saves a lot of time later.
A small talk on Learning Style Change - coding, system design
July 9, 2016
Try to select a topic to work on, 20 minutes, and see how far Julia can go on the topic. Later, she can add more on her research.
Take easy, choose easy topic to work on, choose learning style change as a topic.
Start to work on new style of learning:
1. Take courses on pluralsight.com (starting from Dec. 2015)
2. Read Leetcode solutions from last 2-3 years blogs - written by a younger generation,
compare different languages - Java, C++, JavaScript, C (starting from Feb. 2015)
3. Work on HackerRank, and go over hundreds of submissions, try to find best solutions and analyze the solution. (starting from Feb. 2016)
4. Every day write some code/ read some code/ study APIs/ Try to memorize something about APIs
(starting from Feb. 2015)
5. Try different ideas to explain the algorithm problem solving, understand learning process/ mental process to solve unseen problems.
(starting from May. 2016)
6. Work on algorithm problems everyday, discuss it on blogs, and read other people's code; keep to find best/ top talent through blogs reading (code in C/C++/Java/JavaScript). Appreciate people sharing through blogs, and then, Julia also likes to join the community to write blogs.
Will be back to work on more on this topic.
Try to select a topic to work on, 20 minutes, and see how far Julia can go on the topic. Later, she can add more on her research.
Take easy, choose easy topic to work on, choose learning style change as a topic.
Start to work on new style of learning:
1. Take courses on pluralsight.com (starting from Dec. 2015)
2. Read Leetcode solutions from last 2-3 years blogs - written by a younger generation,
compare different languages - Java, C++, JavaScript, C (starting from Feb. 2015)
3. Work on HackerRank, and go over hundreds of submissions, try to find best solutions and analyze the solution. (starting from Feb. 2016)
4. Every day write some code/ read some code/ study APIs/ Try to memorize something about APIs
(starting from Feb. 2015)
5. Try different ideas to explain the algorithm problem solving, understand learning process/ mental process to solve unseen problems.
(starting from May. 2016)
6. Work on algorithm problems everyday, discuss it on blogs, and read other people's code; keep to find best/ top talent through blogs reading (code in C/C++/Java/JavaScript). Appreciate people sharing through blogs, and then, Julia also likes to join the community to write blogs.
Will be back to work on more on this topic.
Thursday, July 7, 2016
pluralsight - Building Highly Scalable Web Applications in Azure
July 7, 2016
2 hours courses on pluralsight.com. The course is very well prepared, great teaching of system design, a lot of discussions are new to Julia.
Lecturer's website:
http://www.edinkapic.com/2015/09/learn-building-highly-scalable-applications-in-azure.html
Topics included:
storage locking removal
caching
asynchronous calls or non-relational data storage
2 hours courses on pluralsight.com. The course is very well prepared, great teaching of system design, a lot of discussions are new to Julia.
Lecturer's website:
http://www.edinkapic.com/2015/09/learn-building-highly-scalable-applications-in-azure.html
Topics included:
storage locking removal
caching
asynchronous calls or non-relational data storage
String primitive - JavaScript study
July 7, 2016
Motivation talk:
Given an array, for example, ['a','b','c','e'], insert 'd' before 'e' in the array. Thinking in JavaScript.
1. Do not know JavaScript splice API, write a loop;
2. Know JavaScript splice API,
var arr = ['a','b','c','e'];
arr.splice(3,0,'d');
3. Know JavaScript splice API, but careless counting error, 3 goes to 2
var arr = ['a','b','c','e'];
arr.splice(2,0,'d');
Assuming that the array is longer than length 3, and also need to remove some elements before insertion. Counting error is a reasonable mistake.
Consequence:
Take extra 5 - 10 minutes to find the issue.
4. Ideal solution:
Use indexOf to find 'e' position, and then, call splice next.
var arr = ['a','b','c','e'];
arr.splice(arr.indexOf('e'),0,'d');
So, the programmer can be lazy, no counting, just ask indexOf API's help, and then, ask splice API's help. Get smart, invest time to get familiar with all APIs, then, it is the game time.
Start to work on JavaScript string reference:
Target:
1. Memorize all APIs;
2. Write down learning process - notes, blogs to read, questions to ask myself, measurement of progress etc.
JavaScript String reference (30 minutes a time to study -Aug.2, 2016, )
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String
Properties:
string.prototype
string.length
Methods:
Exclude deprecated methods, try to remember all the following methods: 34 methods
String.fromCharCode()
String.fromCodePoint()
String.prototype.anchor()
String.prototype.charAt()
String.prototype.codePointAt()
String.prototype.concat()
String.prototype.endsWith()
String.prototype.includes()
String.prototype.indexOf()
String.prototype.lastIndexOf()
String.prototype.link()
String.prototype.localeCompare()
String.prototype.match()
String.prototype.normalize()
String.prototype.repeat()
String.prototype.replace()
String.prototype.search()
String.prototype.slice()
String.prototype.split()
String.prototype.startsWith()
String.prototype.normalize()
String.prototype.substr()
String.prototype.substring()
String.prototype.toLocaleLowerCase()
String.prototype.toLocaleUpperCase()
String.prototype.toLowerCase()
String.prototype.toString()
String.prototype.toUpperCase()
String.prototype.trim()
String.prototype.trimLeft()
String.prototype.trimRight()
String.prototype.valueOf()
String.prototype[@@iterator]()
String.raw()
July 7, 2016 - More than 60 minutes reading - get into the detail - "wild wild west", JavaScript coding is such a challenging one.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substring
substring
data descriptor/ accessor descriptor
In order to understand string - JavaScript, go through a lot of topics:
1. defineProperty
2. template literals
...
10 minutes reading of define property
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty
string literal
global object directly
Template literals
back-tick (` `)
Expresssion interpolation
syntactic sugar making substitutions like this more readable
tagged template literal - more advanced form of template literals
10 - 15 minutes reading of template literals
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals
August 2, 2016 30 minutes+
// August 2, 2016 - read JavaScript 0 Standard built-in object > string - 30 minutes reading
1. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined
2. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/codePointAt
read polyfill - read the defintio of the function is fun:
charCodeAt()
defineProperty
Number()
TypeError()
3. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/concat
4. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith
5. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes
6. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/lastIndexOf
syntax: str.lastIndexOf(searchValue[, fromIndex])
optional argument: fromIndex
It can be any integer. Default value is +Infinity. If fromIndex >=str.length, the whole string is searched. If fromIndex < 0, the behavior will be the same as if it would be 0.
7. read 10 minutes
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/match
Julia's practice - match function - html file
https://gist.github.com/jianminchen/528872aa8853b22151325990506d60fc
8. substring function
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substring
Julia's practice:
https://gist.github.com/jianminchen/941a13f0283e8063cf8207715e19e4ac
9. split function
split function -
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split
Julia's practice - html
https://gist.github.com/jianminchen/45806800342101f3b4af7ac7c8ca8efa
Motivation talk:
Given an array, for example, ['a','b','c','e'], insert 'd' before 'e' in the array. Thinking in JavaScript.
1. Do not know JavaScript splice API, write a loop;
2. Know JavaScript splice API,
var arr = ['a','b','c','e'];
arr.splice(3,0,'d');
3. Know JavaScript splice API, but careless counting error, 3 goes to 2
var arr = ['a','b','c','e'];
arr.splice(2,0,'d');
Assuming that the array is longer than length 3, and also need to remove some elements before insertion. Counting error is a reasonable mistake.
Consequence:
Take extra 5 - 10 minutes to find the issue.
4. Ideal solution:
Use indexOf to find 'e' position, and then, call splice next.
var arr = ['a','b','c','e'];
arr.splice(arr.indexOf('e'),0,'d');
So, the programmer can be lazy, no counting, just ask indexOf API's help, and then, ask splice API's help. Get smart, invest time to get familiar with all APIs, then, it is the game time.
Start to work on JavaScript string reference:
Target:
1. Memorize all APIs;
2. Write down learning process - notes, blogs to read, questions to ask myself, measurement of progress etc.
JavaScript String reference (30 minutes a time to study -Aug.2, 2016, )
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String
Properties:
string.prototype
string.length
Methods:
Exclude deprecated methods, try to remember all the following methods: 34 methods
String.fromCharCode()
String.fromCodePoint()
String.prototype.anchor()
String.prototype.charAt()
String.prototype.codePointAt()
String.prototype.concat()
String.prototype.endsWith()
String.prototype.includes()
String.prototype.indexOf()
String.prototype.lastIndexOf()
String.prototype.link()
String.prototype.localeCompare()
String.prototype.match()
String.prototype.normalize()
String.prototype.repeat()
String.prototype.replace()
String.prototype.search()
String.prototype.slice()
String.prototype.split()
String.prototype.startsWith()
String.prototype.normalize()
String.prototype.substr()
String.prototype.substring()
String.prototype.toLocaleLowerCase()
String.prototype.toLocaleUpperCase()
String.prototype.toLowerCase()
String.prototype.toString()
String.prototype.toUpperCase()
String.prototype.trim()
String.prototype.trimLeft()
String.prototype.trimRight()
String.prototype.valueOf()
String.prototype[@@iterator]()
String.raw()
July 7, 2016 - More than 60 minutes reading - get into the detail - "wild wild west", JavaScript coding is such a challenging one.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substring
substring
data descriptor/ accessor descriptor
In order to understand string - JavaScript, go through a lot of topics:
1. defineProperty
2. template literals
...
10 minutes reading of define property
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty
string literal
global object directly
Template literals
back-tick (` `)
Expresssion interpolation
syntactic sugar making substitutions like this more readable
tagged template literal - more advanced form of template literals
10 - 15 minutes reading of template literals
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals
August 2, 2016 30 minutes+
// August 2, 2016 - read JavaScript 0 Standard built-in object > string - 30 minutes reading
1. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined
2. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/codePointAt
read polyfill - read the defintio of the function is fun:
charCodeAt()
defineProperty
Number()
TypeError()
3. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/concat
4. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith
5. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes
6. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/lastIndexOf
syntax: str.lastIndexOf(searchValue[, fromIndex])
optional argument: fromIndex
It can be any integer. Default value is +Infinity. If fromIndex >=str.length, the whole string is searched. If fromIndex < 0, the behavior will be the same as if it would be 0.
7. read 10 minutes
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/match
Julia's practice - match function - html file
https://gist.github.com/jianminchen/528872aa8853b22151325990506d60fc
8. substring function
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substring
Julia's practice:
https://gist.github.com/jianminchen/941a13f0283e8063cf8207715e19e4ac
9. split function
split function -
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split
Julia's practice - html
https://gist.github.com/jianminchen/45806800342101f3b4af7ac7c8ca8efa
Wednesday, July 6, 2016
Encouraging story from tennis player - World No. 50 Elena Vesnina - Wimbledon 2016
July 6, 2016
Enjoy the Wimbledon and also learn the sports - how hard people work, no matter age, seeded or unseeded.
Here is the thought process of the player - Elena Vesnina:
http://www.wimbledon.com/en_GB/news/articles/2016-07-05/unseeded_vesnina_reaches_first_grand_slam_semifinal.html
Reading blog:
http://parentingmentallytoughtennis.com/?p=185
Enjoy the Wimbledon and also learn the sports - how hard people work, no matter age, seeded or unseeded.
Here is the thought process of the player - Elena Vesnina:
It is a far cry from her struggles in Melbourne, or even last year’s Wimbledon campaign, which ended in the first round. So what changed?
“Self‑belief,” said the 29-year-old. “Positive thinking. I was not putting any pressure on myself going on the court – I know I'm in good shape, I'm playing good.
“I was not thinking about my draw. I didn't see who I was playing next round. I was trying to enjoy myself on the court first of all, because I'm here at Wimbledon – it's one of the best tennis tournaments in history, with the best players in the world. I have to enjoy myself here.
“You really appreciate more what you have now. You really enjoy what you’re doing. I love playing tennis. It's the best thing what can happen with me. I'm really enjoying my time on the court, and off the court as well.
“I had really difficult beginning of the year, end of the year: I dropped out of the top 100, I was playing all tournaments starting from qualification. I had a lot of matches under my belt. It was not easy, to be honest, because I was in top 30, then I was like 120 or something.
“I'm really happy that it didn't break me up. I think the difficult times - every single player has to go through it because it makes you better. It makes you stronger.”
Julia's comment:
"The difficult times - every single player has to go through it because it makes you better. It makes you stronger"
Memorize the sentence!
"The difficult times - every single player has to go through it because it makes you better. It makes you stronger"
Memorize the sentence!
Ranking: 50— Wimbledon (@Wimbledon) July 5, 2016
Previous Slam semis: 0@EVesnina001 emerges as #Wimbledon surprise package: https://t.co/V0oyxB3XqK pic.twitter.com/8sHl8RLmVg
http://www.wimbledon.com/en_GB/news/articles/2016-07-05/unseeded_vesnina_reaches_first_grand_slam_semifinal.html
"Images she'll remember for the rest of her life"— Wimbledon (@Wimbledon) July 5, 2016
World No.50 Elena Vesnina celebrates her breakthrough moment https://t.co/XFnGTeyusO
Reading blog:
http://parentingmentallytoughtennis.com/?p=185
Tennis Legends - hingis tactics
July 6, 2016
Learn from my favorite tennis legends - hingis:
http://baseline.tennis.com/article/59052/learning-legends-hingis-tactics
Julia works on her tennis skills so hard, she turns the boring weight control project into fascinating sports hobby - chasing tennis tournament, stars, watching hundreds hours tennis matches, and then practice on tennis courts hundreds of hours.
Julia learns from tennis sport:
Hard working,
Very patient
Work on drills,
Focus on training.
She is transferring her sports skills and trains herself on algorithm, problem solving, system design.
https://www.linkedin.com/pulse/how-i-learned-importance-self-service-analyticsand-found-elissa-fink?trk=prof-post
http://qz.com/525496/done-what-a-recruiter-sees-on-your-resume-at-first-glance/
https://hbr.org/2015/12/how-to-spot-a-bad-boss-during-an-interview
https://www.linkedin.com/pulse/3-tips-getting-started-new-boss-jeffrey-kelly?trk=prof-post
Learn from my favorite tennis legends - hingis:
http://baseline.tennis.com/article/59052/learning-legends-hingis-tactics
Julia works on her tennis skills so hard, she turns the boring weight control project into fascinating sports hobby - chasing tennis tournament, stars, watching hundreds hours tennis matches, and then practice on tennis courts hundreds of hours.
Julia learns from tennis sport:
Hard working,
Very patient
Work on drills,
Focus on training.
She is transferring her sports skills and trains herself on algorithm, problem solving, system design.
Blog reading:Inspired by Wimbledon? Former No.1 Martina Hingis shares her fitness secrets https://t.co/HpSD9UnuAG pic.twitter.com/UikZ7mlHiB— Red Magazine (@RedMagDaily) June 27, 2016
https://www.linkedin.com/pulse/how-i-learned-importance-self-service-analyticsand-found-elissa-fink?trk=prof-post
http://qz.com/525496/done-what-a-recruiter-sees-on-your-resume-at-first-glance/
https://hbr.org/2015/12/how-to-spot-a-bad-boss-during-an-interview
https://www.linkedin.com/pulse/3-tips-getting-started-new-boss-jeffrey-kelly?trk=prof-post
Leetcode 130: surrounded region
July 6, 2016
Work on Leetcode 130: surrounded region
Leetcode 130 surrounded region
Study the solution discussiones - very detail discussion, comparison DFS/timeout/stack issues, and then BFS solution, ideas to approach the problem.
1. code study 1: C#
http://www.cnblogs.com/higerzhang/p/4149040.html
Julia's C# practice:
Will post here very soon!
2. Code study 2: C++
C++ code: read C++ code
http://neuzxy.github.io/2016/03/14/leetcode-130.html
Things learned in the code:
1. The description of ideas to solve the problem:
start from all four edges outside most, from each node '0', work on BFS, mark '+' for those node with '0',
and then, set those not '+', but '0' - whereas those are not accessible, surrounded by 'X' - set as 'X'.
2. learn typedef pair<int, int> state_t;
C++ solution
https://ask.julyedu.com/question/164
3. Read every blog from the author: The code is with good quality and some excellent sharing:
http://xiaoyaoworm.com/blog/
To be continued!
Work on Leetcode 130: surrounded region
Leetcode 130 surrounded region
Study the solution discussiones - very detail discussion, comparison DFS/timeout/stack issues, and then BFS solution, ideas to approach the problem.
1. code study 1: C#
http://www.cnblogs.com/higerzhang/p/4149040.html
Julia's C# practice:
Will post here very soon!
2. Code study 2: C++
C++ code: read C++ code
http://neuzxy.github.io/2016/03/14/leetcode-130.html
Things learned in the code:
1. The description of ideas to solve the problem:
start from all four edges outside most, from each node '0', work on BFS, mark '+' for those node with '0',
and then, set those not '+', but '0' - whereas those are not accessible, surrounded by 'X' - set as 'X'.
2. learn typedef pair<int, int> state_t;
C++ solution
https://ask.julyedu.com/question/164
3. Read every blog from the author: The code is with good quality and some excellent sharing:
http://xiaoyaoworm.com/blog/
To be continued!
Tuesday, July 5, 2016
Facebook code lab - daily coding practice
July 5, 2016
Spend 30 minutes a time, choose to work on facebook code lab.
Julia's new favorite place to get training daily:
https://codelab.interviewbit.com/
Try to write code without compiler error, executable code.
Favorite practice:
1. GCD - great common denominator
https://gist.github.com/jianminchen/631086210db7c41fcdda677c3aaf726c
Things to work on: No run-time exception
line 47 - 48
if (b == 0) // bug001 - forget to check if(b==0) first writing, not reaching facebook coding requirement!
return a;
// bug001 - forget to check if(b==0) first writing!
2. is same tree
https://gist.github.com/jianminchen/2c55d67226b86d38f4158160801b82ff
3. Number 1 bits
https://gist.github.com/jianminchen/d2f6022094fcdb41fb7e7cae8b30c725
things to work on: No compiler's help
line 37: a = a >> 1; // bug001 - writing, forget
"a =" in first writing, need compiler's help
Blog reading:
https://zhuanlan.zhihu.com/p/20941886?refer=qinchao
DDD - Debugger Driven Development
PDD - Print Driven Development
BDD - Bug-Driven Development
RDD - Rat-Race-Game-Driven Development
DDD - Deadline-Driven Development
Spend 30 minutes a time, choose to work on facebook code lab.
Julia's new favorite place to get training daily:
https://codelab.interviewbit.com/
Try to write code without compiler error, executable code.
Favorite practice:
1. GCD - great common denominator
https://gist.github.com/jianminchen/631086210db7c41fcdda677c3aaf726c
Things to work on: No run-time exception
line 47 - 48
if (b == 0) // bug001 - forget to check if(b==0) first writing, not reaching facebook coding requirement!
return a;
// bug001 - forget to check if(b==0) first writing!
2. is same tree
https://gist.github.com/jianminchen/2c55d67226b86d38f4158160801b82ff
3. Number 1 bits
https://gist.github.com/jianminchen/d2f6022094fcdb41fb7e7cae8b30c725
things to work on: No compiler's help
line 37: a = a >> 1; // bug001 - writing, forget
"a =" in first writing, need compiler's help
Blog reading:
https://zhuanlan.zhihu.com/p/20941886?refer=qinchao
DDD - Debugger Driven Development
PDD - Print Driven Development
BDD - Bug-Driven Development
RDD - Rat-Race-Game-Driven Development
DDD - Deadline-Driven Development
Sunday, July 3, 2016
AorB - HackerRank - C++ code study
July 3, 2016
Study C++ code submission on HackerRank - AorB:
1.
https://gist.github.com/jianminchen/4a608ffd202433f9be264c392f1bd75a
2
https://gist.github.com/jianminchen/d8879283c292454e2638444328633f09
3.
https://gist.github.com/jianminchen/d65f78caec4c8953949639b70dbdf192
4.
https://gist.github.com/jianminchen/9e72d35b50dc570a948e6a308d1c2e55
Notes to study code #1:
1. Read string class in C++:
http://www.cplusplus.com/reference/string/string/string/
std::string::string
fill(6) string(size_t n, char c)
fill constructor
Fills the string with n consecutive copies of character c.
2. std::string::c_str
http://www.cplusplus.com/reference/string/string/c_str/
3. hexmap[128]
ASCII table from 0 -128
http://www.asciitable.com/
4. reverse in C++ - function template
http://www.cplusplus.com/reference/algorithm/reverse/
5. write string to stdout
http://www.cplusplus.com/reference/cstdio/puts/
http://stackoverflow.com/questions/25311011/how-does-include-bits-stdc-h-work-in-c
statistics:
1. over 300 submission scores 50/50 - Choose 50 submission to study
blog reading:
https://zhuanlan.zhihu.com/qinchao
Study C++ code submission on HackerRank - AorB:
1.
https://gist.github.com/jianminchen/4a608ffd202433f9be264c392f1bd75a
2
https://gist.github.com/jianminchen/d8879283c292454e2638444328633f09
3.
https://gist.github.com/jianminchen/d65f78caec4c8953949639b70dbdf192
4.
https://gist.github.com/jianminchen/9e72d35b50dc570a948e6a308d1c2e55
Notes to study code #1:
1. Read string class in C++:
http://www.cplusplus.com/reference/string/string/string/
std::string::string
fill(6) string(size_t n, char c)
fill constructor
Fills the string with n consecutive copies of character c.
2. std::string::c_str
http://www.cplusplus.com/reference/string/string/c_str/
3. hexmap[128]
ASCII table from 0 -128
http://www.asciitable.com/
4. reverse in C++ - function template
http://www.cplusplus.com/reference/algorithm/reverse/
5. write string to stdout
http://www.cplusplus.com/reference/cstdio/puts/
http://stackoverflow.com/questions/25311011/how-does-include-bits-stdc-h-work-in-c
statistics:
1. over 300 submission scores 50/50 - Choose 50 submission to study
blog reading:
https://zhuanlan.zhihu.com/qinchao
HackerRank: AorB - JavaScript code study
July 3, 2016
Problem statement on HackerRank:
https://www.hackerrank.com/contests/june-world-codesprint/challenges/aorb
Work on JavaScript code on HackerRank AorB submission - code study:
1.
https://gist.github.com/jianminchen/b5ce95c07e3dd027e3753b8c81f00c74
2.
https://gist.github.com/jianminchen/2f6b252009868ebcf4d0449aafa01b30
Statistics:
Only 2 submissions score 50/50. So, study those two submissions.
Notes for code 1:
The code is so beautiful!
Great ideas to highlight (Go over it 30 minutes):
1. line 13 - line 30
var dec - a map, '0' maps to 0, ..., 'F' to 15, char to integer;
variable name is called "dec" - very short!
2. line 32 - line 49
var hexBin - a map, hexadecimal char maps to binary format,
'0' - '0000', ..., 'F' - 'FFFF'
variable name is called "hexBin" - very good name.
hexaDecimalToBinaryFormat is too long, remove "To", capital case 'B', so hexBin.
3. line 51 - 68
var hex - a map, binary number to hexadecimal char
'0000' - '0', ..., '1111' - 'F'
4. line 70 - line 75
function getBinaryArray
Actionable item:
1. Learn the code, write a C# version using exactly ideas!
Spend 30 minutes to do the workout!
2. Go over excellent code 30 minutes, save time to write code; Julia tries to figure out best design.
10 hours hard work -> 30 minutes work! (Learn from best student in CMU? :-)
Problem statement on HackerRank:
https://www.hackerrank.com/contests/june-world-codesprint/challenges/aorb
Work on JavaScript code on HackerRank AorB submission - code study:
1.
https://gist.github.com/jianminchen/b5ce95c07e3dd027e3753b8c81f00c74
2.
https://gist.github.com/jianminchen/2f6b252009868ebcf4d0449aafa01b30
Statistics:
Only 2 submissions score 50/50. So, study those two submissions.
Notes for code 1:
The code is so beautiful!
Great ideas to highlight (Go over it 30 minutes):
1. line 13 - line 30
var dec - a map, '0' maps to 0, ..., 'F' to 15, char to integer;
variable name is called "dec" - very short!
2. line 32 - line 49
var hexBin - a map, hexadecimal char maps to binary format,
'0' - '0000', ..., 'F' - 'FFFF'
variable name is called "hexBin" - very good name.
hexaDecimalToBinaryFormat is too long, remove "To", capital case 'B', so hexBin.
3. line 51 - 68
var hex - a map, binary number to hexadecimal char
'0000' - '0', ..., '1111' - 'F'
4. line 70 - line 75
function getBinaryArray
Actionable item:
1. Learn the code, write a C# version using exactly ideas!
Spend 30 minutes to do the workout!
2. Go over excellent code 30 minutes, save time to write code; Julia tries to figure out best design.
10 hours hard work -> 30 minutes work! (Learn from best student in CMU? :-)
HackerRank: AorB - code submission C# study
July 3, 2016
Study submission code of AorB, find out things to work on in C# code.
First study of code:
1. https://gist.github.com/jianminchen/505d4b6a20d10aaa7a859443fa5fcaf2
2. https://gist.github.com/jianminchen/1b44d66ce8ac106b38495ea72dc79314
3.
https://gist.github.com/jianminchen/4f7f354675d9d762d1493de0213a0342
4.
https://gist.github.com/jianminchen/2f346cb9230967708b9db0154563cc61
5.
https://gist.github.com/jianminchen/1a8344f1fd0729dfc9e3e3e9be98d303
6.
https://gist.github.com/jianminchen/bcf7ade62dc35a85993b102c40584abe
Statistics:
Only 11 submissions score 50/50.
Study submission code of AorB, find out things to work on in C# code.
First study of code:
1. https://gist.github.com/jianminchen/505d4b6a20d10aaa7a859443fa5fcaf2
2. https://gist.github.com/jianminchen/1b44d66ce8ac106b38495ea72dc79314
3.
https://gist.github.com/jianminchen/4f7f354675d9d762d1493de0213a0342
4.
https://gist.github.com/jianminchen/2f346cb9230967708b9db0154563cc61
5.
https://gist.github.com/jianminchen/1a8344f1fd0729dfc9e3e3e9be98d303
6.
https://gist.github.com/jianminchen/bcf7ade62dc35a85993b102c40584abe
Statistics:
Only 11 submissions score 50/50.
C#, C++, JavaScript, Java String, StringBuilder class study
July 3, 2016
Spend time to work on String class API on C#, C++, JavaScript, Java language. Always keep busy, study APIs first, go over all APIs.
1. C# programming language:
First, work on C# StringBuilder class:
https://msdn.microsoft.com/en-us/library/system.text.stringbuilder(v=vs.110).aspx
2. C++ string class study (30 minutes a time)
Review and go through each one (30 minutes study ......)
http://www.cplusplus.com/reference/string/string/
member type (12):
value_type char
traits_type char_traits<char>
allocator_type allocator<char>
reference char&
const_reference const char&
pointer char*
iterator a random access iterator to char (convertible to const_iterator)
const_iterator a random access iterator to const char
reverse_iterator reverse_iterator<iterator>
const_reverse_iterator reverse_iterator<const_iterator>
different_type ptrdiff_t
size_type size_t
questions: traits_type ?
Iterators (8):
begin
end
(C++ 11)
rbegin
rend
cbegin
cend
crbegin
crend
Capacity (9):
size
length
max_size
resize
capacity
reserve
clear
empty
shrink_to_fit (C++ 11)
Element access (3)
operator[]
at
back - access last character
front - access first character
Modifiers (9):
operator+=
append
push_back
assign
insert
erase
replace
swap
pop_back
String operations (12):
c_str
data
get_allocation
copy
find
rfind
find_first_of
find_last_of
find_first_not_of
find_last_not_of
substr
compare
Member constants
npos - maximm value for size_t
Non-member function overloads (6)
operator+
relational operators
swap
operator>>
operator<<
getline
3. JavaScript String reference (30 minutes a time to study)
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String
Properties:
string.prototype
string.length
Methods:
Exclude deprecated methods, try to remember all the following methods: 34 methods
String.fromCharCode()
String.fromCodePoint()
String.prototype.anchor()
String.prototype.charAt()
String.prototype.codePointAt()
String.prototype.concat()
String.prototype.endsWith()
String.prototype.includes()
String.prototype.indexOf()
String.prototype.lastIndexOf()
String.prototype.link()
String.prototype.localeCompare()
String.prototype.match()
String.prototype.normalize()
String.prototype.repeat()
String.prototype.replace()
String.prototype.search()
String.prototype.slice()
String.prototype.split()
String.prototype.startsWith()
String.prototype.normalize()
String.prototype.substr()
String.prototype.substring()
String.prototype.toLocaleLowerCase()
String.prototype.toLocaleUpperCase()
String.prototype.toLowerCase()
String.prototype.toString()
String.prototype.toUpperCase()
String.prototype.trim()
String.prototype.trimLeft()
String.prototype.trimRight()
String.prototype.valueOf()
String.prototype[@@iterator]()
String.raw()
July 7, 2016 - Reading time: more than 30 minutes
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substring
substring
data descriptor/ accessor descriptor
In order to understand string - JavaScript, go through a lot of topics:
10 minutes reading of define property
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty
string literal
global object directly
Template literals
back-tick (` `)
Expresssion interpolation
syntactic sugar making substitutions like this more readable
tagged template literal - more advanced form of template literals
Another 10 - 15 minutes reading of template literals
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals
July 12, 2016
Java String class
https://docs.oracle.com/javase/7/docs/api/java/lang/String.html#length()
Spend time to work on String class API on C#, C++, JavaScript, Java language. Always keep busy, study APIs first, go over all APIs.
1. C# programming language:
First, work on C# StringBuilder class:
https://msdn.microsoft.com/en-us/library/system.text.stringbuilder(v=vs.110).aspx
2. C++ string class study (30 minutes a time)
Review and go through each one (30 minutes study ......)
http://www.cplusplus.com/reference/string/string/
member type (12):
value_type char
traits_type char_traits<char>
allocator_type allocator<char>
reference char&
const_reference const char&
pointer char*
iterator a random access iterator to char (convertible to const_iterator)
const_iterator a random access iterator to const char
reverse_iterator reverse_iterator<iterator>
const_reverse_iterator reverse_iterator<const_iterator>
different_type ptrdiff_t
size_type size_t
questions: traits_type ?
Iterators (8):
begin
end
(C++ 11)
rbegin
rend
cbegin
cend
crbegin
crend
Capacity (9):
size
length
max_size
resize
capacity
reserve
clear
empty
shrink_to_fit (C++ 11)
Element access (3)
operator[]
at
back - access last character
front - access first character
Modifiers (9):
operator+=
append
push_back
assign
insert
erase
replace
swap
pop_back
String operations (12):
c_str
data
get_allocation
copy
find
rfind
find_first_of
find_last_of
find_first_not_of
find_last_not_of
substr
compare
Member constants
npos - maximm value for size_t
Non-member function overloads (6)
operator+
relational operators
swap
operator>>
operator<<
getline
3. JavaScript String reference (30 minutes a time to study)
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String
Properties:
string.prototype
string.length
Methods:
Exclude deprecated methods, try to remember all the following methods: 34 methods
String.fromCharCode()
String.fromCodePoint()
String.prototype.anchor()
String.prototype.charAt()
String.prototype.codePointAt()
String.prototype.concat()
String.prototype.endsWith()
String.prototype.includes()
String.prototype.indexOf()
String.prototype.lastIndexOf()
String.prototype.link()
String.prototype.localeCompare()
String.prototype.match()
String.prototype.normalize()
String.prototype.repeat()
String.prototype.replace()
String.prototype.search()
String.prototype.slice()
String.prototype.split()
String.prototype.startsWith()
String.prototype.normalize()
String.prototype.substr()
String.prototype.substring()
String.prototype.toLocaleLowerCase()
String.prototype.toLocaleUpperCase()
String.prototype.toLowerCase()
String.prototype.toString()
String.prototype.toUpperCase()
String.prototype.trim()
String.prototype.trimLeft()
String.prototype.trimRight()
String.prototype.valueOf()
String.prototype[@@iterator]()
String.raw()
July 7, 2016 - Reading time: more than 30 minutes
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substring
substring
data descriptor/ accessor descriptor
In order to understand string - JavaScript, go through a lot of topics:
10 minutes reading of define property
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty
string literal
global object directly
Template literals
back-tick (` `)
Expresssion interpolation
syntactic sugar making substitutions like this more readable
tagged template literal - more advanced form of template literals
Another 10 - 15 minutes reading of template literals
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals
July 12, 2016
Java String class
https://docs.oracle.com/javase/7/docs/api/java/lang/String.html#length()
C# questions to review
July 3, 2016
Just come cross the blogs about C# questions, like to review those questions and see if I have time to catch up something. Write down what I learn most.
http://www.csharpstar.com/csharp-interview-questions-part-2/
http://www.csharpstar.com/csharp-interview-questions-part-3/
Just come cross the blogs about C# questions, like to review those questions and see if I have time to catch up something. Write down what I learn most.
http://www.csharpstar.com/csharp-interview-questions-part-2/
http://www.csharpstar.com/csharp-interview-questions-part-3/
Saturday, July 2, 2016
JavaScript Array developer.Mozilla.org - 3+ hours study
July 2, 2016
First thing in the morning, read JavaScript Array webpage, and then, start to work on the target:
1. Memorize all the content on the page. (Estimated time to understand every term on the page: 10+ hours)
https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Array/prototype
2. List all concepts to learn
3. Questions about the content
Training on JavaScript - start from memorizing JavaScript Array APIs
Time spent:
3 hours (July 2, 2016)
https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Array/prototype
Design drills to memorize the JavaScript function names:
1. Properties
Array.prototype
Array.length
Method (33 methods)
Array.from()
Array.isArray()
Array.of()
Array.prototype.concat()
Array.prototype.copyWithin()
Array.prototype.entries()
Array.prototype.every()
Array.prototype.fill()
Array.prototype.filter()
Array.prototype.find()
Array.prototype.findIndex()
Array.prototype.forEach()
Array.prototype.includes()
Array.prototype.indexOf()
Array.prototype.join()
Array.prototype.keys()
Array.prototype.lastIndexOf()
Array.prototype.map()
Array.prototype.pop()
Array.prototype.push()
Array.prototype.reduce()
Array.prototype.reduceRight()
Array.prototype.reverse()
Array.prototype.shift()
Array.prototype.slice()
Array.prototype.some()
Array.prototype.sort()
Array.prototype.splice()
Array.prototype.toLocaleString()
Array.prototype.toSource()
Array.prototype.toString()
Array.prototype.unshift()
Array.prototype.values()
Inheritance:
Function -> properties -> (5, please remember: c, d, l, n, p)
Functon.caller
Function.displayName
Function.length
Function.name
Function.prototype
Function -> Methods -> (6, please remember: a, b, c, i, t, t)
Function.prototype.apply()
Function.prototype.bind()
Function.prototype.call()
Function.prototype.isGenerator()
Function.prototype.toSource()
Function.prototype.toString()
Object
Methods
Object.prototype.__defineGetter__()
...
2. Study notes (July 2, 2016):
a global object,
list-like objects
Access(index into) an Array item
Loop over an array - forEach
push - Add to the end of an Array
pop - Remove from the end of an Array
shift - Remove from the front of an Array
unshift - Add to the front of an array
Adds one or more elements to the front of an array and returns the new length of the array.
push - find the index of an item in the Array
pop - Remove an item by Index Position
splice - Remove an item by Index Position
slice - Copy an Array
julia's comment: slice or dice, slice is just to get part of array, can be the whole array.
function syntax, startIndex, endIndex, arr.slice([begin[, end]])
from - Array.from(), creates a new Array instance from an array-like or iterable object.
isArray - Array.isArray(), returns true if a variable is an array, if not false.
of - Array.of(), creates a new Array instance within a variable number of arguments, regardless of number or type of the arguments.
Mutator methods - modify the array
copyWithin - Copies a sequence of array elements with the array
fill - Fills all the elements of an array from a start index to an end index with a static value.
splice - Adds and/or removes elements from an array.
join - joins all elements of an array into a string.
Iteration methods:
forEach()
entries()
every()
some()
filter()
find()
findIndex()
keys()
map()
reduce()
reduceRight()
values()
Question: Syntax - what kind of definition? [ <- optional argument?
traversal and mutation operations
Arrays can be stored at non-contiguous locations in the array, JavaScript arrays are not guaranteed to be dense.
Questions: When to use typed arrays?
JavaScript arrays are not guaranteed to be dense, so typed arrays are guaranteed to be dense. (? Look into it later)
Questions: an associated array - what is "associated" meaning?
zero-indexed -
using bracket notation - renderer['ed].setTexture(model, 'character.png') - works properly
with dot notation - cannot be referenced with dot notation, must be accessed using bracket notation.
Array.length talk - A JavaScript array's length property and numerical properties are connected. Several of the built-in array methods (e.g., join, slice, indexOf, etc.) take into account value of an array's length property when they are called. Other methods (e.g., push, splice, etc.) also result in updates to an array's length property.
Questions: built-in array methods ? Array.prototype.join, those functions are defined for all iterable object.
Good reading with one example, two lines of JavaScript code:
Creating an array using the result of a match
RegExp.exec, String.match, and String.replace (? study later)
Memorize this example - one regular express a time
// Match one d followed by one or more b's followed by one d
// Remember matched b's and the following d
// Ignore case
var myRe = /d(b+)(d)/i;
var myArray = myRe.exec('cdbBdbsbz')
Question: review regular expression in JavaScript?
Array instances
All array instances inherit from Array.prototype.
First thing in the morning, read JavaScript Array webpage, and then, start to work on the target:
1. Memorize all the content on the page. (Estimated time to understand every term on the page: 10+ hours)
https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Array/prototype
2. List all concepts to learn
3. Questions about the content
Training on JavaScript - start from memorizing JavaScript Array APIs
Time spent:
3 hours (July 2, 2016)
https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Array/prototype
Design drills to memorize the JavaScript function names:
1. Properties
Array.prototype
Array.length
Method (33 methods)
Array.from()
Array.isArray()
Array.of()
Array.prototype.concat()
Array.prototype.copyWithin()
Array.prototype.entries()
Array.prototype.every()
Array.prototype.fill()
Array.prototype.filter()
Array.prototype.find()
Array.prototype.findIndex()
Array.prototype.forEach()
Array.prototype.includes()
Array.prototype.indexOf()
Array.prototype.join()
Array.prototype.keys()
Array.prototype.lastIndexOf()
Array.prototype.map()
Array.prototype.pop()
Array.prototype.push()
Array.prototype.reduce()
Array.prototype.reduceRight()
Array.prototype.reverse()
Array.prototype.shift()
Array.prototype.slice()
Array.prototype.some()
Array.prototype.sort()
Array.prototype.splice()
Array.prototype.toLocaleString()
Array.prototype.toSource()
Array.prototype.toString()
Array.prototype.unshift()
Array.prototype.values()
Inheritance:
Function -> properties -> (5, please remember: c, d, l, n, p)
Functon.caller
Function.displayName
Function.length
Function.name
Function.prototype
Function -> Methods -> (6, please remember: a, b, c, i, t, t)
Function.prototype.apply()
Function.prototype.bind()
Function.prototype.call()
Function.prototype.isGenerator()
Function.prototype.toSource()
Function.prototype.toString()
Object
Methods
Object.prototype.__defineGetter__()
...
2. Study notes (July 2, 2016):
a global object,
list-like objects
Access(index into) an Array item
Loop over an array - forEach
push - Add to the end of an Array
pop - Remove from the end of an Array
shift - Remove from the front of an Array
unshift - Add to the front of an array
Adds one or more elements to the front of an array and returns the new length of the array.
push - find the index of an item in the Array
pop - Remove an item by Index Position
splice - Remove an item by Index Position
slice - Copy an Array
julia's comment: slice or dice, slice is just to get part of array, can be the whole array.
function syntax, startIndex, endIndex, arr.slice([begin[, end]])
from - Array.from(), creates a new Array instance from an array-like or iterable object.
isArray - Array.isArray(), returns true if a variable is an array, if not false.
of - Array.of(), creates a new Array instance within a variable number of arguments, regardless of number or type of the arguments.
Mutator methods - modify the array
copyWithin - Copies a sequence of array elements with the array
fill - Fills all the elements of an array from a start index to an end index with a static value.
splice - Adds and/or removes elements from an array.
join - joins all elements of an array into a string.
Iteration methods:
forEach()
entries()
every()
some()
filter()
find()
findIndex()
keys()
map()
reduce()
reduceRight()
values()
Question: Syntax - what kind of definition? [ <- optional argument?
traversal and mutation operations
Arrays can be stored at non-contiguous locations in the array, JavaScript arrays are not guaranteed to be dense.
Questions: When to use typed arrays?
JavaScript arrays are not guaranteed to be dense, so typed arrays are guaranteed to be dense. (? Look into it later)
Questions: an associated array - what is "associated" meaning?
zero-indexed -
using bracket notation - renderer['ed].setTexture(model, 'character.png') - works properly
with dot notation - cannot be referenced with dot notation, must be accessed using bracket notation.
Array.length talk - A JavaScript array's length property and numerical properties are connected. Several of the built-in array methods (e.g., join, slice, indexOf, etc.) take into account value of an array's length property when they are called. Other methods (e.g., push, splice, etc.) also result in updates to an array's length property.
Questions: built-in array methods ? Array.prototype.join, those functions are defined for all iterable object.
Good reading with one example, two lines of JavaScript code:
Creating an array using the result of a match
RegExp.exec, String.match, and String.replace (? study later)
Memorize this example - one regular express a time
// Match one d followed by one or more b's followed by one d
// Remember matched b's and the following d
// Ignore case
var myRe = /d(b+)(d)/i;
var myArray = myRe.exec('cdbBdbsbz')
Question: review regular expression in JavaScript?
Array instances
All array instances inherit from Array.prototype.
Some people play not to lose. I play to win each and every second I'm on court. #SpeedTakes aggression. pic.twitter.com/ae5xlriogs— Simona Halep (@Simona_Halep) July 2, 2016
Friday, July 1, 2016
Google - Nine principles of innovation
July 1, 2016
Study 9 core principles of innovation
1. Innovation comes from anywhere
Moral obligation to extend help, change search result, for example: "How to commit suicide" - National Suicide Prevention Hotline
2. Focus on the user
Worry about the money later, when you focus on the user, all else will follow.
Predictive analysis so search suggestions come up after the user types a few keystrokes. This instant search feature saves the user a few microseconds with each entry. Google sales reps were concerned that this shortened the time customers would review ads, but the company went ahead and believed that it was worth the risk.
"Create a great user experience and the revenue will take care of itself."
3. Aim to be ten times better
If you come into work thinking that you will improve things by ten percent, you will only see incremental change. Think 10 times improvement instead.
4. Bet on technical strengths
a self-driving car - all building blocks - Google maps, Google Earth, and Street View cars.
5. Ship and iterate
Ship your products often and early, and do not wait for perfection.
Google Chrome - launched in 2008, every six weeks Google pushed out an improved version.
6. Give employees 20 percent time
"They will delight you with their creative thinking"
Google street view car -> Google tricycle
7. Default to open processes
Make your processes open to all users. Tap into the collective energy of the user base to obtain great ideas.
Android platform -> open source
voice search app -> children sent clever videos that rival the campaigns of the big ad agencies.
8. Fail well
There should be no stigma attached to failure.
9. Have a mission that matters
Chinese version:
Study 9 core principles of innovation
1. Innovation comes from anywhere
Moral obligation to extend help, change search result, for example: "How to commit suicide" - National Suicide Prevention Hotline
2. Focus on the user
Worry about the money later, when you focus on the user, all else will follow.
Predictive analysis so search suggestions come up after the user types a few keystrokes. This instant search feature saves the user a few microseconds with each entry. Google sales reps were concerned that this shortened the time customers would review ads, but the company went ahead and believed that it was worth the risk.
"Create a great user experience and the revenue will take care of itself."
3. Aim to be ten times better
If you come into work thinking that you will improve things by ten percent, you will only see incremental change. Think 10 times improvement instead.
4. Bet on technical strengths
a self-driving car - all building blocks - Google maps, Google Earth, and Street View cars.
5. Ship and iterate
Ship your products often and early, and do not wait for perfection.
Google Chrome - launched in 2008, every six weeks Google pushed out an improved version.
6. Give employees 20 percent time
"They will delight you with their creative thinking"
Google street view car -> Google tricycle
7. Default to open processes
Make your processes open to all users. Tap into the collective energy of the user base to obtain great ideas.
Android platform -> open source
voice search app -> children sent clever videos that rival the campaigns of the big ad agencies.
8. Fail well
There should be no stigma attached to failure.
9. Have a mission that matters
Chinese version:
Teach people how to be a manager from a programmer background
July 1, 2016
Teach people how to be a manager as a programmer
http://www.businessinsider.com/8-habits-of-highly-effective-google-managers-2011-3
1. Be a good coach (provide specific, constructive feedback, balance +,- feedbacks)
Have regular one-on-ones, tailored to the employee's strengths.
2. Empower your team and don't micro-manage
Make "sketch" assignments
3. Express interest in employee's success and well-being
4. Be productive and results-oriented
5. Be a good communicator and listen to your team
6. Help your employees with career development
7. Have a clear vision and strategy for the team
8. Have key technical skills, so you can help advise the team.
7. Better bosses
"people analytics" teams - Eight habits of Highly Effective Google Managers
"cognitive biases" - "halo/horns" effect
Have some time for them and to be consistent.
Teach people how to be a manager as a programmer
http://www.businessinsider.com/8-habits-of-highly-effective-google-managers-2011-3
1. Be a good coach (provide specific, constructive feedback, balance +,- feedbacks)
Have regular one-on-ones, tailored to the employee's strengths.
2. Empower your team and don't micro-manage
Make "sketch" assignments
3. Express interest in employee's success and well-being
4. Be productive and results-oriented
5. Be a good communicator and listen to your team
6. Help your employees with career development
7. Have a clear vision and strategy for the team
8. Have key technical skills, so you can help advise the team.
7. Better bosses
"people analytics" teams - Eight habits of Highly Effective Google Managers
"cognitive biases" - "halo/horns" effect
Have some time for them and to be consistent.
Office politics, hard conversation, company culture study
July 1, 2016
Spend 20 minutes to do some research about office politics. Study the article and write down some notes. Julia did some research before - office politics.
It is better to focus on thing easy to control, work on communication instead. She takes baby steps, learns to improve communication. But, it is worthy of time to study the article.
How facebook tries to prevent office politics?
https://hbr.org/2016/06/how-facebook-tries-to-prevent-office-politics
Office politics is very good topic, Julia learns not to waste time on it. Try to move it positive directions. Do not take it personal, think about how to win together, do not let emotion take control. Learn to play very good team sports through tennis helps a lot. Julia just keeps calm, and active and move forward with creative ideas/ solutions.
Here is the notes from the article.
Five tactics:
1. Look for empire builders, self-servers, and whiners in the hiring process - and don't hire them.
Hire best and smartest people they can find.
Priorities are company, team, and self - in that order.
2. Take the incentive out of "climbing the ladder".
At Facebook, moving into management is not a promotion. It's a lateral move, a parallel track.
Managers are people with strong people skills.
Individual contributors (ICs) should be your best minds for informing team goals and direction.
Use "hackamonth", where ICs can take a month to help another team on a specific project. It helps to keep talent at the company, keep mold from growing on our team.
3. Be open and transparent, and create opportunities for voices to be heard.
More readings:
http://fortune.com/2015/12/09/facebook-company-culture/
6. Chinese blogs about career, facebook:
https://zhuanlan.zhihu.com/p/20879014?refer=qinchao
https://zhuanlan.zhihu.com/p/20865236?refer=qinchao
7. Data driven, A/B testing, great article:
https://zhuanlan.zhihu.com/p/20865236?refer=qinchao
https://zhuanlan.zhihu.com/p/20226008
More reading:
Dec. 3, 2016
https://www.glassdoor.com/employers/blog/5-ways-that-facebook-attracts-the-best-talent/
Spend 20 minutes to do some research about office politics. Study the article and write down some notes. Julia did some research before - office politics.
It is better to focus on thing easy to control, work on communication instead. She takes baby steps, learns to improve communication. But, it is worthy of time to study the article.
How facebook tries to prevent office politics?
https://hbr.org/2016/06/how-facebook-tries-to-prevent-office-politics
Office politics is very good topic, Julia learns not to waste time on it. Try to move it positive directions. Do not take it personal, think about how to win together, do not let emotion take control. Learn to play very good team sports through tennis helps a lot. Julia just keeps calm, and active and move forward with creative ideas/ solutions.
Here is the notes from the article.
Five tactics:
1. Look for empire builders, self-servers, and whiners in the hiring process - and don't hire them.
Hire best and smartest people they can find.
Priorities are company, team, and self - in that order.
2. Take the incentive out of "climbing the ladder".
At Facebook, moving into management is not a promotion. It's a lateral move, a parallel track.
Managers are people with strong people skills.
Individual contributors (ICs) should be your best minds for informing team goals and direction.
Use "hackamonth", where ICs can take a month to help another team on a specific project. It helps to keep talent at the company, keep mold from growing on our team.
3. Be open and transparent, and create opportunities for voices to be heard.
- make escalation "legal"
- frequent question-and-answer sessions with leadership.
- Engagement surveys
4. Make everyone accountable, so personal bias can't creep into decision making.
5. Train your leaders to effectively manage politics out of conversations.
... we train employees on how to have hard conversation. We tell them when they see something they don't like, they should start by telling the other person what they saw, how they felt, and what the result of that action was.
... we tell them not to assume you understand the why - start by trying to understand the other person's perspective. Doing so helps avoid the kinds of resentment that can lead to political behavior.
More readings:
Facebook core values:
1. Be bold 2. Focus on impact 3. Move fast 4. Be Open 5. Build Social Value
1. Be bold 2. Focus on impact 3. Move fast 4. Be Open 5. Build Social Value
http://recruiterbox.com/blog/3-ways-facebook-recruits-hires-the-best-candidates/
Hire best, not just for next 6 months.
2. Break All rules - for each new manager
http://www.businessinsider.com/facebook-recommends-this-book-to-new-managers-2016-2
Hire best, not just for next 6 months.
2. Break All rules - for each new manager
http://www.businessinsider.com/facebook-recommends-this-book-to-new-managers-2016-2
http://www.gallup.com/businessjournal/529/The-Four-Keys-to-Great-Management.aspx
3.
http://www.businessinsider.com/facebook-hr-chief-explains-its-performance-reviews-2016-2
5. Hard Conversation culture3.
http://www.businessinsider.com/facebook-hr-chief-explains-its-performance-reviews-2016-2
http://fortune.com/2015/12/09/facebook-company-culture/
6. Chinese blogs about career, facebook:
https://zhuanlan.zhihu.com/p/20879014?refer=qinchao
https://zhuanlan.zhihu.com/p/20865236?refer=qinchao
7. Data driven, A/B testing, great article:
https://zhuanlan.zhihu.com/p/20865236?refer=qinchao
https://zhuanlan.zhihu.com/p/20226008
More reading:
Dec. 3, 2016
https://www.glassdoor.com/employers/blog/5-ways-that-facebook-attracts-the-best-talent/
Subscribe to:
Posts (Atom)