Nikola Brežnjak blog - Tackling software development with a dose of humor
  • Home
  • Daily Thoughts
  • Ionic
  • Stack Overflow
  • Books
  • About me
Home
Daily Thoughts
Ionic
Stack Overflow
Books
About me
  • Home
  • Daily Thoughts
  • Ionic
  • Stack Overflow
  • Books
  • About me
Nikola Brežnjak blog - Tackling software development with a dose of humor
Books

The 5 Elements of Effective Thinking – E. Burger and M. Starbird

My notes from the bestseller book The 5 Elements of Effective Thinking by the authors Edward B. Burger and Michael Starbird, which I rated  5/5 and marked as favorite on my Shelfari account:

Earth – understand deeply

Fire – make mistakes

Air – raise questions

Water – follow the flow of ideas

Change – universal constant that allows you to get the most out of living and learning

Education is what survives when what has been learned has been forgotten. ~ B. F. Skinner

In everything you do, refine your skills and knowledge about fundamental knowledge and simple cases. Once is never enough. As you revisit fundamentals you’ll find new insights.

The depth with which you master the basics influences how well you understand everything you learn after that.

As you learn more, the fundamentals become at once simpler but also subtler, deeper, more nuanced, and more meaningful.

One of the challenges of life is to be open-minded about new ideas and new possibilities.

Sadly, many people spend their entire lives focusing on the wrong questions. They may pursue money, when they really want happiness. They may pursue the respect of people whose favor is really not worthy of being sought. So before you succumb to the temptation to immediately spring to work on the answer, always stop and first ask, “What’s the real question here?” Often the question that seems obvious may not be the question that leads to effective action.

Fail nine times! The next time you face a daunting challenge, think to yourself, “In order for me to resolve this issue, I will have to fail nine times, but on the tenth attempt, I will be successful.” This attitude frees you and allows you to think creatively without fear of failure, because you understand that learning from failure is a forward step toward success. Take a risk and when you fail, no longer think, “Oh, no, what a frustrating waste of time and effort,” but instead extract a new insight from that misstep and correctly think, “Great: one down, nine to go—I’m making forward progress!” And indeed you are. After your first failure, think, “Terrific, I’m 10% done!” Mistakes, loss, and failure are all flashing lights clearly pointing the way to deeper understanding and creative solutions.

Success is the ability to go from one failure to another with no loss of enthusiasm. ~ Winston Churchill

https://twitter.com/HitmanHR/status/670239687009771520

Stack Overflow

How to get nested object property with pluck in Lodash

profile for Nikola at Stack Overflow, Q&A for professional and enthusiast programmers
I’m a big fan of Stack Overflow and I tend to contribute regularly (am currently in the top 0.X%). In this category (stackoverflow) of posts, I will be posting my top rated questions and answers. This, btw, is allowed as explained in the meta thread here.

This Lodash question was actually asked by myself:

I have an array of objects like this:

var characters = [
    { 'name': 'barney',  'age': 36, 'salary':{'amount': 10} },
    { 'name': 'fred',    'age': 40, 'salary':{'amount': 20} },
    { 'name': 'pebbles', 'age': 1,  'salary':{'amount': 30} }
];

I want to get the salary amounts into an array. I managed to do it by chaining two pluck functions, like this:

var salaries = _(characters)
  .pluck('salary')
  .pluck('amount')
  .value();

console.log(salaries); //[10, 20, 30]

Is there a way to do this by using only one pluck? Is there a better way with some other function in lodash?

The answer, from user thefourtheye, was:

You can just give the path to be used as a string, like this

console.log(_(characters).pluck('salary.amount').value())
// [ 10, 20, 30 ]

Or use it directly

console.log(_.pluck(characters, 'salary.amount'));
// [ 10, 20, 30 ]

https://twitter.com/HitmanHR/status/670237244695977984

Recent posts

  • Discipline is also a talent
  • Play for the fun of it
  • The importance of failing
  • A fresh start
  • Perseverance

Categories

  • Android (3)
  • Books (114)
    • Programming (22)
  • CodeProject (35)
  • Daily Thoughts (77)
  • Go (3)
  • iOS (5)
  • JavaScript (127)
    • Angular (4)
    • Angular 2 (3)
    • Ionic (61)
    • Ionic2 (2)
    • Ionic3 (8)
    • MEAN (3)
    • NodeJS (27)
    • Phaser (1)
    • React (1)
    • Three.js (1)
    • Vue.js (2)
  • Leadership (1)
  • Meetups (8)
  • Miscellaneou$ (77)
    • Breaking News (8)
    • CodeSchool (2)
    • Hacker Games (3)
    • Pluralsight (7)
    • Projects (2)
    • Sublime Text (2)
  • PHP (6)
  • Quick tips (40)
  • Servers (8)
    • Heroku (1)
    • Linux (3)
  • Stack Overflow (81)
  • Unity3D (9)
  • Windows (8)
    • C# (2)
    • WPF (3)
  • Wordpress (2)

"There's no short-term solution for a long-term result." ~ Greg Plitt

"Everything around you that you call life was made up by people that were no smarter than you." ~ S. Jobs

"Hard work beats talent when talent doesn't work hard." ~ Tim Notke

© since 2016 - Nikola Brežnjak