a workaround of false negative in missing interpolator warning

一般情况下,我们会倾向于打开各种warning,以便规范我们的代码.不过,scala有时候有些warning也是蛮扯的.比如这么一段

$ scala -Xlint:missing-interpolator
Welcome to Scala version 2.11.7 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_05).
Type in expressions to have them evaluated.
Type :help for more information.

scala> val key="value"; println("$key")
:12: warning: possible missing interpolator: detected interpolated identifier `$key`
        println("$key")
                ^
$key
key: String = value

(more…)

docker 几个错误的fix

  1. SELinux安全系统和btrfs文件系统不和 尝试启动docker service失败,使用systemctl查看提示如下:
    # systemctl status docker.service -l
    ...
    SELinux is not supported with the BTRFS graph driver!
    ...
    

CMake 下使用 protobuf

protobuf是google开发的一个序列化和反序列化的库,通过.proto文件定义文件格式,序列化后的数据是binary的,可以在多语言上使用.一般情况下,若客户端和服务端都是自己做的,用protobuf作为通讯协议,无疑是一个不错的选择.

个人一般喜欢用CMake来管理c++工程.那么,cmake下使用protobuf对个人而言是个很重要的事情. (more…)