Skip to content

Instantly share code, notes, and snippets.

Avatar
🐝
Focusing

QI Jianpeng qijianpeng

🐝
Focusing
View GitHub Profile
@qijianpeng
qijianpeng / encoding_decoding_block.md
Created Oct 20, 2020
Encoding or Decoding an NDN Block.
View encoding_decoding_block.md

Util methods can be found in ndn-cxx/ndn-cxx/encoding/block-helpers.cpp.

  //Encoding
  Block block = ::ndn::encoding::makeStringBlock(::ndn::tlv::ApplicationParameters, "string_str");
  //Decoding
  std::string functionParameters = ndn::encoding::readString(block);
@qijianpeng
qijianpeng / uuid-gen.cpp
Created Oct 15, 2020
Generate uuid by boost lib.
View uuid-gen.cpp
#include <boost/uuid/uuid.hpp>
#include <boost/uuid/uuid_io.hpp>
#include <boost/uuid/uuid_generators.hpp>
#include <boost/lexical_cast.hpp>
std::string Genuuid(const int startPos, const int lengthHex)
{
boost::uuids::random_generator gen;
boost::uuids::uuid uuidId = gen();
@qijianpeng
qijianpeng / nearest_common_commit_to_merge_point.sh
Last active May 1, 2019
Find the nearest common commit id to the MERGE_POINT
View nearest_common_commit_to_merge_point.sh
#
# Checks if differences occur between two branches.
#
# Usage:
# source ./build_utils.sh
# DIRECTORY="idbc"
# #before merge
# COMMON_COMMITS_ID=`common_branch_commit_id ur_branch_1 trunk/master`
# #after merge
# RES=`diferences_check $COMMON_COMMITS_ID HEAD $DIRECTORY`
@qijianpeng
qijianpeng / os_match.sh
Created Apr 26, 2019
Matching Operating System version.
View os_match.sh
#!/bin/sh
cyan='\e[1;37;44m'
red='\e[1;31m'
endColor='\e[0m'
datetime=$(date +%Y%m%d%H%M%S)
function lowercase(){
echo "$1" | sed "y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/"
}
@qijianpeng
qijianpeng / Sublime Text License Key.md
Created Jan 17, 2018 — forked from pkfrom/Sublime Text License Key.md
Sublime Text 2 License Key, Sublime Text 3 License Key, Sublime Text Full Version.
View Sublime Text License Key.md
@qijianpeng
qijianpeng / gist:f1f84e390d4917edd7036f4d49697441
Created Jul 14, 2017 — forked from debasishg/gist:8172796
A collection of links for streaming algorithms and data structures
View gist:f1f84e390d4917edd7036f4d49697441
  1. General Background and Overview