Skip to content

Instantly share code, notes, and snippets.

View qijianpeng's full-sized avatar
🐝
Focusing

QI Jianpeng qijianpeng

🐝
Focusing
  • Ocean Univ. of China
  • Qingdao, China
  • 09:33 (UTC +08:00)
View GitHub Profile
@qijianpeng
qijianpeng / encoding_decoding_block.md
Created October 20, 2020 02:39
Encoding or Decoding an NDN Block.

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 October 15, 2020 08:29
Generate uuid by boost lib.
#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 13:15
Find the nearest common commit id to the MERGE_POINT
#
# 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 April 26, 2019 15:49
Matching Operating System version.
#!/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 January 17, 2018 02:03 — forked from pkfrom/Sublime Text License Key.md
Sublime Text 2 License Key, Sublime Text 3 License Key, Sublime Text Full Version.
@qijianpeng
qijianpeng / gist:f1f84e390d4917edd7036f4d49697441
Created July 14, 2017 03:22 — forked from debasishg/gist:8172796
A collection of links for streaming algorithms and data structures
  1. General Background and Overview