how to cherry-pick a merge commit 5/5 (1)

Problem: For example: I have a merge in main dev branch, I want to cherry-pick that merge into a relatively old prod branch, If we directly do: git cherry-pick merge_commit_in_dev_branch, we will get a  error:  is a merge but no -m option was given. Solution So we need to do this: git cherry-pick -m 1  • Read More »


How to synchronize audio video stream (a/v sync) 5/5 (1)

How to a/v sync in IETF RFC? The RFC specified how to do a/v sycn generally in  https://tools.ietf.org/html/rfc6051 RTP flows are synchronised by receivers based on information that is contained in RTCP SR packets generated by senders (specifically, the NTP-format timestamp and the RTP timestamp). Synchronisation requires that a common reference clock MUST be used • Read More »


how to submit a patch to google’s webrtc native 5/5 (1)

I recently submitted a patch to webrtc native. https://webrtc-review.googlesource.com/c/src/+/143841 https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!topic/discuss-webrtc/zn4kmjflvt4 The process is not that difficult, but there could be some caveats depending on your os version etc. Here is my notes/steps:   Read official doc Basically you should follow this official doc is at: https://webrtc.org/contributing/   install depot_tools mkdir webrtc && cd webrtc $ git clone • Read More »


vim how to install vim-grammarous plugin ( grammar check ) 5/5 (2)

vim has a grammar check plugin https://github.com/rhysd/vim-grammarous How to install vim-grammarous? it uses new vim 8+ plugin mechanism, so we can easily install it by: mkdir -p ~/.vim/pack/bundle/start cd ~/.vim/pack/bundle/start git clone https://github.com/rhysd/vim-grammarous   The first time you run the: GrammarousCheck in the vim, it will auto download the languagetool (java jar) etc. How to • Read More »


H.264 profile-level-id, packetization-mode, NAL, I-frame, I-slice 5/5 (1)

H.264 profile-level-id in sdp: profile-level-id = 428014  ( remember SDP use hex, wiki/h264 they use decimal ) profile_idc 0x42 == 66 so it is Baseline profile profile-iop 0x80 mean constraint_set0_flag=1 (so it is Constrained Baseline profile) and others 0 level-idc 0x14 == 20 so it is Level 2.0 https://en.wikipedia.org/wiki/H.264/MPEG-4_AVC described the details of h264 profile, level. Profiles • Read More »


c++ coroutine 5/5 (1)

Coroutines Internals https://www.boost.org/doc/libs/1_70_0/libs/coroutine2/doc/html/index.html https://theboostcpplibraries.com/boost.coroutine https://www.netways.de/en/blog/2019/04/04/modern-c-programming-coroutines-with-boost/ Coroutines introduction Your first coroutine co_awaiting coroutines   https://en.cppreference.com/w/cpp/language/coroutines   Please rate this rating


How to learn pytorch from scratch 5/5 (1)

Pytoch is a quite powerful, flexible and yet popular deep learning framework. The learning curve could be steep if you do not have much deep learning background. So what is a good way to learn it? The official pytorch webiste has some great tutorials at: https://pytorch.org/tutorials/ IMHO those materials are tuned to some intermediate level • Read More »


how to prevent nvidia GPU hangup on ( debian 10) 5/5 (3)

debian 10 have nvidia GPU driver, cuda 9 etc, it is a good thing  for deep learning ( keras or pytorch). but  if let it running for some time ( without any interrupt), it hang after the power management kick in. Work around is to turn off the power management by doing: sudo systemctl mask • Read More »


gdb and signal handling ( especially sigwaitinfo ) 5/5 (1)

How gdb generally works In a debugging session, when the debugger wants to set a breakpoint, it replaces an instruction by int3 When the trap instruction (0xCC on x86) is executed, the processor notifies the OS. On UNIX, the OS checks to see whether the process is being ptraced by somebody. If no, the SIGTRAP signal is delivered to • Read More »


c++ lambda capture, weak_ptr, shared_ptr many subtle caveats 5/5 (1)

Some notes about C++ lamba capture, shared_ptr/weak_ptr, they are not quite obvious! (1) lambda capture implement it is simply just put the captures as members either by copy or reference. special capture this point:  we don’t need to make a distinction between local variables and fields of a class when writing lambda functions. how to • Read More »