jni static registration pure gradle compilation of those things

First, we register a static jni function and write the following code in the entry java class: static { System.loadLibrary("test"); } Then the header file is generated with javah at the terminal. If the command is not found in the report, the environment variable is configured.Find out where jdk is under mac, as shown in the figure ...

Posted by jaco on Sat, 11 May 2019 07:18:48 -0700

Luogu P1553 Digital Flip (Upgraded Edition)

Topic link: https://www.luogu.org/problemnew/show/P1553   Title Description   Given a number, invert the digits on each bit of the number to get a new number. This time, unlike the first question of the NOIp2011 Popularization Group, this number can be decimal, fractional, percentage and integer. Integer inversion is the reversion of all ...

Posted by drak on Sat, 11 May 2019 03:05:57 -0700

Chapter 4 Learning Summary

Chapter 4 is about strings, arrays and generalized tables. In the process of doing the problem, strings are gradually found to be powerful in STL (the next goal is to be familiar with the functions of strings). Skyscraper L1-8 AI Core Code Valuated at 100 million Finally, the problem has been solved. The idea is to divide the levels as far as ...

Posted by ramjai on Thu, 09 May 2019 18:44:40 -0700

c/c++ Inheritance and Polymorphism Conversion Rules from Subclasses to Parents

Question 1: Subclass B can inherit parent A in three ways (public, protected, private). In which way can user code transform object of subclass B into object of parent A? Only when subclass B inherits parent class A in public mode, can the object of subclass B be converted into parent class A in user code. The reasons are as follows: The cla ...

Posted by bretticus on Wed, 08 May 2019 18:03:38 -0700

The Concept and Significance of [C++] 58_Class Template

Reflection:Can generics be applied to classes in C++? Class template Some classes are mainly used to store and organize data elements The way data is organized in a class has nothing to do with the specific types of data elements For example: array class, linked list class, Stack class, Queue class, etc. The idea of template is applied to cla ...

Posted by Naoa on Wed, 08 May 2019 16:57:38 -0700

[C++]57_Deep Understanding Function Template

Function template Deep Understanding of Function Templates The compiler generates different functions from function templates by specific types The compiler compiles the function template twice Compile the template code itself (syntax checking, etc.) Compile the code after parameter substitution (syntax checking, etc.) Matters need ...

Posted by apenster on Fri, 03 May 2019 19:10:38 -0700

Lock overhead optimization and a brief description of CAS

[TOC] lock Mutual exclusion locks are used to protect a critical area, that is, to protect a program fragment accessing shared resources, which can not be accessed by multiple threads at the same time. When a thread enters a critical section, other threads or processes must wait. When it comes to the performance overhead of locks, it is general ...

Posted by roby2411 on Tue, 23 Apr 2019 12:51:34 -0700

What are the new features of C++ 11 compared with C++98

This article is a translation of the following blog: https://herbsutter.com/elements-of-modern-c-style/     The C++11 standard provides many useful new features. This article focuses on the features that make C++11 and C++98 look like a new language, because: C++11 has changed the style and habit of writing C++ code and the way of designi ...

Posted by brad_fears on Thu, 11 Apr 2019 20:48:32 -0700

OpenCL Copies Arrays from Memory to Display Memory

I wanted to optimize the last blog, but the effect was not obvious. But remember the knowledge points. The original intention is to move the calculation of domain defined in the previous blog to CPU, because the calculation of domain defined is the same for every kernel, so direct reading should further reduce the execution time of the kernel. ...

Posted by SilveR316 on Thu, 11 Apr 2019 10:42:32 -0700

spdlog source code reading (2): creation and use of sinks

2. sink creation 2.1 or rotating_file_sink We still take rotating_file_sink as an example to illustrate the process of sink creation in spdlog. The file_log.cpp file can be found in spdlog-master/tests. The example code for rotate is as follows: TEST_CASE("rotating_file_logger1", "[rotating_logger]]") { 1. prepare_logdir(); 2. std::stri ...

Posted by releasedj on Mon, 08 Apr 2019 18:36:30 -0700