gin

26.正则介绍 grep上 中 下

折月煮酒 提交于 2019-11-28 19:43:49
9.1 正则介绍_grep上 (-cinvABC ) 9.2 grep中 (正则表达式的一些用法,[] ^ ^[^] ) 9.3 grep下 (正则表达式的一些用法, . * .* egrep grep -E ) 9.1 正则介绍: 什么是正则 ~ 正则就是一串有规律的字符串 ~ 掌握好正则对于编写shell脚本有很大的帮助 ~ 各种编程语言中都是正则,原理是一样的 ~ 本章将要学习grep/egrep、sed、awk egrep是grep的扩展,grep能实现的egrep都能实现 grep上: ~1. grep [-cinvABC(以下 的选项)] 'word(关键词)' filename(文件名) ~2. -c 行数 显示带关键词的行,有多少行 ~3. -i 不区分大小写 ~4. -n 显示行号 ~5. -v 取反 除了关键词,都列出来 ~6. -r 遍历所有子目录,甚至是孙目录 在一个目录下,所有的目录,全部过滤 ~7. -A 后面跟数字,过滤出符合要求的行以及下面 所加数字 的几行 -A2 即代表 该列出关键词的行以及这一行的下面的两行 ~8. -B 同上,过滤出符合要求的行以及上面n行 ~9. -C 同上,同时过滤出符合要求的行以及上下各n行 实例: 1. [root@afeilinux-01 ~]# mkdir grep [root@afeilinux-01 ~]#

Can I use some kind of assisted Inject with Dagger?

帅比萌擦擦* 提交于 2019-11-28 14:16:19
With Google Guice or Gin I can specify parameter with are not controlled by the dependency injection framework: class SomeEditor { @Inject public SomeEditor(SomeClassA a, @Assisted("stage") SomeClassB b) { } } The assisted parameter stage is specified at the time an instance of SomeEditor is created. The instance of SomeClassA is taken from the object graph and the instance of SomeClassB is taken from the caller at runtime. Is there a similar way of doing this in Dagger? Because factories are a separate type of boilerplate to optimize away ( see mailing list discussion here ), Dagger leaves it