6/22/2017

github code review UI is so hard to use! Use gerrit

Damn it!

How to integrate gerrit with Jenkins?
An important tool is to use /gerrit_manual_trigger/
If it works, the whole integration should work.

Important things:

  • Gerrit Trigger is setup correctly
  • Additional Behaviors Strategy for choosing what to build: Choosing strategy: Gerrit Trigger
  • Gerrit Project: type and pattern must be set correctly. Plain needs to match exactly the words.
  • To enable email notifications: sudo apt-get install mailutils
Gerrit command:
ssh -p 29418 ec2-34-208-116-181.us-west-2.compute.amazonaws.com gerrit create-account --group "'Non-Interactive Users'" --email reviews@deepmap.ai jenkins

6/09/2017

C++ private pointer member can cause weird segment fault

If an class is allowed to copy and assign (e.g. a proto class), it's better to just assign an instance to the class. For example, the configuration proto. If the class is not allowed to copy and assign, allocate the memory on heap and let some class to take the ownership.

NEVER use a class pointer member to point to some class's member on the stack. It can cause very weird segment fault crash and it's very hard to debug.

6/05/2017

python-photo-tools notes

How to install PIP in MobaXterm

apt-get install python2-imaging
apt-get install python2-pip

python -m pip install Pillow

5/27/2017

How to set up Windows sound loopback

Install  VB-audio virtual cable

When recording background music:
Sound | Playback | Set Cable Input as Default

Sound | Recording | Microphone Array | Properties | Listen to Cable Input

Sound | Recording | Cable Output | Properties | Listen to Headphone

In the recording app, set the mic to Cable Output as the input source.

This way the Cable Output will include both the background music from the computer and the sound from the microphone.

5/26/2017

Eclipse Java autoformatter line wrapping settings


Uncheck Prefer wrapping outer expressions(...)

5/11/2017

C++: Please very special attention to map element deletion when iterating it

The normal way doesn't work. You need to use this way:
for (auto it = m.cbegin(); it != m.cend() /* not hoisted */; /* no increment */)
{
  if (must_delete)
  {
    m.erase(it++);    // or "it = m.erase(it)" since C++11
  }
  else
  {
    ++it;
  }
}

5/10/2017

C++ code should depend on tcmalloc

It can improve the performance by 30%