Thursday, August 29, 2019

Acting as a manager

1. “Here’s what I’m hearing … ”
Try it: At the end of team meetings

It is so critical to summarize and clarify the key conclusions and action items for each meeting. When people walk out of the conference room, everyone has a sense of the meeting purpose. Staying on purpose, process and product will make meeting more productive.

2. “Let’s look at what’s going to elevate company's vision/value”
Try it: When giving feedback

In order to do this effectively,  you must know what the company mission or values are. That is the lighthouse for decision maker.

3. “In the long run … ”
Try it: To defuse conflict, or when you screw up

Work out a solution rather than finger-pointing. Let's focus on understanding the problem and working out a fix.


4. “If you ever feel like you’re not growing here, I want you to tell me.”
Try it: In 1-on-1 with direct reports

Focusing on showing how much you care about others and that you share the same values as the group. You’re saying that you’re the type of leader who wants each individual to see progress and be happy, knowing that the team and the company become stronger when each person is advancing.

Update phone numbers in MySQL

We have a bug which stores international UK phone numbers with trunk prefix in the database. For instance, the UK number +442079978240 is wrongly stored as 4402079978240. The request is to update these numbers to remove trunk prefix 0 from the database. For above example, update 4402079978240 to 442079978240 removing the first zero.

The thought is to use regexp to do this update, and Mysql does provide regexp operator and regexp_replace, regexp_substr etc function. However, our current db engine doesn't support regexp_xxx series functions, so we have to rely on regexp operator and other avaliable functions to complete this task.

select out matched numbers using regexp
select phone_number from phone_number_table where phone_number REGEXP '^(440)';

preview result
select concat('44',  right(phone_number, CHAR_LENGTH(phone_number) - 3)) from phone_number_table where phone_number REGEXP '^(440)';

update numbers
UPDATE phone_number_table SET phone_number=concat('44', right(phone_number, CHAR_LENGTH(phone_number) - 3)) WHERE phone_number REGEXP '^(440)';

However, as the where clause doesn't have KEY column, so above update SQL will get an error
You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column To disable safe mode, toggle the option in Preferences -> SQL Editor and reconnect.

disable safe mode, then preform update
SET SQL_SAFE_UPDATES=0;

cleanup
enable safe mode and verify the result
SET SQL_SAFE_UPDATES=1;
select phone_number from phone_number_table where phone_number REGEXP '^(440)';


Monday, August 19, 2019

Email etiquette at work

  • Always use a greeting and a sign-off 
    • Use the person’s name, saying “please” and “thank you” when making requests shows your appreciation.
  • Always use an informative subject line
    • try starting your subject line with an indication of the type of message you’re writing.
  • Don’t write a book in your email
    • Organize your message into a bulleted or numbered list and using bold text for key dates or questions that need answers. Do ask all of your questions at once if possible.
  • Avoid too many or the wrong recipients
  • Don't routinely emailing during off-hours
  • Write helpful and useful out-of-office messages
  • Don't circulate gossip in email
  • Use an professional tone.
  • Send emails after proofreading them.

Thursday, August 15, 2019

Java Annotation 101

JDK 5.0 introduced a few new features including Generics, For/in loop, Autoboxing/Unboxing, Typesafe Enums, Varargs, Static Import and Annotation. This is about 15 years ago, but it is still valuable to do a quick review of this release, esp. the annotation.

Annotations are like meta-tags that you can add to your code and apply to package declarations, type declarations, constructors, methods, fields, parameters and variables.

Simply speaking, an annotation is a mechanism for associating a meta-tag with program elements and allowing the compiler or the VM to extract program behaviors from these annotated elements and generate interdependent code when necessary.

Usually you need use @interface to define an annotation type, then annotate your codes using @MyAnnotation.

There are three annotation types:
  • Marker type annotation has no elements, except the annotation name itself.
  • Single-element, or single-value type, annotation provides a single piece of data only. This can be represented with a data=value pair or, simply with the value (a shortcut syntax) only, within parenthesis.
  • Full-value type annotation has multiple data members. Therefore, you must use a full data=value parameter syntax for each member.
There are two types of annotations available with JDK5:
  • Simple
  • Meta
There are only three types of simple annotations provided by JDK5. They are:
  • Override
  • Deprecated
  • SuppressWarnings
Meta-annotations, which are actually known as the annotations of annotations, contain four types.
  • Target
  • Retention
  • Documented
  • Inherited

Tuesday, August 6, 2019

读书笔记 - Andre Iguodala THE SIXTH MAN


This book is a memoir from Andre Iguodala. There are 9 chapters in this book to tell stories about his professional basketball life, starting from his hometown Springfield, draft by Philadelphia, then traded to Denver, then to Golden State warriors, with the team he won 3 NBA championships in 2015, 2017, 2018, and Finals MVP in 2015.

The nine chapters are
  1. Early lessons
  2. Confidence
  3. When the sun is too hot
  4. Welcome to the NBA
  5. The most hated athlete in town
  6. Elevation
  7. Find the flow
  8. The seventy-fourth win
  9. Riding home
I got this book with his signature from company's event (fireside chat with Andre, as he is company's investor). We went to downtown Marriott conference room, listened to the conversations between Eric and Andre, then followed by audience questions. The most impressed wording from Andre is: the harder you work, the better outcome you get. Grit is critical in our daily life.

Here are some notes from this book.
  • If you weren't reading, you weren't achieving.
  • If you could just focus on getting something done, especially if your goal was to do it better than other people could, you could stay out of trouble.
  • If you don't do everything you possibly can, you will be stuck here for the rest of your life.
  • You have to work to see result.
  • We can't win every single game, just play harder.
  • People like to build you up, and then they like to take you down.
  • You can tell who your real friends are by how they treat you who they don't. (when you in down side)
  • This man breathes the same air you breath.
  • Always pay attention and attention pays off.
  • I wanted to go work where I was happy to go work.
  • He focused on doing little things correctly and with honor and discipline.
  • The true job of an athlete was not to win, but to rise to every occasion, give your best effort, and make those around you better as you did it.
  • Less is more.

Monday, August 5, 2019

读书笔记 - The Making of a Manager


This is a book written by Julie Zhuo to help new managers get on the right track about what to do when everyone looks to you. Julie talks about almost every aspect as a manager in daily work, including leading a small team, giving feedback, managing self, having meetings, hiring, growth, achievements, and culture.

Great managers are made, not born
  • This is how anything in life goes: You try something. You figure out what worked and what didn't. You file away lessons for the future. And then you get better. Rinse, repeat.
  • You need to understand the whys of management, because only when you've bought into the whys can you truly be effective in the hows.
  • Much of the daily work of managers - giving feedback, creating a healthy culture, planning for the future - is universal. 
  • Good design at its core is about understanding people and their needs in order to create the best possible tools for them.
What is management?
  • Your job, as a manager, is to get better outcomes from a group of people working together.
  • The crux of management is the belief that a team of people can achieve more than a single person going it alone.
  • Looks at the team's present outcomes, asks whether we've set up for great outcomes in the future
  • Purpose, people, process. (why, who, how)
  • If you are wondering whether you can be a great manager, ask yourself these three questions
    • Do I find it more motivating to achieve a particular outcome or to play a specific role?
    • Do I like talking with people?
    • Can I provide stability for an emotionally challenging situation?
  • Manager is a specific role, leadership is the particular skill of being able to guide and influence other people. A great manager must certainly be a leader.
Your first three months
  • Every day feels like a week.
  • There is so much to learn and you feel overwhelmed.
  • Your path to manager probably took one of the four routes: apprentice, pioneer, new boss, successor
    • It's tricky to balance your individual contributor commitments with management.
    • As new boss in a new environment, you need to invest in building new relationship.
    • You feel pressure to do things exactly like your former manager. Be yourself; everyone else is already taken.
Leading a small team
  • Everything always goes back to people.
  • What gets in the way of good work?
    • People don't know how to do good work
    • People know how, but they aren't motivated
  • A manager's job is to get better outcomes from a group of people working together through influencing purpose, people and process.
  • Trust is the most important ingredient. 
    • You must trust people, or life becomes impossible.
    • Earn trust with your reports, managing is caring.
  • Strive to be human, not a boss
    • Would you work for your manager again?
  • Be honest and transparent about your report's performance
    • The job of a manager is to turn on person's particular talent into performance
  •  Admit your own mistakes and growth areas
  • No asshole rule (someone who makes other people feel worse about themselves, or specifically targets people less powerful than him/her)
  • You don't always have to make it work
  • Make people moves quickly
The art of feedback
  • Feedback is a gift.
  • The best feedback is the one inspired you to change your behavior, which resulted in your life getting better.
  • Praise is often more motivating than criticism. (You don't always have to start with a problem)
  • The four most common ways to inspire a change in behavior
    • Set clear expectations at the beginning
    • Give task-specific feedback as frequently as you can
    • Share behavioral feedback thoughtfully and regularly
    • Collect 360-degree feedback for maximum objectivity
  • Every major disappointment is a failure to set expectations
  • Your feedback only counts if it makes things better
  • Delivering critical feedback or bad news
Managing yourself
  • Get to brutal honesty with yourself
  • Understand yourself at your best and worst
  • Finding your confidence when you are in the pit
    • Close your eyes and visualize
    • Ask for help from people you can be real with
    • celebrate the little wins
    • practice self-care by establishing boundaries
  • Learning to be twice as good
    • Ask for feedback
    • Treat your manager as a coach
    • Make a mentor out of everyone
    • Set aside time to reflect and set goals
    • Take advantage of formal training
  • Try to double your leadership capacity every year 
  • CEO role: hiring exceptional leaders, building self-reliant teams, establishing a clear vision, and communicating well.
Amazing meetings
  • What is a great outcome for your meeting?
    • Making a decision
    • Sharing information
    • Providing feedback
    • Generating ideas
    • Strengthening relationships
  • Invite the right people
  • Give people a chance to come prepared
  • Make it safe for people to contribute
    • Be explicit about the norms you want to set
    • Change up your meeting format to favor participation
    • manage equal airtime
    • Get feedback about your meeting
  • Some meetings don't need you and some don't need to exist at all
Hiring well
  • Design your team intentionally
  • Hiring is your responsibility
    • Describe your ideal candidate as precisely as you can
    • Develop a sourcing strategy
    • Deliver an amazing interview experience
    • Show candidates how much you want them
  • Hiring is a gamble, but make smart bets
    • Would you hire this person again if the role was open? 
  • Do your research when hiring leaders
  • Take the long view with top talent 
Making things happen
  • Start with a concrete vision
    • Craft a plan based on your team's strength
    • Focus on doing a few things well
    • Define who is responsible for what
    • Break down a big goal into smaller pieces
  • Excerpts
    • Plans are worthless, but planning is everything
    • There is no such thing as "finished".
    • 80/20 rule: majority of results come from a minority of the causes
    • The key is to identify which things matter the most
    • Put effort into a few important things 
    • Effort doesn't count, results are what matter.
    • Innovation is saying no to 1000 things.
    • Treat big projects like a series of smaller projects.
    • Every task has a who and a by when.
    • Portfolio approach for team resource, 1/3 team focusing on near, medium and long term goal
    • Communicate a clear vision and foster a deep sense of purpose within the team.
    • Do you have the right people on the right problems?
Leading a growing team
  • Direct to indirect management (empowering your leaders is a necessity)
  • Context switching all day, every day (every day feels like a week)
  • The skills that matter become more and more people-centric (delegating work to reports)
  • Giving people big problems is a sign of trust (believe your report is capable of solving the problem)
  • Two heads, one shared vision (what are the biggest priorities right now for the team?)
  • What to do when a manager struggles (What's going to make the team more successful over the next few years?)
  • Aim to put yourself out of a job (constantly looking for ways to replace yourself in the job you are currently doing)
    • Identifying and communicating what matters
    • Hiring top talent
    • Resolving conflicts within your group
Nurturing culture
  • Know the kind of team you want to be a part of
    • Understanding your current team
    • Understanding your aspirations
    • Understanding the difference
    • What's unique about your team?
    • What are the best and worst parts of your job?
    • Nothing is somebody else's problem. 
  • Never stop talking about what's important
  • Always walk the walk
    • Talk the talk, walk the walk, build the trust from your reports
    • Talking about your values makes you a more authentic and inspiring leader 
    • Asking for feedbacks
    • Why you choose to build these five features instead of the one that the customers are asking for? 
  • Create the right incentives
  • Invent traditions that celebrate your values

Thursday, August 1, 2019

Australian IPND


The Australian Communications and Media Authority (ACMA) is an Australian government athority.

Integrated Public Number Database (IPND) is an industry-wide database containing all listed and unlisted public telephone numbers. It is managed by Telstra.

Carriage service providers (CSPs) that supply a carriage service to an end-user of a public number must provide the public number and the associated customer data to the IPND Manager.

Where a customer’s IPND record is inaccurate, the CSP must correct the data. This is subject to CSPs checking that the requested changes comply with their regulatory obligations - for example, the CSP should cross-check a customer request to change the spelling of a name against a form of identification.

The ACMA is responsible for monitoring and enforcing CSP compliance with the obligations to provide accurate and timely customer information to the IPND. A key aim of the IPND compliance program is to improve the quality of data in the IPND. This is important because the harms that can result from inaccurate data in the IPND can be serious.

https://www.acma.gov.au/Industry/Telco/Numbering/IPND/integrated-public-number-database-numbering-i-acma