• ARCHIVE
  • ABOUT
  • TRAVEL
  • PHOTOGRAPHY
  • RSS
  • 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.

    ...阅读全文
  • 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.

    ...阅读全文
  • 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.

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

    Feb 3, 2020

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

    Silicon Valley TV Show Intro Screenshot.

    ...阅读全文
  • 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.

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

    Jan 15, 2020

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

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

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

    ...阅读全文
  • 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.

    ...阅读全文
  • 干货满满,环佛罗里达州深度自驾游攻略

    Dec 31, 2019

    2019年末,我们完成了一场追着暴风雨的环佛罗里达自驾游!

    2019 year end florida road trip in 13 days

    全程总共接近 2k miles,虽然很遗憾很多地方因为天气原因没去成,但这次行程总体够深入,够硬核!

    这次旅行,我们看到了大象、犀牛、鳄鱼、海豚、珊瑚、各种海鱼和海鸟,尝试了沼泽地骑行、mangrove 丛林划直立桨板、近海浮潜、白沙滩捡贝壳,参观了各类名胜古迹诸如海明威的故居、杜鲁门小白宫、圣马科斯古城堡,深入游览了肯尼迪航天中心,瞻仰了阿波罗登月飞船、亚特兰蒂斯航天飞机、土星五号运载火箭、SpaceX发射基地,品尝了佛罗里达的海鲜大餐和美酒,以及最重要的,遇见了各种各样有趣的人!

    废话不多说,以下是我们的详细行程,包括装备行李、具体行程、吃、住、行几个部分。

    • 装备 & 行李
    • 具体行程
      • 12/18 Fly to Orlando (MCO)
      • 12/19 Drive to Miami
      • 12/20 超舒服酒店体验 @迈阿密
      • 12/21 狂风暴雨中的西礁岛
      • 12/22 狂风暴雨中的西礁岛,again
      • 12/23 离开西礁岛,bye bye
      • 12/24 深入大沼泽地的骑行
      • 12/25 比斯坎国家公园的海上活动
      • 12/26 看鳄鱼 & 海豚,住那不勒斯
      • 12/27 佛罗里达西海岸的白沙滩,捡贝壳 & 浮潜
      • 12/28 住宿、威士忌和美食 @圣奥古斯丁
      • 12/29 刻满历史沧桑的古城堡,圣马科斯堡
      • 12/30 改写了人类历史的肯尼迪航天中心
    • 行程中的吃饭
    • 行程中的住宿
    • 自驾开车
    • 写在最后
    ...阅读全文
下一页

2013 - 2020 | Ox333333 | CC BY-NC-SA