久违的更新之链接

一个c文件调用另一个c文件的方法,如何找到?

hello.h

#ifndef HELLO
#define HELLO
int fn_c(int x_local);
#endif

hello.c

/* 这是一个存在于程序别处的某个全局变量的声明 */
extern int z_global;

/* 这是一个函数的定义,函数参数可以认为是局部变量 */
int fn_c(int x_local)
{
    return (z_global + x_local);
}

hello_main.c

#include"hello.h"
#include<stdio.h>
int z_global = 1;
int main(int argc, char *argv[])
{
    printf("%d", fn_c(10));
    return 0;
}

Recyclerview Measure

之前写过一篇 RecyclerView 的 onMeasure 问题,但是只是看看博客,泛泛而谈,至今也没有看源码

最近遇到了一个奇怪的问题,一个 wrap_content 的 RelativeLayout 布局,放到 RecyclerView 中变成了 match_parent

Go Function Types

Function Types

A function type denotes the set of all functions with the same parameter and result types.
function 类型代表了一系列参数和返回值相同的类型

Gradle Plugin 3.0

变化

/img/in-post/gradle.png

注:compile、provided 和 apk 目前仍然可用。 不过,它们将在下一个主要版本的 Android 插件中消失

解释

  • implementation
    lib 改变时,只会编译 lib

Go Template

go 语言 Template 总结

go 语言中的 template 使用{{ }}来作为一个标识符,可以在其中插入相应的 template 支持的代码块。template 是一个模板,他所以来的数据从外部传进来。

形如:

tpl.Execute(buf, jObj.MustMap(make(map[string]interface{})))

tpl 就是我们的一个模板类,其中已经读取了我们存在本地的文件,Execute 方法传入了数据。