Category: Multiple Programming Languages
Rust – Hello World
main.rs
fn main() {
println!("Hello, world!");
let a = "Water";
println!("Hello, {}!", a);
}
tasks.json
{
"version": "2.0.0",
"tasks": [
{
"label": "build",
"type": "shell",
"command":"cargo",
"args": ["build"]
}
]
}
launch.json
{
"version": "0.2.0",
"configurations": [
{
"name": "(Windows) 启动",
"preLaunchTask": "build",
"type": "cppvsdbg",
"request": "launch",
"program": "${workspaceFolder}/target/debug/${workspaceFolderBasename}.exe",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false
},
{
"name": "(gdb) 启动",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/target/debug/${workspaceFolderBasename}.exe",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"miDebuggerPath": "这里填GDB所在的目录",
"setupCommands": [
{
"description": "为 gdb 启用整齐打印",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
}
]
}
Use SURF Detector to Match Login View in DeXing APP
First, Get the KeyPoint
Second, Capture the screen with your camera
Finally, Get the result with SURF Detector
Some differences between JEB and GDA
Android Studio 3.5.2
JEB 3
GDA 3.66
Android Studio 3.5.2
JEB 3
GDA 3.66
Calling a C Function From Lua
Prepare So
#include <math.h>
#include <lua.h>
#include <lauxlib.h>
#include <lualib.h>
static int my_sum(lua_State *L){
int d1 = luaL_checknumber(L, 1);
int d2 = luaL_checknumber(L, 2);
lua_pushnumber(L, d1+d2);
return 1;
}
static int my_info(lua_State *L){
lua_pushstring(L, "qinuu");
return 1;
}
static const struct luaL_Reg test_lib[] = {
{"my_sum" , my_sum},
{"my_info" , my_info},
{NULL, NULL}
};
int luaopen_test_lib(lua_State *L){
//luaL_newlib(L, test_lib); // 5.2
luaL_register(L, "test_lib",test_lib); // lua 5.1
return 1;
}
Test
local my_lib = require "test_lib"
print(type(test_lib))
print(test_lib.my_sum(23,17))
print(test_lib.my_info())
Profile : Linux -> PNG
gprof -b emv_clc2 > report.txt
gprof2dot.py report.txt > call_graph.dot
dot -Tpng call_graph.dot -o call_graph.png
1>LINK : fatal error LNK1104: cannot open file ‘libboost_date_time-vc142-mt-s-x32-1_70.lib’
C:\boost_1_70_0>.\b2 --with-date_time link=static runtime-link=static