-
Notifications
You must be signed in to change notification settings - Fork 1
/
2019030101.html
1 lines (1 loc) · 77.4 KB
/
2019030101.html
1
<!DOCTYPE html><html class="theme-next mist use-motion" lang="zh-Hans"><head><meta name="generator" content="Hexo 3.9.0"><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1"><meta name="theme-color" content="#222"><script src="/lib/pace/pace.min.js?v=1.0.2"></script><link href="/lib/pace/pace-theme-minimal.min.css?v=1.0.2" rel="stylesheet"><meta http-equiv="Cache-Control" content="no-transform"><meta http-equiv="Cache-Control" content="no-siteapp"><link href="/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css"><link href="/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css"><link href="/css/main.css?v=5.1.3" rel="stylesheet" type="text/css"><link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-240x240-playpi.png?v=5.1.3"><link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-playpi.png?v=5.1.3"><link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-playpi.png?v=5.1.3"><link rel="mask-icon" href="/images/logo-playpi.svg?v=5.1.3" color="#222"><meta name="keywords" content="Spark,ElasticSearch,es,Git,Python"><link rel="alternate" href="/atom.xml" title="虾丸派" type="application/atom+xml"><meta name="description" content="由于技术能力的限制,平时会遇到一些自己觉得非常诡异的问题,感觉到莫名其妙。其实到头来发现,归根结底还是自己的认知问题:可能是技术水平不够,或者考虑不周全,甚至是一些低级别的错误判断。总而言之,遇到这些问题后,有时候请教人、查资料之后仍旧不得解,只能先记录下来,留做备注说明,等待以后解决。当然,随着时间的流逝,有些问题可能就被忘记了,有些问题在之后的某一个时间点被解决了。本文就是要记录这些问题,并在"><meta name="keywords" content="Spark,ElasticSearch,es,Git,Python"><meta property="og:type" content="article"><meta property="og:title" content="那些年关于技术的未解之谜"><meta property="og:url" content="https://www.playpi.org/2019030101.html"><meta property="og:site_name" content="虾丸派"><meta property="og:description" content="由于技术能力的限制,平时会遇到一些自己觉得非常诡异的问题,感觉到莫名其妙。其实到头来发现,归根结底还是自己的认知问题:可能是技术水平不够,或者考虑不周全,甚至是一些低级别的错误判断。总而言之,遇到这些问题后,有时候请教人、查资料之后仍旧不得解,只能先记录下来,留做备注说明,等待以后解决。当然,随着时间的流逝,有些问题可能就被忘记了,有些问题在之后的某一个时间点被解决了。本文就是要记录这些问题,并在"><meta property="og:locale" content="zh-Hans"><meta property="og:image" content="https://raw.githubusercontent.com/iplaypi/img-playpi/master/img/old/b7f2e3a3gy1g0pyfelevwj20vj0mr0w0.jpg"><meta property="og:image" content="https://raw.githubusercontent.com/iplaypi/img-playpi/master/img/old/b7f2e3a3gy1g12h3dbte0j20tr0ge3yv.jpg"><meta property="og:image" content="https://raw.githubusercontent.com/iplaypi/img-playpi/master/img/old/b7f2e3a3gy1g12h42u9iuj20t50fa74n.jpg"><meta property="og:image" content="https://raw.githubusercontent.com/iplaypi/img-playpi/master/img/old/b7f2e3a3gy1g12h48uvu5j20mj08imwz.jpg"><meta property="og:image" content="https://raw.githubusercontent.com/iplaypi/img-playpi/master/img/old/b7f2e3a3gy1g12h4vfjokj20wu0mgwgs.jpg"><meta property="og:image" content="https://raw.githubusercontent.com/iplaypi/img-playpi/master/img/old/b7f2e3a3gy1g12h4zran1j20ya0mgwgy.jpg"><meta property="og:image" content="https://raw.githubusercontent.com/iplaypi/img-playpi/master/img/old/b7f2e3a3gy1g12h53va2qj20xs0mgacl.jpg"><meta property="og:updated_time" content="2019-03-01T08:53:21.000Z"><meta name="twitter:card" content="summary"><meta name="twitter:title" content="那些年关于技术的未解之谜"><meta name="twitter:description" content="由于技术能力的限制,平时会遇到一些自己觉得非常诡异的问题,感觉到莫名其妙。其实到头来发现,归根结底还是自己的认知问题:可能是技术水平不够,或者考虑不周全,甚至是一些低级别的错误判断。总而言之,遇到这些问题后,有时候请教人、查资料之后仍旧不得解,只能先记录下来,留做备注说明,等待以后解决。当然,随着时间的流逝,有些问题可能就被忘记了,有些问题在之后的某一个时间点被解决了。本文就是要记录这些问题,并在"><meta name="twitter:image" content="https://raw.githubusercontent.com/iplaypi/img-playpi/master/img/old/b7f2e3a3gy1g0pyfelevwj20vj0mr0w0.jpg"><script type="text/javascript" id="hexo.configurations">var NexT=window.NexT||{},CONFIG={root:"/",scheme:"Mist",version:"5.1.3",sidebar:{position:"left",display:"hide",offset:12,b2t:!1,scrollpercent:!0,onmobile:!1},fancybox:!0,tabs:!0,motion:{enable:!0,async:!1,transition:{post_block:"fadeIn",post_header:"slideDownIn",post_body:"slideDownIn",coll_header:"slideLeftIn",sidebar:"slideUpIn"}},duoshuo:{userId:"0",author:"博主"},algolia:{applicationID:"",apiKey:"",indexName:"",hits:{per_page:10},labels:{input_placeholder:"Search for Posts",hits_empty:"We didn't find any results for the search: ${query}",hits_stats:"${hits} results found in ${time} ms"}}}</script><link rel="canonical" href="https://www.playpi.org/2019030101.html"><title>那些年关于技术的未解之谜 | 虾丸派</title></head><body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans"><div class="container sidebar-position-left page-post-detail"><div class="headband"></div><header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader"><div class="header-inner"><div class="site-brand-wrapper"><div class="site-meta"><div class="custom-logo-site-title"><a href="/" class="brand" rel="start"><span class="logo-line-before"><i></i></span> <span class="site-title">虾丸派</span> <span class="logo-line-after"><i></i></span></a></div><h1 class="site-subtitle" itemprop="description">烂笔头</h1></div><div class="site-nav-toggle"><button><span class="btn-bar"></span> <span class="btn-bar"></span> <span class="btn-bar"></span></button></div></div><nav class="site-nav"><ul id="menu" class="menu"><li class="menu-item menu-item-home"><a href="/" rel="section"><i class="menu-item-icon fa fa-fw fa-home"></i><br>首页</a></li><li class="menu-item menu-item-tags"><a href="/tags/" rel="section"><i class="menu-item-icon fa fa-fw fa-tags"></i><br>标签</a></li><li class="menu-item menu-item-categories"><a href="/categories/" rel="section"><i class="menu-item-icon fa fa-fw fa-th"></i><br>分类</a></li><li class="menu-item menu-item-archives"><a href="/archives/" rel="section"><i class="menu-item-icon fa fa-fw fa-archive"></i><br>归档</a></li><li class="menu-item menu-item-about"><a href="/about/" rel="section"><i class="menu-item-icon fa fa-fw fa-user"></i><br>关于</a></li><li class="menu-item menu-item-books"><a href="/books/" rel="section"><i class="menu-item-icon fa fa-fw fa-book"></i><br>书籍</a></li><li class="menu-item menu-item-guide"><a href="/guide/" rel="section"><i class="menu-item-icon fa fa-fw fa-location-arrow"></i><br>指南</a></li><li class="menu-item menu-item-search"><a href="javascript:;" class="popup-trigger"><i class="menu-item-icon fa fa-search fa-fw"></i><br>搜索</a></li></ul><div class="site-search"><div class="popup search-popup local-search-popup"><div class="local-search-header clearfix"><span class="search-icon"><i class="fa fa-search"></i> </span><span class="popup-btn-close"><i class="fa fa-times-circle"></i></span><div class="local-search-input-wrapper"><input autocomplete="off" placeholder="搜索..." spellcheck="false" type="text" id="local-search-input"></div></div><div id="local-search-result"></div></div></div></nav></div></header><main id="main" class="main"><div class="main-inner"><div class="content-wrap"><div id="content" class="content"><div id="posts" class="posts-expand"><article class="post post-type-normal" itemscope itemtype="http://schema.org/Article"><div class="post-block"><link itemprop="mainEntityOfPage" href="https://www.playpi.org/2019030101.html"><span hidden itemprop="author" itemscope itemtype="http://schema.org/Person"><meta itemprop="name" content="虾丸派"><meta itemprop="description" content="记录知识 | 分享技术"><meta itemprop="image" content="/images/favicon-1536x1536-playpi.png"></span><span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization"><meta itemprop="name" content="虾丸派"></span><header class="post-header"><h2 class="post-title" itemprop="name headline">那些年关于技术的未解之谜</h2><div class="post-meta"><span class="post-time"><span class="post-meta-item-text">发表于</span> <time title="创建于" itemprop="dateCreated datePublished" datetime="2019-03-01T16:53:21+08:00">2019-03-01 </time></span><span class="post-category"><span class="post-meta-divider">|</span> <span class="post-meta-item-text">分类于</span> <span itemprop="about" itemscope itemtype="http://schema.org/Thing"><a href="/categories/basic-technical-knowledge/" itemprop="url" rel="index"><span itemprop="name">基础技术知识</span> </a></span></span><span id="busuanzi_container_page_pv" style="display:none"><span class="post-meta-divider">|</span> 阅读次数 <span id="busuanzi_value_page_pv"></span></span><div class="post-wordcount"><span class="post-meta-item-text">字数统计</span> <span title="字数统计">5,315字 </span><span class="post-meta-divider">|</span> <span class="post-meta-item-text">阅读时长 ≈</span> <span title="阅读时长">28分钟</span></div></div></header><div class="post-body" itemprop="articleBody"><p>由于技术能力的限制,平时会遇到一些自己觉得非常诡异的问题,感觉到莫名其妙。其实到头来发现,归根结底还是自己的认知问题:可能是技术水平不够,或者考虑不周全,甚至是一些低级别的错误判断。总而言之,遇到这些问题后,有时候请教人、查资料之后仍旧不得解,只能先记录下来,留做备注说明,等待以后解决。当然,随着时间的流逝,有些问题可能就被忘记了,有些问题在之后的某一个时间点被解决了。本文就是要记录这些问题,并在遇到新问题或者解决老问题之后,保持更新。</p><a id="more"></a><h1 id="常用链接"><a href="# 常用链接" class="headerlink" title="常用链接"></a>常用链接</h1><p>在这里先列出一些常用的网站链接,方便查看:</p><ul><li>es-hadoop 官网:<a href="https://www.elastic.co/guide/en/elasticsearch/hadoop/5.6/configuration.html" target="_blank" rel="noopener">https://www.elastic.co/guide/en/elasticsearch/hadoop/5.6/configuration.html</a> ;</li><li>x</li></ul><h1 id="es-spark- 读取 -es- 数据后 -count- 报错"><a href="#es-spark- 读取 -es- 数据后 -count- 报错" class="headerlink" title="es-spark 读取 es 数据后 count 报错"></a>es-spark 读取 es 数据后 count 报错</h1><p>使用 es-hadoop 组件,起 Spark 任务去查询 es 数据,然后过滤,过滤后做一个 count 算子,结果就报错了。而且,在报错后又重试了很多次(5 次以上),一直正常,没法重现问题。这个任务需要经常跑,以前从来没遇到过这样的异常,初步怀疑是 es 集群不稳定,具体原因不得而知。</p><p>错误截图:<br><img src="https://raw.githubusercontent.com/iplaypi/img-playpi/master/img/old/b7f2e3a3gy1g0pyfelevwj20vj0mr0w0.jpg" alt="报错信息截图" title="报错信息截图"></p><p>完整错误信息如下(重要包名称被替换):<br></p><figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br></pre></td><td class="code"><pre><span class="line"><span class="number">2019</span>-<span class="number">02</span>-<span class="number">26_15</span>:<span class="number">01</span>:<span class="number">44</span> [main] ERROR spokesman3.SpokesAndBrand:<span class="number">510</span>: !!!!Spark 出错: org.codehaus.jackson.JsonParseException: Unexpected end-of-input in field name</span><br><span class="line"> at [Source: org.apache.commons.httpclient.AutoCloseInputStream@<span class="number">2687</span>cf14; line: <span class="number">1</span>, column: <span class="number">17581</span>]</span><br><span class="line">org.elasticsearch.hadoop.rest.EsHadoopParsingException: org.codehaus.jackson.JsonParseException: Unexpected end-of-input in field name</span><br><span class="line"> at [Source: org.apache.commons.httpclient.AutoCloseInputStream@<span class="number">2687</span>cf14; line: <span class="number">1</span>, column: <span class="number">17581</span>]</span><br><span class="line"> at org.elasticsearch.hadoop.rest.RestClient.parseContent (RestClient.java:<span class="number">171</span>)</span><br><span class="line"> at org.elasticsearch.hadoop.rest.RestClient.get (RestClient.java:<span class="number">155</span>)</span><br><span class="line"> at org.elasticsearch.hadoop.rest.RestClient.targetShards (RestClient.java:<span class="number">357</span>)</span><br><span class="line"> at org.elasticsearch.hadoop.rest.RestRepository.doGetReadTargetShards (RestRepository.java:<span class="number">306</span>)</span><br><span class="line"> at org.elasticsearch.hadoop.rest.RestRepository.getReadTargetShards (RestRepository.java:<span class="number">297</span>)</span><br><span class="line"> at org.elasticsearch.hadoop.rest.RestService.findPartitions (RestService.java:<span class="number">241</span>)</span><br><span class="line"> at org.elasticsearch.spark.rdd.AbstractEsRDD.esPartitions$lzycompute (AbstractEsRDD.scala:<span class="number">73</span>)</span><br><span class="line"> at org.elasticsearch.spark.rdd.AbstractEsRDD.esPartitions (AbstractEsRDD.scala:<span class="number">72</span>)</span><br><span class="line"> at org.elasticsearch.spark.rdd.AbstractEsRDD.getPartitions (AbstractEsRDD.scala:<span class="number">44</span>)</span><br><span class="line"> at org.apache.spark.rdd.RDD$$anonfun$partitions$<span class="number">2</span>.apply (RDD.scala:<span class="number">239</span>)</span><br><span class="line"> at org.apache.spark.rdd.RDD$$anonfun$partitions$<span class="number">2</span>.apply (RDD.scala:<span class="number">237</span>)</span><br><span class="line"> at scala.Option.getOrElse (Option.scala:<span class="number">120</span>)</span><br><span class="line"> at org.apache.spark.rdd.RDD.partitions (RDD.scala:<span class="number">237</span>)</span><br><span class="line"> at org.apache.spark.SparkContext.runJob (SparkContext.scala:<span class="number">1929</span>)</span><br><span class="line"> at org.apache.spark.rdd.RDD.count (RDD.scala:<span class="number">1157</span>)</span><br><span class="line"> at org.apache.spark.api.java.JavaRDDLike$class.count (JavaRDDLike.scala:440)</span><br><span class="line"> at org.apache.spark.api.java.AbstractJavaRDDLike.count (JavaRDDLike.scala:<span class="number">46</span>)</span><br><span class="line"> at com.package.to.class.SpokesAndBrand.getMention (SpokesAndBrand.java:508)</span><br><span class="line"> at com.package.to.class.SpokesAndBrand.runCelebrityByBrand (SpokesAndBrand.java:185)</span><br><span class="line"> at com.package.to.class.SpokesAndBrand.execute (SpokesAndBrand.java:116)</span><br><span class="line"> at com.package.to.class.SpokesmanAnalyzer.execute (SpokesmanAnalyzer.java:162)</span><br><span class="line"> at com.package.to.class.SpokesmanAnalyzeCli.execute (SpokesmanAnalyzeCli.java:154)</span><br><span class="line"> at com.package.to.class.SpokesmanAnalyzeCli.start (SpokesmanAnalyzeCli.java:75)</span><br><span class="line"> at com.package.to.class.util.AdvCli.initRunner (AdvCli.java:191)</span><br><span class="line"> at com.package.to.class.job.client.BasicInputOutputSystemWorker.run (BasicInputOutputSystemWorker.java:79)</span><br><span class="line"> at com.package.to.class.model.AbstractDataReportWorker.run (AbstractDataReportWorker.java:122)</span><br><span class="line"> at com.package.to.class.buffalo.job.AbstractBUTaskWorker.runTask (AbstractBUTaskWorker.java:63)</span><br><span class="line"> at com.package.to.class.report.cli.TaskLocalRunnerCli.start (TaskLocalRunnerCli.java:110)</span><br><span class="line"> at com.package.to.class.util.AdvCli.initRunner (AdvCli.java:191)</span><br><span class="line"> at com.package.to.class.report.cli.TaskLocalRunnerCli.main (TaskLocalRunnerCli.java:43)</span><br><span class="line">Caused by: org.codehaus.jackson.JsonParseException: Unexpected end-of-input in field name</span><br><span class="line"> at [Source: org.apache.commons.httpclient.AutoCloseInputStream@<span class="number">2687</span>cf14; line: <span class="number">1</span>, column: <span class="number">17581</span>]</span><br><span class="line"> at org.codehaus.jackson.JsonParser._constructError (JsonParser.java:<span class="number">1433</span>)</span><br><span class="line"> at org.codehaus.jackson.impl.JsonParserMinimalBase._reportError (JsonParserMinimalBase.java:<span class="number">521</span>)</span><br><span class="line"> at org.codehaus.jackson.impl.JsonParserMinimalBase._reportInvalidEOF (JsonParserMinimalBase.java:<span class="number">454</span>)</span><br><span class="line"> at org.codehaus.jackson.impl.Utf8StreamParser.parseEscapedFieldName (Utf8StreamParser.java:<span class="number">1503</span>)</span><br><span class="line"> at org.codehaus.jackson.impl.Utf8StreamParser.slowParseFieldName (Utf8StreamParser.java:<span class="number">1404</span>)</span><br><span class="line"> at org.codehaus.jackson.impl.Utf8StreamParser._parseFieldName (Utf8StreamParser.java:<span class="number">1231</span>)</span><br><span class="line"> at org.codehaus.jackson.impl.Utf8StreamParser.nextToken (Utf8StreamParser.java:<span class="number">495</span>)</span><br><span class="line"> at org.codehaus.jackson.map.deser.std.UntypedObjectDeserializer.mapObject (UntypedObjectDeserializer.java:<span class="number">219</span>)</span><br><span class="line"> at org.codehaus.jackson.map.deser.std.UntypedObjectDeserializer.deserialize (UntypedObjectDeserializer.java:<span class="number">47</span>)</span><br><span class="line"> at org.codehaus.jackson.map.deser.std.UntypedObjectDeserializer.mapArray (UntypedObjectDeserializer.java:<span class="number">165</span>)</span><br><span class="line"> at org.codehaus.jackson.map.deser.std.UntypedObjectDeserializer.deserialize (UntypedObjectDeserializer.java:<span class="number">51</span>)</span><br><span class="line"> at org.codehaus.jackson.map.deser.std.UntypedObjectDeserializer.mapArray (UntypedObjectDeserializer.java:<span class="number">165</span>)</span><br><span class="line"> at org.codehaus.jackson.map.deser.std.UntypedObjectDeserializer.deserialize (UntypedObjectDeserializer.java:<span class="number">51</span>)</span><br><span class="line"> at org.codehaus.jackson.map.deser.std.MapDeserializer._readAndBind (MapDeserializer.java:<span class="number">319</span>)</span><br><span class="line"> at org.codehaus.jackson.map.deser.std.MapDeserializer.deserialize (MapDeserializer.java:<span class="number">249</span>)</span><br><span class="line"> at org.codehaus.jackson.map.deser.std.MapDeserializer.deserialize (MapDeserializer.java:<span class="number">33</span>)</span><br><span class="line"> at org.codehaus.jackson.map.ObjectMapper._readValue (ObjectMapper.java:<span class="number">2704</span>)</span><br><span class="line"> at org.codehaus.jackson.map.ObjectMapper.readValue (ObjectMapper.java:<span class="number">1286</span>)</span><br><span class="line"> at org.elasticsearch.hadoop.rest.RestClient.parseContent (RestClient.java:<span class="number">166</span>)</span><br><span class="line"> ... <span class="number">29</span> more</span><br><span class="line"><span class="number">2019</span>-<span class="number">02</span>-<span class="number">26_15</span>:<span class="number">01</span>:<span class="number">44</span> [main] INFO rdd.JavaEsRDD:<span class="number">58</span>: Removing RDD <span class="number">3086</span> from persistence list</span><br></pre></td></tr></table></figure><p></p><h1 id="Hexo- 生成 -html- 静态页面目录锚点失效"><a href="#Hexo- 生成 -html- 静态页面目录锚点失效" class="headerlink" title="Hexo 生成 html 静态页面目录锚点失效"></a>Hexo 生成 html 静态页面目录锚点失效</h1><p>我这些所有的博客文档是先写成 Markdown 文件,然后使用 Hexo 渲染生成 html 静态页面,再发布到 GitHub Pages 上面,还有一些是发布到我自己的 VPS 上面(为了百度爬虫)。</p><p>但是最近我发现一个现象,有一些文章的锚点无效,也就是表现为目录无法跳转,例如想直接查看某一级目录的内容,在右侧的 <strong>文章目录 </strong>中直接点击对应的标题,不会自动跳转过去。这个问题我发现了很久,但是一直没在意,也没有找到原因。最近才碰巧发现是因为标题内容里面有空格,这才导致生成的 html 静态页面里面的锚点失效,我随机又测试了几次其它的页面,看起来的确是这样。下面列出一些示例:</p><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">https://www.playpi.org/2019022501.html ,Hexo 踩坑记录的 </span><br><span class="line">https://www.playpi.org/2018121901.html ,js 字符串分割方法 </span><br><span class="line">https://www.playpi.org/2019020701.html ,itchat 0 - 初识 </span><br></pre></td></tr></table></figure><p>但是,我又发现其他人的博客,目录标题内容中也有空格,却可以正常跳转,我很疑惑。现在我猜测是 Hexo 的问题,或者哪里需要配置,等待以后的解决方法吧。别人的博客示例:<a href="https://blog.itnote.me/Hexo/hexo-chinese-english-space/" target="_blank" rel="noopener">https://blog.itnote.me/Hexo/hexo-chinese-english-space/</a> 。</p><h1 id="邮件依赖的诡异异常"><a href="# 邮件依赖的诡异异常" class="headerlink" title="邮件依赖的诡异异常"></a>邮件依赖的诡异异常</h1><p>在项目中新引入了邮件相关的依赖【没有其它任何变化】,这样就可以在需要时发送通知邮件,依赖内容如下:</p><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line"><!-- 邮件相关依赖 --></span><br><span class="line"><dependency></span><br><span class="line"> <groupId>org.apache.commons</groupId></span><br><span class="line"> <artifactId>commons-email</artifactId></span><br><span class="line"> <version>1.3.3</version></span><br><span class="line"></dependency></span><br></pre></td></tr></table></figure><p>然后神奇的事情发生了,实际执行时,程序抛出异常【去掉这个依赖则正常】:</p><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br></pre></td><td class="code"><pre><span class="line">Exception in thread "main" java.lang.StackOverflowError</span><br><span class="line"> at sun.nio.cs.UTF_8$Encoder.encodeLoop (UTF_8.java:619)</span><br><span class="line"> at java.nio.charset.CharsetEncoder.encode (CharsetEncoder.java:561)</span><br><span class="line"> at sun.nio.cs.StreamEncoder.implWrite (StreamEncoder.java:271)</span><br><span class="line"> at sun.nio.cs.StreamEncoder.write (StreamEncoder.java:125)</span><br><span class="line"> at java.io.OutputStreamWriter.write (OutputStreamWriter.java:207)</span><br><span class="line"> at java.io.BufferedWriter.flushBuffer (BufferedWriter.java:129)</span><br><span class="line"> at java.io.PrintStream.write (PrintStream.java:526)</span><br><span class="line"> at java.io.PrintStream.print (PrintStream.java:669)</span><br><span class="line"> at java.io.PrintStream.println (PrintStream.java:806)</span><br><span class="line"> at org.slf4j.impl.SimpleLogger.write (SimpleLogger.java:381)</span><br><span class="line"> at org.slf4j.impl.SimpleLogger.log (SimpleLogger.java:376)</span><br><span class="line"> at org.slf4j.impl.SimpleLogger.info (SimpleLogger.java:538)</span><br><span class="line"> at org.apache.maven.cli.logging.Slf4jLogger.info (Slf4jLogger.java:59)</span><br><span class="line"> at org.codehaus.plexus.archiver.AbstractArchiver$1.hasNext (AbstractArchiver.java:464)</span><br><span class="line"> at org.codehaus.plexus.archiver.AbstractArchiver$1.hasNext (AbstractArchiver.java:467)</span><br><span class="line"> at org.codehaus.plexus.archiver.AbstractArchiver$1.hasNext (AbstractArchiver.java:467)</span><br><span class="line"> at org.codehaus.plexus.archiver.AbstractArchiver$1.hasNext (AbstractArchiver.java:467)</span><br></pre></td></tr></table></figure><p>而根据这个异常信息,我搜索不到任何有效的信息,一直无法解决。最后,我对比了其它项目的配置,发现 手动设置 maven-assembly-plugin 插件的版本为<version>2.6</version>即可。而之前是没有设置这个版本号的,默认去仓库获取的最新版本,这个默认的版本可能刚好有问题。</p><h1 id="Python- 入门踩坑"><a href="#Python- 入门踩坑" class="headerlink" title="Python 入门踩坑"></a>Python 入门踩坑</h1><p>在一开始使用 Python 的时候,没有使用类似 Anaconda、Winpython 这种套件来帮我自动管理 Python 的第三方工具库,而是从 Python 安装开始,用到什么再用 pip 安装什么。整个过程真的可以把人搞崩溃,工具库之间的传递依赖、版本的不兼容等问题,令人望而却步,下面给出一些难忘的经历。</p><p>出现错误:</p><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">Install packages failed: Installing packages: error occurred</span><br><span class="line">numpy.distutils.system_info.NotFoundError: no lapack/blas resources found</span><br></pre></td></tr></table></figure><p>需要先手动安装 numpy+mkl,再手动安装 scipy,下载文件链接:<a href="http://www.lfd.uci.edu/~gohlke/pythonlibs" target="_blank" rel="noopener">http://www.lfd.uci.edu/~gohlke/pythonlibs</a> 。我下载了 2 个文件:numpy-1.11.3+mkl-cp27-cp27m-win32.whl、scipy-0.19.0-cp27-cp27m-win32.whl,然后手动安装。</p><p>一开始我下载的是 64 位的安装包,结果发现我的 Windows 安装的 Python 是 32 位的,导致不支持【下载时没有选择位数,直接下载的默认的包】。另外,直接进入 Python 的命令行环境时也会打印出版本信息的。使用 import pip; print (pip.pep425tags.get_supported ()); 可以获取到 pip 支持的文件名和版本。</p><p>注意安装 scipy 之前还需要各种第三方库,官方介绍:<strong>Install numpy+mkl before installing scipy.</strong>。在 Shell 中验证安装第三方库是否成功,例如 numpy:from numpy import *。</p><p>scipy 包安装:pip install scipy==0.16.1【不推荐】,成功完成安装,如果缺少第三方包会报很多错误。网上查询后的总结:安装 numpy 后安装 scipy 失败,报错:<strong>numpy.distutils.system_info.NotFoundError</strong>,一般是缺少一些系统库,需要安装:libopenblas-dev、liblapack-dev、libatlas-dev、libblas-dev。</p><p>常见第三方库介绍:</p><ul><li>pandas,分析数据</li><li>sklearn,机器学习,各种算法</li><li>jieba,分词工具</li><li>gensim nlp word2v,模块训练词向量模型</li><li>scipy,算法库,数学工具包</li><li>numpy,数据分析</li><li>matlptop,图形可视化</li></ul><p>Python 中的编码:<br>2.X 版本,python 编码过程: 输入 –> str –> decode –> unicode –> encode –> str –> 输出。<br>3.X 版本,不一样,直接是 unicode。</p><p>Python 中代码有 <strong>print u’xx’ + yy</strong>,yy 是中文,直接跑的时候打印到 Shell 不报错,但是使用后台挂起跑的时候,重定向到文件时,会报错,因为 Python 获取不到输出流的编码。</p><h1 id="Spark-UI- 无法显示"><a href="#Spark-UI- 无法显示" class="headerlink" title="Spark UI 无法显示"></a>Spark UI 无法显示</h1><p>使用 yarn-client 模式起了一个 Spark 任务,在 Driver 端看到异常日志:</p><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br></pre></td><td class="code"><pre><span class="line">2019-01-16_14:53:31 [qtp192486017-1829 - /static/timeline-view.js] WARN servlet.DefaultServlet:587: EXCEPTION </span><br><span class="line">java.lang.IllegalArgumentException: MALFORMED</span><br><span class="line"> at java.util.zip.ZipCoder.toString (ZipCoder.java:58)</span><br><span class="line"> at java.util.zip.ZipFile.getZipEntry (ZipFile.java:583)</span><br><span class="line"> at java.util.zip.ZipFile.access$900 (ZipFile.java:60)</span><br><span class="line"> at java.util.zip.ZipFile$ZipEntryIterator.next (ZipFile.java:539)</span><br><span class="line"> at java.util.zip.ZipFile$ZipEntryIterator.nextElement (ZipFile.java:514)</span><br><span class="line"> at java.util.zip.ZipFile$ZipEntryIterator.nextElement (ZipFile.java:495)</span><br><span class="line"> at java.util.jar.JarFile$JarEntryIterator.next (JarFile.java:257)</span><br><span class="line"> at java.util.jar.JarFile$JarEntryIterator.nextElement (JarFile.java:266)</span><br><span class="line"> at java.util.jar.JarFile$JarEntryIterator.nextElement (JarFile.java:247)</span><br><span class="line"> at org.spark-project.jetty.util.resource.JarFileResource.exists (JarFileResource.java:189)</span><br><span class="line"> at org.spark-project.jetty.servlet.DefaultServlet.getResource (DefaultServlet.java:398)</span><br><span class="line"> at org.spark-project.jetty.servlet.DefaultServlet.doGet (DefaultServlet.java:476)</span><br><span class="line"> at javax.servlet.http.HttpServlet.service (HttpServlet.java:707)</span><br><span class="line"> at javax.servlet.http.HttpServlet.service (HttpServlet.java:820)</span><br><span class="line"> at org.spark-project.jetty.servlet.ServletHolder.handle (ServletHolder.java:684)</span><br><span class="line"> at org.spark-project.jetty.servlet.ServletHandler$CachedChain.doFilter (ServletHandler.java:1507)</span><br><span class="line"> at org.apache.hadoop.yarn.server.webproxy.amfilter.AmIpFilter.doFilter (AmIpFilter.java:164)</span><br><span class="line"> at org.spark-project.jetty.servlet.ServletHandler$CachedChain.doFilter (ServletHandler.java:1478)</span><br><span class="line"> at org.spark-project.jetty.servlet.ServletHandler.doHandle (ServletHandler.java:499)</span><br><span class="line"> at org.spark-project.jetty.server.handler.ContextHandler.doHandle (ContextHandler.java:1086)</span><br><span class="line"> at org.spark-project.jetty.servlet.ServletHandler.doScope (ServletHandler.java:427)</span><br><span class="line"> at org.spark-project.jetty.server.handler.ContextHandler.doScope (ContextHandler.java:1020)</span><br><span class="line"> at org.spark-project.jetty.server.handler.ScopedHandler.handle (ScopedHandler.java:135)</span><br><span class="line"> at org.spark-project.jetty.server.handler.GzipHandler.handle (GzipHandler.java:264)</span><br><span class="line"> at org.spark-project.jetty.server.handler.ContextHandlerCollection.handle (ContextHandlerCollection.java:255)</span><br><span class="line"> at org.spark-project.jetty.server.handler.HandlerWrapper.handle (HandlerWrapper.java:116)</span><br><span class="line"> at org.spark-project.jetty.server.Server.handle (Server.java:366)</span><br><span class="line"> at org.spark-project.jetty.server.AbstractHttpConnection.handleRequest (AbstractHttpConnection.java:494)</span><br><span class="line"> at org.spark-project.jetty.server.AbstractHttpConnection.headerComplete (AbstractHttpConnection.java:973)</span><br><span class="line"> at org.spark-project.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete (AbstractHttpConnection.java:1035)</span><br><span class="line"> at org.spark-project.jetty.http.HttpParser.parseNext (HttpParser.java:641)</span><br><span class="line"> at org.spark-project.jetty.http.HttpParser.parseAvailable (HttpParser.java:231)</span><br><span class="line"> at org.spark-project.jetty.server.AsyncHttpConnection.handle (AsyncHttpConnection.java:82)</span><br><span class="line"> at org.spark-project.jetty.io.nio.SelectChannelEndPoint.handle (SelectChannelEndPoint.java:696)</span><br><span class="line"> at org.spark-project.jetty.io.nio.SelectChannelEndPoint$1.run (SelectChannelEndPoint.java:53)</span><br><span class="line"> at org.spark-project.jetty.util.thread.QueuedThreadPool.runJob (QueuedThreadPool.java:608)</span><br><span class="line"> at org.spark-project.jetty.util.thread.QueuedThreadPool$3.run (QueuedThreadPool.java:543)</span><br><span class="line"> at java.lang.Thread.run (Thread.java:748)</span><br><span class="line">2019-01-16_14:53:31 [qtp192486017-1829 - /static/timeline-view.js] WARN servlet.ServletHandler:592: Error for /static/timeline-view.js</span><br><span class="line">java.lang.NoClassDefFoundError: org/spark-project/jetty/server/handler/ErrorHandler$ErrorPageMapper</span><br><span class="line"> at org.spark-project.jetty.server.handler.ErrorHandler.handle (ErrorHandler.java:71)</span><br><span class="line"> at org.spark-project.jetty.server.Response.sendError (Response.java:349)</span><br><span class="line"> at javax.servlet.http.HttpServletResponseWrapper.sendError (HttpServletResponseWrapper.java:118)</span><br><span class="line"> at org.spark-project.jetty.http.gzip.CompressedResponseWrapper.sendError (CompressedResponseWrapper.java:291)</span><br><span class="line"> at org.spark-project.jetty.servlet.DefaultServlet.doGet (DefaultServlet.java:589)</span><br><span class="line"> at javax.servlet.http.HttpServlet.service (HttpServlet.java:707)</span><br><span class="line"> at javax.servlet.http.HttpServlet.service (HttpServlet.java:820)</span><br><span class="line"> at org.spark-project.jetty.servlet.ServletHolder.handle (ServletHolder.java:684)</span><br><span class="line"> at org.spark-project.jetty.servlet.ServletHandler$CachedChain.doFilter (ServletHandler.java:1507)</span><br><span class="line"> at org.apache.hadoop.yarn.server.webproxy.amfilter.AmIpFilter.doFilter (AmIpFilter.java:164)</span><br><span class="line"> at org.spark-project.jetty.servlet.ServletHandler$CachedChain.doFilter (ServletHandler.java:1478)</span><br><span class="line"> at org.spark-project.jetty.servlet.ServletHandler.doHandle (ServletHandler.java:499)</span><br><span class="line"> at org.spark-project.jetty.server.handler.ContextHandler.doHandle (ContextHandler.java:1086)</span><br><span class="line"> at org.spark-project.jetty.servlet.ServletHandler.doScope (ServletHandler.java:427)</span><br><span class="line"> at org.spark-project.jetty.server.handler.ContextHandler.doScope (ContextHandler.java:1020)</span><br><span class="line"> at org.spark-project.jetty.server.handler.ScopedHandler.handle (ScopedHandler.java:135)</span><br><span class="line"> at org.spark-project.jetty.server.handler.GzipHandler.handle (GzipHandler.java:264)</span><br><span class="line"> at org.spark-project.jetty.server.handler.ContextHandlerCollection.handle (ContextHandlerCollection.java:255)</span><br><span class="line"> at org.spark-project.jetty.server.handler.HandlerWrapper.handle (HandlerWrapper.java:116)</span><br><span class="line"> at org.spark-project.jetty.server.Server.handle (Server.java:366)</span><br><span class="line"> at org.spark-project.jetty.server.AbstractHttpConnection.handleRequest (AbstractHttpConnection.java:494)</span><br><span class="line"> at org.spark-project.jetty.server.AbstractHttpConnection.headerComplete (AbstractHttpConnection.java:973)</span><br><span class="line"> at org.spark-project.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete (AbstractHttpConnection.java:1035)</span><br><span class="line"> at org.spark-project.jetty.http.HttpParser.parseNext (HttpParser.java:641)</span><br><span class="line"> at org.spark-project.jetty.http.HttpParser.parseAvailable (HttpParser.java:231)</span><br><span class="line"> at org.spark-project.jetty.server.AsyncHttpConnection.handle (AsyncHttpConnection.java:82)</span><br><span class="line"> at org.spark-project.jetty.io.nio.SelectChannelEndPoint.handle (SelectChannelEndPoint.java:696)</span><br><span class="line"> at org.spark-project.jetty.io.nio.SelectChannelEndPoint$1.run (SelectChannelEndPoint.java:53)</span><br><span class="line"> at org.spark-project.jetty.util.thread.QueuedThreadPool.runJob (QueuedThreadPool.java:608)</span><br><span class="line"> at org.spark-project.jetty.util.thread.QueuedThreadPool$3.run (QueuedThreadPool.java:543)</span><br><span class="line"> at java.lang.Thread.run (Thread.java:748)</span><br><span class="line">2019-01-16_14:53:31 [qtp192486017-1829 - /static/timeline-view.js] WARN server.AbstractHttpConnection:552: /static/timeline-view.js</span><br><span class="line">java.lang.NoSuchMethodError: javax.servlet.http.HttpServletRequest.isAsyncStarted () Z</span><br><span class="line"> at org.spark-project.jetty.servlet.ServletHandler.doHandle (ServletHandler.java:608)</span><br><span class="line"> at org.spark-project.jetty.server.handler.ContextHandler.doHandle (ContextHandler.java:1086)</span><br><span class="line"> at org.spark-project.jetty.servlet.ServletHandler.doScope (ServletHandler.java:427)</span><br><span class="line"> at org.spark-project.jetty.server.handler.ContextHandler.doScope (ContextHandler.java:1020)</span><br><span class="line"> at org.spark-project.jetty.server.handler.ScopedHandler.handle (ScopedHandler.java:135)</span><br><span class="line"> at org.spark-project.jetty.server.handler.GzipHandler.handle (GzipHandler.java:264)</span><br><span class="line"> at org.spark-project.jetty.server.handler.ContextHandlerCollection.handle (ContextHandlerCollection.java:255)</span><br><span class="line"> at org.spark-project.jetty.server.handler.HandlerWrapper.handle (HandlerWrapper.java:116)</span><br><span class="line"> at org.spark-project.jetty.server.Server.handle (Server.java:366)</span><br><span class="line"> at org.spark-project.jetty.server.AbstractHttpConnection.handleRequest (AbstractHttpConnection.java:494)</span><br><span class="line"> at org.spark-project.jetty.server.AbstractHttpConnection.headerComplete (AbstractHttpConnection.java:973)</span><br><span class="line"> at org.spark-project.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete (AbstractHttpConnection.java:1035)</span><br><span class="line"> at org.spark-project.jetty.http.HttpParser.parseNext (HttpParser.java:641)</span><br><span class="line"> at org.spark-project.jetty.http.HttpParser.parseAvailable (HttpParser.java:231)</span><br><span class="line"> at org.spark-project.jetty.server.AsyncHttpConnection.handle (AsyncHttpConnection.java:82)</span><br><span class="line"> at org.spark-project.jetty.io.nio.SelectChannelEndPoint.handle (SelectChannelEndPoint.java:696)</span><br><span class="line"> at org.spark-project.jetty.io.nio.SelectChannelEndPoint$1.run (SelectChannelEndPoint.java:53)</span><br><span class="line"> at org.spark-project.jetty.util.thread.QueuedThreadPool.runJob (QueuedThreadPool.java:608)</span><br><span class="line"> at org.spark-project.jetty.util.thread.QueuedThreadPool$3.run (QueuedThreadPool.java:543)</span><br><span class="line"> at java.lang.Thread.run (Thread.java:748)</span><br></pre></td></tr></table></figure><p>这个日志在反复打印,也就是在任务的运行过程中,一直都有这个错误。它引发了什么问题呢,我检查了一下,对 Spark 任务的实际功能并没有影响,任务跑完后功能正常实现。但是,我发现在任务的运行过程中,Spark UI 页面打开后不正常显示【异常信息的开头就是关于某个 js 文件问题】:<br><img src="https://raw.githubusercontent.com/iplaypi/img-playpi/master/img/old/b7f2e3a3gy1g12h3dbte0j20tr0ge3yv.jpg" alt="SparkUI 不正常显示" title="SparkUI 不正常显示"></p><p>点击进去,直接显示 Error 500:<br><img src="https://raw.githubusercontent.com/iplaypi/img-playpi/master/img/old/b7f2e3a3gy1g12h42u9iuj20t50fa74n.jpg" alt="点击进去" title="点击进去"><br><img src="https://raw.githubusercontent.com/iplaypi/img-playpi/master/img/old/b7f2e3a3gy1g12h48uvu5j20mj08imwz.jpg" alt="Error500" title="Error500"></p><p>服务器的 Driver 端日志截图:<br>日志截图 1<br><img src="https://raw.githubusercontent.com/iplaypi/img-playpi/master/img/old/b7f2e3a3gy1g12h4vfjokj20wu0mgwgs.jpg" alt="日志截图 1" title="日志截图 1"></p><p>日志截图 2<br><img src="https://raw.githubusercontent.com/iplaypi/img-playpi/master/img/old/b7f2e3a3gy1g12h4zran1j20ya0mgwgy.jpg" alt="日志截图 2" title="日志截图 2"></p><p>日志截图 3<br><img src="https://raw.githubusercontent.com/iplaypi/img-playpi/master/img/old/b7f2e3a3gy1g12h53va2qj20xs0mgacl.jpg" alt="日志截图 3" title="日志截图 3"></p><p>等了几天,又遇到同样的问题,除了这 2 次,其它时间点就没遇到过了:</p><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br></pre></td><td class="code"><pre><span class="line">2019-01-24_22:51:49 [qtp697001207-1591 - /static/spark-dag-viz.js] WARN servlet.DefaultServlet:587: EXCEPTION </span><br><span class="line">java.lang.IllegalArgumentException: MALFORMED</span><br><span class="line">at java.util.zip.ZipCoder.toString (ZipCoder.java:58)</span><br><span class="line">at java.util.zip.ZipFile.getZipEntry (ZipFile.java:583)</span><br><span class="line">at java.util.zip.ZipFile.access$900 (ZipFile.java:60)</span><br><span class="line">at java.util.zip.ZipFile$ZipEntryIterator.next (ZipFile.java:539)</span><br><span class="line">at java.util.zip.ZipFile$ZipEntryIterator.nextElement (ZipFile.java:514)</span><br><span class="line">at java.util.zip.ZipFile$ZipEntryIterator.nextElement (ZipFile.java:495)</span><br><span class="line">at java.util.jar.JarFile$JarEntryIterator.next (JarFile.java:257)</span><br><span class="line">at java.util.jar.JarFile$JarEntryIterator.nextElement (JarFile.java:266)</span><br><span class="line">at java.util.jar.JarFile$JarEntryIterator.nextElement (JarFile.java:247)</span><br><span class="line">at org.spark-project.jetty.util.resource.JarFileResource.exists (JarFileResource.java:189)</span><br><span class="line">at org.spark-project.jetty.servlet.DefaultServlet.getResource (DefaultServlet.java:398)</span><br><span class="line">at org.spark-project.jetty.servlet.DefaultServlet.doGet (DefaultServlet.java:476)</span><br><span class="line">at javax.servlet.http.HttpServlet.service (HttpServlet.java:707)</span><br><span class="line">at javax.servlet.http.HttpServlet.service (HttpServlet.java:820)</span><br><span class="line">at org.spark-project.jetty.servlet.ServletHolder.handle (ServletHolder.java:684)</span><br><span class="line">at org.spark-project.jetty.servlet.ServletHandler$CachedChain.doFilter (ServletHandler.java:1507)</span><br><span class="line">at org.apache.hadoop.yarn.server.webproxy.amfilter.AmIpFilter.doFilter (AmIpFilter.java:164)</span><br><span class="line">at org.spark-project.jetty.servlet.ServletHandler$CachedChain.doFilter (ServletHandler.java:1478)</span><br><span class="line">at org.spark-project.jetty.servlet.ServletHandler.doHandle (ServletHandler.java:499)</span><br><span class="line">at org.spark-project.jetty.server.handler.ContextHandler.doHandle (ContextHandler.java:1086)</span><br><span class="line">at org.spark-project.jetty.servlet.ServletHandler.doScope (ServletHandler.java:427)</span><br><span class="line">at org.spark-project.jetty.server.handler.ContextHandler.doScope (ContextHandler.java:1020)</span><br><span class="line">at org.spark-project.jetty.server.handler.ScopedHandler.handle (ScopedHandler.java:135)</span><br><span class="line">at org.spark-project.jetty.server.handler.GzipHandler.handle (GzipHandler.java:264)</span><br><span class="line">at org.spark-project.jetty.server.handler.ContextHandlerCollection.handle (ContextHandlerCollection.java:255)</span><br><span class="line">at org.spark-project.jetty.server.handler.HandlerWrapper.handle (HandlerWrapper.java:116)</span><br><span class="line">at org.spark-project.jetty.server.Server.handle (Server.java:366)</span><br><span class="line">at org.spark-project.jetty.server.AbstractHttpConnection.handleRequest (AbstractHttpConnection.java:494)</span><br><span class="line">at org.spark-project.jetty.server.AbstractHttpConnection.headerComplete (AbstractHttpConnection.java:973)</span><br><span class="line">at org.spark-project.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete (AbstractHttpConnection.java:1035)</span><br><span class="line">at org.spark-project.jetty.http.HttpParser.parseNext (HttpParser.java:641)</span><br><span class="line">at org.spark-project.jetty.http.HttpParser.parseAvailable (HttpParser.java:231)</span><br><span class="line">at org.spark-project.jetty.server.AsyncHttpConnection.handle (AsyncHttpConnection.java:82)</span><br><span class="line">at org.spark-project.jetty.io.nio.SelectChannelEndPoint.handle (SelectChannelEndPoint.java:696)</span><br><span class="line">at org.spark-project.jetty.io.nio.SelectChannelEndPoint$1.run (SelectChannelEndPoint.java:53)</span><br><span class="line">at org.spark-project.jetty.util.thread.QueuedThreadPool.runJob (QueuedThreadPool.java:608)</span><br><span class="line">at org.spark-project.jetty.util.thread.QueuedThreadPool$3.run (QueuedThreadPool.java:543)</span><br><span class="line">at java.lang.Thread.run (Thread.java:748)</span><br><span class="line">2019-01-24_22:51:49 [qtp697001207-1591 - /static/spark-dag-viz.js] WARN servlet.ServletHandler:592: Error for /static/spark-dag-viz.js</span><br><span class="line">java.lang.NoClassDefFoundError: org/spark-project/jetty/server/handler/ErrorHandler$ErrorPageMapper</span><br><span class="line">at org.spark-project.jetty.server.handler.ErrorHandler.handle (ErrorHandler.java:71)</span><br><span class="line">at org.spark-project.jetty.server.Response.sendError (Response.java:349)</span><br><span class="line">at javax.servlet.http.HttpServletResponseWrapper.sendError (HttpServletResponseWrapper.java:118)</span><br><span class="line">at org.spark-project.jetty.http.gzip.CompressedResponseWrapper.sendError (CompressedResponseWrapper.java:291)</span><br><span class="line">at org.spark-project.jetty.servlet.DefaultServlet.doGet (DefaultServlet.java:589)</span><br><span class="line">at javax.servlet.http.HttpServlet.service (HttpServlet.java:707)</span><br><span class="line">at javax.servlet.http.HttpServlet.service (HttpServlet.java:820)</span><br><span class="line">at org.spark-project.jetty.servlet.ServletHolder.handle (ServletHolder.java:684)</span><br><span class="line">at org.spark-project.jetty.servlet.ServletHandler$CachedChain.doFilter (ServletHandler.java:1507)</span><br><span class="line">at org.apache.hadoop.yarn.server.webproxy.amfilter.AmIpFilter.doFilter (AmIpFilter.java:164)</span><br><span class="line">at org.spark-project.jetty.servlet.ServletHandler$CachedChain.doFilter (ServletHandler.java:1478)</span><br><span class="line">at org.spark-project.jetty.servlet.ServletHandler.doHandle (ServletHandler.java:499)</span><br><span class="line">at org.spark-project.jetty.server.handler.ContextHandler.doHandle (ContextHandler.java:1086)</span><br><span class="line">at org.spark-project.jetty.servlet.ServletHandler.doScope (ServletHandler.java:427)</span><br><span class="line">at org.spark-project.jetty.server.handler.ContextHandler.doScope (ContextHandler.java:1020)</span><br><span class="line">at org.spark-project.jetty.server.handler.ScopedHandler.handle (ScopedHandler.java:135)</span><br><span class="line">at org.spark-project.jetty.server.handler.GzipHandler.handle (GzipHandler.java:264)</span><br><span class="line">at org.spark-project.jetty.server.handler.ContextHandlerCollection.handle (ContextHandlerCollection.java:255)</span><br><span class="line">at org.spark-project.jetty.server.handler.HandlerWrapper.handle (HandlerWrapper.java:116)</span><br><span class="line">at org.spark-project.jetty.server.Server.handle (Server.java:366)</span><br><span class="line">at org.spark-project.jetty.server.AbstractHttpConnection.handleRequest (AbstractHttpConnection.java:494)</span><br><span class="line">at org.spark-project.jetty.server.AbstractHttpConnection.headerComplete (AbstractHttpConnection.java:973)</span><br><span class="line">at org.spark-project.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete (AbstractHttpConnection.java:1035)</span><br><span class="line">at org.spark-project.jetty.http.HttpParser.parseNext (HttpParser.java:641)</span><br><span class="line">at org.spark-project.jetty.http.HttpParser.parseAvailable (HttpParser.java:231)</span><br><span class="line">at org.spark-project.jetty.server.AsyncHttpConnection.handle (AsyncHttpConnection.java:82)</span><br><span class="line">at org.spark-project.jetty.io.nio.SelectChannelEndPoint.handle (SelectChannelEndPoint.java:696)</span><br><span class="line">at org.spark-project.jetty.io.nio.SelectChannelEndPoint$1.run (SelectChannelEndPoint.java:53)</span><br><span class="line">at org.spark-project.jetty.util.thread.QueuedThreadPool.runJob (QueuedThreadPool.java:608)</span><br><span class="line">at org.spark-project.jetty.util.thread.QueuedThreadPool$3.run (QueuedThreadPool.java:543)</span><br><span class="line">at java.lang.Thread.run (Thread.java:748)</span><br><span class="line">2019-01-24_22:51:49 [qtp697001207-1591 - /static/spark-dag-viz.js] WARN server.AbstractHttpConnection:552: /static/spark-dag-viz.js</span><br><span class="line">java.lang.NoSuchMethodError: javax.servlet.http.HttpServletRequest.isAsyncStarted () Z</span><br><span class="line">at org.spark-project.jetty.servlet.ServletHandler.doHandle (ServletHandler.java:608)</span><br><span class="line">at org.spark-project.jetty.server.handler.ContextHandler.doHandle (ContextHandler.java:1086)</span><br><span class="line">at org.spark-project.jetty.servlet.ServletHandler.doScope (ServletHandler.java:427)</span><br><span class="line">at org.spark-project.jetty.server.handler.ContextHandler.doScope (ContextHandler.java:1020)</span><br><span class="line">at org.spark-project.jetty.server.handler.ScopedHandler.handle (ScopedHandler.java:135)</span><br><span class="line">at org.spark-project.jetty.server.handler.GzipHandler.handle (GzipHandler.java:264)</span><br><span class="line">at org.spark-project.jetty.server.handler.ContextHandlerCollection.handle (ContextHandlerCollection.java:255)</span><br><span class="line">at org.spark-project.jetty.server.handler.HandlerWrapper.handle (HandlerWrapper.java:116)</span><br><span class="line">at org.spark-project.jetty.server.Server.handle (Server.java:366)</span><br><span class="line">at org.spark-project.jetty.server.AbstractHttpConnection.handleRequest (AbstractHttpConnection.java:494)</span><br><span class="line">at org.spark-project.jetty.server.AbstractHttpConnection.headerComplete (AbstractHttpConnection.java:973)</span><br><span class="line">at org.spark-project.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete (AbstractHttpConnection.java:1035)</span><br><span class="line">at org.spark-project.jetty.http.HttpParser.parseNext (HttpParser.java:641)</span><br><span class="line">at org.spark-project.jetty.http.HttpParser.parseAvailable (HttpParser.java:231)</span><br><span class="line">at org.spark-project.jetty.server.AsyncHttpConnection.handle (AsyncHttpConnection.java:82)</span><br><span class="line">at org.spark-project.jetty.io.nio.SelectChannelEndPoint.handle (SelectChannelEndPoint.java:696)</span><br><span class="line">at org.spark-project.jetty.io.nio.SelectChannelEndPoint$1.run (SelectChannelEndPoint.java:53)</span><br><span class="line">at org.spark-project.jetty.util.thread.QueuedThreadPool.runJob (QueuedThreadPool.java:608)</span><br><span class="line">at org.spark-project.jetty.util.thread.QueuedThreadPool$3.run (QueuedThreadPool.java:543)</span><br><span class="line">at java.lang.Thread.run (Thread.java:748)</span><br></pre></td></tr></table></figure><p>此外,还有一点值得注意,Chrome 浏览器的某些端口是禁止访问的,所以遇到过有一个 Spark 任务使用了 4045 端口【locked】,在 Chrome 浏览器是看不了任务状态的,页面无法打开,被 Chrome 浏览器屏蔽了,此时并不是 Spark 的问题。</p><h1 id="关于 -Git- 的小问题"><a href="# 关于 -Git- 的小问题" class="headerlink" title="关于 Git 的小问题"></a>关于 Git 的小问题</h1><p>1、本地版本落后,而且又与远程仓库冲突,git pull 报错警告,需要 merge,无法直接更新最新版本。下面的操作直接覆盖本地文件,强制更新到最新版本,本地未提交的更改会丢失。</p><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">git fetch --all</span><br><span class="line">git reset --hard origin/master</span><br></pre></td></tr></table></figure><p>2、在 2018 年 9 月的某一天,发现 Git 的代码推送总是需要输入帐号和密码,哪怕保存下来也不行,每次 push 都需要重新输入,感觉很奇怪。后来发现是版本太旧了,当时的版本是 v2.13.0,升级后的版本是 v2.18.0,升级后就恢复正常了。后来无意间在哪里看到过通知,说是 TSL 协议升级了,所以针对旧版本强制输入用户名密码,升级就可以解决。</p><p>备注一下,HTTPS 是在 TCP 和 HTTP 之间增加了 TLS【Transport Layer Security,传输层安全】,提供了内容加密、身份认证和数据完整性三大功能。TLS 的前身是 SSL【Secure Sockets Layer,安全套接字层】,由网景公司开发,后来被 IETF 标准化并改名。</p></div><div><div id="wechat_subscriber" style="display:block;padding:10px 0;margin:20px auto;width:100%;text-align:center"><img id="wechat_subscriber_qcode" src="/images/wechat-qr-personal.jpg" alt="虾丸派 wechat" style="width:200px;max-width:100%"><div>扫一扫添加博主,进技术交流群,共同学习进步</div></div></div><div><div style="padding:10px 0;margin:20px auto;width:90%;text-align:center"><div>永不止步</div><button id="rewardButton" disable="enable" onclick='var qr=document.getElementById("QR");"none"===qr.style.display?qr.style.display="block":qr.style.display="none"'><span>打赏</span></button><div id="QR" style="display:none"><div id="wechat" style="display:inline-block"><img id="wechat_qr" src="/images/wechat-pay-playpi.png" alt="虾丸派 微信支付"><p>微信支付</p></div></div></div></div><div><ul class="post-copyright"><li class="post-copyright-author"><strong>本文作者:</strong> 虾丸派</li><li class="post-copyright-link"><strong>本文链接:</strong> <a href="https://www.playpi.org/2019030101.html" title="那些年关于技术的未解之谜">https://www.playpi.org/2019030101.html</a></li><li class="post-copyright-license"><strong>版权声明: </strong>本博客所有文章除特别声明外,均采用 <a href="https://creativecommons.org/licenses/by-nc-sa/3.0/" rel="external nofollow" target="_blank">CC BY-NC-SA 3.0</a> 许可协议。转载请注明出处!</li></ul></div><footer class="post-footer"><div class="post-tags"><a href="/tags/Git/" rel="tag"><i class="fa fa-tag"></i> Git</a> <a href="/tags/Spark/" rel="tag"><i class="fa fa-tag"></i> Spark</a> <a href="/tags/Python/" rel="tag"><i class="fa fa-tag"></i> Python</a> <a href="/tags/ElasticSearch/" rel="tag"><i class="fa fa-tag"></i> ElasticSearch</a> <a href="/tags/es/" rel="tag"><i class="fa fa-tag"></i> es</a></div><div class="post-nav"><div class="post-nav-next post-nav-item"><a href="/2019022501.html" rel="next" title="Hexo 的踩坑经验"><i class="fa fa-chevron-left"></i> Hexo 的踩坑经验</a></div><span class="post-nav-divider"></span><div class="post-nav-prev post-nav-item"><a href="/2019030401.html" rel="prev" title="利用阿里云申请免费的 SSL 证书">利用阿里云申请免费的 SSL 证书 <i class="fa fa-chevron-right"></i></a></div></div></footer></div></article><div class="post-spread"></div></div></div><div class="comments" id="comments"><div id="vcomments"></div></div></div><div class="sidebar-toggle"><div class="sidebar-toggle-line-wrap"><span class="sidebar-toggle-line sidebar-toggle-line-first"></span> <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span> <span class="sidebar-toggle-line sidebar-toggle-line-last"></span></div></div><aside id="sidebar" class="sidebar"><div class="sidebar-inner"><ul class="sidebar-nav motion-element"><li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap">文章目录</li><li class="sidebar-nav-overview" data-target="site-overview-wrap">站点概览</li></ul><section class="site-overview-wrap sidebar-panel"><div class="site-overview"><div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person"><img class="site-author-image" itemprop="image" src="/images/favicon-1536x1536-playpi.png" alt="虾丸派"><p class="site-author-name" itemprop="name">虾丸派</p><p class="site-description motion-element" itemprop="description">记录知识 | 分享技术</p></div><nav class="site-state motion-element"><div class="site-state-item site-state-posts"><a href="/archives/"><span class="site-state-item-count">144</span> <span class="site-state-item-name">日志</span></a></div><div class="site-state-item site-state-categories"><a href="/categories/index.html"><span class="site-state-item-count">13</span> <span class="site-state-item-name">分类</span></a></div><div class="site-state-item site-state-tags"><a href="/tags/index.html"><span class="site-state-item-count">294</span> <span class="site-state-item-name">标签</span></a></div></nav><div class="feed-link motion-element"><a href="/atom.xml" rel="alternate"><i class="fa fa-rss"></i> RSS</a></div><div class="links-of-author motion-element"><span class="links-of-author-item"><a href="https://github.com/iplaypi" target="_blank" title="GitHub"><i class="fa fa-fw fa-github"></i>GitHub</a> </span><span class="links-of-author-item"><a href="https://weibo.com/u/3086148515" target="_blank" title="微博"><i class="fa fa-fw fa-weibo"></i>微博</a> </span><span class="links-of-author-item"><a href="mailto:playpi@qq.com" target="_blank" title="E-Mail"><i class="fa fa-fw fa-envelope"></i>E-Mail</a></span></div><div class="cc-license motion-element" itemprop="license"><a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" class="cc-opacity" target="_blank" rel="external nofollow"><img src="/images/cc-by-nc-sa.svg" alt="Creative Commons"></a></div><div class="links-of-blogroll motion-element links-of-blogroll-inline"><div class="links-of-blogroll-title"><i class="fa fa-fw fa-link"></i> 友情链接</div><ul class="links-of-blogroll-list"><li class="links-of-blogroll-item"><a href="https://github.com/iplaypi" title="GitHub" target="_blank" rel="external nofollow">GitHub</a></li><li class="links-of-blogroll-item"><a href="https://weibo.com/u/3086148515" title="Weibo" target="_blank" rel="external nofollow">Weibo</a></li><li class="links-of-blogroll-item"><a href="https://www.playpi.org" title="虾丸派" target="_blank" rel="external nofollow">虾丸派</a></li><li class="links-of-blogroll-item"><a href="https://www.playpi.org" title="playpi" target="_blank" rel="external nofollow">playpi</a></li><li class="links-of-blogroll-item"><a href="https://www.liaoxuefeng.com" title="廖雪峰" target="_blank" rel="external nofollow">廖雪峰</a></li><li class="links-of-blogroll-item"><a href="http://www.ruanyifeng.com" title="阮一峰" target="_blank" rel="external nofollow">阮一峰</a></li><li class="links-of-blogroll-item"><a href="https://travis-ci.org/iplaypi/iplaypi.github.io" title="travis-ci" target="_blank" rel="external nofollow">travis-ci</a></li><li class="links-of-blogroll-item"><a href="https://www.vultr.com/?ref=7861302-4F" title="Vultr" target="_blank" rel="external nofollow">Vultr</a></li></ul></div></div></section><section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active"><div class="post-toc"><div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-1"><a class="nav-link" href="#常用链接"><span class="nav-number">1.</span> <span class="nav-text">常用链接</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#es-spark- 读取 -es- 数据后 -count- 报错"><span class="nav-number">2.</span> <span class="nav-text">es-spark 读取 es 数据后 count 报错</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#Hexo- 生成 -html- 静态页面目录锚点失效"><span class="nav-number">3.</span> <span class="nav-text">Hexo 生成 html 静态页面目录锚点失效</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#邮件依赖的诡异异常"><span class="nav-number">4.</span> <span class="nav-text">邮件依赖的诡异异常</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#Python- 入门踩坑"><span class="nav-number">5.</span> <span class="nav-text">Python 入门踩坑</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#Spark-UI- 无法显示"><span class="nav-number">6.</span> <span class="nav-text">Spark UI 无法显示</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#关于 -Git- 的小问题"><span class="nav-number">7.</span> <span class="nav-text">关于 Git 的小问题</span></a></li></ol></div></div></section></div></aside></div></main><footer id="footer" class="footer"><div class="footer-inner"><div class="copyright">© 2016–<span itemprop="copyrightYear">2021</span> <span class="post-meta-divider">|</span> <span class="with-love"><i class="fa fa-heart"></i> </span><span class="author" itemprop="copyrightHolder">虾丸派</span> <span class="post-meta-divider">|</span> <span class="post-meta-item-icon"><i class="fa fa-area-chart"></i> </span><span class="post-meta-item-text">全站字数统计</span> <span title="全站字数统计">326.3k 字</span></div><div class="powered-by">由 <a class="theme-link" target="_blank" href="https://hexo.io" rel="external nofollow">Hexo</a> 强力驱动</div><span class="post-meta-divider">|</span><div class="theme-info">主题 <a class="theme-link" target="_blank" href="https://github.com/iissnan/hexo-theme-next" rel="external nofollow">NexT.Mist</a><script async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script><span id="busuanzi_container_site_pv" style="display:none"><span class="post-meta-divider">|</span> 总访问量 <span id="busuanzi_value_site_pv"></span> 次 </span><span id="busuanzi_container_site_uv" style="display:none"><span class="post-meta-divider">|</span> 总访客 <span id="busuanzi_value_site_uv"></span> 人</span></div><div class="busuanzi-count"><script async src="https://dn-lbstatics.qbox.me/busuanzi/2.3/busuanzi.pure.mini.js"></script></div></div></footer><div class="back-to-top"><i class="fa fa-arrow-up"></i> <span id="scrollpercent"><span>0</span>%</span></div></div><script type="text/javascript">"[object Function]"!==Object.prototype.toString.call(window.Promise)&&(window.Promise=null)</script><script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script><script type="text/javascript" src="/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script><script type="text/javascript" src="/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script><script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script><script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script><script type="text/javascript" src="/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script><script type="text/javascript" src="/js/src/utils.js?v=5.1.3"></script><script type="text/javascript" src="/js/src/motion.js?v=5.1.3"></script><script type="text/javascript" src="/js/src/scrollspy.js?v=5.1.3"></script><script type="text/javascript" src="/js/src/post-details.js?v=5.1.3"></script><script type="text/javascript" src="/js/src/bootstrap.js?v=5.1.3"></script><script src="//unpkg.com/valine@1.3.7/dist/Valine.min.js"></script><script type="text/javascript">new Valine({av:AV,el:"#comments",verify:!1,notify:!1,app_id:"FC5Jijeg1meo2K2OzPYWK327-gzGzoHsz",app_key:"6A1ReY8tjhPutK00F01YbJSq",placeholder:"没有问题吗?"})</script><script type="text/javascript">var isfetched=!1,isXml=!0,search_path="search.xml";0===search_path.length?search_path="search.xml":/json$/i.test(search_path)&&(isXml=!1);var path="/"+search_path,onPopupClose=function(t){$(".popup").hide(),$("#local-search-input").val(""),$(".search-result-list").remove(),$("#no-result").remove(),$(".local-search-pop-overlay").remove(),$("body").css("overflow","")};function proceedsearch(){$("body").append('<div class="search-popup-overlay local-search-pop-overlay"></div>').css("overflow","hidden"),$(".search-popup-overlay").click(onPopupClose),$(".popup").toggle();var t=$("#local-search-input");t.attr("autocapitalize","none"),t.attr("autocorrect","off"),t.focus()}var searchFunc=function(t,e,s){"use strict";$("body").append('<div class="search-popup-overlay local-search-pop-overlay"><div id="search-loading-icon"><i class="fa fa-spinner fa-pulse fa-5x fa-fw"></i></div></div>').css("overflow","hidden"),$("#search-loading-icon").css("margin","20% auto 0 auto").css("text-align","center"),$.ajax({url:t,dataType:isXml?"xml":"json",async:!0,success:function(t){isfetched=!0,$(".popup").detach().appendTo(".header-inner");var o=isXml?$("entry",t).map(function(){return{title:$("title",this).text(),content:$("content",this).text(),url:$("url",this).text()}}).get():t,n=document.getElementById(e),r=document.getElementById(s),t=function(){var m=n.value.trim().toLowerCase(),x=m.split(/[\s\-]+/);1<x.length&&x.push(m);var e,w=[];0<m.length&&o.forEach(function(t){var e=!1,o=0,h=0,n=t.title.trim(),r=n.toLowerCase(),s=t.content.trim().replace(/<[^>]+>/g,""),a=s.toLowerCase(),i=decodeURIComponent(t.url),c=[],l=[];if(""!=n&&(x.forEach(function(t){function e(t,e,o){var n=t.length;if(0===n)return[];var r,s=0,a=[];for(o||(e=e.toLowerCase(),t=t.toLowerCase());-1<(r=e.indexOf(t,s));)a.push({position:r,word:t}),s=r+n;return a}c=c.concat(e(t,r,!1)),l=l.concat(e(t,a,!1))}),(0<c.length||0<l.length)&&(e=!0,o=c.length+l.length)),e){function p(t,e,o,n){for(var r=n[n.length-1],s=r.position,a=r.word,i=[],c=0;s+a.length<=o&&0!=n.length;){a===m&&c++,i.push({position:s,length:a.length});var l=s+a.length;for(n.pop();0!=n.length&&(s=(r=n[n.length-1]).position,a=r.word,s<l);)n.pop()}return h+=c,{hits:i,start:e,end:o,searchTextCount:c}}[c,l].forEach(function(t){t.sort(function(t,e){return e.position!==t.position?e.position-t.position:t.word.length-e.word.length})});t=[];0!=c.length&&t.push(p(0,0,n.length,c));for(var u=[];0!=l.length;){var f=l[l.length-1],d=f.position,g=f.word,v=d-20,f=d+80;v<0&&(v=0),(f=f<d+g.length?d+g.length:f)>s.length&&(f=s.length),u.push(p(0,v,f,l))}u.sort(function(t,e){return t.searchTextCount!==e.searchTextCount?e.searchTextCount-t.searchTextCount:t.hits.length!==e.hits.length?e.hits.length-t.hits.length:t.start-e.start});e=parseInt("1");function $(o,t){var n="",r=t.start;return t.hits.forEach(function(t){n+=o.substring(r,t.position);var e=t.position+t.length;n+='<b class="search-keyword">'+o.substring(t.position,e)+"</b>",r=e}),n+=o.substring(r,t.end)}0<=e&&(u=u.slice(0,e));var C="";0!=t.length?C+="<li><a href='"+i+"' class='search-result-title'>"+$(n,t[0])+"</a>":C+="<li><a href='"+i+"' class='search-result-title'>"+n+"</a>",u.forEach(function(t){C+="<a href='"+i+'\'><p class="search-result">'+$(s,t)+"...</p></a>"}),C+="</li>",w.push({item:C,searchTextCount:h,hitCount:o,id:w.length})}}),1===x.length&&""===x[0]?r.innerHTML='<div id="no-result"><i class="fa fa-search fa-5x" /></div>':0===w.length?r.innerHTML='<div id="no-result"><i class="fa fa-frown-o fa-5x" /></div>':(w.sort(function(t,e){return t.searchTextCount!==e.searchTextCount?e.searchTextCount-t.searchTextCount:t.hitCount!==e.hitCount?e.hitCount-t.hitCount:e.id-t.id}),e='<ul class="search-result-list">',w.forEach(function(t){e+=t.item}),e+="</ul>",r.innerHTML=e)};n.addEventListener("input",t),$(".local-search-pop-overlay").remove(),$("body").css("overflow",""),proceedsearch()}})};$(".popup-trigger").click(function(t){t.stopPropagation(),!1===isfetched?searchFunc(path,"local-search-input","local-search-result"):proceedsearch()}),$(".popup-btn-close").click(onPopupClose),$(".popup").click(function(t){t.stopPropagation()}),$(document).on("keyup",function(t){27===t.which&&$(".search-popup").is(":visible")&&onPopupClose()})</script><script>!function(){var t=document.createElement("script"),e=window.location.protocol.split(":")[0];t.src="https"===e?"https://zz.bdstatic.com/linksubmit/push.js":"http://push.zhanzhang.baidu.com/push.js";e=document.getElementsByTagName("script")[0];e.parentNode.insertBefore(t,e)}()</script><script type="text/javascript" src="/js/src/js.cookie.js?v=5.1.3"></script><script type="text/javascript" src="/js/src/scroll-cookie.js?v=5.1.3"></script><script src="/live2dw/lib/L2Dwidget.min.js?094cbace49a39548bed64abff5988b05"></script><script>L2Dwidget.init({pluginRootPath:"live2dw/",pluginJsPath:"lib/",pluginModelPath:"assets/",tagMode:!1,debug:!1,model:{scale:1,jsonPath:"/live2dw/assets/hijiki.model.json"},display:{position:"left",width:100,height:200,hOffset:0,vOffset:-20},mobile:{show:!1,motion:!0,scale:.3},log:!1})</script></body></html>