• ARCHIVE
  • ABOUT
  • TRAVEL
  • PHOTOGRAPHY
  • RSS
  • Bye Google! Hey Uber!

    May 20, 2021

    3 years and 5 months, it’s time to move on!

    I’m so grateful I had the privelege to work so many smart and nice people in Google, this is the place where I grew into a leader and learned how to manage projects and people.

    The reason I’m leaving has nothing to do with YouTube TV, nor the company, I’m very proud of the product and features that we developed and shipped, I would strongly recommend Google to my friends because it’s the best place to work, especially for engineers.

    Google Badge and Laptop

    ...more
  • Adjust Raspberry Pi camera focus to fix the blurry issue

    May 28, 2020

    Raspberry Pi Camera

    Device: Raspberry Pi 3 B+
    Camera: Raspberry Pi Camera v2.1

    I tried to use a Raspberry Pi to shoot a timelapse, to record the growth of my baby tangerine.

    However, after checking the first pilot, the tangerine plant is pretty blurry, the camera was focusing on somewhere far away but not the plant, like the floor in the background is clear.

    ...more
  • Return Value Optimization disabled for static variable

    Mar 14, 2020

    TL;DR

    If a function returns a static variable, there won’t be any return value optimization (RVO), as static variable is allocated for the lifetime of the program, it can’t be moved.

    ...more
  • Facebook 北美地区 E3 到 E8 程序员薪水分析

    Feb 4, 2020

    前一篇 湾区大厂程序员薪水构成、level 和对应期望,介绍了硅谷几座大厂程序员薪水的基本构成和每个 level 的对应职责。这一篇,我们利用 levels.fyi 的公开数据(包含了从 2017 年到 2020 年各大科技公司、各类职位、各个 level 的收入数据),就脸书 FB 从 E3 到 E8 程序员的年收入 TC (Total Compensation) 做一些分析。

    Facebook logo in front of its headquarter.

    ...more
  • 湾区大厂程序员薪水构成、level 和对应期望

    Feb 3, 2020

    新年伊始,周围不少小伙伴拿完 bonus,打算转行或跳槽,正好问到了程序员待遇、level 等话题,这里就硅谷几个大厂(谷歌、脸书、领英、亚麻、微软等)的薪水构成、程序员 level 以及职业发展做一些简单介绍。

    Silicon Valley TV Show Intro Screenshot.

    ...more
  • The const reference vs pointer in C++ class constructor

    Jan 20, 2020

    tl;dr

    There are many discussions between reference and pointers, it’s not always true to say “use references when you can, and pointers when you have to“. We should pay attention to the lifetime of the input parameters, choose the one that is safer and more efficient according to the use case.

    How to pass a parameter?

    Before we talk about const reference vs. pointer in C++ class constructor, let’s take a quick look at different ways of passing a parameter to a function.

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    // 1. Passing by value.
    void DoSomething(int a) {}

    // 2. Passing by const reference.
    void DoSomething(const int& a) {}

    // 3. Passing by pointer.
    void DoSomething(int* a) {}

    // 4. Passing by const pointer.
    void DoSomething(const int* a) {}
    # parameter object copied? original object mutable?
    1 passing by value ✔️ X
    2 passing by const reference X X
    3 passing by pointer X ✔️
    4 passing by const pointer X X

    As it can easily tell from the table above, passing by value introduces an extra object copy, while passing by pointer makes the original object mutable.

    If you just want to pass some data, do some work with its value without updating it, you can choose #2 or #4, (don’t pick #1 as it’s could be expensive especially for large object, don’t use #3 as you could mistankenly update its value). Between #2 and #4, I’m leaning to #2 because reference is always non-nullable.

    If you want to pass a parameter and update its value, pick #3 obviously.

    I rarely use #1 in daily work.

    ...more
  • 解决百度爬虫无法爬取 Github Pages 个人博客的问题

    Jan 15, 2020

    据 marketmechina 统计,去年12月份中国市场全平台 (桌面+手机客户端)搜索引擎市场份额:

    • 百度: 67.09%
    • 搜狗: 18.75%
    • 神马: 6.84%
    • 谷歌: 2.64%
    • 必应: 2.6%
    • 其它: 2.08%

    不得不说,即使大家现在如此 diss 百度,这中文搜索的第一把交椅,百度还是坐的很稳。想要获得中文搜索的流量,百度这一入口不容忽视。

    ...more
  • Use git-mv to Rename or Move a File

    Jan 12, 2020

    Tl;dr

    Use

    1
    git mv [source_file] [destination_file]

    to rename or move a file instead of renaming or moving a file directly (e.g. from IDE, or via mv). This is helpful for preserving history and potentially helpful for preventing merge mistakes.

    ...more
NEXT

2013 - 2022 | Zhipeng Jiang | CC BY-NC-SA