大师网-带你快速走向大师之路 解决你在学习过程中的疑惑,带你快速进入大师之门。节省时间,提升效率



Elasticsearch search使用几点总结

3.如果短语匹配的时候,怕遗漏,考虑使用match_phrase_prefix。 二、使用term匹配的时候,主要是确定词匹配 keyword或者 integer类型,可以是数组 三、使用must和should结合的时候,层级关系不同导致的结果不同,AND 结合 OR形式应该如这种 private static void addKeywordSearchQuery(String keyWordStr,BoolQueryBuilder boolQueryBuilder){ String[] keywords = keyWordStr.split("\\|");

Do You Really Need @DirtiesContext?

Do You Really Need @DirtiesContext? 为什么加 @DirtiesContext 就修好,有没有什么副作用? @DirtiesContext is a spring test annotation which is used to indicate that the application context cached should be removed and reloaded after each test run. The application context removed will also be closed. 如上面所述,@DirtiesContext 会导致application context不被缓存,也就是说,有可能会对测试运行的速度有影响。官方文档

$ionicHistory API的相关知识

$ionicHistory API的相关知识 $ionicHistory 定义: $ ionicHistory在用户浏览应用程序时跟踪页面。获取页面信息,进行页面跳转操作。特点:Should a user navigate few pages deep on one tab, and then switch to a new tab and back, the back button relates not to the previous tab


日更3天|英语学习 文/蓝色33 今天学习几个马云爸爸演讲中的金句。 You should learn from your competitor, but never copy. Copy and you die. 向竞争对手学习,但不要山寨别人。山寨意味着凉凉。 Intelligent people need a fool to lead them. When the team's all a bunch of scientists

iOS Git 提交忽略文件 UserInterfaceState.xcuserstate

gitignore里面 # Xcode # # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore Swift.gitignore ## Build generated build/ DerivedData/ ## Various settings *.gitignore. However # you should judge for yourself, the pros and cons are mentioned at: # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control # # Pods/ # # Add this line if you want to avoid checking in source code from the Xcode workspace # *.


python2.7+wxpython4.0.1+pyinstaller打包的正确用法 hi 各位看官,本文是截止2018年7月4日,基于python2.7开发wxpython时的打包正确用法。 坑1: wxpython的最新版本为4.0.3 但是因为4.0.3引入了新的pubsub 4.0 不兼容python2.7。所以如果用python2.7的同学必须降级到wxpython 4.0.1版本 坑2: 打包方面,我们可以用pyinstaller打包。但是pip上,pyinstaller最新的版本是3.3.1 版本,此版本上有bug https://github.com/pyinst


1.1WEB项目虚拟环境搭建 1、建立项目 首先,以规范的形式描述 其次,建立虚拟环境 最后,创建项目 1 .

价值 40 枚 ETH 的 URL 钓鱼案例

价值 40 枚 ETH 的 URL 钓鱼案例 一、缘起 前天知道创宇VP余弦在他的知识星球「灰袍技能」发了这么个帖子,因为网络钓鱼,被骗了40枚ETH(当前价格约为21万): 我初看蛮惊讶,这都能上当,这智商也太……接下来点击的那个链接,颠覆了我的世界观,动图如下: 明明点击的是如下链接: https://twitter.com/VitalikButerin/status/967032359953428480 怎么到最后竟变成: https://twitter.com/evilcos/

R语言 排序问题

R语言 排序问题 解决R语言排序问题的方法: order from base arrange from dplyr setorder and setorderv from data.table arrange from plyr sort from taRifx orderBy from doBy sortData from Deducer Most of the time you should use the dplyr or data.table solutions, unless having no-dependencies is important, in which case use base::order.

Nginx CORS 配置

Nginx CORS 配置 # # Wide-open CORS config for nginx # location / { if ($request_method = 'OPTIONS') { add_header 'Access-Control-Allow-Origin' '*'; add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS'; # # Custom headers and headers various browsers *should* be OK with but aren't # add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type

Laravel 异常处理

} if ($e instanceof \ErrorException) { return xxx; } } } render方法 /** * Render an exception into an HTTP response. * * @param \Illuminate\Http\Request $request * @param \Exception $e * @return \Illuminate\Http\Response */ public function render($request, Exception $e) { //TODO 这里一条自定义http错误自动跳转到首页 if (getenv('APP_ENV') == 'production' $e instanceof HttpException) { Log::error($e);

ES 查询优化(二)

ES 查询优化(二) 接上一篇继续介绍。 1、查询精确匹配 假设有 { "tags" : ["search"] } { "tags" : ["search", "open_source"] } 两个文档,查询语句如下: GET /shirts/_search { "query": { "bool": { "filter": { "term": { "brand": "gucci" } } } }, "aggs": { "colors": { "terms": { "field": "color" } }, "color_red": { "filter": { "term": { "color": "red" } }, "aggs": { "models": { "terms": { "field": "model" } } } } }, "post_filter": { "term": { "color": "red" } } }

使用 WebStorm 创建 React App

使用 WebStorm 创建 React App image.png /usr/local/bin/node /usr/local/lib/node_modules/create-react-app/index.js . Done 构建通用的 React 和 Node 应用 原文:Build a universal React and Node App 演示:https://judo-heroes.herokuapp.com/ 译者:nzbin 译者的话:这是一篇非常优秀的 React 教程,该文对 React 组件、React Router 以及 Node 做了很好的梳理。


JUnit测试异常 假如需要测试下面的类: public class Student { public boolean canVote(int age) { if (i =0) throw new IllegalArgumentException("age should be +"); } } 测试抛出的异常有三种方法: @Test ( expected = Throwable.class ) @Test(expected = IllegalArgumentException.class) public void canVoteExp() { Student student = new Student(); student.canVote(0); } catch (IllegalArgumentException e) { assertThat(e.getMessage(), containsString("age should be +"));

Leetcode 210. Course Schedule II

To take course 1 you should have finished course 0. public int[] findOrder(int numCourses, int[][] prerequisites) { //tip 后面的是前置条件 int[] preCount = new int[numCourses]; List unlock = new ArrayList (); for (int i = 0; i ()); } for (int i = 0; i q = new LinkedList (); for (int i = 0; i subs = unlock.get(num); for (int i = 0; i subs.size(); i++) { int next = subs.get(i); preCount[next] -= 1; if (preCount[next] == 0) { q.offer(next); } } } return cnt == numCourses ?

Python Queue在Pool的多进程中的共享方式

Python Queue在Pool的多进程中的共享方式 今天使用Pool使用Queue来传递数据的时候报错: Queue objects should only be shared between processes through inheritance 后来研究了一下发现网上的教程大部分是要求用mp包里的Manager来构建一个proxy来使用Queue,但其实解决这个错误不一定需要使用Manager.Queue,这个错误报错的地方其实是在fork的时候,把Queue对象作为参数传进给子进程导致的错误。所以使用


pwr::pwr.t.test in R console ''' # 载入r对象 from rpy2 import robjects # 载入导入包函数 from rpy2.robjects.packages import importr # 将pwr包导入为模块,记得提前在(test环境下)R中安装好pwr包 pwr = importr('pwr') # When one wants to create a vector from Python, either the class Vector or the convenience classes IntVector, FloatVector, BoolVector, StrVector can be used. # 将参数中的.替换为_,解决不兼容问题, 来自rpy2文档


3分钟理解ES6箭头函数里的this 一句话概括,es6箭头函数里的this指的是定义这个函数时外层代码的this,这句话可以从两个方面理解: es6箭头函数没有自己的this es6箭头函数里的this是外层代码(定义时,非执行时)this的引用 我们用一个简单的例子理解一下 var Animal = function() { this.name = "Animal"; } } var cat = new Animal(); var speak = cat.speak; In ES5, it should be undefined is saying miao~.

mysql-5.7.17-linux-glibc2.5 的免编译安装

mysql-5.7.17-linux-glibc2.5 的免编译安装 1 ./bin/mysqld --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --initialize 2018-01-17T07:41:02.340159Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).lGGrWng3qP 上面结果最后一个是mysql的初始密码。 9. 启动mysql .