Tag:c

  • [Ubuntu] compile GTEST on Ubuntu, write gtest-config.cmake and test

    Time:2019-12-9

    This article was first published on my blog https://kezunlin.me/post/4a1427cf/, welcome to read! compile gtest on ubuntu 16.04 Guide compile gtest on ubuntu 16.04 compile gtest on windows 10 apt-get sudo apt-get install libgtest-dev cd /usr/src/gtest # only source files compile git clone https://github.com/google/googletest.git wget https://github.com/google/googletest/archive/release-1.8.0.tar.gz cd googletest mkdir build cd build cmake-gui .. make -j8 […]

  • [share] a very simple baseentity crud method

    Time:2019-12-9

    Preface I’ve tried ado.net, dapper, EF, repository, and even written generator tools for regular CRUD operations. Their daily operation is inconvenient: Declaration and operation are required before each use; Many people have an entity class, corresponding to an operation class (or Dal, dbcontext, repository); Baseentity is a very simple codefirst development method, especially for single […]

  • Detailed explanation of RSA encryption and decryption in C

    Time:2019-12-9

    1. RSA encryption and decryption — use public key encryption and private key decryption public class RSATool { public string Encrypt(string strText, string strPublicKey) { RSACryptoServiceProvider rsa = new RSACryptoServiceProvider(); rsa.FromXmlString(strPublicKey); byte[] byteText = Encoding.UTF8.GetBytes(strText); byte[] byteEntry = rsa.Encrypt(byteText, false); return Convert.ToBase64String(byteEntry); } public string Decrypt(string strEntryText,string strPrivateKey) { RSACryptoServiceProvider rsa = new RSACryptoServiceProvider(); rsa.FromXmlString(strPrivateKey); […]

  • Lua web rapid development guide (5) – building httpd template engine with template library

    Time:2019-12-9

    Introducing template Template engine is generated to separate user interface and business data (content), which is not a profound technology The template engine first compiles legal templates into Lua functions, and then generates an HTML code of template files and data through the template engine CF’s admin library uses template to build server-side rendering pages, […]

  • [windows part] compile GTEST and cmakelists.txt on Windows 10

    Time:2019-12-8

    This article starts from my blog https://kezunlin.me/post/aca50ff8/, welcome to read! compile gtest on windows 10<!–more–> Guide compile gtest on ubuntu 16.04 compile gtest on windows 10 download wget https://github.com/google/googletest/archive/release-1.8.0.zip compile mkdir build cd build sudo cmake-gui .. with options BUILD_SHARED_LIBS ON CMAKE_CONFIGURATION_TYPES Release compile and install gtest to C:\Program Files\gtest. CMakeLists.txt if(MSVC) SET(GTEST_ROOT “C:/Program Files/gtest”) […]

  • The third of Python’s parent parser series: generating a peg parser

    Time:2019-12-8

    Original question | Generating a PEG Parser author|Guido van Rossum (father of Python) TranslatorPea flower cat (Python cat public number writer) statement|This translation is for the purpose of communication and learning, based on CC by-nc-sa 4.0 license agreement. For the convenience of reading, the content is slightly changed. First address: https://mp.weixin.qq.com/s/oj I’ve outlined the parser […]

  • Lite language — from introduction to abandonment (2)

    Time:2019-12-8

    github.com/kulics/lite​Let’s take a look at Lite’s function and structure design this time. Function declaration In Lite, a function is also an expression. It must be assigned to a variable or a non variable. The declaration format is # (->) {} # function : (->) { #Functional logic# a = 1 + 1 } This is […]

  • An example analysis of C ා date format string conversion

    Time:2019-12-8

    In this paper, an example is given to illustrate the conversion operation of C ා date format strings. To share with you for your reference, as follows: Method 1: convert.todatetime (string) String format is required, it must be yyyy MM DD HH: mm: SS Method 2: convert.todatetime (string, iformatprovider) DateTime dt; DateTimeFormatInfo dtFormat = new […]

  • Implementation of singleton class in C + +

    Time:2019-12-7

    This article was first published on my blog https://kezunlin.me/post/8932eaec/, welcome to read! singleton class and usage in c++. Guide what singleton solve? https://stackoverflow.com/que… Singletons solve one (and only one) problem. Resource Contention.If you have some resource that(1) can only have a single instance, and(2) you need to manage that single instance,you need a singleton. There […]

  • OVS dpdk vxlan tunnel processing

    Time:2019-12-7

    Before learning about the implementation of OVS vxlan, let’s review how traditional vtep devices handle vxlan messages. As shown in the figure below: After the vxlan message enters the switch port, the vxlan tunnel is terminated according to the message header information. After the end of the tunnel, overlay mapping is carried out according to […]

  • . net technology salon activity – DNT elite forum: witness. Net, successful cases on the tuyere!

    Time:2019-12-7

    On July 28, 2019, the first phase of DNT Elite Forum (and. Net Beijing Club) will be held in Zhongguancun International maker center in Beijing. Launched by senior. Net experts and community activists, the forum is based on the principle of “sharing, growth, cooperation and win-win” and aims to build a leading technology sharing platform […]

  • Explain the usage of C + + BitSet

    Time:2019-12-7

    C + + BitSet is an array like structure in the BitSet header file. Each element can only be 0 or 1, and each element only uses 1 bit space. Here’s how Constructor There are four types of BitSet common constructors, as follows BitSet < 4 > bitset1; // no parameter construction, length is 4, […]