研发团队的工程效率实践

这是我在 GitChat 的一篇文章。 介绍 研发团队的工程效率实践,现在越来越多的人开始谈论这个话题,但是真真能实操的还是很少,或者说操作起来有些难度,毕竟每

户外活动之2018年登梧桐山

这是一篇游记,春暖花开.梧桐山登山游(多图慎入)。 梧桐山 梧桐山,位於中国广东省深圳市东部,是国家级风景名胜区、国家森林公园。梧桐山由罗湖区、

不求人!一步一步教你在最新版 iTunes 12.7 上自制 iPhone 手机铃声

这是一篇翻译另外加上自己的一些完善而整理的一篇文章,希望能够对自己有实质上指导帮助的同时,也可以给你带来一些帮助。

趁苹果发布 iPhone 8 和 iPhone X 之际,他们也更新了 iTunes 12.7。不过,iTunes 12.7 有一个很大的缺陷,就是移除了 App 和铃声页面,用户无法在 iTunes 上下载应用程序以及铃声,并同步到 iOS 设备上了。

虽然不能在 iTunes 上下载铃声,但是 iTunes 仍然能够管理在 iPhone 储存的铃声,通过 iTunes 制作 AAC 文件(m4a 格式)的制作工具没有被移除。因此,我们还是可以利用 iTunes 来制作铃声,但通过 iTunes 同步到 iPhone 的方法有很大的不同。

1. 检查输入编码

首先更新 iTunes 到最新版本,并在 iTunes 的「偏好设置」→「通用」分页按「导入设置」,确保「导入时使用」的编码器是「AAC 编码器」。

基于 Go 和 Elasticsearch 构建一个搜索服务

这篇文章是一篇基于 Go 和 Elasticsearch 构建一个搜索服务的实践文章。

本文介绍如何基于 GoElasticsearch 构建简单的搜索服务,该服务将在本地 Docker 机器中运行一个 Elasticsearch 实例。如果你只对源代码感兴趣,你可以在 GitHub 上找到它。

入门

如果你还没有安装 DockerGogolang/dep-一个依赖管理工具,那你就点击链接按照步骤进行操作吧。

在 $GOPATH 中为你的项目创建一个目录。

配置服务

创建如下内容的 docker-compose.yaml 文件:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
version: '3.5'
services:
  search_api:
    container_name: 'search_api'
    build: './search-api'
    restart: 'on-failure'
    ports:
      - '8080:8080'
    depends_on:
      - elasticsearch
  elasticsearch:
    container_name: 'elasticsearch'
    image: 'docker.elastic.co/elasticsearch/elasticsearch:6.2.3'
    ports:
      - '9200:9200'

我们定义了两个服务:search_api 和 elasticsearch 。

search_api 服务是在端口 8080 上托管我们的应用程序,而 elasticsearch 是运行在官方的 Elasticsearch Docker 镜像上,服务端口是 9200 。

了解 Go 语言新版中的缓存处理

这篇文章是我对 Go test 和编译时的 cache 的学习小总结。 介绍 我相信大家在执行 go test ... 的时候,都看到过 (cached) 字样吧。 测试 要禁用测试缓存,请使用可缓存标志以外的任

萌新如何成为 TiDB Contributor

本文是我给你一次成为 TiDB Contributor 的机会,就看你要不要了。

点击 issue #6129 即可参加。

由来

​本文来源于一次跟刘老大在 TiDB Contributor Club 的交流,最终成文也得到了刘老大的很多帮助和点拨,在这里表示一下感谢。我也希望可以通过这样的小活动让更多的人参与进来,让社区更加的活跃,也让你有更多的收获。

​虽然这些任务很简单,但这些小任务是可以折射出咱们 TiDB 团队对于代码质量的完美追求。这就是我们作为开发者应该追寻和要去学习的,其实这就是给你提高代码水平的机会,你不把握要轻易放弃,我也没办法了。

问题概述说明

在 TiDB 的测试用例里面的 % 有一些是用双引号 "” 把整个 SQL 语句括起来的,但是 Github 在显示时会进行转义,所以我们会看到 % 被标红了,当我们在做 code review 的时候看起来是极其不美观的,程序员追求的是完美,所以咱们肯定要想办法进行修改,这里推荐的就是 Go 语言里面的 `。

比方说这个 PR https://github.com/pingcap/tidb/pull/5697/files

如何判定呢?

我可以给大家一个参考说明,如果你使用了 Go 语法高亮插件的话,那么你就可以看到无法高亮的部分就说明转义了,可能是有问题的,那么就需要我们进行修改。【比如 100%500,%W %r】

萌新如何成为 TiDB Contributor

This article is an opportunity for me to give you TiDB Contributor, depending on whether you want it or not.

Intro

This article was written under the leadership of Liu boss. I also hope that more people will be involved through such small activities. Although these tasks are very simple, these small tasks can reflect our TiDB team's perfect pursuit of code quality. This is what we should learn. This is an opportunity for you to improve/improve your code level. You shouldn't give up easily.

Overview of the problem

Some of the % in TiDB's test cases enclose the statement with double quotes "", but Github escaping it when displayed, so it will be marked with % red, and we are doing a review of It doesn't look beautiful at the moment, so we need to change this and recommend replacing it with the Go language.

For examples: PR #5697

How to decide?

I can give you a reference note. If you use the Go syntax highlighting plug-in, then you can see that the unhighlighted part is escaping. It may be problematic. Then we need to make changes. [eg, 100%500, %W %r].

cannot take a address of temp params

本文介绍不能给临时变量分配内存地址。 The Go Programming Language Specification Address operators For an operand x of type T, the address operation &x generates a pointer of type *T to x. The operand must be addressable, that is, either a variable, pointer indirection, or slice indexing operation; or a field selector of an addressable struct operand; or

基于 Docker 进行 Golang 开发

本文将介绍如何基于 Docker 进行 Golang 的开发。 前言 Docker 一般被用来部署服务,作为容器在使用,但是也可以用于开发容器的。 为什么要在开发中使用 Docker ? 一致的开发环境