avatar

个人记录 | 随心所意,记录点滴

本站建设记录

安装hugo,下载直接可用 🔗https://github.com/gohugoio/hugo/releases 验证是否成功 🔗hugo version 建站 🔗hugo new site gker 添加主题 🔗cd gker; git init; git submodule add https://github.com/budparr/gohugo-theme-ananke.git themes/ananke; //编辑你的 config.toml 配置文件使用该主题 echo ’theme = “ananke”’ » config.toml 新建文章 🔗hugo new post/first.md 本地测试 🔗hugo server -D 访问http://localhost:1313 生成静态网站 🔗hugo 生成的网站源码结构 🔗archetypes: 储存.md的模板文件,类似于hexo的scaffolds,该文件夹的优先级高于主题下的/archetypes文件夹 config.toml: 配置文件 content: 储存网站的所有内容,类似于hexo的source data: 储存数据文件供模板调用,类似于hexo的source/_data layouts: 储存.html模板,该文件夹的优先级高于主题下的/layouts文件夹 static: 储存图片,css,js等静态文件,该目录下的文件会直接拷贝到/public,该文件夹的优先级高于主题下的/static文件夹 themes: 储存主题 public: 执行hugo命令后,储存生成的静态文件

Android颜色计算

/** * 合并颜色,支持argb8888 * @param fg 前景色 * @param bg 背景色 */ public static int blendColor(int fg, int bg) { int scr = Color.red(fg); int scg = Color.green(fg); int scb = Color.blue(fg); int sa = fg >>> 24; int dcr = Color.red(bg); int dcg = Color.green(bg); int dcb = Color.blue(bg); int color_r = dcr * (0xff - sa) / 0xff + scr * sa / 0xff; int color_g = dcg * (0xff - sa) / 0xff + scg * sa / 0xff; int color_b = dcb * (0xff - sa) / 0xff + scb * sa / 0xff; return ((color_r << 16) + (color_g << 8) + color_b) | (0xff000000); } /** Calculates the constrast between two colors, using the algorithm provided by the WCAG v2.

MacOS遇到莫名其妙的ssl或者git问题

mac上遇到unable to access ‘https://github.com/bitcoin/bitcoin.git/': LibreSSL SSL_read: SSL_ERROR_SYSCALL, errno 54 或者git无法使用时,执行下面的指令即可: sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer

EOS代码结构总览

##总览 ###代码地址 https://github.com/EOSIO/eos ###代码结构图 ###对应说明 CMakeModules 描述编译过程的文件 Docker 容器,方便编译和运行。参考docker.com contracts 智能合约代码(重要) docs 文档 libraries EOS编译时依赖的其他项目 plugins(重要) 各种API插件 programs 可以运行的程序 scripts 辅助编译的脚本 tests 测试代码。编译完成后测试程序是否正常运行的程序。 tools 工具类 build.sh 开始编译的脚本 其他程序图标等不做解释。为什么contracts和plugins标注重要呢?因为其他所有的东西都是辅助而已,contracts是最为核心的东西,plugins是桥梁对程序员来说也很重要,programs等只是外包装。 ###编译过程 在README文档中说的已经很清楚了,按照步骤一步一步即可编译完成。 ###运行过程 编译完成后,主要的运行程序(对应在programs目录下)有eosiod、eosioc、eosio-walletd 按照README提示,执行一次eosiod生成data-dir目录,配置config.ini后重新运行即可。 ####eosiod 这是EOS的主程序 ####eosioc eosioc 为了方面调用eosiod所暴露出来的REST接口的工具。 ####eosio-wallet eosio-wallet启动后就是一个web服务器,默认监听本地8888接口,支持用 http://127.0.0.1:8888/v1/wallet/get_public_keys 等REST方法操作EOS账户、钱包相关动作。

Android硬件加速后单个Bitmap可以显示的最大尺寸

private void getGLESTextureLimitBelowLollipop() { int[] maxSize = new int[1]; GLES10.glGetIntegerv(GLES10.GL_MAX_TEXTURE_SIZE, maxSize, 0); Toast.makeText(this," " + maxSize[0],Toast.LENGTH_LONG).show(); } private void getGLESTextureLimitEqualAboveLollipop() { EGL10 egl = (EGL10) EGLContext.getEGL(); EGLDisplay dpy = egl.eglGetDisplay(EGL10.EGL_DEFAULT_DISPLAY); int[] vers = new int[2]; egl.eglInitialize(dpy, vers); int[] configAttr = { EGL10.EGL_COLOR_BUFFER_TYPE, EGL10.EGL_RGB_BUFFER, EGL10.EGL_LEVEL, 0, EGL10.EGL_SURFACE_TYPE, EGL10.EGL_PBUFFER_BIT, EGL10.EGL_NONE }; EGLConfig[] configs = new EGLConfig[1]; int[] numConfig = new int[1]; egl.eglChooseConfig(dpy, configAttr, configs, 1, numConfig); if (numConfig[0] == 0) {// TROUBLE! No config found.